-查看实例进程看是否有归档的进程
[oracle@edsir1p8-PROD4 ~]$ ps -ef | grep PROD4
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/11.2.0/db_1/dbs/archOldest online log sequence 6
Current log sequence 8
sql> show parameter log_archive
--在mount状态下做
--关闭数据库
SQL> shutdown immediate ---必须是immediate 一至性关闭数据库
SQL> startup mount
SQL> alter system set log_archive_dest_1='location=/home/oracle/arch'; ---目录提前创建好
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/arch
Oldest online log sequence 6
Next log sequence to archive 8
Current log sequence 8
--生成归档(需要切redo日志)
QL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
-----------------------------------------------------------------------------
3
/u01/app/oracle/oradata/PROD4/PROD4/redo03.log
2
/u01/app/oracle/oradata/PROD4/PROD4/redo02.log
1
/u01/app/oracle/oradata/PROD4/PROD4/redo01.log
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 INACTIVE
--切redo
SQL> alter system switch logfile;
System altered.
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 CURRENT
--三种状态 current :当前用的
active :正在归档时的状态,
inactive:归档完毕,不用的状态
--查看归档目录下生成的归档文件
[oracle@edsir1p8-PROD4 ~]$ ls /home/oracle/arch/
1_8_861102502.dbf
[oracle@edsir1p8-PROD4 ~]$ ps -ef | grep PROD4
oracle 8551 1 0 10:29 ? 00:00:00 ora_arc0_PROD4
oracle 8554 1 0 10:29 ? 00:00:00 ora_arc1_PROD4
oracle 8556 1 0 10:29 ? 00:00:00 ora_arc2_PROD4
oracle 8558 1 0 10:29 ? 00:00:00 ora_arc3_PROD4
网站题目:手动启动数据库归档
URL网址:
http://chengdu.cdxwcx.cn/article/gcehpg.html