· 查看数据库状态SQL> alter database open;
Database altered.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 7
Current log sequence 9
· 通过修改初始化参数文件,指定归档文件目录[oracle@dy1 dbs]$ vi initora1.ora
log_archive_dest_1='location=/home/oracle/app/oracle/arch'
· 将数据库改为归档模式
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1336960 bytes
Variable Size 306186624 bytes
Database Buffers 109051904 bytes
Redo Buffers 6094848 bytes
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 /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 7
Next log sequence to archive 9
Current log sequence 9
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string location=/home/oracle/app/orac
le/arch
SQL> create spfile from pfile;
· 切换日志并查看是否正确产生归档日志SQL> alter system switch logfile;
System altered.
SQL> !
[oracle@dy1 arch]$ cd /home/oracle/app/oracle/arch
[oracle@dy1 arch]$ ls
1_10_778651832.dbf
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26825102/viewspace-719571/
,如需转载,请注明出处,否则将追究法律责任。