归档模式管理
平臺:windows
oracle:11.2.0.4.0
?
1、檢查當(dāng)前是否開啟歸檔模式
C:\Users\DataCenter>sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on 星期日 4月 26 17:03:24 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.連接到: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> archive log list 數(shù)據(jù)庫日志模式 非存檔模式 自動存檔 禁用 存檔終點(diǎn) D:\app\DataCenter\product\11.2.0\dbhome_1\RDBMS 最早的聯(lián)機(jī)日志序列 13 當(dāng)前日志序列 15 SQL>2、關(guān)閉數(shù)據(jù)庫
SQL> shutdown immediate 數(shù)據(jù)庫已經(jīng)關(guān)閉。 已經(jīng)卸載數(shù)據(jù)庫。 ORACLE 例程已經(jīng)關(guān)閉。?
3、將數(shù)據(jù)庫啟動到mount狀態(tài)
SQL> startup mount ORACLE 例程已經(jīng)啟動。Total System Global Area 2137886720 bytes Fixed Size 2282944 bytes Variable Size 1811941952 bytes Database Buffers 318767104 bytes Redo Buffers 4894720 bytes 數(shù)據(jù)庫裝載完畢。4、開啟數(shù)據(jù)庫歸檔
SQL> alter database archivelog;數(shù)據(jù)庫已更改。SQL>?5、設(shè)置歸檔路徑
SQL> alter system set log_archive_dest_1="location=D:\app\DataCenter\arch" scope=spfile;系統(tǒng)已更改。SQL>6、將數(shù)據(jù)庫啟動
SQL> alter database open;數(shù)據(jù)庫已更改。SQL>?7、查看開始?xì)w檔結(jié)果
SQL> archive log list; 數(shù)據(jù)庫日志模式 存檔模式 自動存檔 啟用 存檔終點(diǎn) D:\app\DataCenter\product\11.2.0\dbhome_1\RDBMS 最早的聯(lián)機(jī)日志序列 13 下一個(gè)存檔日志序列 15 當(dāng)前日志序列 15 SQL>?查看發(fā)現(xiàn),雖然歸檔模式已經(jīng)開啟,但是歸檔路徑依然沒有生效。需要重啟庫,就可以生效.
SQL> shutdown immediate; 數(shù)據(jù)庫已經(jīng)關(guān)閉。 已經(jīng)卸載數(shù)據(jù)庫。 ORACLE 例程已經(jīng)關(guān)閉。 SQL> startup ORACLE 例程已經(jīng)啟動。Total System Global Area 2137886720 bytes Fixed Size 2282944 bytes Variable Size 1811941952 bytes Database Buffers 318767104 bytes Redo Buffers 4894720 bytes 數(shù)據(jù)庫裝載完畢。 數(shù)據(jù)庫已經(jīng)打開。 SQL> archive log list 數(shù)據(jù)庫日志模式 存檔模式 自動存檔 啟用 存檔終點(diǎn) D:\app\DataCenter\arch 最早的聯(lián)機(jī)日志序列 13 下一個(gè)存檔日志序列 15 當(dāng)前日志序列 15 SQL>另外, 在之前數(shù)據(jù)庫處于mount狀態(tài)時(shí),設(shè)置完成數(shù)據(jù)庫的歸檔路徑之后,可以執(zhí)行一次startup mount force,使數(shù)據(jù)庫更改歸檔路徑生效亦可.
?
如何關(guān)閉數(shù)據(jù)庫歸檔模式?
alter database noarchivelog;?
轉(zhuǎn)載于:https://www.cnblogs.com/arcer/p/4458060.html
總結(jié)
- 上一篇: iOS UILable高度自适应
- 下一篇: bestcoder Delete