我們大家都知道Oracle數據庫可以在2種模式下運行,即,歸檔模式(archivelog)與非歸檔模式(noarchivelog),歸檔模式的主要作用是提高數據庫的可恢復性,其實際生產的數據庫都應該運行在此模式下,
歸檔模式應該和相應的備份策略相結合,只有歸檔模式沒有相應的備份策略只會帶來麻煩。
1.shutdown normal或shutdown immediate關閉數據庫
- [oracle@jumper Oracle]$ sqlplus "/ as sysdba"
- SQL*Plus: Release 9.2.0.4.0 - Production on Sat Oct 15 15:48:36 2005
- Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
- Connected to:
- Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
- With the Partitioning option
- JServer Release 9.2.0.4.0 - Production
- SQL> shutdown immediate;
- Database closed.
- Database dismounted.
- Oracle instance shut down.
2.啟動Oracle數據庫到mount狀態
- SQL> startup mount;
- Oracle instance started.
- Total System Global Area 101782828 bytes
- Fixed Size 451884 bytes
- Variable Size 37748736 bytes
- Database Buffers 62914560 bytes
- Redo Buffers 667648 bytes
- Database mounted.
3.啟用或停止歸檔模式
如果要啟用歸檔模式,此處使用
- alter database archivelog 命令。
- SQL> alter database archivelog;
- Database altered.
- SQL> alter database open;
- Database altered.
- SQL> archive log list;
- Database log mode Archive Mode
- Automatic archival Enabled
- Archive destination /opt/Oracle/oradata/conner/archive
- Oldest online log sequence 148
- Next log sequence to archive 151
- Current log sequence 151