*.audit_file_dest=/dba/app/oracle/admin/dominic/adump *.audit_trail=db *.cluster_database=true *.compatible=11.2.0.4.0 *.control_files=+DATA_DISK/DOMINIC/controlfile/current.260.825093345,+LOG_DISK/DOMINIC/controlfile/current.256.825093345
*.audit_file_dest='/dba/app/oracle/admin/dominic/adump' *.audit_trail='db' *.cluster_database=true *.compatible='11.2.0.4.0' *.control_files='+DATA_DISK/DOMINIC/controlfile/current.260.825093345','+LOG_DISK/DOMINIC/controlfile/current.256.825093345' — DOMINIC 大写 *.db_block_size=8192 *.db_create_file_dest='+DATA_DISK' *.db_domain='' *.db_name='dominic' #*.log_file_name_convert='+DATA_DISK/dominic/logfile','/u01/app/oracle/logfile','+LOG_DISK/dominic/logfile','/u01/app/oracle/oradata/dominic' *.db_recovery_file_dest='+LOG_DISK' *.db_recovery_file_dest_size=4558159872 *.diagnostic_dest='/dba/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=dominicXDB)' dominic2.instance_number=2 dominic1.instance_number=1 *.log_archive_format='%t_%s_%r.dbf' *.memory_target=1153433600 *.open_cursors=500 *.processes=300 *.remote_listener='dominic-scan:1521' *.remote_login_passwordfile='exclusive' *.sessions=350 dominic2.thread=2 dominic1.thread=1 dominic2.undo_tablespace='UNDOTBS2' dominic1.undo_tablespace='UNDOTBS1' *.undo_management='AUTO' 一 : 创建参数文件 to ASM [oracle@dominic1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 21 19:04:49 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance.
SQL> startup nomount ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora' –需要追加的路径
SQL> host [oracle@dominic1 ~]$ cd /dba/app/oracle/product/11.2/dbhome_1/dbs/
[oracle@dominic1 dbs]$ ls init.ora [oracle@dominic1 dbs]$ exit exit SQL> create spfile='+data_disk/dominic/parameterfile/initdominic.ora' from pfile='/dba/app/oracle/backup/s_pfile'; File created. SQL> HOST
[oracle@dominic1 ~]$ echo “SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'” > /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora [oracle@dominic1 ~]$ cat /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora SPFILE='+data_disk/dominic/parameterfile/initdominic.ora' [oracle@dominic1 ~]$ ssh dominic2 [oracle@dominic2 ~]$ echo “SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'” > /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic2.ora [oracle@dominic2 ~]$ cat /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic2.ora SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'
ASMCMD> pwd +data_disk/dominic/parameterfile ASMCMD> ls initdominic.ora
二: 创建密码文件:
三: 创建对应的路径: ASM : +DATA_DISK /DOMINI/datafile 、logfile、controlfile、parameterfile。 + LOG_DISK /dominic/logfile, controlfil 等:
+++++++++++++++++++++++++++++++++++++++++++++失败++++++++++++++++++++++ RMAN> run { 2> set newname for datafile 1 to '+DATA_DISK/DOMINIC/datafile/system01.dbf'; 3> set newname for datafile 2 to '+DATA_DISK/DOMINIC/datafile/undotbs01.dbf'; 4> set newname for datafile 3 to '+DATA_DISK/DOMINIC/datafile/users01.dbf'; 5> set newname for datafile 4 to '+DATA_DISK/DOMINIC/datafile/undotbs01.dbf'; 6> set newname for datafile 5 to '+DATA_DISK/DOMINIC/datafile/example01.dbf'; 7> set newname for datafile 6 to '+DATA_DISK/DOMINIC/datafile/dominic_tbs01.dbf'; 8> restore database; 9> switch datafile all; 10> } 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 21-JUN-14 Starting implicit crosscheck backup at 21-JUN-14 allocated channel: ORA_DISK_1 Crosschecked 3 objects Finished implicit crosscheck backup at 21-JUN-14 Starting implicit crosscheck copy at 21-JUN-14 using channel ORA_DISK_1 Finished implicit crosscheck copy at 21-JUN-14 searching for all files in the recovery area cataloging files… cataloging done List of Cataloged Files ======================= File Name: +log_disk/dominic/controlfile/current.257.850853325 File Name: +log_disk/dominic/controlfile/current.256.850853775 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to +DATA_DISK/DOMINIC/datafile/system01.dbf channel ORA_DISK_1: restoring datafile 00002 to +DATA_DISK/DOMINIC/datafile/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00003 to +DATA_DISK/DOMINIC/datafile/users01.dbf channel ORA_DISK_1: restoring datafile 00004 to +DATA_DISK/DOMINIC/datafile/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00005 to +DATA_DISK/DOMINIC/datafile/example01.dbf channel ORA_DISK_1: restoring datafile 00006 to +DATA_DISK/DOMINIC/datafile/dominic_tbs01.dbf channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB channel ORA_DISK_1: ORA-19870: error while restoring backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB ORA-19504: failed to create file “+DATA_DISK/dominic/datafile/undotbs01.dbf” ORA-17502: ksfdcre:4 Failed to create file +DATA_DISK/dominic/datafile/undotbs01.dbf ORA-15005: name “dominic/datafile/undotbs01.dbf” is already used by an existing alias failover to previous backup RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 06/21/2014 20:29:11 RMAN-06026: some targets not found – aborting restore RMAN-06023: no backup or copy of datafile 5 found to restore –上次也抱这错,好好思考一下(node asm -> rman filesys node) RMAN-06023: no backup or copy of datafile 4 found to restore RMAN-06023: no backup or copy of datafile 3 found to restore RMAN-06023: no backup or copy of datafile 2 found to restore RMAN-06023: no backup or copy of datafile 1 found to restore –ASM 只需要写磁盘组即可 2、注册备份集 RMAN> catalog start with '/dba/app/rmanbk/';
最后我改写成这样, set newname for datafile 1 to '+DATA_DISK'; 成功了,不报RMAN-6023错, 而且rman 恢复路径也按照前定义好的。
====================成功le 案例============================ [oracle@dominic1 rmanbak]$ rman target / Recovery Manager: Release 11.2.0.4.0 – Production on Sat Jun 21 20:42:11 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: DOMINIC (DBID=1978806569, not open) RMAN> run { 2> set newname for datafile 1 to '+DATA_DISK'; 3> set newname for datafile 2 to '+DATA_DISK'; 4> set newname for datafile 3 to '+DATA_DISK'; 5> set newname for datafile 4 to '+DATA_DISK'; 6> set newname for datafile 5 to '
本文来源gao!%daima.com搞$代*!码$网3
+DATA_DISK'; 7> set newname for datafile 6 to '+DATA_DISK'; 8> restore database; 9> switch datafile all; 10> switch tempfile all; 11> } 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 21-JUN-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=42 instance=dominic1 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00002 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00003 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00004 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00005 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00006 to +DATA_DISK channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB channel ORA_DISK_1: piece handle=/dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB tag=TAG20140601T232615 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:01:26 Finished restore at 21-JUN-14 datafile 1 switched to datafile copy input datafile copy RECID=10 STAMP=850855528 file name=+DATA_DISK/dominic/datafile/system.263.850855443 datafile 2 switched to datafile copy input datafile copy RECID=11 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/sysaux.262.850855443 datafile 3 switched to datafile copy input datafile copy RECID=12 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/undotbs1.261.850855443 datafile 4 switched to datafile copy input datafile copy RECID=13 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/users.265.850855443 datafile 5 switched to datafile copy input datafile copy RECID=14 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/example.264.850855443 datafile 6 switched to datafile copy input datafile copy RECID=15 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/dominic_tbs.260.850855443 =================================================== ASMCMD> pwd +data_disk/dominic/datafile ASMCMD> ls DOMINIC_TBS.260.850855443 EXAMPLE.264.850855443 SYSAUX.262.850855443 SYSTEM.263.850855443 UNDOTBS1.261.850855443 USERS.265.850855443
select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_ ———- ——- ——- ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— — 3 ONLINE /dba/app/oracle/oradata/dominic/redo03.log NO 2 ONLINE /dba/app/oracle/oradata/dominic/redo02.log NO 1 ONLINE /dba/app/oracle/oradata/dominic/redo01.log NO 1 ONLINE /dba/app/oracle/redolog/redo01-a.log NO 2 ONLINE /dba/app/oracle/redolog/redo02-a.log NO 3 INVALID ONLINE /dba/app/oracle/redolog/redo03-a.log NO 6 rows selected.
SQL> alter database rename file '/dba/app/oracle/redolog/redo01-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/redolog/redo02-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/redolog/redo03-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/oradata/dominic/redo02.log' to '+DATA_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/oradata/dominic/redo03.log' to '+DATA_DISK'; Database altered.
SQL> select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_ ———- ——- ——- ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— — 3 ONLINE +DATA_DISK NO 2 ONLINE +DATA_DISK NO 1 ONLINE +DATA_DISK NO 1 ONLINE +LOG_DISK YES 2 ONLINE +LOG_DISK YES 3 INVALID ONLINE +LOG_DISK YES 6 rows selected.