oracle数据库可以运行在两种模式下:归档模式(archivelog)和非归档模式(noarchivelog)。
检查归档模式命令:
sql> archive log list
database log mode no archive mode
automatic archival disabled
archive destination use_db_recovery_file_dest
oldest online log sequence 15
current log sequence 17
|
设置归档模式:
sql> shutdown immediate;
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount
oracle instance started.
total system global area 1258291200 bytes
fixed size 1219160 bytes
variable size 318768552 bytes
database buffers 922746880 bytes
redo buffers 15556608 bytes
database mounted.
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 use_db_recovery_file_dest
oldest online log sequence 15
next log sequence to archive 17
current log sequence 17
|
如果需要停止归档模式,使用:alter database noarchivelog 命令。oracle10g之前,你还需要修改初始化参数使数据库处于自动归档模式。在pfile/spfile中设置如下参数:
重启数据库此参数生效,此时数据库处于自动归档模式。也可以在数据库启动过程中,手工执行:
使数据库启用自动归档,但是重启后数据库仍然处于手工归档模式。10g使用db_recovery_file_dest来作为归档日志的存放地。
sql> show parameter db_recovery
name type value
db_recovery_file_dest string /home/oracle/ora10g/flash_reco
very_area/
db_recovery_file_dest_size big integer 20g
|
可以修改db_recovery_file_dest_size参数的大小
alter system set db_recovery_file_dest_size=21474836480
|