测试如下:
在日志没有传送到备库时
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> select sequence#,applied from v$archived_log order by 1 desc ;
SEQUENCE# APPLIED
---------- ---------
51 NO
50 NO
49 NO
48 NO
47 NO
46 NO
45 NO
44 NO
43 NO
42 NO
41 YES
在主库上删除归档日志
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Sep 12 03:21:52 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.All rights reserved.
connected to target database: ORCL (DBID=1382102121)
RMAN> delete noprompt archivelog all;
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=51 device type=DISK
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_52.arc thread=1 sequence=52
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_53.arc thread=1 sequence=53
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_54.arc thread=1 sequence=54
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_55.arc thread=1 sequence=55
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_56.arc thread=1 sequence=56
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_57.arc thread=1 sequence=57
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_58.arc thread=1 sequence=58
监听起起来,日志传输过去
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select sequence#,applied from v$archived_log order by 1 desc ;
SEQUENCE# APPLIED
---------- ---------
59 NO
58 NO
57 NO
56 NO
55 NO
54 NO
53 NO
52 NO
51 NO
50 NO
49 NO
备置
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/OraDb11g_home1/dbs/snapcf_orcl.f'; # default
删除归档日志
RMAN> delete noprompt archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 device type=DISK
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_52.arc thread=1 sequence=52
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_53.arc thread=1 sequence=53
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_54.arc thread=1 sequence=54
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_55.arc thread=1 sequence=55
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_56.arc thread=1 sequence=56
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_57.arc thread=1 sequence=57
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_58.arc thread=1 sequence=58
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/app/archivelog/arch_854332222_1_59.arc thread=1 sequence=59
重置删除策略
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY clear;
old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
RMAN configuration parameters are successfully reset to default value
RMAN> delete noprompt archivelog all;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
107 152A 11-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_52.arc
108 153A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_53.arc
109 154A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_54.arc
110 155A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_55.arc
111 156A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_56.arc
112 157A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_57.arc
113 158A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_58.arc
119 159A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_59.arc
124 160A 12-SEP-14
Name: /u01/app/archivelog/arch_854332222_1_60.arc
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_52.arc RECID=107 STAMP=858048409
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_53.arc RECID=108 STAMP=858048409
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_54.arc RECID=109 STAMP=858048470
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_55.arc RECID=110 STAMP=858049000
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_56.arc RECID=111 STAMP=858049071
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_57.arc RECID=112 STAMP=858049141
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_58.arc RECID=113 STAMP=858050501
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_59.arc RECID=119 STAMP=858050931
deleted archived log
archived log file name=/u01/app/archivelog/arch_854332222_1_60.arc RECID=124 STAMP=858051230
Deleted 9 objects
RMAN>
|