首页 > 其他分享 >备库归档日志文件的删除测试

备库归档日志文件的删除测试

时间:2023-06-18 10:32:40浏览次数:49  
标签:11 12 06 22 16 归档 2023 备库 日志

文档课题:备库归档日志文件的删除测试.
数据库:oracle 11.2.0.4
架构:rac(2节点)+dg(orcldg与sh_orcl)
场景描述:在该架构中,orcldg备库作为sh_orcl备库归档日志文件的来源,现测试以下两点:
          a、归档日志文件从orcldg备库传输到sh_orcl备库后先不应用,此时orcldg端是否能删除未应用的归档日志?
		  b、sh_orcl无法接收orcldg端的归档日志,此时在orcldg备库端是否能删除未传输的归档日志?
1、环境准备
--orcldg备库log_archive_dest_4配置
SYS@orcldg> show parameter log_archive_dest_4                                                                                                             

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_4                   string      SERVICE=sh_orcl COMPRESSION=EN
                                                 ABLE LGWR ASYNC VALID_FOR=(ONL
                                                 INE_LOGFILES,PRIMARY_ROLE) DB_
                                                 UNIQUE_NAME=sh_orcl
--修改log_archive_dest_4配置参数,将valid_for修改为ALL_LOGFILES,ALL_ROLES.												 
SYS@orcldg> alter system set log_archive_dest_4='SERVICE=sh_orcl COMPRESSION=ENABLE LGWR ASYNC VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=sh_orcl';

System altered.
--将主库端log_archive_dest_3置空.
SYS@orcl1> alter system set log_archive_dest_3='' sid='*';

System altered.

说明:以上配置在于主库停止传输归档日志文件到sh_orcl备库,转为由备库orcldg传输归档日志文件到sh_orcl备库.
2、备库日志应用情况
--orcldg备库日志应用情况。
SYS@orcldg> set line 200
SYS@orcldg> select thread#,sequence#,to_char(first_time,'yyyy-mm-dd hh24:mi:ss'),to_char(next_time,'yyyy-mm-dd hh24:mi:ss'),to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by 1,2;

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        327 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:11 YES
         1        328 2023-06-12 16:12:44 2023-06-12 16:12:51 2023-06-12 16:13:11 YES
         1        329 2023-06-12 16:12:51 2023-06-12 16:13:15 2023-06-12 16:13:15 YES
         1        330 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:33 YES
         1        331 2023-06-12 16:13:33 2023-06-12 16:22:32 2023-06-12 16:22:32 YES
         1        332 2023-06-12 16:22:32 2023-06-12 18:22:17 2023-06-12 18:22:17 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:16:53 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:11:56 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:11:56 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:11:56 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:16:53 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:16:54 NO
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:12:00 YES
         2        167 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        168 2023-06-12 16:12:44 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        169 2023-06-12 16:12:44 2023-06-12 16:12:46 2023-06-12 16:13:12 YES
         2        170 2023-06-12 16:12:46 2023-06-12 16:12:54 2023-06-12 16:13:12 YES
         2        171 2023-06-12 16:12:54 2023-06-12 16:13:15 2023-06-12 16:13:16 YES
         2        172 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:34 YES
         2        173 2023-06-12 16:13:33 2023-06-12 16:22:58 2023-06-12 16:22:58 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:11:56 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:11:55 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:16:53 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:11:59 YES

27 rows selected.

注意:此时orcldg备库相同序列号有两个,表名之前配置已生效.
--sh_orcl备库日志应用情况.
SYS@sh_orcl> select thread#,sequence#,to_char(first_time,'yyyy-mm-dd hh24:mi:ss'),to_char(next_time,'yyyy-mm-dd hh24:mi:ss'),to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by 1,2;

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        327 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:29 YES
         1        328 2023-06-12 16:12:44 2023-06-12 16:12:51 2023-06-12 16:13:29 YES
         1        329 2023-06-12 16:12:51 2023-06-12 16:13:15 2023-06-12 16:13:29 YES
         1        330 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:32 YES
         1        331 2023-06-12 16:13:33 2023-06-12 16:22:32 2023-06-12 16:22:30 YES
         1        332 2023-06-12 16:22:32 2023-06-12 18:22:17 2023-06-12 18:22:16 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:16:53 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:16:52 YES
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:16:52 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:16:53 NO
         2        167 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:29 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        168 2023-06-12 16:12:44 2023-06-12 16:12:44 2023-06-12 16:13:29 YES
         2        169 2023-06-12 16:12:44 2023-06-12 16:12:46 2023-06-12 16:13:29 YES
         2        170 2023-06-12 16:12:46 2023-06-12 16:12:54 2023-06-12 16:13:29 YES
         2        171 2023-06-12 16:12:54 2023-06-12 16:13:15 2023-06-12 16:13:29 YES
         2        172 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:32 YES
         2        173 2023-06-12 16:13:33 2023-06-12 16:22:58 2023-06-12 16:22:56 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:16:52 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:16:52 YES

20 rows selected.

3、开始测试
3.1、接收日志后不应用
3.1.1、产生新归档
--sh_orcl备库停止实时应用,但依然正常接收归档日志文件.
SYS@sh_orcl> alter database recover managed standby database cancel;

Database altered.

--主库生成新新归档.
LEO@orcl1> create table test01 as select * from dba_objects;

Table created.

LEO@orcl1> conn / as sysdba
Connected.
SYS@orcl1> alter system archive log current;

System altered.

3.1.2、备库日志应用情况
--orcldg应用情况
SYS@orcldg> select thread#,sequence#,to_char(first_time,'yyyy-mm-dd hh24:mi:ss'),to_char(next_time,'yyyy-mm-dd hh24:mi:ss'),to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by 1,2;

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        327 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:11 YES
         1        328 2023-06-12 16:12:44 2023-06-12 16:12:51 2023-06-12 16:13:11 YES
         1        329 2023-06-12 16:12:51 2023-06-12 16:13:15 2023-06-12 16:13:15 YES
         1        330 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:33 YES
         1        331 2023-06-12 16:13:33 2023-06-12 16:22:32 2023-06-12 16:22:32 YES
         1        332 2023-06-12 16:22:32 2023-06-12 18:22:17 2023-06-12 18:22:17 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:16:53 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:11:56 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:11:56 YES
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:11:56 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:16:53 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:16:54 NO
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:12:00 YES
         1        337 2023-06-12 22:11:58 2023-06-12 22:36:51 2023-06-12 22:36:52 YES
         1        337 2023-06-12 22:11:58 2023-06-12 22:36:51 2023-06-12 22:36:52 NO
         2        167 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        168 2023-06-12 16:12:44 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        169 2023-06-12 16:12:44 2023-06-12 16:12:46 2023-06-12 16:13:12 YES
         2        170 2023-06-12 16:12:46 2023-06-12 16:12:54 2023-06-12 16:13:12 YES
         2        171 2023-06-12 16:12:54 2023-06-12 16:13:15 2023-06-12 16:13:16 YES
         2        172 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:34 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        173 2023-06-12 16:13:33 2023-06-12 16:22:58 2023-06-12 16:22:58 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:11:56 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:11:55 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:16:53 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:11:59 YES
         2        177 2023-06-12 22:11:58 2023-06-12 22:36:53 2023-06-12 22:36:53 NO
         2        177 2023-06-12 22:11:58 2023-06-12 22:36:53 2023-06-12 22:36:53 IN-MEMORY

31 rows selected.
--sh_orcl应用情况
SYS@sh_orcl> select thread#,sequence#,to_char(first_time,'yyyy-mm-dd hh24:mi:ss'),to_char(next_time,'yyyy-mm-dd hh24:mi:ss'),to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by 1,2;

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        327 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:29 YES
         1        328 2023-06-12 16:12:44 2023-06-12 16:12:51 2023-06-12 16:13:29 YES
         1        329 2023-06-12 16:12:51 2023-06-12 16:13:15 2023-06-12 16:13:29 YES
         1        330 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:32 YES
         1        331 2023-06-12 16:13:33 2023-06-12 16:22:32 2023-06-12 16:22:30 YES
         1        332 2023-06-12 16:22:32 2023-06-12 18:22:17 2023-06-12 18:22:16 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:16:53 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:16:52 YES
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:16:52 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:16:53 NO
         1        337 2023-06-12 22:11:58 2023-06-12 22:36:51 2023-06-12 22:36:51 NO

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        167 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:29 YES
         2        168 2023-06-12 16:12:44 2023-06-12 16:12:44 2023-06-12 16:13:29 YES
         2        169 2023-06-12 16:12:44 2023-06-12 16:12:46 2023-06-12 16:13:29 YES
         2        170 2023-06-12 16:12:46 2023-06-12 16:12:54 2023-06-12 16:13:29 YES
         2        171 2023-06-12 16:12:54 2023-06-12 16:13:15 2023-06-12 16:13:29 YES
         2        172 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:32 YES
         2        173 2023-06-12 16:13:33 2023-06-12 16:22:58 2023-06-12 16:22:56 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:16:52 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:16:52 YES
         2        177 2023-06-12 22:11:58 2023-06-12 22:36:53 2023-06-12 22:36:52 NO

22 rows selected.
--系统层面归档日志文件情况.
[oracle@leo-shhisdbdg 2023_06_12]$ ll
total 69164
-rw-r----- 1 oracle oinstall     1024 Jun 12 16:13 o1_mf_1_327_l8fnx991_.arc
-rw-r----- 1 oracle oinstall    75264 Jun 12 16:13 o1_mf_1_328_l8fnx994_.arc
-rw-r----- 1 oracle oinstall   531456 Jun 12 16:13 o1_mf_1_329_l8fnx997_.arc
-rw-r----- 1 oracle oinstall    13824 Jun 12 16:13 o1_mf_1_330_l8fnxdf5_.arc
-rw-r----- 1 oracle oinstall   279040 Jun 12 16:22 o1_mf_1_331_l8fog6wf_.arc
-rw-r----- 1 oracle oinstall 13850112 Jun 12 18:22 o1_mf_1_332_l8fwgr15_.arc
-rw-r----- 1 oracle oinstall  7461888 Jun 12 22:16 o1_mf_1_333_l8gb6nxv_.arc
-rw-r----- 1 oracle oinstall     1024 Jun 12 22:16 o1_mf_1_334_l8gb6nbw_.arc
-rw-r----- 1 oracle oinstall    34816 Jun 12 22:16 o1_mf_1_335_l8gb6nc2_.arc
-rw-r----- 1 oracle oinstall 15705600 Jun 12 22:16 o1_mf_1_336_l8gb6nd4_.arc
-rw-r----- 1 oracle oinstall 14654464 Jun 12 22:36 o1_mf_1_337_l8gcd3gs_.arc
-rw-r----- 1 oracle oinstall   178176 Jun 12 16:13 o1_mf_2_166_l8fnx990_.arc
-rw-r----- 1 oracle oinstall     1024 Jun 12 16:13 o1_mf_2_167_l8fnx95n_.arc
-rw-r----- 1 oracle oinstall     1024 Jun 12 16:13 o1_mf_2_168_l8fnx95g_.arc
-rw-r----- 1 oracle oinstall     1024 Jun 12 16:13 o1_mf_2_169_l8fnx99d_.arc
-rw-r----- 1 oracle oinstall    57856 Jun 12 16:13 o1_mf_2_170_l8fnx999_.arc
-rw-r----- 1 oracle oinstall    43008 Jun 12 16:13 o1_mf_2_171_l8fnx9b7_.arc
-rw-r----- 1 oracle oinstall    10752 Jun 12 16:13 o1_mf_2_172_l8fnxdkk_.arc
-rw-r----- 1 oracle oinstall   291328 Jun 12 16:22 o1_mf_2_173_l8foh0ox_.arc
-rw-r----- 1 oracle oinstall 14983168 Jun 12 22:16 o1_mf_2_174_l8gb6n9o_.arc
-rw-r----- 1 oracle oinstall    48128 Jun 12 22:16 o1_mf_2_175_l8gb6n4f_.arc
-rw-r----- 1 oracle oinstall   249856 Jun 12 22:16 o1_mf_2_176_l8gb6n3p_.arc
-rw-r----- 1 oracle oinstall  2300928 Jun 12 22:36 o1_mf_2_177_l8gcd4or_.arc

说明:如上所示,o1_mf_1_336_l8gb6nc2_.arc、o1_mf_1_337_l8gcd3gs_.arc、o1_mf_2_177_l8gcd4or_.arc归档日志已传输到备库sh_orcl,但此时未应用.
3.1.3、删除测试
--在orcldg备库执行.
RMAN> delete noprompt archivelog until time 'sysdate-1/1440';

说明:可将未应用的归档日志文件o1_mf_1_336_l8gb6nc2_.arc o1_mf_1_337_l8gcd3gs_.arc删除,但却未能删除o1_mf_2_177_l8gcd4or_.arc.

RMAN> delete noprompt archivelog all;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_2_177_l8gcd5td_.arc thread=2 sequence=177

说明:即使o1_mf_2_177_l8gcd4or_.arc在sh_orcl备库端显示已经应用,但orcldg端依然无法删除该归档日志.

3.2、无法接收日志
3.2.1、产生新归档
--以下测试无法传输归档日志文件的情况.
关闭sh_orcl数据库,使orcldg端的归档日志文件无法传输到备库sh_orcl.
SYS@sh_orcl> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

--主库产生新归档日志文件
SYS@orcl1> conn leo/leo;
Connected.
LEO@orcl1> insert into test01 select * from test01;

86305 rows created.

LEO@orcl1> commit;

Commit complete.

LEO@orcl1> conn / as sysdba
Connected.
SYS@orcl1> alter system archive log current;

System altered.

3.2.2、备库日志应用情况
--备库orcldg查看日志应用情况.
SYS@orcldg> select thread#,sequence#,to_char(first_time,'yyyy-mm-dd hh24:mi:ss'),to_char(next_time,'yyyy-mm-dd hh24:mi:ss'),to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by 1,2;

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        327 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:11 YES
         1        328 2023-06-12 16:12:44 2023-06-12 16:12:51 2023-06-12 16:13:11 YES
         1        329 2023-06-12 16:12:51 2023-06-12 16:13:15 2023-06-12 16:13:15 YES
         1        330 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:33 YES
         1        331 2023-06-12 16:13:33 2023-06-12 16:22:32 2023-06-12 16:22:32 YES
         1        332 2023-06-12 16:22:32 2023-06-12 18:22:17 2023-06-12 18:22:17 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:11:56 YES
         1        333 2023-06-12 18:22:17 2023-06-12 22:11:02 2023-06-12 22:16:53 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:11:56 YES
         1        334 2023-06-12 22:11:02 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:11:56 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         1        335 2023-06-12 22:11:10 2023-06-12 22:11:16 2023-06-12 22:16:53 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:16:54 YES
         1        336 2023-06-12 22:11:16 2023-06-12 22:11:58 2023-06-12 22:12:00 YES
         1        337 2023-06-12 22:11:58 2023-06-12 22:36:51 2023-06-12 22:36:52 YES
         1        337 2023-06-12 22:11:58 2023-06-12 22:36:51 2023-06-12 22:36:52 YES
         1        338 2023-06-12 22:36:51 2023-06-12 22:55:55 2023-06-12 22:55:56 YES
         1        339 2023-06-12 22:55:55 2023-06-12 22:56:56 2023-06-12 22:56:56 IN-MEMORY
         2        167 2023-06-12 16:12:43 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        168 2023-06-12 16:12:44 2023-06-12 16:12:44 2023-06-12 16:13:12 YES
         2        169 2023-06-12 16:12:44 2023-06-12 16:12:46 2023-06-12 16:13:12 YES
         2        170 2023-06-12 16:12:46 2023-06-12 16:12:54 2023-06-12 16:13:12 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        171 2023-06-12 16:12:54 2023-06-12 16:13:15 2023-06-12 16:13:16 YES
         2        172 2023-06-12 16:13:15 2023-06-12 16:13:33 2023-06-12 16:13:34 YES
         2        173 2023-06-12 16:13:33 2023-06-12 16:22:58 2023-06-12 16:22:58 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:11:56 YES
         2        174 2023-06-12 16:22:58 2023-06-12 22:11:06 2023-06-12 22:16:53 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:11:55 YES
         2        175 2023-06-12 22:11:06 2023-06-12 22:11:10 2023-06-12 22:16:53 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:16:53 YES
         2        176 2023-06-12 22:11:10 2023-06-12 22:11:58 2023-06-12 22:11:59 YES
         2        177 2023-06-12 22:11:58 2023-06-12 22:36:53 2023-06-12 22:36:53 NO
         2        177 2023-06-12 22:11:58 2023-06-12 22:36:53 2023-06-12 22:36:53 YES

   THREAD#  SEQUENCE# TO_CHAR(FIRST_TIME, TO_CHAR(NEXT_TIME,' TO_CHAR(COMPLETION_ APPLIED
---------- ---------- ------------------- ------------------- ------------------- ---------
         2        178 2023-06-12 22:36:53 2023-06-12 22:55:55 2023-06-12 22:55:56 YES
         2        179 2023-06-12 22:55:55 2023-06-12 22:56:52 2023-06-12 22:56:53 YES

35 rows selected.

--系统层面归档日志文件情况
oracle@hisdbdg 2023_06_12]$ ll
total 13728
-rw-r----- 1 oracle oinstall 11013120 Jun 12 22:55 o1_mf_1_338_l8gdhwmq_.arc
-rw-r----- 1 oracle oinstall    55808 Jun 12 22:56 o1_mf_1_339_l8gdkrrp_.arc
-rw-r----- 1 oracle oinstall  2300928 Jun 12 22:36 o1_mf_2_177_l8gcd5td_.arc
-rw-r----- 1 oracle oinstall   648704 Jun 12 22:55 o1_mf_2_178_l8gdhwo3_.arc
-rw-r----- 1 oracle oinstall    29696 Jun 12 22:56 o1_mf_2_179_l8gdko3j_.arc

说明:节点1序列号为338、339,节点2序列号为178、179的归档日志文件为新增,其并未传输到sh_orcl备库.
3.2.3、删除测试
--备库orcldg端进行删除测试.
RMAN> delete noprompt archivelog until time 'sysdate-1/1440';

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_1_338_l8gdhwmq_.arc thread=1 sequence=338
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_1_339_l8gdkrrp_.arc thread=1 sequence=339
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_2_177_l8gcd5td_.arc thread=2 sequence=177
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_2_178_l8gdhwo3_.arc thread=2 sequence=178
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2023_06_12/o1_mf_2_179_l8gdko3j_.arc thread=2 sequence=179

说明:如上所示,orcldg备库端无法删除sh_orcl备库未接收的归档日志文件.

标签:11,12,06,22,16,归档,2023,备库,日志
From: https://blog.51cto.com/u_12991611/6507601

相关文章

  • Day04学习日志
    Day04学习日志Scanner之前我们学的基本语法中我们并没有实现程序和人的交互,但是Java给我们提供了这样一个工具类,我们可以获取用户的输入。java.util.Scanner是Java5的新特征,我们可以通过Scanner类来获取用户的输入。基本语法:Scanners=newScanner(System.in);通过Sc......
  • 个人博客文章归档实现
    个人博客文章归档实现......
  • Go 语言之自定义 zap 日志
    Go语言之自定义zap日志zap日志:https://github.com/uber-go/zap一、日志写入文件zap.NewProduction、zap.NewDevelopment是预设配置好的。zap.New可自定义配置zap.New源码这是构造Logger最灵活的方式,但也是最冗长的方式。对于典型的用例,高度固执己见的预设(NewProdu......
  • docker日志文件过大
    发现服务器磁盘空间不足,其中有很多/var/lib/docker/overlay2/..#df-hFilesystemSizeUsedAvailUse%Mountedonudev3.8G03.8G0%/devtmpfs770M1.3M769M1%/run/dev/vda159G55G2.0G97%/tmpfs......
  • Go 语言之 zap 日志库简单使用
    Go语言之zap日志库简单使用默认的Gologlog:https://pkg.go.dev/logpackagemainimport( "log" "os")funcinit(){ log.SetPrefix("LOG:")//设置前缀 f,err:=os.OpenFile("./log.log",os.O_WRONLY|os.O_CREATE|os.O_APPEND,......
  • CKS 考试题整理 (09)-日志审计 log audit
    Task在cluster中启用审计日志。为此,请启用日志后端,并确保:日志存储在/var/log/kubernetes/audit-logs.txt日志文件能保留10天最多保留2个旧审计日志文件 /etc/kubernetes/logpolicy/sample-policy.yaml提供了基本策略。它仅指定不记录的内容。注意:基本策略位于clu......
  • ubutu18.04操作归档管理器时鼠标变手型无法点击
    ubuntu18.04用系统自带的归档管理器打开压缩包文件,拖动文件时变成鼠标变成手形后,界面不能再点击任何东西。分析:可能是个GUI窗体BUG,正常应该是子窗口再父窗口上,结果BUG导致,子窗口被父窗口覆盖,所以不能操作。解决方法:用键盘Alt+tab组合键跳到归档管理器,再......
  • adb获取日志
    1、在cmd里面输入adbdevices查看连接设备号和连接状态  当连接设备有多个成功的时,可以指定连接设备查看其日志(adb-s设备号logcat)  2、可以下载个Terminal这个工具,导出日志就很方便 ......
  • 项目中使用nacos config 不停的刷config日志
     网上大部分意见是说客户端与服务端的md5不一致导致的我这边是关闭调了nacosconfig的动态刷新,这样会影响config的实时更新。https://blog.csdn.net/virtual_users/article/details/129405590上面链接的方法(删除namespace)试过了对我没用https://blog.csdn.net/qq_35425070......
  • log4xx/log4j异步日志配置示例
    <?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPElog4j:configurationSYSTEM"log4j.dtd"><log4j:configurationxmlns:log4j='http://jakarta.apache.org/log4j/'debug="false"><append......