-查看实例进程看是否有归档的进程
[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
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341