restore RMAN in 12c MT(Multitenant ) database flashback table

这篇具有很好参考价值的文章主要介绍了restore RMAN in 12c MT(Multitenant ) database flashback table。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

*****************************************************************************

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner. For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

ORACLE_SID=ora12mt
Pfile location, and name: /u03/app/oracle/product/database/12.1.0.2/dbs/initora12mt.ora
Backup location: /u03/backup
Database, redolog, and Controlfile new location: /u03/database/oradata/ora12mt

Source, old backup location: /u04/fra/ora12mt/ORA12MT
Source database file and redolog log location: path: /u04/database/oradata/ora12mt
 

*****************************************************************************

++ Identify the backups needed for this manual PITR restore / recovery  and copy it to destination server . In our test case we have copied the backups in location "/u03/backup/"    ---FRA

++ On the destination server  --异地恢复

        -- set the ORACLE_SID and bring the database to nomount stage

        -- restore the spfile from backup and create pfile from it

       

$export ORACLE_SID=ora12mt

$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Dec 15 09:36:25 2016

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

connected to target database (not started)

RMAN> startup nomount force;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u03/app/oracle/product/database/12.1.0.2/dbs/initora12mt.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area 1073741824 bytes

Fixed Size 2932632 bytes
Variable Size 293601384 bytes
Database Buffers 771751936 bytes
Redo Buffers 5455872 bytes

RMAN> restore spfile from '/u03/backup/o1_mf_s_928681105_d3br9ton_.bkp';------自己查

Starting restore at 15-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u03/backup/o1_mf_s_928681105_d3br9ton_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 15-DEC-16

RMAN>shutdown immediate;

<< connect to SQL*Plus and create pfile from the restored spfile

SQL> create pfile from spfile;

File created.

SQL>

++ Modify the pfile parameters like location / memory etc on auxiliary server and bring the database to no-mount stage

$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 15 09:52:56 2016

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

Connected to an idle instance.

SQL> startup nomount pfile='initora12mt.ora';
ORACLE instance started.

Total System Global Area 629145600 bytes
Fixed Size 2927528 bytes
Variable Size 310379608 bytes
Database Buffers 310378496 bytes
Redo Buffers 5459968 bytes
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

++ Restore the controlfile and bring the database to mount stage

$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Dec 15 09:53:40 2016

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

connected to target database: ORA12MT (not mounted)

RMAN> restore controlfile from '/u03/backup/o1_mf_s_928683729_d3btvsvn_.bkp';

Starting restore at 15-DEC-16
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u03/database/oradata/ora12mt/control01.dbf
Finished restore at 15-DEC-16

RMAN> alter database mount;

Statement processed
released channel: ORA_DISK_1

++ Catalog the backup pieces, run the crosscheck and delete the expired backup

RMAN> catalog start with '/u03/backup/' noprompt;

Starting implicit crosscheck backup at 15-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=242 device type=DISK
Crosschecked 6 objects
Finished implicit crosscheck backup at 15-DEC-16

Starting implicit crosscheck copy at 15-DEC-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 15-DEC-16

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /u03/backup/

List of Files Unknown to the Database
=====================================
File Name: /u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp
File Name: /u03/backup/o1_mf_s_928683729_d3btvsvn_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp
File Name: /u03/backup/o1_mf_s_928681105_d3br9ton_.bkp
File Name: /u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp
File Name: /u03/backup/o1_mf_s_928683729_d3btvsvn_.bkp
File Name: /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp
File Name: /u03/backup/o1_mf_s_928681105_d3br9ton_.bkp
File Name: /u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp

RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp RECID=3 STAMP=928680915
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp RECID=15 STAMP=930650099
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp RECID=4 STAMP=928680918
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp RECID=11 STAMP=930650099
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/37E8C85AD7431EDBE0531602A8C02428/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp RECID=5 STAMP=928681004
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp RECID=10 STAMP=930650099
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/37E8BA3824481B77E0531602A8C080DD/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp RECID=6 STAMP=928681059
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp RECID=13 STAMP=930650099
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp RECID=7 STAMP=928681104
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp RECID=9 STAMP=930650099
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u04/fra/ora12mt/ORA12MT/autobackup/2016_11_23/o1_mf_s_928681105_d3br9ton_.bkp RECID=8 STAMP=928681106
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_s_928681105_d3br9ton_.bkp RECID=14 STAMP=930650099
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/backup/o1_mf_s_928683729_d3btvsvn_.bkp RECID=12 STAMP=930650099
Crosschecked 13 objects

RMAN> delete expired backup ;

using channel ORA_DISK_1

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
3 3 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp
4 4 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp
5 5 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/37E8C85AD7431EDBE0531602A8C02428/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp
6 6 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/37E8BA3824481B77E0531602A8C080DD/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp
7 7 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp
8 8 1 1 EXPIRED DISK /u04/fra/ora12mt/ORA12MT/autobackup/2016_11_23/o1_mf_s_928681105_d3br9ton_.bkp

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp RECID=3 STAMP=928680915
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp RECID=4 STAMP=928680918
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/37E8C85AD7431EDBE0531602A8C02428/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp RECID=5 STAMP=928681004
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/37E8BA3824481B77E0531602A8C080DD/backupset/2016_11_23/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp RECID=6 STAMP=928681059
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/backupset/2016_11_23/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp RECID=7 STAMP=928681104
deleted backup piece
backup piece handle=/u04/fra/ora12mt/ORA12MT/autobackup/2016_11_23/o1_mf_s_928681105_d3br9ton_.bkp RECID=8 STAMP=928681106
Deleted 6 EXPIRED objects

++ Get the structure of database (needed for prepare script of restore )

RMAN> report schema;

using target database control file instead of recovery catalog
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name ORA12MT

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSTEM_FNO-1_0brcua0p
3 0 SYSAUX *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSAUX_FNO-3_0crcua0s
4 0 UNDOTBS1 *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-UNDOTBS1_FNO-4_0frcua1q
5 0 PDB$SEED:SYSTEM *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSTEM_FNO-5_0grcua21
6 0 USERS *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-USERS_FNO-6_0ircua2f
7 0 PDB$SEED:SYSAUX *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSAUX_FNO-7_0drcua1b
8 0 PDB1:SYSTEM *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSTEM_FNO-8_0hrcua28
9 0 PDB1:SYSAUX *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-SYSAUX_FNO-9_0ercua1i
10 0 PDB1:USERS *** /u04/database/oradata/ora12mt/data_data_D-ORA12MT_I-4146636107_TS-USERS_FNO-10_0jrcua2g
11 0 T1 *** /u04/database/oradata/ora12mt/t1.dbf
12 0 PDB1:T1 *** /u04/database/oradata/ora12mt/t1-pdb1.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 60 TEMP 32767 /u04/database/oradata/ora12mt/ORA12MT/datafile/o1_mf_temp_ctpogy8o_.tmp
2 20 PDB$SEED:TEMP 32767 /u03/database/oradata/ora12mt/ORA12MT/datafile/pdbseed_temp012016-07-18_05-31-24-PM.dbf
3 20 PDB1:TEMP 32767 /u04/database/oradata/ora12mt/ORA12MT/37E8C85AD7431EDBE0531602A8C02428/datafile/o1_mf_temp_cttxkklv_.tmp

++ To extract the data from the table which is part of PDB all we need is

          

-- SYSTEM,SYSAUX,<undo tablespace>   (in case of RAC include all the undo tablespaces from each node) of ROOT

-- PDB$SEED

-- SYSTEM,SYSAUX, <undo tablespace in case local undo>  and <tablespace containing table data> of Pluggable database

Syntax will be as below

      restore database root skip tablespace <tablespace other than system and sysaux > database "PDB$SEED" database <PDB which contains data> skip tablespace <tablespace other than containing data>;

(in our case table information in USERS tablespace of pluggable database PDB1)

RMAN> run{
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
SET UNTIL TIME = "to_date('2016-11-23 14:56:30','YYYY/MM/DD HH24:MI:SS')";
set newname for database root to '/u03/database/oradata/ora12mt/%U';
set newname for database "PDB$SEED" to '/u03/database/oradata/ora12mt/%U';
set newname for datafile 8 to '/u03/database/oradata/ora12mt/%U';
set newname for datafile 9 to '/u03/database/oradata/ora12mt/%U';
set newname for datafile 10 to '/u03/database/oradata/ora12mt/%U';
restore database root skip tablespace users database "PDB$SEED" database PDB1 skip tablespace PDB1:T1;
switch datafile 1;
switch datafile 3;
switch datafile 4;
switch datafile 5;
switch datafile 7;
switch datafile 8;
switch datafile 9;
switch datafile 10;
}2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21>

released channel: ORA_DISK_1
allocated channel: t1
channel t1: SID=242 device type=DISK

allocated channel: t2
channel t2: SID=355 device type=DISK

allocated channel: t3
channel t3: SID=8 device type=DISK

allocated channel: t4
channel t4: SID=125 device type=DISK

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

Starting restore at 15-DEC-16

channel t1: starting datafile backup set restore
channel t1: specifying datafile(s) to restore from backup set
channel t1: restoring datafile 00001 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-1
channel t1: restoring datafile 00003 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-3
channel t1: restoring datafile 00004 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-UNDOTBS1_FNO-4
channel t1: reading from backup piece /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp
channel t2: starting datafile backup set restore
channel t2: specifying datafile(s) to restore from backup set
channel t2: restoring datafile 00008 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-8
channel t2: restoring datafile 00009 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-9
channel t2: restoring datafile 00010 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-USERS_FNO-10
channel t2: reading from backup piece /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp
channel t3: starting datafile backup set restore
channel t3: specifying datafile(s) to restore from backup set
channel t3: restoring datafile 00005 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-5
channel t3: restoring datafile 00007 to /u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-7
channel t3: reading from backup piece /u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp
channel t3: piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br8c6d_.bkp tag=TAG20161123T145518
channel t3: restored backup piece 1
channel t3: restore complete, elapsed time: 00:01:45
channel t2: piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br6n46_.bkp tag=TAG20161123T145518
channel t2: restored backup piece 1
channel t2: restore complete, elapsed time: 00:01:56
channel t1: piece handle=/u03/backup/o1_mf_nnndf_TAG20161123T145518_d3br3yyn_.bkp tag=TAG20161123T145518
channel t1: restored backup piece 1
channel t1: restore complete, elapsed time: 00:02:36
Finished restore at 15-DEC-16

datafile 1 switched to datafile copy
input datafile copy RECID=53 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-1

datafile 3 switched to datafile copy
input datafile copy RECID=54 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-3

datafile 4 switched to datafile copy
input datafile copy RECID=55 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-UNDOTBS1_FNO-4

datafile 5 switched to datafile copy
input datafile copy RECID=56 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-5

datafile 7 switched to datafile copy
input datafile copy RECID=57 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-7

datafile 8 switched to datafile copy
input datafile copy RECID=58 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSTEM_FNO-8

datafile 9 switched to datafile copy
input datafile copy RECID=59 STAMP=930653716 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-SYSAUX_FNO-9

datafile 10 switched to datafile copy
input datafile copy RECID=60 STAMP=930653717 file name=/u03/database/oradata/ora12mt/data_D-ORA12MT_TS-USERS_FNO-10
released channel: t1
released channel: t2
released channel: t3
released channel: t4

++ Identify the archives and restore it from backup

RMAN> list backup of archivelog all;

List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
3 10.21M DISK 00:00:03 23-NOV-16
BP Key: 15 Status: AVAILABLE Compressed: YES Tag: TAG20161123T145514
Piece Name: /u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp

List of Archived Logs in backup set 3
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 54 2107527 11-OCT-16 7688704 23-NOV-16
1 55 7688704 23-NOV-16 7689057 23-NOV-16

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7 13.00K DISK 00:00:00 23-NOV-16
BP Key: 9 Status: AVAILABLE Compressed: YES Tag: TAG20161123T145824
Piece Name: /u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp

List of Archived Logs in backup set 7
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 56 7689057 23-NOV-16 7689108 23-NOV-16
1 57 7689108 23-NOV-16 7689190 23-NOV-16

RMAN> restore archivelog from logseq 54 until logseq 57;

Starting restore at 15-DEC-16
using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=54
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=55
channel ORA_DISK_1: reading from backup piece /u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp
channel ORA_DISK_1: piece handle=/u03/backup/o1_mf_annnn_TAG20161123T145514_d3br3v24_.bkp tag=TAG20161123T145514
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=56
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=57
channel ORA_DISK_1: reading from backup piece /u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp
channel ORA_DISK_1: piece handle=/u03/backup/o1_mf_annnn_TAG20161123T145824_d3br9rpz_.bkp tag=TAG20161123T145824
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 15-DEC-16

Recovery Manager complete.

++ Now, we need to turn offline all the remaining datafiles (not part of restore )

$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 15 11:37:16 2016

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select 'container : '||c.name|| ' : alter database datafile '||d.file#||' offline drop;' from v$datafile d ,v$containers c
2 where d.con_id=c.con_id
3 and d.file# in (select file# from v$datafile_header where length(error)>=1)
4 order by c.con_id;

'CONTAINER:'||C.NAME||':ALTERDATABASEDATAFILE'||D.FILE#||'OFFLINEDROP;'
--------------------------------------------------------------------------------
container : CDB$ROOT : alter database datafile 6 offline drop;
container : CDB$ROOT : alter database datafile 11 offline drop;
container : PDB1 : alter database datafile 12 offline drop;

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> alter database datafile 6 offline drop;

Database altered.

SQL> alter database datafile 11 offline drop;

Database altered.

SQL> alter session set container=PDB1;

Session altered.

SQL> alter database datafile 12 offline drop;

Database altered.

SQL>

++ Now,complete the recovery

 SQL>recover automatic database UNTIL TIME '2016/11/23 14:56:30' USING BACKUP CONTROLFILE;

Media recovery complete.

++ Check the redo log file location and name ,change it if required and open DB w/ resetlogs

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u04/database/oradata/ora12mt/redo04_1.dbf
/u04/database/oradata/ora12mt/redo05_1.dbf
/u04/database/oradata/ora12mt/redo06_1.dbf

SQL> alter database rename file '/u04/database/oradata/ora12mt/redo04_1.dbf' to '/u03/database/oradata/ora12mt/redo-01.dbf';

Database altered.

SQL> alter database rename file '/u04/database/oradata/ora12mt/redo05_1.dbf' to '/u03/database/oradata/ora12mt/redo-02.dbf';

Database altered.

SQL> alter database rename file '/u04/database/oradata/ora12mt/redo06_1.dbf' to '/u03/database/oradata/ora12mt/redo-03.dbf';

Database altered.

SQL> alter database open resetlogs;

Database altered.

SQL>

 Now, you can extract the data from table and import it back to production文章来源地址https://www.toymoban.com/news/detail-693216.html

到了这里,关于restore RMAN in 12c MT(Multitenant ) database flashback table的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 手工升级到Oracle 12C

    10.2.0.5,11.1.0.7,11.2.0.2以上版本可以直接升级到12c。 10.2.0.5以前的版本和11.2.0.1版需要先升级到中间版本,再升级到12c。 操作系统:Red Hat 8 Linux 64位 源数据库版本:Oracle 11.2.0.3 目标数据库版本:Oracle 12.1.0.2 备份源数据库(RMan) 执行Pre-Upgrade Information Tool(preupgrd.sql) 准备新

    2024年02月08日
    浏览(61)
  • 安装oracle12c数据库

    目录 安装文件下载         下载程序下载步骤 安装步骤 安装前提

    2024年02月16日
    浏览(55)
  • Windows下 Oracle 12c 安装保姆级图文详解

    Windows下 Oracle 12c 安装步骤如下: 1、将压缩包“winx64_12c_database_1of2.zip“和“winx64_12c_database_2of2.zip”解压到同一目录“database”目录。 2、双击“database”目录下的“setup.exe\\\",软件会加载并初步校验系统是否可以达到了数据库安装的最低配置,如果达到要求,就会直接加载程序并

    2024年02月10日
    浏览(44)
  • Docker 安装oracle12c容器并创建新用户

    下载镜像 启动镜像 8080和22端口没有映射出来,有需要自己 正常日志 启动报错日志 原因 容器没有操作主机文件夹权限 主机内执行 进入容器内并以dba登录Oracle 创建表空间及用户和赋权

    2024年02月08日
    浏览(43)
  • 【Oracle】Linux——Centos7安装Oracle12c

    官方网站:https://www.oracle.com 历史版本下载地址:https://edelivery.oracle.com/ (需要登录) 如果官方下载有问题,使用百度网盘:链接: https://pan.baidu.com/s/101U3P3KYUQ5p_zsAP1aCfw?pwd=6666 提取码: 6666 添加oinstall、dba 组,创建oracle用户,设置oracle用户密码(练习的话,为了方便记忆,建议不

    2024年03月20日
    浏览(63)
  • 4. Oracle12c数据库在Linux系统安装步骤

    1.Oracle11gR2数据库安装 https://edu.csdn.net/course/detail/27750 2.Oracle 12c 数据库安装 https://edu.csdn.net/course/detail/35882 ​ 3.Oracle 19c 数据库一键安装 https://edu.csdn.net/course/detail/39198 4.Oracle 19c RAC For Linux安装部署 (视频讲解) https://edu.csdn.net/course/detail/35792 5.oracle 19c 数据库基础和日常管理

    2024年02月15日
    浏览(50)
  • 让数据无所畏惧!探索Oracle 12c的强大安全功能:数据红action、数据掩码、加密表空间、统一审计等功能|oracle 12c相对oralce 11g的新特性(4)

    oracle 12c引入了许多新的安全功能,如数据红action、数据掩码、加密表空间等,引入了统一审计功能,可以记录和监视对数据库的所有访问和操作,提高了数据的安全性。 功能说明: 这个功能用于在查询结果中对敏感数据进行动态脱敏,以保护数据隐私。例如,假设有一个员

    2024年02月07日
    浏览(48)
  • STC12C5A系列单片机内部 EEPROM 的应用

    参考范例程序。 eeprom.c eeprom.h STC12C5A60S2 只有两个扇区,每个扇区有 512 个字节。 测试读取功能: 测试写入功能: 测试擦除功能: 注意:如果擦除将擦除整个扇区。 运行结果如下:

    2024年02月15日
    浏览(47)
  • oracle 12c 容器数据库公共用户去访问pdb数据库

    在oracle 12c之前数据库和数据库实例之间的关系是多对一或者一对一的关系,在oracle 12c 中引进了多租户的概念,实现了数据库实例可以对应多个数据库。cdb代表的是容器数据库,pdb代表的是可插拔数据库,实际上就是传统的数据库.而且现在也衍生了两种用户,一种是cbd用户,

    2024年02月01日
    浏览(48)
  • 好文分享 | 记一次Oracle12c数据库SQL短暂缓慢问题分析

    本文为墨天轮社区作者 张sir 原创作品,记录了日常运维Oracle数据库过程中遇到的一个慢SQL问题的解决、优化过程,文章内容全面具体、分析到位,且含有经验总结,分享给各位。 这次出问题的数据库比较特殊,承接的系统交易要求很高,SQL基本都是短平快,响应时间基本不

    2024年02月05日
    浏览(57)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包