19C之前恢复drop 掉的PDB 创建另一个实例

--------恢复PDB------------------

 create pluggable database testpdb admin user test identified by test;
 backup database plus archivelog tag 'full db  backup';
 
RMAN>  backup database plus archivelog tag 'full db  backup';
ORA-15012: ASM file '+DATA1/CDB/ARCHIVELOG/2024_06_01/thread_2_seq_90.424.1170496125' does not exist
RMAN> crosscheck archivelog all;


crosscheck backup all;
delete expired backup;
list backup summary;
RMAN> list backup;
  
 
SQL> drop pluggable database testpdb;
Pluggable database dropped.
 
·     In case if we try to restore PDB as a database, we will get below error 
RMAN> restore pluggable database testpdb;
 
Starting restore at 17-JUN-15
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/17/2015 16:46:46
RMAN-06813: could not translate pluggable database TESTPDB
 
Restore procedure
 
Pluggable database (PDB) can’t be restored as a database. It needs to be restored as database object. 
For that auxiliary instance has to be created temporarily where CDB and required PDB will be restored. Later PDB will be unplugged from auxiliary instance and attached to target instance
 

Create a temporary auxiliary instance to restore container database (CDB) and required pluggable database (PDB)
 
Create password file for auxiliary instance
 
[oracle@Server dbs]$ orapwd file=orapwtestcdb1 password=sys entries=5
[oracle@Server dbs]$ ls -lrt orapwtestcdb1
-rw-r-----. 1 oracle oinstall 5120 Jun 17 17:04 orapwtestcdb1
 
Create init file for auxiliary instance
 

*.compatible='12.1.0.0.0'
*.control_files='/u01/app/oracle/oradata/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_name='testcdb1'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testcdb1XDB)'
*.enable_pluggable_database=true
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
 
Start the auxiliary instance in nomount state
 

[oracle@Server dbs]$ export ORACLE_SID=testcdb1
[oracle@Server dbs]$ sqlplus sys/sy as sysdba
 
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jun 17 17:04:57 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL>  startup nomount pfile=inittestcdb1.ora
ORACLE instance started.
Total System Global Area          242208768 bytes
Fixed Size                                 2849120 bytes
Variable Size                             184551072 bytes
Database Buffers                      50331648 bytes
Redo Buffers                4476928 bytes
 
Connect auxiliary instance through RMAN
 
[oracle@Server dbs]$ rman auxiliary sys/sys
Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jun 17 17:08:45 2015
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to auxiliary database: TESTCDB1 (not mounted)
 
Execute Duplicate command for CDB and particular PDB using backup location
 
RMAN>  Duplicate database to 'testcdb1' noopen backup location '/u01/app/oracle/fast_recovery_area/TESTCDB/backup/';
 
Starting Duplicate Db at 17-JUN-15
contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script
 
Oracle instance shut down
 
connected to auxiliary database (not started)
Oracle instance started
 
Total System Global Area          242208768 bytes
Fixed Size                                 2849120 bytes
Variable Size                184551072 bytes
Database Buffers                      50331648 bytes
Redo Buffers                            4476928 bytes
 
contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''/u01/app/oracle/oradata/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name =
 ''TESTCDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTCDB1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/app/oracle/fast_recovery_area/TESTCDB/backup/o1_mf_s_882636099_br359n4j_.bkp';
   alter clone database mount;
}
executing Memory Script
 
sql statement: alter system set  control_files =   ''/u01/app/oracle/oradata/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl'' comment= ''Set by RMAN'' scope=spfile
 
sql statement: alter system set  db_name =  ''TESTCDB'' comment= ''Modified by RMAN duplicate'' scope=spfile
 
sql statement: alter system set  db_unique_name =  ''TESTCDB1'' comment= ''Modified by RMAN duplicate'' scope=spfile
 
Oracle instance shut down
Oracle instance started
Total System Global Area     242208768 bytes
 
Fixed Size                     2849120 bytes
Variable Size                184551072 bytes
Database Buffers              50331648 bytes
Redo Buffers                   4476928 bytes
 
Starting restore at 17-JUN-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
 
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl
Finished restore at 17-JUN-15
 
database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
 
contents of Memory Script:
{
   set until scn  1926434;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   set newname for clone datafile  6 to new;
   set newname for clone datafile  7 to new;
   set newname for clone datafile  15 to new;
   set newname for clone datafile  16 to new;
   restore
   clone database
   ;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 17-JUN-15
using channel ORA_AUX_DISK_1
 
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb117q9nt34_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb117q9nt34_1_1 tag=TAG20150617T163756
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb118q9nt5f_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb118q9nt5f_1_1 tag=TAG20150617T163756
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00015 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00016 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb119q9nt6i_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb119q9nt6i_1_1 tag=TAG20150617T163756
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 17-JUN-15
 
contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script
 
datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=882637965 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br36zdcj_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=882637965 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br36zdcn_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=882637965 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_undotbs1_br36zdcq_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=882637965 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br371fvr_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=882637965 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_users_br36zdfb_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=882637966 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br371frz_.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=15 STAMP=882637966 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br372tts_.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=16 STAMP=882637966 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br372ttf_.dbf
 
contents of Memory Script:
{
   set until scn  1926434;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script
 
executing command: SET until clause
 
Starting recover at 17-JUN-15
using channel ORA_AUX_DISK_1
 
starting media recovery
 
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=23
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb11dq9nta2_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTCDB/backup/testpdb11dq9nta2_1_1 tag=TAG20150617T164113
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/fast_recovery_area/TESTCDB1/archivelog/2015_06_17/o1_mf_1_23_br373zdg_.arc thread=1 sequence=23
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/TESTCDB1/archivelog/2015_06_17/o1_mf_1_23_br373zdg_.arc RECID=1 STAMP=882637967
media recovery complete, elapsed time: 00:00:02
Finished recover at 17-JUN-15
Oracle instance started
 
Total System Global Area     242208768 bytes
 
Fixed Size                     2849120 bytes
Variable Size                184551072 bytes
Database Buffers              50331648 bytes
Redo Buffers                   4476928 bytes
 
contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TESTCDB1'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script
 
sql statement: alter system set  db_name =  ''TESTCDB1'' comment= ''Reset to original value by RMAN'' scope=spfile
 
sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started
 
Total System Global Area     242208768 bytes
 
Fixed Size                     2849120 bytes
Variable Size                184551072 bytes
Database Buffers              50331648 bytes
Redo Buffers                   4476928 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTCDB1" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1  SIZE 50 M ,
  GROUP   2  SIZE 50 M ,
  GROUP   3  SIZE 50 M
 DATAFILE
  '/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br36zdcj_.dbf',
  '/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br371fvr_.dbf',
  '/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_system_br372tts_.dbf'
 CHARACTER SET WE8MSWIN1252
 
 
contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   set newname for clone tempfile  2 to new;
   set newname for clone tempfile  3 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br36zdcn_.dbf",
 "/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_undotbs1_br36zdcq_.dbf",
 "/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_users_br36zdfb_.dbf",
 "/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br371frz_.dbf",
 "/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br372ttf_.dbf";
   switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
 
renamed tempfile 1 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 2 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_temp_%u_.tmp in control file
 
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br36zdcn_.dbf RECID=1 STAMP=882637984
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_undotbs1_br36zdcq_.dbf RECID=2 STAMP=882637984
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_users_br36zdfb_.dbf RECID=3 STAMP=882637984
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br371frz_.dbf RECID=4 STAMP=882637984
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br372ttf_.dbf RECID=5 STAMP=882637984
 
datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=882637984 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br36zdcn_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=882637984 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_undotbs1_br36zdcq_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=882637984 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_users_br36zdfb_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=882637984 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br371frz_.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=5 STAMP=882637984 file name=/u01/app/oracle/oradata/TESTCDB1/datafile/o1_mf_sysaux_br372ttf_.dbf
Leaving database unopened, as requested
Cannot remove created server parameter file
Finished Duplicate Db at 17-JUN-15
 
RMAN> exit
 
Connect to auxiliary CDB instance and check PDB existence

 
[oracle@Server dbs]$ sqlplus "/ as sysdba"
 
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jun 17 17:31:47 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
 
SQL> alter database open resetlogs;
Database altered.
 
SQL> show pdbs
 
    CON_ID        CON_NAME                              OPEN MODE     RESTRICTED
----------          ------------------------------      ----------          ----------
         2             PDB$SEED                               READ ONLY       NO
         3             TESTPDB                                  MOUNTED
 
Check validity of PDB by opening it

SQL> alter pluggable database testpdb open;
Pluggable database altered.
 
SQL> show pdbs
 
    CON_ID        CON_NAME                              OPEN MODE     RESTRICTED
----------          ------------------------------      ----------          ----------
         2             PDB$SEED                               READ ONLY       NO
         3             TESTPDB                                  READ WRITE     NO
 
Close the PDB to unplug it

 
SQL> alter pluggable database testpdb close immediate;
Pluggable database altered.
 
SQL> show pdbs
 
    CON_ID        CON_NAME                              OPEN MODE     RESTRICTED
----------          ------------------------------      ----------          ----------
         2             PDB$SEED                               READ ONLY       NO
         3             TESTPDB                                  MOUNTED
 
Execute unplug command to detach PDB from auxiliary CDB

 
SQL>  alter pluggable database testpdb unplug into '/tmp/testpdb.xml';
Pluggable database altered.
 
Plug PDB into Target database

 
·     Check existing PDBs

 
SQL> show pdbs
 
    CON_ID        CON_NAME                              OPEN MODE     RESTRICTED
----------          ------------------------------      ----------          ----------
         2             PDB$SEED                               READ ONLY       NO
 
Execute create pluggable database using XML file created through unplug command. Use copy command to move pdb data files to new location

SQL>  create pluggable database testpdb using '/tmp/testpdb.xml'
COPY   2  ;
Pluggable database created.
 
SQL> show pdbs
 

    CON_ID        CON_NAME                              OPEN MODE     RESTRICTED
----------          ------------------------------      ----------          ----------
         2             PDB$SEED                               READ ONLY       NO
         3             TESTPDB                                  MOUNTED
 
Summary: If Pluggable database (PDB) is dropped mistakenly in Container Database (CDB), it has to be restored through Point in time recovery (PITR) method as we recover other database objects.

----------------------------ASM 恢复                  

[oracle@rac1 ~]$ orapwd file=orapwtestcdb1 password=A#qwert#12 entries=5
[oracle@rac1 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac1 dbs]$ ls -ltr orapw
ls: cannot access orapw: No such file or directory


[oracle@rac1 ~]$ pwd
/home/oracle
[oracle@rac1 ~]$
-rw-r-----. 1 oracle oinstall     6144 Jun 15 13:53 orapwtestcdb1

--没有放到合适的位置,也没用这个文件

[oracle@rac1 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac1 dbs]$ cat inittestcdb1.ora
*.compatible='19.0.0.0.0'
*.control_files='+data1/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl'----之前没这个目录
*.db_block_size=8192
*.db_create_file_dest='+data1'----不用详细
*.db_name='testcdb1'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testcdb1XDB)'
*.enable_pluggable_database=true
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@rac1 dbs]$ 

[oracle@rac1 dbs]$ export ORACLE_SID=testcdb1
[oracle@rac1 dbs]$ sqlplus sys/A#qwert#12 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 13:55:32 2024
Version 19.20.0.0.0


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

Connected to an idle instance.

SQL>  startup nomount pfile=inittestcdb1.ora
ORACLE instance started.

Total System Global Area  390067064 bytes
Fixed Size                  9163640 bytes
Variable Size             339738624 bytes
Database Buffers           33554432 bytes
Redo Buffers                7610368 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0


[oracle@rac1 dbs]$ rman auxiliary sys/A#qwert#1254455        

------------password no use................

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Jun 15 18:26:32 2024
Version 19.20.0.0.0

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

connected to auxiliary database: TESTCDB1 (DBID=1016994380)

RMAN> 

[oracle@rac1 dbs]$ rman auxiliary sys/A#qwert#12

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Jun 15 13:57:56 2024
Version 19.20.0.0.0

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

connected to auxiliary database: TESTCDB1 (not mounted)

RMAN> Duplicate database to 'testcdb1' noopen backup location '+data1';

Starting Duplicate Db at 15-JUN-24
searching for database ID
found backup of database ID 2265125454

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''testcdb1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '+DATA1/CDB/AUTOBACKUP/2024_06_15/s_1171720335.532.1171677135';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''CDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''testcdb1'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

Starting restore at 15-JUN-24
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:05
output file name=+DATA1/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl
Finished restore at 15-JUN-24

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location

contents of Memory Script:
{
   set until scn  9566546;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   set newname for clone datafile  6 to new;
   set newname for clone datafile  7 to new;
   set newname for clone datafile  8 to new;
   set newname for clone datafile  9 to new;
   set newname for clone datafile  10 to new;
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 15-JUN-24
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00003 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00004 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00007 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00009 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00010 to +data1
channel ORA_AUX_DISK_1: reading from backup piece +DATA1/CDB/BACKUPSET/2024_06_15/nnndf0_tag20240615t134035_0.427.1171676435
channel ORA_AUX_DISK_1: piece handle=+DATA1/CDB/BACKUPSET/2024_06_15/nnndf0_tag20240615t134035_0.427.1171676435 tag=TAG20240615T134035
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00006 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00008 to +data1
channel ORA_AUX_DISK_1: reading from backup piece +DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_06_15/nnndf0_tag20240615t134035_0.404.1171676439
channel ORA_AUX_DISK_1: piece handle=+DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_06_15/nnndf0_tag20240615t134035_0.404.1171676439 tag=TAG20240615T134035
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 15-JUN-24

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=14 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/system.350.1171677579
datafile 3 switched to datafile copy
input datafile copy RECID=15 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/sysaux.506.1171677579
datafile 4 switched to datafile copy
input datafile copy RECID=16 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.387.1171677579
datafile 5 switched to datafile copy
input datafile copy RECID=17 STAMP=1171720789 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.440.1171677587
datafile 6 switched to datafile copy
input datafile copy RECID=18 STAMP=1171720789 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.468.1171677587
datafile 7 switched to datafile copy
input datafile copy RECID=19 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/users.402.1171677579
datafile 8 switched to datafile copy
input datafile copy RECID=20 STAMP=1171720789 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.480.1171677587
datafile 9 switched to datafile copy
input datafile copy RECID=21 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.431.1171677579
datafile 10 switched to datafile copy
input datafile copy RECID=22 STAMP=1171720789 file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.401.1171677579

contents of Memory Script:
{
   set until scn  9566546;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 15-JUN-24
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 45 is already on disk as file +DATA1/CDB/ARCHIVELOG/2024_06_15/thread_1_seq_45.540.1171676445
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_06_15/thread_1_seq_45.540.1171676445 thread=1 sequence=45
media recovery complete, elapsed time: 00:00:00
Finished recover at 15-JUN-24
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''TESTCDB1'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''TESTCDB1'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTCDB1" RESETLOGS ARCHIVELOG 
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1  SIZE 50 M ,
  GROUP     2  SIZE 50 M ,
  GROUP     3  SIZE 50 M ,
  GROUP     4  SIZE 50 M ,
  GROUP     5  SIZE 50 M ,
  GROUP     6  SIZE 50 M 
 DATAFILE
  '+DATA1/TESTCDB1/DATAFILE/system.350.1171677579',
  '+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.440.1171677587'
 CHARACTER SET AL32UTF8

sql statement: ALTER DATABASE ADD LOGFILE 
  
  
  
  
  
  INSTANCE 'i2' 
  GROUP     7  SIZE 100 M ,
  GROUP     8  SIZE 100 M 
sql statement: ALTER DATABASE ADD LOGFILE 
  
  
  
  
  
  
  INSTANCE 'i3' 
  GROUP     9  SIZE 100 M ,
  GROUP    10  SIZE 100 M 

contents of Memory Script:
{
   catalog clone datafilecopy  "+DATA1/TESTCDB1/DATAFILE/sysaux.506.1171677579", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs1.387.1171677579", 
 "+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.468.1171677587", 
 "+DATA1/TESTCDB1/DATAFILE/users.402.1171677579", 
 "+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.480.1171677587", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs2.431.1171677579", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs3.401.1171677579";
   switch clone datafile all;
}
executing Memory Script

cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/sysaux.506.1171677579 RECID=1 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.387.1171677579 RECID=2 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.468.1171677587 RECID=3 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/users.402.1171677579 RECID=4 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.480.1171677587 RECID=5 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.431.1171677579 RECID=6 STAMP=1171720811
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.401.1171677579 RECID=7 STAMP=1171720811

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1171720811 file name=+DATA1/TESTCDB1/DATAFILE/sysaux.506.1171677579
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1171720811 file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.387.1171677579
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1171720811 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.468.1171677587
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1171720811 file name=+DATA1/TESTCDB1/DATAFILE/users.402.1171677579
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1171720811 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.480.1171677587
datafile 9 switched to datafile copy
input datafile copy RECID=6 STAMP=1171720811 file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.431.1171677579
datafile 10 switched to datafile copy
input datafile copy RECID=7 STAMP=1171720811 file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.401.1171677579
Leaving database unopened, as requested
Cannot remove created server parameter file
Finished Duplicate Db at 15-JUN-24

RMAN> report schema;

RMAN-06139: warning: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name TESTCDB1

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1180     SYSTEM               ***     +DATA1/TESTCDB1/DATAFILE/system.350.1171677579
3    1010     SYSAUX               ***     +DATA1/TESTCDB1/DATAFILE/sysaux.506.1171677579
4    615      UNDOTBS1             ***     +DATA1/TESTCDB1/DATAFILE/undotbs1.387.1171677579
5    510      PDB$SEED:SYSTEM      ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.440.1171677587
6    480      PDB$SEED:SYSAUX      ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.468.1171677587
7    5        USERS                ***     +DATA1/TESTCDB1/DATAFILE/users.402.1171677579
8    215      PDB$SEED:UNDOTBS1    ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.480.1171677587
9    250      UNDOTBS2             ***     +DATA1/TESTCDB1/DATAFILE/undotbs2.431.1171677579
10   25       UNDOTBS3             ***     +DATA1/TESTCDB1/DATAFILE/undotbs3.401.1171677579

RMAN> exit


Recovery Manager complete.
[oracle@rac1 dbs]$ sqlplus "/ as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 14:00:57 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> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
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@rac1 dbs]$ ps -ef|grep pmon
oracle    4714     1  0 14:00 ?        00:00:00 ora_pmon_testcdb1
oracle    6270 27940  0 14:02 pts/2    00:00:00 grep --color=auto pmon
oracle   17947     1  0 13:37 ?        00:00:00 ora_pmon_cdb1
grid     31754     1  0 13:30 ?        00:00:00 asm_pmon_+ASM1
[oracle@rac1 dbs]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 14:03:18 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> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac1 dbs]$ ps -ef|grep pmon
oracle    8434 27940  0 14:03 pts/2    00:00:00 grep --color=auto pmon
oracle   17947     1  0 13:37 ?        00:00:00 ora_pmon_cdb1
grid     31754     1  0 13:30 ?        00:00:00 asm_pmon_+ASM1
 
[oracle@rac1 dbs]$  rman auxiliary sys/A#qwert#12
 

RMAN> startup nomount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 06/15/2024 14:06:04
RMAN-06171: not connected to target database

RMAN> startup  nomount pfile=inittestcdb1.ora  force

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 06/15/2024 18:28:40
RMAN-06171: not connected to target database

RMAN> 

----------------------带PDB的恢复----------------------------


Recovery Manager complete.
[oracle@rac1 dbs]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 14:06:13 2024
Version 19.20.0.0.0

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

Connected to an idle instance.

SQL>  startup nomount pfile=inittestcdb1.ora
ORACLE instance started.

Total System Global Area  390067064 bytes
Fixed Size                  9163640 bytes
Variable Size             339738624 bytes
Database Buffers           33554432 bytes
Redo Buffers                7610368 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac1 dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Jun 15 14:06:29 2024
Version 19.20.0.0.0

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

connected to target database: TESTCDB1 (not mounted)

RMAN>  Duplicate database to 'testcdb1' noopen backup location '+data1';

Starting Duplicate Db at 15-JUN-24
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/15/2024 14:06:35
RMAN-05501: aborting duplication of target database
RMAN-06174: not connected to auxiliary database

RMAN> exit
  

Recovery Manager complete.
[oracle@rac1 dbs]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 14:07:24 2024
Version 19.20.0.0.0

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

Connected to an idle instance.

SQL>  startup nomount pfile=inittestcdb1.ora
ORACLE instance started.

Total System Global Area  390067064 bytes
Fixed Size                  9163640 bytes
Variable Size             339738624 bytes
Database Buffers           33554432 bytes
Redo Buffers                7610368 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac1 dbs]$  rman auxiliary sys/A#qwert#12

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Jun 15 14:07:41 2024
Version 19.20.0.0.0

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

connected to auxiliary database: TESTCDB1 (not mounted)

RMAN>  Duplicate database to 'testcdb1' noopen backup location '+data1';

Starting Duplicate Db at 15-JUN-24
searching for database ID
found backup of database ID 2265125454

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''testcdb1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '+DATA1/CDB/AUTOBACKUP/2024_06_15/s_1171721115.429.1171677915';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''CDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''testcdb1'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

Starting restore at 15-JUN-24
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:05
output file name=+DATA1/TESTCDB1/controlfile/o1_mf_bfsn3k7o_.ctl
Finished restore at 15-JUN-24

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
datafile 60 not processed because file is offline
datafile 61 not processed because file is offline

contents of Memory Script:
{
   set until scn  9569022;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   set newname for clone datafile  6 to new;
   set newname for clone datafile  7 to new;
   set newname for clone datafile  8 to new;
   set newname for clone datafile  9 to new;
   set newname for clone datafile  10 to new;
   set newname for clone datafile  59 to new;
   restore
   clone database
   skip forever tablespace  "TESTPDB":"UNDOTBS1",
 "TESTPDB":"SYSAUX"   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 15-JUN-24
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00003 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00004 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00007 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00009 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00010 to +data1
channel ORA_AUX_DISK_1: reading from backup piece +DATA1/CDB/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.424.1171677905
channel ORA_AUX_DISK_1: piece handle=+DATA1/CDB/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.424.1171677905 tag=TAG20240615T140505
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00006 to +data1
channel ORA_AUX_DISK_1: restoring datafile 00008 to +data1
channel ORA_AUX_DISK_1: reading from backup piece +DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.492.1171677909
channel ORA_AUX_DISK_1: piece handle=+DATA1/CDB/0633F844101D69CBE0636401A8C09D55/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.492.1171677909 tag=TAG20240615T140505
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00059 to +data1
channel ORA_AUX_DISK_1: reading from backup piece +DATA1/CDB/1AE8818E8B712414E0636401A8C00D9E/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.753.1171677911
channel ORA_AUX_DISK_1: piece handle=+DATA1/CDB/1AE8818E8B712414E0636401A8C00D9E/BACKUPSET/2024_06_15/nnndf0_tag20240615t140505_0.753.1171677911 tag=TAG20240615T140505
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 15-JUN-24

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=15 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/system.437.1171678125
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/sysaux.539.1171678125
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.367.1171678125
datafile 5 switched to datafile copy
input datafile copy RECID=18 STAMP=1171721336 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.446.1171678133
datafile 6 switched to datafile copy
input datafile copy RECID=19 STAMP=1171721336 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.449.1171678133
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/users.391.1171678125
datafile 8 switched to datafile copy
input datafile copy RECID=21 STAMP=1171721336 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.456.1171678133
datafile 9 switched to datafile copy
input datafile copy RECID=22 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.439.1171678125
datafile 10 switched to datafile copy
input datafile copy RECID=23 STAMP=1171721336 file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.497.1171678125
datafile 59 switched to datafile copy
input datafile copy RECID=24 STAMP=1171721336 file name=+DATA1/TESTCDB1/1AE8818E8B712414E0636401A8C00D9E/DATAFILE/system.457.1171678135

contents of Memory Script:
{
   set until scn  9569022;
   recover
   clone database
   skip forever tablespace  "TESTPDB":"UNDOTBS1",
 "TESTPDB":"SYSAUX"    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 15-JUN-24
using channel ORA_AUX_DISK_1

Executing: alter database datafile 60, 61 offline drop
starting media recovery

archived log for thread 1 with sequence 47 is already on disk as file +DATA1/CDB/ARCHIVELOG/2024_06_15/thread_1_seq_47.275.1171677915
archived log file name=+DATA1/CDB/ARCHIVELOG/2024_06_15/thread_1_seq_47.275.1171677915 thread=1 sequence=47
media recovery complete, elapsed time: 00:00:00
Finished recover at 15-JUN-24
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''TESTCDB1'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''TESTCDB1'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area     390067064 bytes

Fixed Size                     9163640 bytes
Variable Size                339738624 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7610368 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTCDB1" RESETLOGS ARCHIVELOG 
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1  SIZE 50 M ,
  GROUP     2  SIZE 50 M ,
  GROUP     3  SIZE 50 M ,
  GROUP     4  SIZE 50 M ,
  GROUP     5  SIZE 50 M ,
  GROUP     6  SIZE 50 M 
 DATAFILE
  '+DATA1/TESTCDB1/DATAFILE/system.437.1171678125',
  '+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.446.1171678133',
  '+DATA1/TESTCDB1/1AE8818E8B712414E0636401A8C00D9E/DATAFILE/system.457.1171678135'
 CHARACTER SET AL32UTF8

sql statement: ALTER DATABASE ADD LOGFILE 
  
  
  
  
  
  INSTANCE 'i2' 
  GROUP     7  SIZE 100 M ,
  GROUP     8  SIZE 100 M 
sql statement: ALTER DATABASE ADD LOGFILE 
  
  
  
  
  
  
  INSTANCE 'i3' 
  GROUP     9  SIZE 100 M ,
  GROUP    10  SIZE 100 M 

contents of Memory Script:
{
   catalog clone datafilecopy  "+DATA1/TESTCDB1/DATAFILE/sysaux.539.1171678125", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs1.367.1171678125", 
 "+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.449.1171678133", 
 "+DATA1/TESTCDB1/DATAFILE/users.391.1171678125", 
 "+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.456.1171678133", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs2.439.1171678125", 
 "+DATA1/TESTCDB1/DATAFILE/undotbs3.497.1171678125";
   switch clone datafile all;
}
executing Memory Script

cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/sysaux.539.1171678125 RECID=1 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.367.1171678125 RECID=2 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.449.1171678133 RECID=3 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/users.391.1171678125 RECID=4 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.456.1171678133 RECID=5 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.439.1171678125 RECID=6 STAMP=1171721357
cataloged datafile copy
datafile copy file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.497.1171678125 RECID=7 STAMP=1171721357

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1171721357 file name=+DATA1/TESTCDB1/DATAFILE/sysaux.539.1171678125
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1171721357 file name=+DATA1/TESTCDB1/DATAFILE/undotbs1.367.1171678125
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1171721357 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.449.1171678133
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1171721357 file name=+DATA1/TESTCDB1/DATAFILE/users.391.1171678125
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1171721357 file name=+DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.456.1171678133
datafile 9 switched to datafile copy
input datafile copy RECID=6 STAMP=1171721357 file name=+DATA1/TESTCDB1/DATAFILE/undotbs2.439.1171678125
datafile 10 switched to datafile copy
input datafile copy RECID=7 STAMP=1171721357 file name=+DATA1/TESTCDB1/DATAFILE/undotbs3.497.1171678125
Leaving database unopened, as requested
Cannot remove created server parameter file
Finished Duplicate Db at 15-JUN-24

RMAN> report schema;

RMAN-06139: warning: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name TESTCDB1

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1180     SYSTEM               ***     +DATA1/TESTCDB1/DATAFILE/system.437.1171678125
3    1010     SYSAUX               ***     +DATA1/TESTCDB1/DATAFILE/sysaux.539.1171678125
4    615      UNDOTBS1             ***     +DATA1/TESTCDB1/DATAFILE/undotbs1.367.1171678125
5    510      PDB$SEED:SYSTEM      ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/system.446.1171678133
6    480      PDB$SEED:SYSAUX      ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/sysaux.449.1171678133
7    5        USERS                ***     +DATA1/TESTCDB1/DATAFILE/users.391.1171678125
8    215      PDB$SEED:UNDOTBS1    ***     +DATA1/TESTCDB1/0633F844101D69CBE0636401A8C09D55/DATAFILE/undotbs1.456.1171678133
9    250      UNDOTBS2             ***     +DATA1/TESTCDB1/DATAFILE/undotbs2.439.1171678125
10   25       UNDOTBS3             ***     +DATA1/TESTCDB1/DATAFILE/undotbs3.497.1171678125
59   510      _###_UNKNOWN_PDB_#_3:SYSTEM ***     +DATA1/TESTCDB1/1AE8818E8B712414E0636401A8C00D9E/DATAFILE/system.457.1171678135

RMAN> exit


Recovery Manager complete.
[oracle@rac1 dbs]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 14:09:43 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> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
         3 _###_UNKNOWN_PDB_#_3           MOUNTED

----没有resetlogs前名字不对
SQL> alter database open resetlogs;

Database altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTPDB                        MOUNTED
SQL> alter pluggable database testpdb open;
alter pluggable database testpdb open
*
ERROR at line 1:
ORA-65104: operation not allowed on an inactive pluggable database


SQL>  alter pluggable database testpdb unplug into '/tmp/testpdb.xml';
 alter pluggable database testpdb unplug into '/tmp/testpdb.xml'
*
ERROR at line 1:
ORA-65104: operation not allowed on an inactive pluggable database


SQL> 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/27870.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

我的开源工具beanfilter:实现基于注解(Annotation)的服务端(spring)动态字段过滤

beanfilter是我最近完成的一个开源Java工具, 项目地址 https://gitee.com/l0km/beanfilter 才做完成第一阶段,发布了第一个版本0.1.0 完成对spring的支持,后续还要实现对thrift服务的支持,以下为工具的使用说明 beanfilter 基于注解(Annotat…

小程序的生命周期以及页面生命周期

小程序的生命周期主要分为应用生命周期和页面生命周期两部分。 应用生命周期 应用生命周期指的是小程序从启动到销毁的整个过程,主要包括以下几个阶段和对应的函数: onLaunch:小程序初始化时执行,只执行一次。这是全局的生命周…

Linux-Https协议

文章目录 前言一、Https协议二、常见的加密方式对称加密非对称加密数据摘要&&数据指纹中间人攻击 三、Https的加密历程方案1-只使用对称加密方案2-只使用非对称加密方案3-双方都使用非对称加密方案4-非对称加密对称加密 前言 之前我们学习了Http协议,也试着…

官方文档 搬运 MAXMIND IP定位 mysql导入 简单使用

官方文档地址: 官方文档 文件下载 1. 导入mysql可能报错 Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement 查看配置 SHOW GLOBAL VARIABLES LIKE %secure%;secure_file_priv 原来…

laravel版本≥ 8.1

laravel10 php ≥ 8.1 且 ≤ 8.3&#xff1f; 8.1 < php < 8.3PHP版本要求在 8.1 到 8.3 之间&#xff0c;包括这两个版本。具体来说&#xff1a;"≥ 8.1" 表示 PHP 的版本至少是 8.1&#xff0c;也就是说 8.1 及以上的版本都可以。 "≤ 8.3" 表示 P…

计算机组成原理学习 Part 1

计算机系统 组成 计算机系统 { 硬件 计算机的实体&#xff0c;如主机、外设等 软件 由具有各类特殊功能的信息&#xff08;程序&#xff09;组成 计算机系统 \begin{cases} 硬件 &\text 计算机的实体&#xff0c;如主机、外设等\\ 软件 &\text 由具有各类特殊功能的信…

【报错】无法找到模块“element-plus/es/locale/index.mjs”的声明文件。

报错&#xff1a; 无法找到模块“element-plus/es/locale/index.mjs”的声明文件。“E:/codeAll/work/test1/test2/HealinLikeMe-ui/node_modules/.pnpm/element-plus2.7.3_vue3.4.27_typescript5.4.5_/node_modules/element-plus/es/locale/index.mjs”隐式拥有 "any&quo…

Linux笔记--vi编辑器

vi编辑器 基本操作 对于vi编辑器有这几种模式 移动 当编辑一个过大的文件时通过方向键移动光标过慢所以可以使用快捷键进行移动 编辑 dw指令只能在单词第一个字母处使用 D指令删除的是当前行 查找替换 pattern指代想要搜索的内容

056、PyCharm 快速代码重构的方法

在实际的编程过程中&#xff0c;如果有一段代码需要在多个地方重复使用&#xff0c;我们应该将这段代码封装成一个函数。这样可以提高代码的可重用性和可维护性。 在PyCharm编辑器里&#xff0c;可以使用以下操作对代码块进行快速的重构。 &#xff08;1&#xff09;、选中一…

【Photoshop】PS修改文字内容

Photoshop(PS)修改图片上文字内容&#xff0c;网上教材不少&#xff0c;本人整理实践过的方法&#xff0c;分享给各位。本人实践方法&#xff1a; 内容识别填充&#xff1a;适用于背景色复杂的图片内容修补工具&#xff1a;适用于背景色为纯色的图片 方式一&#xff1a;内容识…

java入门-文件与IO流

File类 提供一些方法(api)来操纵文件和获取文件的信息 File常用API 属性 获取系统分隔符 不同操作系统的分隔符 windows的目录分割符号是用向右的斜线&#xff0c;java中\ 表示转义字符&#xff0c;所以向右的斜线需要写两个 \; linux目录分割符号是向左的斜线: / private st…

MySQL 考证作用

提升个人技能&#xff1a;参加MySQL考证的过程本身就是一个学习和提升的过程。考生需要系统地复习和掌握MySQL的相关知识和技能&#xff0c;这有助于提升个人的专业能力和技术水平。增强就业竞争力&#xff1a;在求职过程中&#xff0c;拥有MySQL认证证书可以作为一个加分项&am…

Github 2024-06-15 开源项目日报Top10

根据Github Trendings的统计,今日(2024-06-15统计)共有10个项目上榜。根据开发语言中项目的数量,汇总情况如下: 开发语言项目数量C++项目3Python项目2TypeScript项目1Java项目1HTML项目1Vue项目1Go项目1JavaScript项目1C项目1ComfyUI:强大而模块化的稳定扩散GUI 创建周期:…

Gobject tutorial 三

Derivable type and abstract type Derivable type 在GLib中&#xff0c;类型可以分为两种。一种是可以被继承的(derivable)&#xff0c;一种是不能被继承的(final)。二者的主要区别是&#xff0c;final 类型对象的类结构中&#xff0c;除了其父类外&#xff0c;再无其他成员…

Linux内核中的锁

不同的锁&#xff0c;作用对象是不一样的&#xff0c;也就是作用域不一样下面分别是作用于临界区、CPU、内存、cache 的各种锁的归纳&#xff1a; 补充&#xff1a;cache是一种缓存&#xff0c;包含硬件缓存&#xff08;CPU缓存&#xff09;以及软件缓存&#xff08;网页缓存&a…

Cocos2d-x 4.0 工程首次建立与编译(Mac m1)

Mac m1芯片下将cocos2d-x升级至4.0版本后&#xff0c;官方剔除了不同平台的工程以及变更了编译方式&#xff0c;直接使用cmake构建&#xff0c;需要做一些前置的准备工作。 环境准备&#xff1a; 项 版本 备注 MacOS10.3 or laterpython2.7.16(建议>2.7.10)cmake3.29.3Do…

自动驾驶场景下TCP协议参数优化调整案例分享

RTT 往返时间&#xff0c;从tcp协议栈决定发包&#xff0c;到收到回包的时间。 包含本地驱动&#xff0c;网卡硬件&#xff0c;网线&#xff0c;交换机&#xff0c;收包方处理的耗时。需注意如果开了delayed ack&#xff0c;协议栈未做特殊处理&#xff08;默认没做&#xff…

C++中字符字面量的使用细节

C中字符字面量的使用细节 如何在 C中书写字符字面值:将字符用单引号括起&#xff0c;如M(注意&#xff0c;示例中没有使用双引号。C对字符用单引号&#xff0c;对字符串使用双引号。cout对象能够处理这两种情况&#xff0c;但正如第4章将讨论的&#xff0c;这两者有天壤之别)。…

【项目管理知识】挣值管理的概念与计算

【项目管理知识】挣值管理的概念与计算 四个基础概念&#xff1a;BAC、AC、PV、EV四个绩效概念&#xff1a;CV、CPI、SV、SPI四个延伸概念&#xff1a;ETC、EAC、非典型偏差、典型偏差挣值管理-非典型偏差挣值管理-典型偏差 完工尚需绩效指数&#xff1a;TCPI 四个基础概念&…

探索交互的本质:从指令到界面的演进与Linux基础指令的深入剖析

目录 1.指令 vs 界面//选读 1.1交互的需求 满足需求的第一阶段-指令 满足需求的第二阶段-界面 1.2 指令 和 界面交互 区别 2.操作系统介绍 2.1 举例说明 驱动软件层 2.2 为什么要有操作系统&#xff1f; 0x03 为什么要进行指令操作&#xff1f; 3.Linux基本指令 l…