BayaiM__oracle切換歸檔模式步驟:
阿新 • • 發佈:2018-11-02
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