BayaiM__oracle切换归档模式步骤:

前端之家收集整理的这篇文章主要介绍了BayaiM__oracle切换归档模式步骤:前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

BayaiM__oracle切换归档模式(步骤):

------------------oracle11g设置归档模式和非归档模式--------------------------
[[email protected] ~]#mkdir /u01/arch
[[email protected] ~]#chown -R oracle:oinstall /u01/arch
[[email protected] ~]#sqlplus / as sysdba
sql> archive log list;
sql> select name,log_mode from v$database;
sql> shutdown immediate;
sql> startup mount;
sql> alter database archivelog;
sql> alter database open;
sql> alter system set log_archive_dest_1=‘location=/u01/arch‘ scope=spfile;
sql> shutdown immediate;
sql> startup;
sql> show parameter dest;
log_archive_dest_1 string location=/u01/arch
sql> alter system switch logfile; -- 是强制日志切换,不一定就归档当前的重做日志文件(若自动归档打开,就归档前的重做日志,若自动归档没有打开,就不归档当前重做日志。)
sql> /
[[email protected] arch]# pwd
/u01/arch
[[email protected] arch]# ll
-rw-r----- 1 oracle oinstall 8863744 11月 2 14:53 1_12_991067760.dbf
-rw-r----- 1 oracle oinstall 1024 11月 2 14:53 1_13_991067760.dbf
[[email protected] ~]$ lsnrctl
LSNRCTL> stop
LSNRCTL> start
Services Summary...
Service "prodb" has 1 instance(s).
Instance "prodb",status UNKNOWN,has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>


修改日志文件命名格式
alter system set log_archive_max_processes = 5;
alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;

 

-------------------------------------------------------------------------------------------------------------------

对于小白人,无脑操作,完全按照我的步骤就好,不要问,记住不懂得不要问,只要做就好了。

2018年11月2日15:00:24

bayaim

猜你在找的Oracle相关文章