启用归档日志模式
1. 查看数据库日志模式
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8
Current log sequence 10
2. 关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
3. 备份数据库
该备份跟以后产生的日志一起用于将来的灾难恢复(很重要,如要改为归档日志模式,没有这个数据库备份,仅有日志文件是无法从该时间点恢复的)。
4. 启动数据库到MOUNT模式
SQL> startup mount
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 79693416 bytes
Database Buffers 197132288 bytes
Redo Buffers 7168000 bytes
Database mounted.
5. 切换数据库日志模式到归档模式
SQL> alter database archivelog
2 /
Database altered.
6. 打开数据库
SQL> alter database open
2 /
Database altered.
7. 查看更改后的数据库日志模式
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8
Next log sequence to archive 10
Current log sequence 10
SQL>