Oracle rman 没有0级时1级备份和0级大小一样,可以用来做恢复 resetlogs后也可以

[oracle@rac3 rman_backup]$ du -sk /nfs
24708   /nfs


[oracle@rac3 rman_backup]$ sh -x /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh cdb daily
+ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ export 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS'
+ NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
++ basename cdb
+ ORACLE_DB=cdb
++ basename daily
+ BACKUP_OPTION=daily
+ case `hostname` in
++ hostname
+ ORACLE_SID=cdb3
+ export ORACLE_SID
++ dirname /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh
++ basename cdb
++ date +%Y%m%d%H%M%S
+ RMAN_LOG_FILE=/home/oracle/rman_backup/log/cdb_fra_20240907041509.out
+ RMAN=/u01/app/oracle/product/19.0.0/db_1/bin/rman
++ date +%Y%m%d%H%M%S
+ BACKUP_TAG=cdb_20240907041509_level0
+ echo 'ORACLE DB name: cdb'
+ echo 'ORACLE instance : cdb3'
+ ORACLE_USER=oracle
+ TARGET_CONNECT_STR=/
+ '[' cdb = cdb ']'
+ CATALOG_CONNECT_STR=nocatalog
+ export SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ export NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ export IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ export IngrianNAE_Properties_Conf_SessionID_Max=100
+ IngrianNAE_Properties_Conf_SessionID_Max=100
+ export ORACLE_UNQNAME=cdb
+ ORACLE_UNQNAME=cdb
++ hostname
+ NB_ORA_CLIENT=rac3
+ NB_ORA_SERV=nxxxxx
+ NB_ORA_POLICY=NP2_ORAC_DB_Backup
+ RMAN_SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64
+ RMAN_PARMS='PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)"'
+ case $BACKUP_OPTION in
+ NB_ORA_SCHED=Daily
+ echo
+ echo 'RMAN: /u01/app/oracle/product/19.0.0/db_1/bin/rman'
+ echo 'ORACLE_SID: cdb3'
+ echo 'ORACLE_USER: oracle'
+ echo 'ORACLE_HOME: /u01/app/oracle/product/19.0.0/db_1'
+ echo
+ echo 'NB_ORA_SERV: nxxxxx'
+ echo 'NB_ORA_CLIENT: rac3'
+ echo 'NB_ORA_POL/ICY: NP2_ORAC_DB_Backup'
+ echo 'NB_ORA_SCHED: Daily'
+ echo
+ CMD_STR='
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907041509.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ '[' '' = root ']'
+ /usr/bin/sh -c '
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907041509.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ RSTAT=0
+ echo ==========================================================================
+ echo
[oracle@rac3 rman_backup]$ du -sk /nfs
1598164 /nfs   1级备份和0级备份一样大的
[oracle@rac3 rman_backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Sep 7 04:16:39 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB (DBID=2265125454)

RMAN> startup force mount;

Oracle instance started
database mounted

Total System Global Area    2382361320 bytes

Fixed Size                     9167592 bytes
Variable Size                956301312 bytes
Database Buffers            1409286144 bytes
Redo Buffers                   7606272 bytes

RMAN> 

RMAN> run 
2> {  
3> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
4> restore database;
5> recover database;
6> RELEASE CHANNEL ch00;
7> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=33 instance=cdb3 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting restore at 07-SEP-24

skipping datafile 5; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.293.1179026801
skipping datafile 6; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.258.1179026801
skipping datafile 8; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.284.1179026801
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00015 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_4.261.1179026585
channel ch00: reading from backup piece re34d46k_878_1_1
channel ch00: piece handle=re34d46k_878_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00020 to +DATA/CDB/DATAFILE/test.347.1179026645
channel ch00: reading from backup piece rf34d46k_879_1_1
channel ch00: piece handle=rf34d46k_879_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00014 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_3.287.1179026585
channel ch00: reading from backup piece rd34d46k_877_1_1
channel ch00: piece handle=rd34d46k_877_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00016 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/users.274.1179026589
channel ch00: reading from backup piece ri34d46l_882_1_1
channel ch00: piece handle=ri34d46l_882_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00007 to +DATA/CDB/DATAFILE/users.267.1179026649
channel ch00: reading from backup piece rh34d46l_881_1_1
channel ch00: piece handle=rh34d46l_881_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to +DATA/CDB/DATAFILE/undotbs1.269.1179026645
channel ch00: reading from backup piece r534d46j_869_1_1
channel ch00: piece handle=r534d46j_869_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00010 to +DATA/CDB/DATAFILE/undotbs3.270.1179026649
channel ch00: reading from backup piece rg34d46k_880_1_1
channel ch00: piece handle=rg34d46k_880_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00009 to +DATA/CDB/DATAFILE/undotbs2.265.1179026651
channel ch00: reading from backup piece ra34d46j_874_1_1
channel ch00: piece handle=ra34d46j_874_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00012 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/sysaux.275.1179026597
channel ch00: reading from backup piece r834d46j_872_1_1
channel ch00: piece handle=r834d46j_872_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00013 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undotbs1.360.1179026589
channel ch00: reading from backup piece rc34d46k_876_1_1
channel ch00: piece handle=rc34d46k_876_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to +DATA/CDB/DATAFILE/sysaux.268.1179026653
channel ch00: reading from backup piece r434d46j_868_1_1
channel ch00: piece handle=r434d46j_868_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00011 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/system.282.1179026605
channel ch00: reading from backup piece r634d46j_870_1_1
channel ch00: piece handle=r634d46j_870_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:25
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to +DATA/CDB/DATAFILE/system.363.1179026669
channel ch00: reading from backup piece r334d46j_867_1_1
channel ch00: piece handle=r334d46j_867_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:35
Finished restore at 07-SEP-24

Starting recover at 07-SEP-24

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 07-SEP-24

released channel: ch00

RMAN> alter database open;--可以恢复

本地搞个全部删掉数据文件看看

 

RMAN> backup  device type disk incremental level 0 
2> as compressed backupset 
3> database force;

Starting backup at 07-SEP-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=819 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=60 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=61 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=58 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=820 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=59 instance=cdb3 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=818 instance=cdb3 device type=DISK
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/CDB/DATAFILE/system.363.1179026669
channel ORA_DISK_1: starting piece 1 at 07-SEP-24
channel ORA_DISK_2: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/CDB/DATAFILE/sysaux.268.1179026653
channel ORA_DISK_2: starting piece 1 at 07-SEP-24
channel ORA_DISK_3: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/CDB/DATAFILE/undotbs1.269.1179026645
channel ORA_DISK_3: starting piece 1 at 07-SEP-24
channel ORA_DISK_4: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00011 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/system.282.1179026605
channel ORA_DISK_4: starting piece 1 at 07-SEP-24
channel ORA_DISK_5: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_5: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.293.1179026801
channel ORA_DISK_5: starting piece 1 at 07-SEP-24
channel ORA_DISK_6: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_6: specifying datafile(s) in backup set
input datafile file number=00012 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/sysaux.275.1179026597
channel ORA_DISK_6: starting piece 1 at 07-SEP-24
channel ORA_DISK_7: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_7: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.258.1179026801
channel ORA_DISK_7: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00009 name=+DATA/CDB/DATAFILE/undotbs2.265.1179026651
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_3: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.336.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_3: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00008 name=+DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.284.1179026801
channel ORA_DISK_3: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.318.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00013 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undotbs1.360.1179026589
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.390.1179029973 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00014 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_3.287.1179026585
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.278.1179029973 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00015 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_4.261.1179026585
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.256.1179029975 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00020 name=+DATA/CDB/DATAFILE/test.347.1179026645
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.380.1179029977 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00010 name=+DATA/CDB/DATAFILE/undotbs3.270.1179026649
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.315.1179029977 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00007 name=+DATA/CDB/DATAFILE/users.267.1179026649
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.399.1179029979 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_8: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_8: specifying datafile(s) in backup set
input datafile file number=00016 name=+DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/users.274.1179026589
channel ORA_DISK_8: starting piece 1 at 07-SEP-24
channel ORA_DISK_8: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.382.1179029983 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_8: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_3: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.272.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:14
channel ORA_DISK_7: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.419.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_7: backup set complete, elapsed time: 00:00:19
channel ORA_DISK_6: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.409.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_6: backup set complete, elapsed time: 00:00:27
channel ORA_DISK_2: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.319.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:37
channel ORA_DISK_4: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/06344F62B8C65A17E0636401A8C0F073/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.417.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:47
channel ORA_DISK_5: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.288.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_5: backup set complete, elapsed time: 00:00:47
channel ORA_DISK_1: finished piece 1 at 07-SEP-24
piece handle=+DATA1/CDB/BACKUPSET/2024_09_07/nnndn0_tag20240907t041930_0.376.1179029971 tag=TAG20240907T041930 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:57
Finished backup at 07-SEP-24

Starting Control File and SPFILE Autobackup at 07-SEP-24
piece handle=+DATA1/CDB/AUTOBACKUP/2024_09_07/s_1179030027.273.1179030027 comment=NONE
Finished Control File and SPFILE Autobackup at 07-SEP-24

RMAN> exit


Recovery Manager complete.
[oracle@rac3 rman_backup]$ su - grid
Password: 
Last login: Sat Sep  7 04:01:17 EDT 2024
[grid@rac3 ~]$ asmcmd
ASMCMD> cd data
ASMCMD> cd CDB
ASMCMD> ls
0633F844101D69CBE0636401A8C09D55/
06344F62B8C65A17E0636401A8C0F073/
CHANGETRACKING/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
 
ASMCMD>  rm -rf 0633F844101D69CBE0636401A8C09D55 06344F62B8C65A17E0636401A8C0F073 DATAFILE

-----全部删掉          
  

[oracle@rac3 rman_backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Sep 7 04:21:46 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup mount;

Oracle instance started
database mounted

Total System Global Area    2382361320 bytes

Fixed Size                     9167592 bytes
Variable Size                956301312 bytes
Database Buffers            1409286144 bytes
Redo Buffers                   7606272 bytes

RMAN> run 
2> {  
3> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
4> restore database;
5> recover database;
6> RELEASE CHANNEL ch00;
7> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=34 instance=cdb3 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting restore at 07-SEP-24

channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00015 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_4.261.1179026585
channel ch00: reading from backup piece re34d46k_878_1_1
channel ch00: piece handle=re34d46k_878_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00020 to +DATA/CDB/DATAFILE/test.347.1179026645
channel ch00: reading from backup piece rf34d46k_879_1_1
channel ch00: piece handle=rf34d46k_879_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00014 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_3.287.1179026585
channel ch00: reading from backup piece rd34d46k_877_1_1
channel ch00: piece handle=rd34d46k_877_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00016 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/users.274.1179026589
channel ch00: reading from backup piece ri34d46l_882_1_1
channel ch00: piece handle=ri34d46l_882_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00007 to +DATA/CDB/DATAFILE/users.267.1179026649
channel ch00: reading from backup piece rh34d46l_881_1_1
channel ch00: piece handle=rh34d46l_881_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to +DATA/CDB/DATAFILE/undotbs1.269.1179026645
channel ch00: reading from backup piece r534d46j_869_1_1
channel ch00: piece handle=r534d46j_869_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00010 to +DATA/CDB/DATAFILE/undotbs3.270.1179026649
channel ch00: reading from backup piece rg34d46k_880_1_1
channel ch00: piece handle=rg34d46k_880_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00009 to +DATA/CDB/DATAFILE/undotbs2.265.1179026651
channel ch00: reading from backup piece ra34d46j_874_1_1
channel ch00: piece handle=ra34d46j_874_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00008 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.284.1179026801
channel ch00: reading from backup piece rb34d46j_875_1_1
channel ch00: piece handle=rb34d46j_875_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00006 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.258.1179026801
channel ch00: reading from backup piece r934d46j_873_1_1
channel ch00: piece handle=r934d46j_873_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00012 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/sysaux.275.1179026597
channel ch00: reading from backup piece r834d46j_872_1_1
channel ch00: piece handle=r834d46j_872_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00013 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undotbs1.360.1179026589
channel ch00: reading from backup piece rc34d46k_876_1_1
channel ch00: piece handle=rc34d46k_876_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to +DATA/CDB/DATAFILE/sysaux.268.1179026653
channel ch00: reading from backup piece r434d46j_868_1_1
channel ch00: piece handle=r434d46j_868_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00005 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.293.1179026801
channel ch00: reading from backup piece r734d46j_871_1_1
channel ch00: piece handle=r734d46j_871_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:25
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00011 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/system.282.1179026605
channel ch00: reading from backup piece r634d46j_870_1_1
channel ch00: piece handle=r634d46j_870_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to +DATA/CDB/DATAFILE/system.363.1179026669
channel ch00: reading from backup piece r334d46j_867_1_1
channel ch00: piece handle=r334d46j_867_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:35
Finished restore at 07-SEP-24

Starting recover at 07-SEP-24

starting media recovery

archived log for thread 3 with sequence 77 is already on disk as file +DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_77.368.1179029937
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=76
channel ch00: reading from backup piece rj34d48d_883_1_1
channel ch00: piece handle=rj34d48d_883_1_1 tag=TAG20240907T041613
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.258.1179030257 thread=3 sequence=76
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.258.1179030257 RECID=464 STAMP=1179030257
media recovery complete, elapsed time: 00:00:01
Finished recover at 07-SEP-24

released channel: ch00

RMAN> alter database open;

Statement processed

RMAN>

------有一级备份时-----------------

[oracle@rac3 rman_backup]$ du -sk /nfs
1598164 /nfs
[oracle@rac3 rman_backup]$ 
[oracle@rac3 rman_backup]$ 
[oracle@rac3 rman_backup]$ 
[oracle@rac3 rman_backup]$ sh -x /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh cdb daily
+ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ export 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS'
+ NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
++ basename cdb
+ ORACLE_DB=cdb
++ basename daily
+ BACKUP_OPTION=daily
+ case `hostname` in
++ hostname
+ ORACLE_SID=cdb3
+ export ORACLE_SID
++ dirname /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh
++ basename cdb
++ date +%Y%m%d%H%M%S
+ RMAN_LOG_FILE=/home/oracle/rman_backup/log/cdb_fra_20240907042923.out
+ RMAN=/u01/app/oracle/product/19.0.0/db_1/bin/rman
++ date +%Y%m%d%H%M%S
+ BACKUP_TAG=cdb_20240907042923_level0
+ echo 'ORACLE DB name: cdb'
+ echo 'ORACLE instance : cdb3'
+ ORACLE_USER=oracle
+ TARGET_CONNECT_STR=/
+ '[' cdb = cdb ']'
+ CATALOG_CONNECT_STR=nocatalog
+ export SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ export NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ export IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ export IngrianNAE_Properties_Conf_SessionID_Max=100
+ IngrianNAE_Properties_Conf_SessionID_Max=100
+ export ORACLE_UNQNAME=cdb
+ ORACLE_UNQNAME=cdb
++ hostname
+ NB_ORA_CLIENT=rac3
+ NB_ORA_SERV=nxxxxx
+ NB_ORA_POLICY=NP2_ORAC_DB_Backup
+ RMAN_SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64
+ RMAN_PARMS='PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)"'
+ case $BACKUP_OPTION in
+ NB_ORA_SCHED=Daily
+ echo
+ echo 'RMAN: /u01/app/oracle/product/19.0.0/db_1/bin/rman'
+ echo 'ORACLE_SID: cdb3'
+ echo 'ORACLE_USER: oracle'
+ echo 'ORACLE_HOME: /u01/app/oracle/product/19.0.0/db_1'
+ echo
+ echo 'NB_ORA_SERV: nxxxxx'
+ echo 'NB_ORA_CLIENT: rac3'
+ echo 'NB_ORA_POL/ICY: NP2_ORAC_DB_Backup'
+ echo 'NB_ORA_SCHED: Daily'
+ echo
+ CMD_STR='
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907042923.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ '[' '' = root ']'
+ /usr/bin/sh -c '
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907042923.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ RSTAT=0
+ echo ==========================================================================
+ echo
[oracle@rac3 rman_backup]$ du -sk /nfs
1690908 /nfs  ---------------增加了几百M而已
[oracle@rac3 rman_backup]$ 

--------------------------------------------------------搞个resetlogs试试----------------------------------------

[oracle@rac3 rman_backup]$ du -sk /nfs
1690908 /nfs
[oracle@rac3 rman_backup]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Sep 7 04:30:52 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL> shutdown abort     
ORACLE instance shut down.
SQL> recover database until cancel;
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


SQL> startup mount;
ORACLE instance started.

Total System Global Area 2382361320 bytes
Fixed Size                  9167592 bytes
Variable Size             956301312 bytes
Database Buffers         1409286144 bytes
Redo Buffers                7606272 bytes
Database mounted.
SQL>  recover database until cancel;
ORA-00279: change 10939255 generated at 09/07/2024 04:29:30 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-15173: entry 'ARCHIVELOG' does not exist in directory 'CDB'
ORA-00280: change 10939255 for thread 3 is in sequence #81


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel 
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '+DATA/CDB/DATAFILE/system.258.1179030223'


ORA-01112: media recovery not started


SQL> recover database
Media recovery complete.
SQL> ;
SP2-0223: No lines in SQL buffer.
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> recover database using backup controlfile until cance;
ORA-00277: illegal option to the UNTIL recovery flag CANCE


SQL>  recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-38872: Cannot perform backup control file recovery if Flashback Database is
enabled.


SQL> alter database flashback off;     

Database altered.

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 11039438 generated at 09/07/2024 04:31:01 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-00280: change 11039438 for thread 3 is in sequence #81


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;

Database altered.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac3 rman_backup]$ sh -x /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh cdb daily
+ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
+ export 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS'
+ NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
++ basename cdb
+ ORACLE_DB=cdb
++ basename daily
+ BACKUP_OPTION=daily
+ case `hostname` in
++ hostname
+ ORACLE_SID=cdb3
+ export ORACLE_SID
++ dirname /home/oracle/rman_backup/rman_backup_fradb3_pdb.sh
++ basename cdb
++ date +%Y%m%d%H%M%S
+ RMAN_LOG_FILE=/home/oracle/rman_backup/log/cdb_fra_20240907043339.out
+ RMAN=/u01/app/oracle/product/19.0.0/db_1/bin/rman
++ date +%Y%m%d%H%M%S
+ BACKUP_TAG=cdb_20240907043339_level0
+ echo 'ORACLE DB name: cdb'
+ echo 'ORACLE instance : cdb3'
+ ORACLE_USER=oracle
+ TARGET_CONNECT_STR=/
+ '[' cdb = cdb ']'
+ CATALOG_CONNECT_STR=nocatalog
+ export SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ SFNT_HSMAPI_BASE=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000
+ export NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ NAE_Properties_Conf_Filename=/opt/oracle/extapi/64/hsm/safenet/8.9.0.000/IngrianNAE.properties
+ export IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ IngrianNAE_Properties_Conf_Slot_ID_Max=100
+ export IngrianNAE_Properties_Conf_SessionID_Max=100
+ IngrianNAE_Properties_Conf_SessionID_Max=100
+ export ORACLE_UNQNAME=cdb
+ ORACLE_UNQNAME=cdb
++ hostname
+ NB_ORA_CLIENT=rac3
+ NB_ORA_SERV=nxxxxx
+ NB_ORA_POLICY=NP2_ORAC_DB_Backup
+ RMAN_SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64
+ RMAN_PARMS='PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)"'
+ case $BACKUP_OPTION in
+ NB_ORA_SCHED=Daily
+ echo
+ echo 'RMAN: /u01/app/oracle/product/19.0.0/db_1/bin/rman'
+ echo 'ORACLE_SID: cdb3'
+ echo 'ORACLE_USER: oracle'
+ echo 'ORACLE_HOME: /u01/app/oracle/product/19.0.0/db_1'
+ echo
+ echo 'NB_ORA_SERV: nxxxxx'
+ echo 'NB_ORA_CLIENT: rac3'
+ echo 'NB_ORA_POL/ICY: NP2_ORAC_DB_Backup'
+ echo 'NB_ORA_SCHED: Daily'
+ echo
+ CMD_STR='
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907043339.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ '[' '' = root ']'
+ /usr/bin/sh -c '
ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_HOME
ORACLE_SID=cdb3
export ORACLE_SID
/u01/app/oracle/product/19.0.0/db_1/bin/rman target / nocatalog msglog /home/oracle/rman_backup/log/cdb_fra_20240907043339.out append << EOF
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
show all;
RUN {
ALLOCATE CHANNEL ch00 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch01 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch02 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch03 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch04 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch05 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch06 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch07 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch08 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch09 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch10 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch11 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch12 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch13 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch14 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
ALLOCATE CHANNEL ch15 TYPE '\''SBT_TAPE'\'' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
send '\''NB_ORA_SERV=nxxxxx, NB_ORA_CLIENT=rac3, NB_ORA_POLICY=NP2_ORAC_DB_Backup, NB_ORA_SCHED=Daily'\'';
backup incremental level 1 
as compressed backupset 
DATABASE root pluggable database pdb ,'\''PDB\$SEED'\''  plus archivelog ;
#database force filesperset=1;
delete noprompt archivelog all 
#completed before '\''sysdate-1'\'' device type '\''SBT_TAPE'\'' 
backed up 1 times to device type '\''SBT_TAPE'\'';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
RELEASE CHANNEL ch10;
RELEASE CHANNEL ch11;
RELEASE CHANNEL ch12;
RELEASE CHANNEL ch13;
RELEASE CHANNEL ch14;
RELEASE CHANNEL ch15;
}
EOF
'
+ RSTAT=0
+ echo ==========================================================================
+ echo
[oracle@rac3 rman_backup]$ du -sk /nfs
1784948 /nfs
[oracle@rac3 rman_backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Sep 7 04:34:09 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB (DBID=2265125454)

RMAN> startup force mount;

Oracle instance started
database mounted

Total System Global Area    2382361320 bytes

Fixed Size                     9167592 bytes
Variable Size                956301312 bytes
Database Buffers            1409286144 bytes
Redo Buffers                   7606272 bytes

RMAN> 

RMAN> 

RMAN> run 
2> {  
3> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
4> restore database;
5> recover database;
6> RELEASE CHANNEL ch00;
7> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=29 instance=cdb3 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting restore at 07-SEP-24

skipping datafile 5; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.266.1179030181
skipping datafile 6; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.360.1179030145
skipping datafile 8; already restored to file +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.275.1179030139
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00015 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_4.363.1179030127
channel ch00: reading from backup piece re34d46k_878_1_1
channel ch00: piece handle=re34d46k_878_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00020 to +DATA/CDB/DATAFILE/test.268.1179030127
channel ch00: reading from backup piece rf34d46k_879_1_1
channel ch00: piece handle=rf34d46k_879_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00014 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_3.265.1179030129
channel ch00: reading from backup piece rd34d46k_877_1_1
channel ch00: piece handle=rd34d46k_877_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00016 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/users.270.1179030129
channel ch00: reading from backup piece ri34d46l_882_1_1
channel ch00: piece handle=ri34d46l_882_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00007 to +DATA/CDB/DATAFILE/users.267.1179030131
channel ch00: reading from backup piece rh34d46l_881_1_1
channel ch00: piece handle=rh34d46l_881_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to +DATA/CDB/DATAFILE/undotbs1.269.1179030131
channel ch00: reading from backup piece r534d46j_869_1_1
channel ch00: piece handle=r534d46j_869_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00010 to +DATA/CDB/DATAFILE/undotbs3.347.1179030135
channel ch00: reading from backup piece rg34d46k_880_1_1
channel ch00: piece handle=rg34d46k_880_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00009 to +DATA/CDB/DATAFILE/undotbs2.282.1179030135
channel ch00: reading from backup piece ra34d46j_874_1_1
channel ch00: piece handle=ra34d46j_874_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00012 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/sysaux.274.1179030153
channel ch00: reading from backup piece r834d46j_872_1_1
channel ch00: piece handle=r834d46j_872_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00013 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undotbs1.261.1179030159
channel ch00: reading from backup piece rc34d46k_876_1_1
channel ch00: piece handle=rc34d46k_876_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to +DATA/CDB/DATAFILE/sysaux.287.1179030167
channel ch00: reading from backup piece r434d46j_868_1_1
channel ch00: piece handle=r434d46j_868_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00011 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/system.284.1179030207
channel ch00: reading from backup piece r634d46j_870_1_1
channel ch00: piece handle=r634d46j_870_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to +DATA/CDB/DATAFILE/system.258.1179030223
channel ch00: reading from backup piece r334d46j_867_1_1
channel ch00: piece handle=r334d46j_867_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:35
Finished restore at 07-SEP-24

Starting recover at 07-SEP-24

starting media recovery

channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=76
channel ch00: reading from backup piece rj34d48d_883_1_1
channel ch00: piece handle=rj34d48d_883_1_1 tag=TAG20240907T041613
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.299.1179030981 thread=3 sequence=76
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.299.1179030981 RECID=476 STAMP=1179030980
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=77
channel ch00: reading from backup piece s834d516_904_1_1
channel ch00: piece handle=s834d516_904_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_77.299.1179030983 thread=3 sequence=77
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_77.299.1179030983 RECID=477 STAMP=1179030982
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=78
channel ch00: reading from backup piece s634d516_902_1_1
channel ch00: piece handle=s634d516_902_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_78.299.1179030985 thread=3 sequence=78
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_78.299.1179030985 RECID=478 STAMP=1179030983
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=79
channel ch00: reading from backup piece s734d516_903_1_1
channel ch00: piece handle=s734d516_903_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_79.299.1179030987 thread=3 sequence=79
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_79.299.1179030987 RECID=479 STAMP=1179030985
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=80
channel ch00: reading from backup piece su34d597_926_1_1
channel ch00: piece handle=su34d597_926_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_80.299.1179030989 thread=3 sequence=80
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_80.299.1179030989 RECID=480 STAMP=1179030986
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=81
channel ch00: reading from backup piece sv34d597_927_1_1
channel ch00: piece handle=sv34d597_927_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_81.299.1179030991 thread=3 sequence=81
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=1
channel ch00: reading from backup piece st34d597_925_1_1
channel ch00: piece handle=st34d597_925_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_1.300.1179030989 thread=3 sequence=1
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_81.299.1179030991 RECID=481 STAMP=1179030987
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_1.300.1179030989 RECID=482 STAMP=1179030989
media recovery complete, elapsed time: 00:00:00
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=2
channel ch00: reading from backup piece tj34d59b_947_1_1
channel ch00: piece handle=tj34d59b_947_1_1 tag=TAG20240907T043347
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_2.300.1179030991 RECID=483 STAMP=1179030990
Finished recover at 07-SEP-24

released channel: ch00

RMAN> alter database open;

Statement processed

RMAN> shutdown abort

Oracle instance shut down

RMAN> 

--------------------resetlogs 后吧文件删了试试----------

RMAN> shutdown abort

Oracle instance shut down

RMAN> exit


Recovery Manager complete.
[oracle@rac3 rman_backup]$ su - grid
Password: 
Last login: Sat Sep  7 04:31:11 EDT 2024
[grid@rac3 ~]$ asmcmd
ASMCMD> cd data/cdb
ASMCMD> ls
0633F844101D69CBE0636401A8C09D55/
06344F62B8C65A17E0636401A8C0F073/
CHANGETRACKING/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
ASMCMD> rm -rf 0633F844101D69CBE0636401A8C09D55 06344F62B8C65A17E0636401A8C0F073 DATAFILE
ASMCMD> exit
[grid@rac3 ~]$ exit
logout
[oracle@rac3 rman_backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Sep 7 04:38:30 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup mount;

Oracle instance started
database mounted

Total System Global Area    2382361320 bytes

Fixed Size                     9167592 bytes
Variable Size                956301312 bytes
Database Buffers            1409286144 bytes
Redo Buffers                   7606272 bytes

RMAN> run 
2> {  
3> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/nfs)";
4> restore database;
5> recover database;
6> RELEASE CHANNEL ch00;
7> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=795 instance=cdb3 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting restore at 07-SEP-24

channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00015 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_4.363.1179030127
channel ch00: reading from backup piece re34d46k_878_1_1
channel ch00: piece handle=re34d46k_878_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00020 to +DATA/CDB/DATAFILE/test.268.1179030127
channel ch00: reading from backup piece rf34d46k_879_1_1
channel ch00: piece handle=rf34d46k_879_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00014 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undo_3.265.1179030129
channel ch00: reading from backup piece rd34d46k_877_1_1
channel ch00: piece handle=rd34d46k_877_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00016 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/users.270.1179030129
channel ch00: reading from backup piece ri34d46l_882_1_1
channel ch00: piece handle=ri34d46l_882_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00007 to +DATA/CDB/DATAFILE/users.267.1179030131
channel ch00: reading from backup piece rh34d46l_881_1_1
channel ch00: piece handle=rh34d46l_881_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to +DATA/CDB/DATAFILE/undotbs1.269.1179030131
channel ch00: reading from backup piece r534d46j_869_1_1
channel ch00: piece handle=r534d46j_869_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00010 to +DATA/CDB/DATAFILE/undotbs3.347.1179030135
channel ch00: reading from backup piece rg34d46k_880_1_1
channel ch00: piece handle=rg34d46k_880_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00009 to +DATA/CDB/DATAFILE/undotbs2.282.1179030135
channel ch00: reading from backup piece ra34d46j_874_1_1
channel ch00: piece handle=ra34d46j_874_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:03
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00008 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.275.1179030139
channel ch00: reading from backup piece rb34d46j_875_1_1
channel ch00: piece handle=rb34d46j_875_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00006 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.360.1179030145
channel ch00: reading from backup piece r934d46j_873_1_1
channel ch00: piece handle=r934d46j_873_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00012 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/sysaux.274.1179030153
channel ch00: reading from backup piece r834d46j_872_1_1
channel ch00: piece handle=r834d46j_872_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00013 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/undotbs1.261.1179030159
channel ch00: reading from backup piece rc34d46k_876_1_1
channel ch00: piece handle=rc34d46k_876_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to +DATA/CDB/DATAFILE/sysaux.287.1179030167
channel ch00: reading from backup piece r434d46j_868_1_1
channel ch00: piece handle=r434d46j_868_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00005 to +DATA/CDB/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.266.1179030181
channel ch00: reading from backup piece r734d46j_871_1_1
channel ch00: piece handle=r734d46j_871_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00011 to +DATA/CDB/06344F62B8C65A17E0636401A8C0F073/DATAFILE/system.284.1179030207
channel ch00: reading from backup piece r634d46j_870_1_1
channel ch00: piece handle=r634d46j_870_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:25
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to +DATA/CDB/DATAFILE/system.258.1179030223
channel ch00: reading from backup piece r334d46j_867_1_1
channel ch00: piece handle=r334d46j_867_1_1 tag=TAG20240907T041514
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:35
Finished restore at 07-SEP-24

Starting recover at 07-SEP-24

starting media recovery

archived log for thread 3 with sequence 3 is already on disk as file +DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_3.300.1179031001
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=76
channel ch00: reading from backup piece rj34d48d_883_1_1
channel ch00: piece handle=rj34d48d_883_1_1 tag=TAG20240907T041613
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.299.1179031263 thread=3 sequence=76
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_76.299.1179031263 RECID=485 STAMP=1179031263
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=77
channel ch00: reading from backup piece s834d516_904_1_1
channel ch00: piece handle=s834d516_904_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_77.299.1179031265 thread=3 sequence=77
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_77.299.1179031265 RECID=486 STAMP=1179031265
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=78
channel ch00: reading from backup piece s634d516_902_1_1
channel ch00: piece handle=s634d516_902_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_78.299.1179031267 thread=3 sequence=78
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_78.299.1179031267 RECID=487 STAMP=1179031266
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=79
channel ch00: reading from backup piece s734d516_903_1_1
channel ch00: piece handle=s734d516_903_1_1 tag=TAG20240907T042926
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_79.299.1179031269 thread=3 sequence=79
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_79.299.1179031269 RECID=488 STAMP=1179031268
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=80
channel ch00: reading from backup piece su34d597_926_1_1
channel ch00: piece handle=su34d597_926_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_80.299.1179031271 thread=3 sequence=80
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_80.299.1179031271 RECID=489 STAMP=1179031269
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=81
channel ch00: reading from backup piece sv34d597_927_1_1
channel ch00: piece handle=sv34d597_927_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_81.299.1179031273 thread=3 sequence=81
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=1
channel ch00: reading from backup piece st34d597_925_1_1
channel ch00: piece handle=st34d597_925_1_1 tag=TAG20240907T043343
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_1.383.1179031271 thread=3 sequence=1
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_81.299.1179031273 RECID=490 STAMP=1179031270
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_1.383.1179031271 RECID=491 STAMP=1179031272
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=3 sequence=2
channel ch00: reading from backup piece tj34d59b_947_1_1
channel ch00: piece handle=tj34d59b_947_1_1 tag=TAG20240907T043347
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:01
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_2.383.1179031273 thread=3 sequence=2
channel default: deleting archived log(s)
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_09_07/thread_3_seq_2.383.1179031273 RECID=492 STAMP=1179031273
media recovery complete, elapsed time: 00:00:01
Finished recover at 07-SEP-24

released channel: ch00

RMAN> alter database open;

Statement processed

RMAN> exit


Recovery Manager complete.
[oracle@rac3 rman_backup]$ du -sk /nfs
1784948 /nfs
[oracle@rac3 rman_backup]$ 

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     4
Next log sequence to archive   5
Current log sequence           5

SQL> 

视图:v$block_change_tracking
查看块跟踪的状态,跟踪文件的大小及位置

 

查看当前块跟踪的状态
SQL> select status from v$block_change_tracking;
STATUS
----------
DISABLED    --->关闭状态

 

也可通过后台进程CTWR(修改跟踪进程)判断,CTWR进程负责维护新的修改跟踪文件
ps -elf | grep ctwr | grep -v grep

 

开启块跟踪
SQL> alter database enable block change tracking;
Database altered.

 

SQL> select * from v$block_change_tracking;
STATUS    FILENAME                           BYTES
---------- ------------------------------ ----------
ENABLED   /u01/app/oracle/ORCL/changetra  11599872
          cking/o1_mf_8zqj5157_.chg
跟踪文件是自动在db_create_file_dest设置的目录下生成的,大小约11M

 

通过后台进程CTWR判断
ps -elf | grep ctwr | grep -v grep
0 S oracle  10379   1 0  75  0 - 186111 ?   22:30 ?    00:00:00 ora_ctwr_orcl

 

关闭块跟踪
SQL> alter database disable block change tracking;
Database altered.
关闭块跟踪会删除跟踪文件

 

SQL> select status from v$block_change_tracking;
STATUS
----------
DISABLED

 

如果db_create_file_dest目录没有设置,也可以在开启块跟踪时直接指定路径
SQL> alter database enable block change tracking using file '/u01/app/oracle/track.log';

Database altered.

 

SQL> select * from v$block_change_tracking;
STATUS    FILENAME                      BYTES
---------- -------------------------- ---------
ENABLED   /u01/app/oracle/track.log  11599872

 

更改跟踪文件的位置:


--可以使用alter database rename 语句来修改跟踪文件的位置,该命令会更新控制文件里的信息,命令必须在mount 状态下执行,如果数据库不能shutdown,那么可以先disable块跟踪,然后再指定新的位置,但是这样会丢失以前跟踪文件里的数据。

 

关闭数据库
SQL> shutdown immediate

 

移动文件
mv /u01/app/oracle/track.log /u01/app/track.log

 

启动到mount
sqlplus / as sysdba
SQL> startup mount

 

修改文件位置
SQL> alter database rename file '/u01/app/oracle/track.log' to '/u01/app/track.chg';

 

OPEN数据库
SQL> alter database open;

 

查看
SQL> select * from v$block_change_tracking;
STATUS    FILENAME                      BYTES
---------- -------------------------- ---------
ENABLED   /u01/app/track.chg         11599872


注释:
在使用RMAN 增量备份的情况下,启动块跟踪,在做增量备份时会缩短RMAN 备份的时间,因为不用扫描整个数据库。但是块跟踪也会带来其他的一些开销。所以要根据实际情况决定是否启用块跟踪。

你可能感兴趣的:(oracle,dba)