Oracle数据库的归档模式(archivelog mode)
Oracle数据库可以运行在2种模式下:
- 归档模式(archivelog)
归档模式可以提高Oracle数据库的可恢复性,生产数据库都应该运行在此模式下,归档模式应该和相应的备份策略相结合,只有归档模式没有相应的备份策略只会带来麻烦。
- 非归档模式(noarchivelog)
如何启用和关闭数据库的归档模式。
1.shutdown normal或shutdown immediate关闭数据库
2.startup mount启动数据库到mount状态
3.启用或停止归档模式
启用归档模式:alter database archivelog
停用归档模式:alter database noarchivelog
4.查看归档模式:archive log list
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started.
Total System Global Area 1653518336 bytes Fixed Size 2253784 bytes Variable Size 1207962664 bytes Database Buffers 436207616 bytes Redo Buffers 7094272 bytes Database mounted. SQL> alter database archivelog;
Database altered.
SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 18 Next log sequence to archive 20 Current log sequence 20 |