千家信息网

手动启动数据库归档

发表于:2025-01-22 作者:千家信息网编辑
千家信息网最后更新 2025年01月22日,-查看实例进程看是否有归档的进程[oracle@edsir1p8-PROD4 ~]$ ps -ef | grep PROD4SQL> archive log list;Database log mod
千家信息网最后更新 2025年01月22日手动启动数据库归档
-查看实例进程看是否有归档的进程[oracle@edsir1p8-PROD4 ~]$ ps -ef | grep PROD4SQL> archive log list;Database log mode       No Archive ModeAutomatic archival       DisabledArchive destination      /u01/app/oracle/product/11.2.0/db_1/dbs/archOldest online log sequence     6Current log sequence       8sql> show parameter log_archive--在mount状态下做--关闭数据库SQL> shutdown immediate        ---必须是immediate 一至性关闭数据库SQL> startup mountSQL> 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 ModeAutomatic archival       EnabledArchive destination       /home/oracle/archOldest online log sequence     6Next log sequence to archive   8Current 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.logSQL> select group#,status from v$log;    GROUP# STATUS---------- ---------------- 1 INACTIVE 2 CURRENT 3 INACTIVE --切redoSQL> 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 PROD4oracle    8551     1  0 10:29 ?        00:00:00 ora_arc0_PROD4oracle    8554     1  0 10:29 ?        00:00:00 ora_arc1_PROD4oracle    8556     1  0 10:29 ?        00:00:00 ora_arc2_PROD4oracle    8558     1  0 10:29 ?        00:00:00 ora_arc3_PROD4
0