12c RMAN新特性restore/recover from service远程恢复

12c中提供了基于网络的RMAN Restore和recover功能:

 

About Restoring Files Over the Network

RMAN restores database files, over the network, from a physical standby database by using the FROM SERVICE clause of the RESTORE command. The FROM SERVICE clause provides the service name of the physical standby database from which the files must be restored. During the restore operation, RMAN creates backup sets, on the physical standby database, of the files that need to be restored and then transfers these backup sets to the target database over the network.

Use the SECTION SIZE clause of the RESTORE command to perform a multisection restore operation. To encrypt the backup sets created on the physical standby database, use the SET ENCRYPTION command before the RESTORE command to specify the encryption algorithm used.

To transfer files from the physical standby database as compressed backup sets, use the USING COMPRESSED BACKUPSET clause in the RESTORE command. By default, RMAN compresses backup sets using the algorithm that is set in the RMAN configuration. You can override the default and set a different algorithm by using the SET COMPRESSION ALGORITHM command before the RESTORE statement.

About Recovering Files Over the Network

RMAN can perform recovery by fetching an incremental backup, over the network, from a primary database and then applying this incremental backup to the physical standby database. RMAN is connected as TARGET to the physical standby database. The recovery process is optimized by restoring only the used data blocks in a data file. Use the FROM SERVICE clause to specify the service name of the primary database from which the incremental backup must be fetched.

To use multisection backup sets during the recovery process, specify the SECTION SIZE clause in the RECOVER command. To transfer the required files from the primary database as encrypted backup sets, use the SET ENCRYPTION command before the RESTORE command to specify the encryption algorithm used to create the backup sets.

To compress backup sets that are used to recover files over the network, use the USING COMPRESSED BACKUPSET. RMAN compresses backup sets when it creates them on the primary database and then transfers these backup sets to the target

 

 

 

restore from service

 

可以通过restore .. from service指定的对象类型:

  • database
  • datafile
  • tablespace
  • 控制文件
  • SPFILE

 

restore datafile from service

当在主库Primary丢失/或损坏FILE#=6的user01.dbf数据文件时,可以直接使用restore datafile from service来从standby(其实并不要求一定是DataGuard,只需要是合适的备用库即可)上获得数据文件,例如:

 

select * from v$version;

BANNER                                                                                         CON_ID
------------------------------------------------------------------------------------------ ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production                        0
PL/SQL Release 12.1.0.2.0 - Production                                                              0
CORE    12.1.0.2.0      Production                                                                          0
TNS for Linux: Version 12.1.0.2.0 - Production                                                      0
NLSRTL Version 12.1.0.2.0 - Production                                                           askmaclean.com


RMAN> select name from v$datafile where file#=6;



NAME                                                                            
--------------------------------------------------------------------------------

/s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf
 

RMAN> alter database datafile 6 offline;

Statement processed




RMAN> restore datafile 6 from service pdstby;

Starting restore at 04-OCT-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=51 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service pdstby
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 04-OCT-14




RMAN> recover datafile 6 from service pdstby;

Starting recover at 04-OCT-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service pdstby
destination for restore of datafile 00006: /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/04/2014 02:57:09

ORA-19845: error in backupDatafile while communicating with remote database server
ORA-17628: Oracle error 19648 returned by remote Oracle server
ORA-19648: datafile : incremental-start SCN equals checkpoint SCN
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 6 could not be verified
ORA-19845: error in backupDatafile while communicating with remote database server
ORA-17628: Oracle error 19648 returned by remote Oracle server
ORA-19648: datafile : incremental-start SCN equals checkpoint SCN



之后recover 并online datafile 6即可

 

具体的几种用法:

 

  • 数据库级别: restore database from service <服务别名>
  • 表空间: restore tablespace from service <服务别名>
  • 控制文件: restore controlfile to ‘指定的位置’ from service <服务别名>
  • SPFILE: restore spfile from service <服务别名>

 

 

通过recover .. from service命令可以通过网络将service指定的数据库的增量备份拉过来在本地做recover从而让本地数据库跟上远程数据库的SCN。

CONNECT TARGET “sys/<password>@standby as sysdba” RECOVER DATABASE FROM SERVICE primary;

recover database from service

 

 

此外上述增量备份还可以是基于压缩备份的:

 

SET COMPRESSION ALGORITHM ‘BASIC’;

SET COMPRESSION ALGORITHM ‘LOW’;

SET COMPRESSION ALGORITHM ‘MEDIUM’;

SET COMPRESSION ALGORITHM ‘HIGH’;

 

CONNECT TARGET “sys/<password>@standby as sysdba”

SET COMPRESSION ALGORITHM ‘BASIC’;

RECOVER DATABASE FROM SERVICE primary

USING COMPRESSED BACKUPSET;

关注刘相兵的新浪微博

扫码加入微信Oracle小密圈,了解Oracle最新技术下载分享资源

Comments

  1. In this practice you learn how to duplicate an active database in ASM to another disk group in ASM. ORCL is the active database that will be duplicated or cloned as DBTEST. The tasks include:• Use ASMCA to confirm sufficient disk space for the duplicated database.• Prepare the destination for the future DBTEST database with Oracle Net connectivity, password file, and a minimal initdbtest.ora file.• Confirm source database configuration settings.• Duplicate the ORCL database by using RMAN.• Test access to the cloned database.AssumptionsTwo terminal windows is open in the $LABS directory pointing to the orcl database instance. Work as the oracle OS user unless the task indicates the grid OS user.Tasks1. In a terminal window, log in as the grid OS user with oracle as training password and point your environment variables to the +ASM instance.$ su – gridPassword: oracle <<< not displayed$ . oraenvORACLE_SID = [grid] ? +ASMThe Oracle base has been changed from /u01/app/oracle to /u01/app/grid$2. Use the asmca utility to create the DISK2 disk group for your duplicate database.a. Enter asmca to start the utility which opens in a separate window.$ asmca b. Click Create and enter Disk Group Name: DISK2, click Redundancy: External (None), and select two available disks, and then click OK. c. Disk Group: Creation progress window may appear, followed by a success message. Click OK.d. Your new disk group is displayed on the Disk Groups tabbed page. e. Click Exit, and then Yes to confirm your exit.3. Continue as oracle OS user pointing to the orcl instance. Prepare Oracle Net connectivity with the netca utility. Add a dbtest entry to the tnsnames.ora file.$ netcaa. On the Oracle Net Configuration Assistant: Welcome page, select Local Net Service Name configuration and click Next.b. Confirm that Add is selected and click Next.c. Enter dbtest as Service Name and click Next.d. Select TCP as protocol and click Next.e. Enter your host and domain name (for example, edRSr39p1.us.oracle.com) in the Host name field. If you car unsure about the format, execute the command in the next step to view currently active examples.f. Confirm that Use the standard port number of 1521 is selected and click Next. g. Select No, do not test, because your dbtest instance does not yet exist, and click Next.h. Confirm dbtest as Net Service Name and click Next.i. Answer No to the question: Would you like to configure another net service name and click Next.j. You should see the message: Net service name Configuration Complete! Click Next.k. Click Finish.$ netcaOracle Net Services Configuration:Default local naming configuration complete. Created net service name: dbtestOracle Net Services configuration successful. The exit code is 0$4. Pointing to the ORCL instance, view the DBTEST entry in the $ORACLE_HOME/network/admin/tnsnames.ora file.$ cat $ORACLE_HOME/network/admin/tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.$ cat $ORACLE_HOME/network/admin/tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.RCAT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edRSr39p1.us.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = rcat) ) )DBTEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edRSr39p1.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dbtest) ) )ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edRSr39p1.us.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) $5. Comparing the DBTEST entry with the ORCL configuration, your notice that (SERVER = DEDICATED) is missing. a. Update the tnsnames.ora file with the gedit or vi editor so that the ORCL and DBTEST configurations follow the same pattern.$ gedit $ORACLE_HOME/network/admin/tnsnames.ora b. After you finished your edit, confirm that the entry is now:…DBTEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edRSr39p1.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dbtest) ) )6. Copy the file into the equivalent grid home directory, /u01/app/grid/product/12.1.0/grid/network/admin in this example.$ cp /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora /u01/app/grid/product/12.1.0/grid/network/admin/tnsnames.ora$7. Create a password file for the future DBTEST database to allow OS authentication.a. As oracle OS user, point the environment variables to the dbtest instance.$ . oraenvORACLE_SID = [orcl] ? dbtestORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/dbhome_1/The Oracle base for ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1/ is /u01/app/oracle$ b. Create the $ORACLE_HOME/dbs/orapwdbtestfile with the orapwd utility.$ orapwd file=$ORACLE_HOME/dbs/orapwdbtest entries=15 password=oracle_4U$c. Optionally, confirm that the file exists.$ ls $ORACLE_HOME/dbs/*ora*/u01/app/oracle/product/12.1.0/dbhome_1//dbs/init.ora/u01/app/oracle/product/12.1.0/dbhome_1//dbs/orapwdbtest/u01/app/oracle/product/12.1.0/dbhome_1//dbs/orapworcl/u01/app/oracle/product/12.1.0/dbhome_1//dbs/orapwrcat/u01/app/oracle/product/12.1.0/dbhome_1//dbs/pfileorcl.ora/u01/app/oracle/product/12.1.0/dbhome_1//dbs/spfileorcl.ora/u01/app/oracle/product/12.1.0/dbhome_1//dbs/spfilercat.ora/u01/app/oracle/product/12.1.0/dbhome_1//dbs/spfileukoA.ora$8. In the same directory, create a minimal initdbtest.ora file with the following entries: db_name=dbtest remote_login_passwordfile=exclusiveThen confirm your content with the cat command.$ vi $ORACLE_HOME/dbs/initdbtest.ora $ cat $ORACLE_HOME/dbs/initdbtest.ora db_name=dbtest remote_login_passwordfile=exclusive$9. Point environment variables to the dbtest instance (as shown in step 7 a). Log in to SQL*Plus as SYSDBA, start the dbtest instance in NOMOUNT mode with the initdbtest.ora file. Then exit.$ . oraenvORACLE_SID = [dbtest] ? ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/dbhome_1The Oracle base for ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 is /u01/app/oracle$$ sqlplus / as sysdbaSQL>SQL> startup NOMOUNT pfile=’/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initdbtest.ora’ORACLE instance started.Total System Global Area 229683200 bytesFixed Size 2286176 bytesFixed Size 2286800 bytesVariable Size 171969328 bytesRedo Buffers 5095424 bytesSQL> exit$10. Confirm the ORCL source database configuration settings in SQL*Plus.a. With your environment variables pointed to orcl, you logged in to SQL*Plus as SYSBDA. Confirm that compatibility is set to 12.0 or higher to take advantage of the features new to Oracle Database 12c.SQL> show parameters compatibleNAME TYPE VALUE———————————— ———– ——————compatible string 12.1.0.0.0noncdb_compatible boolean FALSESQL> b. Confirm your backup location and size. If the FRA is smaller, enlarge it withALTER SYSTEM SET db_recovery_file_dest_size = 10G SCOPE=BOTH;SQL> show parameters recovery_fNAME TYPE VALUE———————————— ———– ——————db_recovery_file_dest string +FRAdb_recovery_file_dest_size big integer 10GSQL> c. Confirm that the database is in archive log mode. Then exit.SQL> SELECT NAME, LOG_MODE, OPEN_MODE FROM V$DATABASE;NAME LOG_MODE OPEN_MODE——— ———— ——————–ORCL ARCHIVELOG READ WRITESQL> exit$Note: If your values differ, discuss with your instructors which steps you may need to take to prepare the database that you wish to duplicate.11. In your cloning session set the $TNS_ADMIN environment variable as oracle OS user, because the server processes will try to resolve the AUXILIARY service name by using $TNS_ADMIN/tnsnames.ora.$ export TNS_ADMIN=/u01/app/grid/product/12.1.0/grid/network/admin$ echo $TNS_ADMIN/u01/app/grid/product/12.1.0/grid/network/admin$12. Use RMAN to duplicate the ORCL database as DBTEST database.Note that for the target and catalog, the service names are used, but NOT for the auxiliary connection. So you must set the environment variables pointing to the dbtest instance.$ . oraenvORACLE_SID = [orcl] ? dbtestORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/dbhome_1The Oracle base for ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 is /u01/app/oracle$ echo $ORACLE_SIDdbtest$$ rman target sys/oracle_4U@orcl auxiliary sys/oracle_4U catalog rcatowner/oracle_4U@rcatRecovery Manager: Release 12.1.0.1.0 – Production on Wed Apr 24 12:17:30 2013Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.connected to target database: ORCL (DBID=1341256546)connected to recovery catalog databaseconnected to auxiliary database: DBTEST (not mounted)RMAN>Note: It is not recommended that you enter a password on the command line. We used this approach only to avoid ambiguity (and allow you to copy-and-paste it).13. Duplicate the ORCL database as DBTEST database from the +DATA disk group to the +DISK2 disk group with the following command:DUPLICATE TARGET DATABASE TO dbtest FROM ACTIVE DATABASE SPFILE PARAMETER_VALUE_CONVERT ‘+DATA’,’+DISK2′,’ORCL’,’DBTEST’ SET DB_RECOVERY_FILE_DEST_SIZE=’10G’;RMAN> DUPLICATE TARGET DATABASE TO dbtest FROM ACTIVE DATABASE SPFILE PARAMETER_VALUE_CONVERT ‘+DATA’,’+DISK2′,’ORCL’,’DBTEST’ SET DB_RECOVERY_FILE_DEST_SIZE=’10G’;2> 3> Starting Duplicate Db at 2013-06-29:09:10:25new incarnation of database registered in recovery catalogstarting full resync of recovery catalogfull resync completeallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=12 device type=DISKcurrent log archivedcontents of Memory Script:{ restore clone from service ‘orcl’ spfile to ‘/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfiledbtest.ora’; sql clone “alter system set spfile= ”/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfiledbtest.ora””;}executing Memory ScriptStarting restore at 2013-06-29:09:10:35using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: restoring SPFILEoutput file name=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfiledbtest.orachannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 2013-06-29:09:10:37sql statement: alter system set spfile= ”/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfiledbtest.ora”contents of Memory Script:{ sql clone “alter system set db_name = ”DBTEST” comment= ”duplicate” scope=spfile”; sql clone “alter system set control_files = ”+FRA/DBTEST/CONTROLFILE/control02.ctl”, ”+DISK2/DBTEST/CONTROLFILE/current.265.819027437” comment= ”” scope=spfile”; sql clone “alter system set DB_RECOVERY_FILE_DEST_SIZE = 10G comment= ”” scope=spfile”; shutdown clone immediate; startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ”DBTEST” comment= ”duplicate” scope=spfilesql statement: alter system set control_files = ”+FRA/DBTEST/CONTROLFILE/control02.ctl”, ”+DISK2/DBTEST/CONTROLFILE/current.265.819027437” comment= ”” scope=spfilesql statement: alter system set DB_RECOVERY_FILE_DEST_SIZE = 10G comment= ”” scope=spfileOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 534462464 bytesFixed Size 2290416 bytesVariable Size 276827408 bytesDatabase Buffers 247463936 bytesRedo Buffers 7880704 bytescontents of Memory Script:{ sql clone “alter system set control_files = ”+FRA/DBTEST/CONTROLFILE/control02.ctl”, ”+DISK2/DBTEST/CONTROLFILE/current.256.819364259” comment= ”Set by RMAN” scope=spfile”; sql clone “alter system set db_name = ”ORCL” comment= ”Modified by RMAN duplicate” scope=spfile”; sql clone “alter system set db_unique_name = ”DBTEST” comment= ”Modified by RMAN duplicate” scope=spfile”; shutdown clone immediate; startup clone force nomount restore clone from service ‘orcl’ primary controlfile; alter clone database mount;}executing Memory Scriptsql statement: alter system set control_files = ”+FRA/DBTEST/CONTROLFILE/control02.ctl”, ”+DISK2/DBTEST/CONTROLFILE/current.256.819364259” comment= ”Set by RMAN” scope=spfilesql statement: alter system set db_name = ”ORCL” comment= ”Modified by RMAN duplicate” scope=spfilesql statement: alter system set db_unique_name = ”DBTEST” comment= ”Modified by RMAN duplicate” scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 534462464 bytesFixed Size 2290416 bytesVariable Size 276827408 bytesDatabase Buffers 247463936 bytesRedo Buffers 7880704 bytesStarting restore at 2013-06-29:09:11:23allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=13 device type=DISKchannel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: restoring control filechannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07output file name=+FRA/DBTEST/CONTROLFILE/control02.ctloutput file name=+DISK2/DBTEST/CONTROLFILE/current.256.819364259Finished restore at 2013-06-29:09:11:32database mountedcontents of Memory Script:{ set newname for clone datafile 1 to new; set newname for clone datafile 2 to new; set newname for clone datafile 3 to new; set newname for clone datafile 4 to new; set newname for clone datafile 6 to new; restore from service ‘orcl’ clone database ; sql ‘alter system archive log current’;}executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 2013-06-29:09:11:41using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00001 to +DATAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00002 to +DATAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00003 to +DATAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00004 to +DATAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00006 to +DATAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 2013-06-29:09:14:23sql statement: alter system archive log currentcurrent log archivedcontents of Memory Script:{ restore clone force from service ‘orcl’ archivelog from scn 2751227; switch clone datafile all;}executing Memory ScriptStarting restore at 2013-06-29:09:14:27using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=14channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using network backup set from service orclchannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=15channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03Finished restore at 2013-06-29:09:14:34datafile 1 switched to datafile copyinput datafile copy RECID=17 STAMP=819364475 file name=+DATA/DBTEST/DATAFILE/system.266.819364303datafile 2 switched to datafile copyinput datafile copy RECID=18 STAMP=819364475 file name=+DATA/DBTEST/DATAFILE/example.256.819364357datafile 3 switched to datafile copyinput datafile copy RECID=19 STAMP=819364475 file name=+DATA/DBTEST/DATAFILE/sysaux.257.819364383datafile 4 switched to datafile copyinput datafile copy RECID=20 STAMP=819364476 file name=+DATA/DBTEST/DATAFILE/undotbs1.258.819364449datafile 6 switched to datafile copyinput datafile copy RECID=21 STAMP=819364476 file name=+DATA/DBTEST/DATAFILE/users.263.819364463contents of Memory Script:{ set until scn 2751502; recover clone database delete archivelog ;}executing Memory Scriptexecuting command: SET until clauseStarting recover at 2013-06-29:09:14:37using channel ORA_AUX_DISK_1starting media recoveryarchived log for thread 1 with sequence 14 is already on disk as file +FRA/DBTEST/ARCHIVELOG/2013_06_29/thread_1_seq_14.284.819364469archived log for thread 1 with sequence 15 is already on disk as file +FRA/DBTEST/ARCHIVELOG/2013_06_29/thread_1_seq_15.283.819364473archived log file name=+FRA/DBTEST/ARCHIVELOG/2013_06_29/thread_1_seq_14.284.819364469 thread=1 sequence=14archived log file name=+FRA/DBTEST/ARCHIVELOG/2013_06_29/thread_1_seq_15.283.819364473 thread=1 sequence=15media recovery complete, elapsed time: 00:00:02Finished recover at 2013-06-29:09:14:43Oracle instance startedTotal System Global Area 534462464 bytesFixed Size 2290416 bytesVariable Size 276827408 bytesDatabase Buffers 247463936 bytesRedo Buffers 7880704 bytescontents of Memory Script:{ sql clone “alter system set db_name = ”DBTEST” comment= ”Reset to original value by RMAN” scope=spfile”; sql clone “alter system reset db_unique_name scope=spfile”;}executing Memory Scriptsql statement: alter system set db_name = ”DBTEST” comment= ”Reset to original value by RMAN” scope=spfilesql statement: alter system reset db_unique_name scope=spfileOracle instance startedTotal System Global Area 534462464 bytesFixed Size 2290416 bytesVariable Size 276827408 bytesDatabase Buffers 247463936 bytesRedo Buffers 7880704 bytessql statement: CREATE CONTROLFILE REUSE SET DATABASE “DBTEST” RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 SIZE 50 M , GROUP 2 SIZE 50 M , GROUP 3 SIZE 50 M DATAFILE ‘+DATA/DBTEST/DATAFILE/system.266.819364303’ CHARACTER SET AL32UTF8contents of Memory Script:{ set newname for clone tempfile 1 to new; switch clone tempfile all; catalog clone datafilecopy “+DATA/DBTEST/DATAFILE/example.256.819364357”, “+DATA/DBTEST/DATAFILE/sysaux.257.819364383”, “+DATA/DBTEST/DATAFILE/undotbs1.258.819364449”, “+DATA/DBTEST/DATAFILE/users.263.819364463”; switch clone datafile all;}executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to +DATA in control filecataloged datafile copydatafile copy file name=+DATA/DBTEST/DATAFILE/example.256.819364357 RECID=1 STAMP=819364518cataloged datafile copydatafile copy file name=+DATA/DBTEST/DATAFILE/sysaux.257.819364383 RECID=2 STAMP=819364518cataloged datafile copydatafile copy file name=+DATA/DBTEST/DATAFILE/undotbs1.258.819364449 RECID=3 STAMP=819364519cataloged datafile copydatafile copy file name=+DATA/DBTEST/DATAFILE/users.263.819364463 RECID=4 STAMP=819364519datafile 2 switched to datafile copyinput datafile copy RECID=1 STAMP=819364518 file name=+DATA/DBTEST/DATAFILE/example.256.819364357datafile 3 switched to datafile copyinput datafile copy RECID=2 STAMP=819364518 file name=+DATA/DBTEST/DATAFILE/sysaux.257.819364383datafile 4 switched to datafile copyinput datafile copy RECID=3 STAMP=819364519 file name=+DATA/DBTEST/DATAFILE/undotbs1.258.819364449datafile 6 switched to datafile copyinput datafile copy RECID=4 STAMP=819364519 file name=+DATA/DBTEST/DATAFILE/users.263.819364463contents of Memory Script:{ Alter clone database open resetlogs;}executing Memory Scriptdatabase openedFinished Duplicate Db at 2013-06-29:09:16:19RMAN> 14. Optionally, review the output. Find the major steps that RMAN performs for you. Then exit RMAN.An incomplete example:• Registering the new database in the recovery catalog• Cloning the SPFILE.• Cloning the control file to the DISK2 disk group• Cloning the data files• Switching to the data files copies• Performing media recovery• Open DBTEST in RESETLOGS modeRMAN> exit $15. Confirm the availability and accessibility of your newly created dbtest database.$ . oraenvORACLE_SID = [oracle] ? dbtestORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/dbhome_1The Oracle base for ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 is /u01/app/oracle$ sqlplus / as sysdbaSQL> select dbid, name, created, open_mode from v$database; DBID NAME CREATED OPEN_MODE———- ——— ——————- ——————–1212227365 DBTEST 2013-06-29:09:15:17 READ WRITESQL> exit$

Speak Your Mind

沪公网安备 31010802001379号

TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569