以下过程主要涉及如下3个问题:
1,根据SCN号“重做”ADG
2,主库是ASM数据库,使用了一半自动命名文件名的文件,和一部分手工指定文件名(别名)的文件:
——————————————————————————–
针对OMF的数据文件使用下面命令:
catalog start with ‘+DATA1/MUM/DATAFILE/’;
针对非OFM的数据文件使用下面命令:
catalog datafilecopy ‘<File-Specification>’;
——————————————————————————–
3,优化ASM的IO效率
源库:
[oracle@dm01db01 exachk221]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 9 17:25:17 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> col CURRENT_SCN for 9999999999999999999999999999999999999999 SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN ----------------------------------------- 12762144188510 SQL>
备库:
[oracle@oradg ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 9 18:13:01 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning and Automatic Storage Management options SQL> col CURRENT_SCN for 9999999999999999999999999999999999999999 SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN ----------------------------------------- 12742479679876 ---------备库当前的SCN SQL> --force logging scn SQL> col MIN(FIRST_NONLOGGED_SCN) for 9999999999999999999999999999999999999999 SQL> SELECT MIN(FIRST_NONLOGGED_SCN) FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN>0; MIN(FIRST_NONLOGGED_SCN) ----------------------------------------- 12216936897722 ----------备库中最早一个nologging操作的SCN(怀疑建立dg时忘记force logging) 这个数据量其实跟做一次全备恢复,或者说重做一个完整dg的数据量差不多了 不过,最近有些人问起基于scn的方式,因此这里用这个做个例子,就做基于这个scn的adg的恢复工作 SQL> SQL> col FIRST_NONLOGGED_SCN for 9999999999999999999999999999999999999999 SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0; FILE# FIRST_NONLOGGED_SCN ---------- ----------------------------------------- 5 12216939788997 6 12216939789023 7 12216939789049 8 12217338487354 9 12216939789075 10 12216939789099 11 12216939789126 12 12216939789177 13 12217031789781 14 12217031789985 15 12217031790205 16 12217031790532 17 12217031790710 18 12217031790873 19 12217031791015 20 12217031791175 21 12217031791570 22 12217031805288 23 12217079076408 24 12216939788876 25 12216939788941 26 12216939788946 27 12216939788972 30 12217079092653 55 12217079042170 56 12217079042203 57 12217079042209 58 12217079042213 71 12216939751569 72 12216939751587 73 12216939751602 74 12216939751622 75 12216939751640 76 12216939751660 77 12216939751680 78 12216939751390 79 12216939751428 80 12216939751429 81 12216939751435 82 12216939751443 83 12216939751461 84 12216939751475 85 12216939751509 86 12216939751528 87 12216939751546 94 12217094078570 104 12216936897722 ---------这个是最小的,下次执行应该加个order by,O(∩_∩)O哈哈~ 105 12216936897724 48 rows selected. SQL>
查看主库force logging:
SQL> select FORCE_LOGGING from v$database; FOR --- NO SQL> alter database force logging; Database altered. SQL> select FORCE_LOGGING from v$database; FOR --- YES SQL>
查看有哪些文件含有force logging操作,以及他们的scn(下次执行,应该带上orderby,这样更清晰):
备库:
生成批量的backup命令,进行基于scn的恢复(含有force logging的都需要)
SQL> SELECT 'BACKUP INCREMENTAL FROM SCN '||FIRST_NONLOGGED_SCN||' DATAFILE '||FILE#||' FORMAT ''/tmp/ForStandby_%U'' TAG ''FORSTANDBY'';' FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0; 'BACKUPINCREMENTALFROMSCN'||FIRST_NONLOGGED_SCN||'DATAFILE'||FILE#||'FORMAT''/TMP/FORSTANDBY_%U''TAG''FORSTANDBY'';' ----------------------------------------------------------------------------------------------------------------------------------------------------- BACKUP INCREMENTAL FROM SCN 12742479679876 DATAFILE 5 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789023 DATAFILE 6 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789049 DATAFILE 7 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217338487354 DATAFILE 8 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789075 DATAFILE 9 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789099 DATAFILE 10 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789126 DATAFILE 11 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939789177 DATAFILE 12 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031789781 DATAFILE 13 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031789985 DATAFILE 14 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031790205 DATAFILE 15 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031790532 DATAFILE 16 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031790710 DATAFILE 17 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031790873 DATAFILE 18 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031791015 DATAFILE 19 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031791175 DATAFILE 20 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031791570 DATAFILE 21 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217031805288 DATAFILE 22 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079076408 DATAFILE 23 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939788876 DATAFILE 24 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939788941 DATAFILE 25 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939788946 DATAFILE 26 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939788972 DATAFILE 27 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079092653 DATAFILE 30 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079042170 DATAFILE 55 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079042203 DATAFILE 56 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079042209 DATAFILE 57 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217079042213 DATAFILE 58 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751569 DATAFILE 71 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751587 DATAFILE 72 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751602 DATAFILE 73 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751622 DATAFILE 74 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751640 DATAFILE 75 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751660 DATAFILE 76 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751680 DATAFILE 77 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751390 DATAFILE 78 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751428 DATAFILE 79 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751429 DATAFILE 80 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751435 DATAFILE 81 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751443 DATAFILE 82 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751461 DATAFILE 83 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751475 DATAFILE 84 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751509 DATAFILE 85 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751528 DATAFILE 86 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216939751546 DATAFILE 87 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12217094078570 DATAFILE 94 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216936897722 DATAFILE 104 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; BACKUP INCREMENTAL FROM SCN 12216936897724 DATAFILE 105 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY'; 48 rows selected. SQL>
主库,备份可以有两个方法:
1,根据上述备份命令写备份脚本
2,从最早的一个scn开始备份也可以
[oracle@dm01db01 scripts]$ cat temp.sh #!/bin/sh export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/dbhome_1 export ORACLE_SID=bjlunar1 export ORACLE_BASE=/u01/app/oracle export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:. rman target / <<EOF allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 type disk; allocate channel prmy4 type disk; allocate channel prmy5 type disk; allocate channel prmy6 type disk; allocate channel prmy7 type disk; allocate channel prmy8 type disk; BACKUP INCREMENTAL FROM SCN 12216936897722 DATABASE FORMAT '/u03/ForStandby_%U' tag 'FORSTANDBY'; release channel prmy1; release channel prmy2; release channel prmy3; release channel prmy4; release channel prmy5; release channel prmy6; release channel prmy7; release channel prmy8; EXIT; EOF [oracle@dm01db01 scripts]$
[oracle@dm01db01 scripts]$ more nohup.out ./temp.sh: line 1: i#!/bin/sh: No such file or directory Recovery Manager: Release 11.2.0.2.0 - Production on Mon Sep 9 17:52:31 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: bjlunar (DBID=4088537672) RMAN> Starting backup at 09-SEP-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1715 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=1250 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=1728 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=1921 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=7 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=1253 instance=bjlunar1 device type=DISK backup will be obsolete on date 16-SEP-13 archived logs will not be kept or backed up RMAN-06755: WARNING: datafile 48: incremental-start SCN is too recent; using checkpoint SCN 12030111275805 instead RMAN-06755: WARNING: datafile 50: incremental-start SCN is too recent; using checkpoint SCN 12030111275805 instead channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00037 name=+DATA_DM01/bjlunar/datafile/pension input datafile file number=00010 name=+DATA_DM01/bjlunar/datafile/users05 input datafile file number=00014 name=+DATA_DM01/bjlunar/datafile/users09 input datafile file number=00019 name=+DATA_DM01/bjlunar/datafile/users14 input datafile file number=00024 name=+DATA_DM01/bjlunar/datafile/users19 input datafile file number=00032 name=+DATA_DM01/bjlunar/datafile/undotbs201 input datafile file number=00047 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts.328.770330337 input datafile file number=00057 name=+DATA_DM01/bjlunar/datafile/ac43_data03 input datafile file number=00063 name=+DATA_DM01/bjlunar/datafile/lunar_inx01 input datafile file number=00069 name=+DATA_DM01/bjlunar/datafile/lunar_inx07 input datafile file number=00075 name=+DATA_DM01/bjlunar/datafile/lunar_data05 input datafile file number=00081 name=+DATA_DM01/bjlunar/datafile/lunar_data11 input datafile file number=00087 name=+DATA_DM01/bjlunar/datafile/lunar_data17 input datafile file number=00028 name=+DATA_DM01/bjlunar/datafile/undotbs02 input datafile file number=00034 name=+DATA_DM01/bjlunar/datafile/medicalpart1 input datafile file number=00031 name=+DATA_DM01/bjlunar/datafile/sbdata02 input datafile file number=00093 name=+DATA_DM01/bjlunar/datafile/bxjh_data01 input datafile file number=00002 name=+DATA_DM01/bjlunar/datafile/sysaux.272.764800659 input datafile file number=00098 name=+DATA_DM01/bjlunar/datafile/lr_app_lr_ts.dat channel ORA_DISK_1: starting piece 1 at 09-SEP-13 channel ORA_DISK_2: starting full datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00049 name=+DATA_DM01/bjlunar/datafile/dbfs_bak.330.770478151 input datafile file number=00051 name=+DATA_DM01/bjlunar/datafile/pension02 input datafile file number=00060 name=+DATA_DM01/bjlunar/datafile/ac43_inx02 input datafile file number=00066 name=+DATA_DM01/bjlunar/datafile/lunar_inx04 input datafile file number=00072 name=+DATA_DM01/bjlunar/datafile/lunar_data02 input datafile file number=00078 name=+DATA_DM01/bjlunar/datafile/lunar_data08 input datafile file number=00084 name=+DATA_DM01/bjlunar/datafile/lunar_data14 input datafile file number=00090 name=+DATA_DM01/bjlunar/datafile/ac43_inx07 input datafile file number=00007 name=+DATA_DM01/bjlunar/datafile/users02 input datafile file number=00053 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts03 input datafile file number=00092 name=+DATA_DM01/bjlunar/datafile/undotbs04 input datafile file number=00097 name=+DATA_DM01/bjlunar/datafile/lr_app_ls_ts.dat input datafile file number=00101 name=+DATA_DM01/bjlunar/datafile/lr_idx_lr_ts.dat input datafile file number=00102 name=+DATA_DM01/bjlunar/datafile/lr_annex_ts.dat channel ORA_DISK_2: starting piece 1 at 09-SEP-13 channel ORA_DISK_3: starting full datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00005 name=+DATA_DM01/bjlunar/datafile/users.267.764800667 input datafile file number=00003 name=+DATA_DM01/bjlunar/datafile/undotbs1.271.764800661 input datafile file number=00016 name=+DATA_DM01/bjlunar/datafile/users11 input datafile file number=00021 name=+DATA_DM01/bjlunar/datafile/users16 input datafile file number=00026 name=+DATA_DM01/bjlunar/datafile/users21 input datafile file number=00038 name=+DATA_DM01/bjlunar/datafile/unemployee input datafile file number=00050 name=+DATA_DM01/medicare02 skipping datafile 00050 because it has not changed input datafile file number=00059 name=+DATA_DM01/bjlunar/datafile/ac43_inx01 input datafile file number=00065 name=+DATA_DM01/bjlunar/datafile/lunar_inx03 input datafile file number=00071 name=+DATA_DM01/bjlunar/datafile/lunar_data01 input datafile file number=00077 name=+DATA_DM01/bjlunar/datafile/lunar_data07 input datafile file number=00083 name=+DATA_DM01/bjlunar/datafile/lunar_data13 input datafile file number=00089 name=+DATA_DM01/bjlunar/datafile/ac43_inx06 input datafile file number=00036 name=+DATA_DM01/bjlunar/datafile/ac43_par01 input datafile file number=00033 name=+DATA_DM01/bjlunar/datafile/medical_part input datafile file number=00094 name=+DATA_DM01/bjlunar/datafile/base_data input datafile file number=00091 name=+DATA_DM01/bjlunar/datafile/undotbs03 input datafile file number=00096 name=+DATA_DM01/bjlunar/datafile/lr_app_la_ts.dat input datafile file number=00100 name=+DATA_DM01/bjlunar/datafile/lr_idx_ls_ts.dat channel ORA_DISK_3: starting piece 1 at 09-SEP-13 channel ORA_DISK_4: starting full datafile backup set channel ORA_DISK_4: specifying datafile(s) in backup set input datafile file number=00039 name=+DATA_DM01/bjlunar/datafile/medicare input datafile file number=00011 name=+DATA_DM01/bjlunar/datafile/users06 input datafile file number=00015 name=+DATA_DM01/bjlunar/datafile/users10 input datafile file number=00020 name=+DATA_DM01/bjlunar/datafile/users15 input datafile file number=00025 name=+DATA_DM01/bjlunar/datafile/users20 input datafile file number=00035 name=+DATA_DM01/bjlunar/datafile/ac43_par input datafile file number=00048 name=+DATA_DM01/index_ac43_ts_01 skipping datafile 00048 because it has not changed input datafile file number=00058 name=+DATA_DM01/bjlunar/datafile/ac43_data04 input datafile file number=00064 name=+DATA_DM01/bjlunar/datafile/lunar_inx02 input datafile file number=00070 name=+DATA_DM01/bjlunar/datafile/lunar_inx08 input datafile file number=00076 name=+DATA_DM01/bjlunar/datafile/lunar_data06 input datafile file number=00082 name=+DATA_DM01/bjlunar/datafile/lunar_data12 input datafile file number=00088 name=+DATA_DM01/bjlunar/datafile/ac43_inx05 input datafile file number=00004 name=+DATA_DM01/bjlunar/datafile/undotbs2.259.764800671 input datafile file number=00008 name=+DATA_DM01/bjlunar/datafile/users03 input datafile file number=00054 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts04 input datafile file number=00095 name=+DATA_DM01/bjlunar/datafile/lr_public_ts.dat input datafile file number=00029 name=+DATA_DM01/bjlunar/datafile/system01 input datafile file number=00099 name=+DATA_DM01/bjlunar/datafile/lr_idx_la_ts.dat channel ORA_DISK_4: starting piece 1 at 09-SEP-13 channel ORA_DISK_5: starting full datafile backup set channel ORA_DISK_5: specifying datafile(s) in backup set input datafile file number=00041 name=+DATA_DM01/bjlunar/datafile/pension01 input datafile file number=00006 name=+DATA_DM01/bjlunar/datafile/users01 input datafile file number=00012 name=+DATA_DM01/bjlunar/datafile/users07 input datafile file number=00017 name=+DATA_DM01/bjlunar/datafile/users12 input datafile file number=00022 name=+DATA_DM01/bjlunar/datafile/users17 input datafile file number=00027 name=+DATA_DM01/bjlunar/datafile/users22 input datafile file number=00043 name=+DATA_DM01/bjlunar/datafile/lunar_index_l01 input datafile file number=00055 name=+DATA_DM01/bjlunar/datafile/ac43_data01 input datafile file number=00061 name=+DATA_DM01/bjlunar/datafile/ac43_inx03 input datafile file number=00067 name=+DATA_DM01/bjlunar/datafile/lunar_inx05 input datafile file number=00073 name=+DATA_DM01/bjlunar/datafile/lunar_data03 input datafile file number=00079 name=+DATA_DM01/bjlunar/datafile/lunar_data09 input datafile file number=00085 name=+DATA_DM01/bjlunar/datafile/lunar_data15 input datafile file number=00104 name=+DATA_DM01/bjlunar/datafile/bpcm.397.802032443 input datafile file number=00040 name=+DATA_DM01/bjlunar/datafile/lunarothers input datafile file number=00045 name=+DATA_DM01/bjlunar/datafile/lunar_index_g02 input datafile file number=00107 name=+DATA_DM01/bjlunar/datafile/udotbs5 input datafile file number=00106 name=+DATA_DM01/bjlunar/datafile/form.399.802032659 input datafile file number=00109 name=+DATA_DM01/bjlunar/datafile/system02 channel ORA_DISK_5: starting piece 1 at 09-SEP-13 channel ORA_DISK_6: starting full datafile backup set channel ORA_DISK_6: specifying datafile(s) in backup set input datafile file number=00042 name=+DATA_DM01/bjlunar/datafile/medicare01 input datafile file number=00009 name=+DATA_DM01/bjlunar/datafile/users04 input datafile file number=00013 name=+DATA_DM01/bjlunar/datafile/users08 input datafile file number=00018 name=+DATA_DM01/bjlunar/datafile/users13 input datafile file number=00023 name=+DATA_DM01/bjlunar/datafile/users18 input datafile file number=00030 name=+DATA_DM01/bjlunar/datafile/sbdata01 input datafile file number=00044 name=+DATA_DM01/bjlunar/datafile/lunar_index_g01 input datafile file number=00056 name=+DATA_DM01/bjlunar/datafile/ac43_data02 input datafile file number=00062 name=+DATA_DM01/bjlunar/datafile/ac43_inx04 input datafile file number=00068 name=+DATA_DM01/bjlunar/datafile/lunar_inx06 input datafile file number=00074 name=+DATA_DM01/bjlunar/datafile/lunar_data04 input datafile file number=00080 name=+DATA_DM01/bjlunar/datafile/lunar_data10 input datafile file number=00086 name=+DATA_DM01/bjlunar/datafile/lunar_data16 input datafile file number=00105 name=+DATA_DM01/bjlunar/datafile/bpcm.398.802032553 input datafile file number=00052 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts_02 input datafile file number=00046 name=+DATA_DM01/bjlunar/datafile/lunar_index_l02 input datafile file number=00108 name=+DATA_DM01/bjlunar/datafile/syldgx_01.dbf input datafile file number=00001 name=+DATA_DM01/bjlunar/datafile/system.264.764800657 input datafile file number=00103 name=+DATA_DM01/bjlunar/datafile/bxrlzydata01 channel ORA_DISK_6: starting piece 1 at 09-SEP-13 channel ORA_DISK_2: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5oojeeb6_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:57:26 channel ORA_DISK_6: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5sojeeb7_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_6: backup set complete, elapsed time: 01:00:46 channel ORA_DISK_5: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5rojeeb7_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_5: backup set complete, elapsed time: 01:05:36 channel ORA_DISK_4: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5qojeeb7_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_4: backup set complete, elapsed time: 01:10:16 channel ORA_DISK_3: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5pojeeb7_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 01:18:36 channel ORA_DISK_1: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5nojeeb6_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 01:21:27 using channel ORA_DISK_1 using channel ORA_DISK_2 using channel ORA_DISK_3 using channel ORA_DISK_4 using channel ORA_DISK_5 using channel ORA_DISK_6 backup will be obsolete on date 16-SEP-13 archived logs will not be kept or backed up channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 09-SEP-13 channel ORA_DISK_1: finished piece 1 at 09-SEP-13 piece handle=/u03/ForStandby_5tojej3u_1_1 tag=FORSTANDBY comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 09-SEP-13 RMAN> RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name bjlunar are: CONFIGURE RETENTION POLICY TO REDUNDANCY 2; CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/ctsp_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/%Udb_bak'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0.2/dbhome_1/dbs/snapcf_bjlunar1.f'; # default RMAN> Recovery Manager complete. [oracle@dm01db01 scripts]$
备份比较快,大约550G左右,耗时大约1个半小时: -rw-r----- 1 oracle asmadmin 65224884224 Sep 9 19:11 ForStandby_5oojeeb6_1_1 -rw-r----- 1 oracle asmadmin 69556887552 Sep 9 19:15 ForStandby_5sojeeb7_1_1 -rw-r----- 1 oracle asmadmin 76908052480 Sep 9 19:20 ForStandby_5rojeeb7_1_1 -rw-r----- 1 oracle asmadmin 88362360832 Sep 9 19:24 ForStandby_5qojeeb7_1_1 -rw-r----- 1 oracle asmadmin 116584480768 Sep 9 19:33 ForStandby_5pojeeb7_1_1 -rw-r----- 1 oracle asmadmin 133882372096 Sep 9 19:35 ForStandby_5nojeeb6_1_1 -rw-r----- 1 oracle asmadmin 21987328 Sep 9 19:36 ForStandby_5tojej3u_1_1 在主库生成standby controlfile: RMAN> backup current controlfile for standby format '/tmp/stdbyctl.bkp'; Starting backup at 10-SEP-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1431 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=1333 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=780 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=672 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=769 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=1334 instance=bjlunar1 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including standby control file in backup set channel ORA_DISK_1: starting piece 1 at 10-SEP-13 channel ORA_DISK_1: finished piece 1 at 10-SEP-13 piece handle=/tmp/stdbyctl.bkp tag=TAG20130910T091011 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 10-SEP-13 Starting Control File and SPFILE Autobackup at 10-SEP-13 piece handle=/u03/ctsp_c-4088537672-20130910-00 comment=NONE Finished Control File and SPFILE Autobackup at 10-SEP-13 RMAN> 传输到备库 sftp> get /tmp/stdbyctl.bkp Downloading stdbyctl.bkp from /tmp/stdbyctl.bkp 100% 21472KB 21472KB/s 00:00:01 /tmp/stdbyctl.bkp: 21987328 bytes transferred in 1 seconds (21472 KB/s) sftp> sftp> put stdbyctl.bkp Uploading stdbyctl.bkp to /tmp/stdbyctl.bkp 100% 21472KB 7157KB/s 00:00:03 C:/TEMP/stdbyctl.bkp: 21987328 bytes transferred in 3 seconds (7157 KB/s) sftp>
检查备库的空间,使用新备份的控制文件启动standby: Last login: Tue Sep 10 09:47:25 2013 from 10.58.160.79 [root@oradg ~]# su - oracle [oracle@oradg ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 536G 160G 349G 32% / /dev/sda1 99M 23M 72M 24% /boot tmpfs 1.8G 180M 1.6G 10% /dev/shm none 1.8G 104K 1.8G 1% /var/lib/xenstored 10.58.160.38:/u02 7.6T 1.7T 5.8T 23% /u03 [oracle@oradg ~]$ cd /u03 [oracle@oradg u03]$ cp /tmp/stdbyctl.bkp . [oracle@oradg u03]$ [oracle@oradg u03]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Tue Sep 10 10:03:34 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning and Automatic Storage Management options SQL> alter database mount; Database altered. SQL> RMAN> catalog backuppiece '/tmp/stdbyctl.bkp'; cataloged backup piece backup piece handle=/tmp/stdbyctl.bkp RECID=3182 STAMP=825761032 RMAN> SQL>shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> startup nomount ORACLE instance started. Total System Global Area 2137886720 bytes Fixed Size 2228200 bytes Variable Size 1375731736 bytes Database Buffers 754974720 bytes Redo Buffers 4952064 bytes SQL> [oracle@oradg ~]$ rman target / Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 10:05:10 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: bjlunar (not mounted) RMAN> restore standby controlfile from '/tmp/stdbyctl.bkp'; Starting restore at 10-SEP-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=853 device type=DISK channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 output file name=+DATA_DM01/lunars/controlfile/current.373.793718513 Finished restore at 10-SEP-13 RMAN>
restore 数据文件:
RMAN> CATALOG START WITH '/u03/ForStandby'; searching for all files that match the pattern /u03/ForStandby List of Files Unknown to the Database ===================================== File Name: /u03/ForStandby/ForStandby_5pojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5tojej3u_1_1 File Name: /u03/ForStandby/ForStandby_5nojeeb6_1_1 File Name: /u03/ForStandby/ForStandby_5qojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5rojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5sojeeb7_1_1 Do you really want to catalog the above files (enter YES or NO)? yes cataloging files... cataloging done List of Cataloged Files ======================= File Name: /u03/ForStandby/ForStandby_5pojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5tojej3u_1_1 File Name: /u03/ForStandby/ForStandby_5nojeeb6_1_1 File Name: /u03/ForStandby/ForStandby_5qojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5rojeeb7_1_1 File Name: /u03/ForStandby/ForStandby_5sojeeb7_1_1 RMAN> SQL> select name from v$datafile; NAME ---------------------------------------------------------------------------------------------------- +DATA_DM01/lunars/datafile/system.264.764800657 +DATA_DM01/lunars/datafile/sysaux.272.764800659 +DATA_DM01/lunars/datafile/undotbs1.271.764800661 +DATA_DM01/lunars/datafile/undotbs2.259.764800671 +DATA_DM01/lunars/datafile/users.267.764800667 +DATA_DM01/lunars/datafile/users01 +DATA_DM01/lunars/datafile/users02 +DATA_DM01/lunars/datafile/users03 +DATA_DM01/lunars/datafile/users04 +DATA_DM01/lunars/datafile/users05 +DATA_DM01/lunars/datafile/users06 +DATA_DM01/lunars/datafile/users07 +DATA_DM01/lunars/datafile/users08 +DATA_DM01/lunars/datafile/users09 +DATA_DM01/lunars/datafile/users10 +DATA_DM01/lunars/datafile/users11 +DATA_DM01/lunars/datafile/users12 +DATA_DM01/lunars/datafile/users13 +DATA_DM01/lunars/datafile/users14 +DATA_DM01/lunars/datafile/users15 +DATA_DM01/lunars/datafile/users16 +DATA_DM01/lunars/datafile/users17 +DATA_DM01/lunars/datafile/users18 +DATA_DM01/lunars/datafile/users19 +DATA_DM01/lunars/datafile/users20 +DATA_DM01/lunars/datafile/users21 +DATA_DM01/lunars/datafile/users22 +DATA_DM01/lunars/datafile/undotbs02 +DATA_DM01/lunars/datafile/system01 +DATA_DM01/lunars/datafile/sbdata01 +DATA_DM01/lunars/datafile/sbdata02 +DATA_DM01/lunars/datafile/undotbs201 +DATA_DM01/lunars/datafile/medical_part +DATA_DM01/lunars/datafile/medicalpart1 +DATA_DM01/lunars/datafile/ac43_par +DATA_DM01/lunars/datafile/ac43_par01 +DATA_DM01/lunars/datafile/pension +DATA_DM01/lunars/datafile/unemployee +DATA_DM01/lunars/datafile/medicare +DATA_DM01/lunars/datafile/lunarothers +DATA_DM01/lunars/datafile/pension01 +DATA_DM01/lunars/datafile/medicare01 +DATA_DM01/lunars/datafile/lunar_index_l01 +DATA_DM01/lunars/datafile/lunar_index_g01 +DATA_DM01/lunars/datafile/lunar_index_g02 +DATA_DM01/lunars/datafile/lunar_index_l02 +DATA_DM01/lunars/datafile/index_ac43_ts.328.770330337 +DATA_DM01/index_ac43_ts_01 +DATA_DM01/lunars/datafile/dbfs_bak.330.770478151 +DATA_DM01/medicare02 +DATA_DM01/lunars/datafile/pension02 +DATA_DM01/lunars/datafile/index_ac43_ts_02 +DATA_DM01/lunars/datafile/index_ac43_ts03 +DATA_DM01/lunars/datafile/index_ac43_ts04 +DATA_DM01/lunars/datafile/ac43_data01 +DATA_DM01/lunars/datafile/ac43_data02 +DATA_DM01/lunars/datafile/ac43_data03 +DATA_DM01/lunars/datafile/ac43_data04 +DATA_DM01/lunars/datafile/ac43_inx01 +DATA_DM01/lunars/datafile/ac43_inx02 +DATA_DM01/lunars/datafile/ac43_inx03 +DATA_DM01/lunars/datafile/ac43_inx04 +DATA_DM01/lunars/datafile/lunar_inx01 +DATA_DM01/lunars/datafile/lunar_inx02 +DATA_DM01/lunars/datafile/lunar_inx03 +DATA_DM01/lunars/datafile/lunar_inx04 +DATA_DM01/lunars/datafile/lunar_inx05 +DATA_DM01/lunars/datafile/lunar_inx06 +DATA_DM01/lunars/datafile/lunar_inx07 +DATA_DM01/lunars/datafile/lunar_inx08 +DATA_DM01/lunars/datafile/lunar_data01 +DATA_DM01/lunars/datafile/lunar_data02 +DATA_DM01/lunars/datafile/lunar_data03 +DATA_DM01/lunars/datafile/lunar_data04 +DATA_DM01/lunars/datafile/lunar_data05 +DATA_DM01/lunars/datafile/lunar_data06 +DATA_DM01/lunars/datafile/lunar_data07 +DATA_DM01/lunars/datafile/lunar_data08 +DATA_DM01/lunars/datafile/lunar_data09 +DATA_DM01/lunars/datafile/lunar_data10 +DATA_DM01/lunars/datafile/lunar_data11 +DATA_DM01/lunars/datafile/lunar_data12 +DATA_DM01/lunars/datafile/lunar_data13 +DATA_DM01/lunars/datafile/lunar_data14 +DATA_DM01/lunars/datafile/lunar_data15 +DATA_DM01/lunars/datafile/lunar_data16 +DATA_DM01/lunars/datafile/lunar_data17 +DATA_DM01/lunars/datafile/ac43_inx05 +DATA_DM01/lunars/datafile/ac43_inx06 +DATA_DM01/lunars/datafile/ac43_inx07 +DATA_DM01/lunars/datafile/undotbs03 +DATA_DM01/lunars/datafile/undotbs04 +DATA_DM01/lunars/datafile/bxjh_data01 +DATA_DM01/lunars/datafile/base_data +DATA_DM01/lunars/datafile/lr_public_ts.dat +DATA_DM01/lunars/datafile/lr_app_la_ts.dat +DATA_DM01/lunars/datafile/lr_app_ls_ts.dat +DATA_DM01/lunars/datafile/lr_app_lr_ts.dat +DATA_DM01/lunars/datafile/lr_idx_la_ts.dat +DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat +DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat +DATA_DM01/lunars/datafile/lr_annex_ts.dat +DATA_DM01/lunars/datafile/bxrlzydata01 +DATA_DM01/lunars/datafile/bpcm.397.802032443 +DATA_DM01/lunars/datafile/bpcm.398.802032553 +DATA_DM01/lunars/datafile/form.399.802032659 +DATA_DM01/lunars/datafile/udotbs5 +DATA_DM01/lunars/datafile/syldgx_01.dbf +DATA_DM01/lunars/datafile/system02 109 rows selected. SQL> RMAN> catalog start with '+DATA_DM01/lunars/datafile/'; searching for all files that match the pattern +DATA_DM01/lunars/datafile/ List of Files Unknown to the Database ===================================== File Name: +data_dm01/lunars/datafile/DBFS_BAK.374.793719745 File Name: +data_dm01/lunars/datafile/PENSION_TABLESPACE.333.793719745 File Name: +data_dm01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745 File Name: +data_dm01/lunars/datafile/USERS.337.793720931 File Name: +data_dm01/lunars/datafile/UNDOTBS1.338.793720931 File Name: +data_dm01/lunars/datafile/AC43_PAR.389.793728721 File Name: +data_dm01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197 File Name: +data_dm01/lunars/datafile/INDEX_AC43_TS.377.793729989 File Name: +data_dm01/lunars/datafile/UNDOTBS2.425.793742003 File Name: +data_dm01/lunars/datafile/MEDICAL_PARTITION.429.793742873 File Name: +data_dm01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417 File Name: +data_dm01/lunars/datafile/SYSAUX.446.793745257 File Name: +data_dm01/lunars/datafile/SYSTEM.448.793745389 File Name: +data_dm01/lunars/datafile/BPCM.361.802046773 File Name: +data_dm01/lunars/datafile/BPCM.362.802046921 File Name: +data_dm01/lunars/datafile/FORM.363.802046993 Do you really want to catalog the above files (enter YES or NO)? yes cataloging files... cataloging done List of Cataloged Files ======================= File Name: +data_dm01/lunars/datafile/DBFS_BAK.374.793719745 File Name: +data_dm01/lunars/datafile/PENSION_TABLESPACE.333.793719745 File Name: +data_dm01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745 File Name: +data_dm01/lunars/datafile/USERS.337.793720931 File Name: +data_dm01/lunars/datafile/UNDOTBS1.338.793720931 File Name: +data_dm01/lunars/datafile/AC43_PAR.389.793728721 File Name: +data_dm01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197 File Name: +data_dm01/lunars/datafile/INDEX_AC43_TS.377.793729989 File Name: +data_dm01/lunars/datafile/UNDOTBS2.425.793742003 File Name: +data_dm01/lunars/datafile/MEDICAL_PARTITION.429.793742873 File Name: +data_dm01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417 File Name: +data_dm01/lunars/datafile/SYSAUX.446.793745257 File Name: +data_dm01/lunars/datafile/SYSTEM.448.793745389 File Name: +data_dm01/lunars/datafile/BPCM.361.802046773 File Name: +data_dm01/lunars/datafile/BPCM.362.802046921 File Name: +data_dm01/lunars/datafile/FORM.363.802046993 RMAN> catalog datafilecopy '+DATA_DM01/lunars/datafile/users01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users05'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users06'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users07'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users08'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users09'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users10'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users11'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users12'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users13'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users14'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users15'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users16'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users17'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users18'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users19'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users20'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users21'; catalog datafilecopy '+DATA_DM01/lunars/datafile/users22'; catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/system01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/sbdata01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/sbdata02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs201'; catalog datafilecopy '+DATA_DM01/lunars/datafile/medical_part'; catalog datafilecopy '+DATA_DM01/lunars/datafile/medicalpart1'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_par'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_par01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/pension'; catalog datafilecopy '+DATA_DM01/lunars/datafile/unemployee'; catalog datafilecopy '+DATA_DM01/lunars/datafile/medicare'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunarothers'; catalog datafilecopy '+DATA_DM01/lunars/datafile/pension01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/medicare01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_l01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_g01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_g02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_l02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/pension02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts_02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx05'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx06'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx07'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx08'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data02'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data05'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data06'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data07'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data08'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data09'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data10'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data11'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data12'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data13'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data14'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data15'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data16'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data17'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx05'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx06'; catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx07'; catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs03'; catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs04'; catalog datafilecopy '+DATA_DM01/lunars/datafile/bxjh_data01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/base_data'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_public_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_la_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_ls_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_lr_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_la_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_annex_ts.dat'; catalog datafilecopy '+DATA_DM01/lunars/datafile/bxrlzydata01'; catalog datafilecopy '+DATA_DM01/lunars/datafile/udotbs5'; catalog datafilecopy '+DATA_DM01/lunars/datafile/syldgx_01.dbf'; 有两个文件有问题,需要重新备份(后来根据时间等信息判断,这两个文件时我昨晚开始做备份后,他们新增加的文件,因此没有包含在昨晚的备份集): RMAN> RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of catalog command on default channel at 09/10/2013 10:44:50 ORA-19625: error identifying file +DATA_DM01/lunars/datafile/udotbs5 ORA-17503: ksfdopn:2 Failed to open file +DATA_DM01/lunars/datafile/udotbs5 ORA-15173: entry 'udotbs5' does not exist in directory 'datafile' RMAN> RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of catalog command on default channel at 09/10/2013 10:44:50 ORA-19625: error identifying file +DATA_DM01/lunars/datafile/syldgx_01.dbf ORA-17503: ksfdopn:2 Failed to open file +DATA_DM01/lunars/datafile/syldgx_01.dbf ORA-15173: entry 'syldgx_01.dbf' does not exist in directory 'datafile' RMAN> SQL> select * from v$datafile where name in ('+DATA_DM01/lunars/datafile/udotbs5','+DATA_DM01/lunars/datafile/syldgx_01.dbf'); FILE# CREATION_CHANGE# CREATION_TIM TS# RFILE# STATUS ENABLED CHECKPOINT_CHANGE# CHECKPOINT_T UNRECOVERABLE_CHANGE# UNRECOVERABL ---------- ---------------- ------------ ---------- ---------- ------- ---------- ------------------ ------------ --------------------- ------------ LAST_CHANGE# LAST_TIME OFFLINE_CHANGE# ONLINE_CHANGE# ONLINE_TIME BYTES BLOCKS CREATE_BYTES BLOCK_SIZE ------------ ------------ --------------- -------------- ------------ ---------- ---------- ------------ ---------- NAME PLUGGED_IN BLOCK1_OFFSET ---------------------------------------------------------------------------------------------------- ---------- ------------- AUX_NAME ----------------------------------------------------------------------------------------------------------------------------------------------------- FIRST_NONLOGGED_SCN FIRST_NONLOG FOREIGN_DBID FOREIGN_CREATION_CHANGE# FOREIGN_CREA PLU PLUGIN_CHANGE# PLUGIN_RESETLOGS_CHANGE# PLUGIN_RESET ------------------- ------------ ------------ ------------------------ ------------ --- -------------- ------------------------ ------------ 107 1.2743E+13 13-MAY-13 2 107 ONLINE READ WRITE 1.2762E+13 09-SEP-13 0 0 0 0 0 1.0737E+10 8192 +DATA_DM01/lunars/datafile/udotbs5 0 4294967295 NONE 0 0 0 NO 0 0 108 1.2744E+13 15-JUL-13 65 108 ONLINE READ WRITE 1.2762E+13 09-SEP-13 0 0 0 0 0 1.0737E+10 8192 +DATA_DM01/lunars/datafile/syldgx_01.dbf 0 4294967295 NONE 0 0 0 NO 0 0 SQL> SQL> set linesize 149 SQL> set pages 999 SQL> / FILE# CREATION_CHANGE# CREATION_TIM TS# RFILE# STATUS ENABLED CHECKPOINT_CHANGE# CHECKPOINT_T UNRECOVERABLE_CHANGE# UNRECOVERABL ---------- ---------------- ------------ ---------- ---------- ------- ---------- ------------------ ------------ --------------------- ------------ LAST_CHANGE# LAST_TIME OFFLINE_CHANGE# ONLINE_CHANGE# ONLINE_TIME BYTES BLOCKS CREATE_BYTES BLOCK_SIZE ------------ ------------ --------------- -------------- ------------ ---------- ---------- ------------ ---------- NAME ----------------------------------------------------------------------------------------------------------------------------------------------------- PLUGGED_IN BLOCK1_OFFSET ---------- ------------- AUX_NAME ----------------------------------------------------------------------------------------------------------------------------------------------------- FIRST_NONLOGGED_SCN FIRST_NONLOG FOREIGN_DBID FOREIGN_CREATION_CHANGE# FOREIGN_CREA PLU PLUGIN_CHANGE# PLUGIN_RESETLOGS_CHANGE# PLUGIN_RESET ------------------- ------------ ------------ ------------------------ ------------ --- -------------- ------------------------ ------------ 109 1.2752E+13 09-AUG-13 0 109 SYSTEM READ WRITE 1.2762E+13 09-SEP-13 0 0 0 1073741824 131072 1073741824 8192 +DATA_DM01/bjlunar/datafile/system02 0 4294967295 NONE 0 0 0 NO 0 0 SQL>
总共新增加了3个文件,重新备份这3个文件即可:
[oracle@dm01db01 scripts]$ ./temp.sh ./temp.sh: line 1: i#!/bin/sh: No such file or directory Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 10:30:29 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: bjlunar (DBID=4088537672) RMAN> Starting backup at 10-SEP-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1432 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=105 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=201 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=293 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=675 instance=bjlunar1 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=872 instance=bjlunar1 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00107 name=+DATA_DM01/bjlunar/datafile/udotbs5 channel ORA_DISK_1: starting piece 1 at 10-SEP-13 channel ORA_DISK_2: starting full datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00108 name=+DATA_DM01/bjlunar/datafile/syldgx_01.dbf channel ORA_DISK_2: starting piece 1 at 10-SEP-13 channel ORA_DISK_3: starting full datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00109 name=+DATA_DM01/bjlunar/datafile/system02 channel ORA_DISK_3: starting piece 1 at 10-SEP-13 channel ORA_DISK_3: finished piece 1 at 10-SEP-13 piece handle=/u03/datafile_62ojg8q8_1_1 tag=DF comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_2: finished piece 1 at 10-SEP-13 piece handle=/u03/datafile_61ojg8q8_1_1 tag=DF comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03 channel ORA_DISK_1: finished piece 1 at 10-SEP-13 piece handle=/u03/datafile_60ojg8q8_1_1 tag=DF comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 Finished backup at 10-SEP-13 Starting Control File and SPFILE Autobackup at 10-SEP-13 piece handle=/u03/ctsp_c-4088537672-20130910-01 comment=NONE Finished Control File and SPFILE Autobackup at 10-SEP-13 RMAN> Recovery Manager complete. [oracle@dm01db01 scripts]$ [oracle@dm01db01 u03]$ ls -lrt /u03/datafile* -rw-r----- 1 oracle asmadmin 5144576 Sep 10 2013 /u03/datafile_62ojg8q8_1_1 -rw-r----- 1 oracle asmadmin 45178880 Sep 10 2013 /u03/datafile_61ojg8q8_1_1 -rw-r----- 1 oracle asmadmin 190144512 Sep 10 2013 /u03/datafile_60ojg8q8_1_1 [oracle@dm01db01 u03]$ catalog backuppiece '/u03/datafile_62ojg8q8_1_1'; catalog backuppiece '/u03/datafile_61ojg8q8_1_1'; catalog backuppiece '/u03/datafile_60ojg8q8_1_1'; RMAN> restore datafile 107,108,109; Starting restore at 10-SEP-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=853 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=1141 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=1991 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=3 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=289 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=574 device type=DISK skipping datafile 108; already restored to file +DATA_DM01/lunars/datafile/syldgx_01.dbf skipping datafile 109; already restored to file +DATA_DM01/lunars/datafile/system02 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 00107 to +DATA_DM01/lunars/datafile/udotbs5 channel ORA_DISK_1: reading from backup piece /u03/datafile_60ojg8q8_1_1 channel ORA_DISK_1: piece handle=/u03/datafile_60ojg8q8_1_1 tag=DF channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:45 Finished restore at 10-SEP-13 RMAN>
现有ASM的文件信息如下:
可以看见,一部分是系统定义的文件名,一部分使用了别名,后面会针对这两个种情况分别处理一下: 1 ASMCMD> ls -l Type Redund Striped Time Sys Name DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.368.793731515 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.369.793732151 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.370.793732783 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.371.793732783 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.372.793732783 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.393.793733313 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.394.793733891 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.395.793733893 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.421.793740913 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.422.793741589 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.423.793741589 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_PAR.389.793728721 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_PAR.426.793742681 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BASE.441.793744845 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y BPCM.361.802046773 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y BPCM.362.802046921 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunarOTHERS_TABLESPACE.431.793743417 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.404.793736097 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.405.793736561 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.406.793737193 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.407.793737193 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.408.793737195 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.409.793737659 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.410.793738289 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.411.793738291 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.412.793738291 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.413.793738745 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.414.793739389 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.415.793739389 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.416.793739391 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.417.793739835 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.418.793740489 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.419.793740489 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.420.793740491 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_GLOBAL.392.793729979 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_GLOBAL.436.793744213 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_LOCAL.391.793729977 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_LOCAL.437.793744315 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.396.793733893 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.397.793734387 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.398.793734997 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.399.793734997 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.400.793734997 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.401.793735473 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.402.793736095 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.403.793736095 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BXJH_DATA.440.793744677 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BXRLZYDATA.469.795147351 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y DBFS_BAK.374.793719745 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y FORM.363.802046993 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.349.793730593 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y INDEX_AC43_TS.377.793729989 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.432.793743487 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.433.793743601 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.434.793744149 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_ANNEX_TS.452.793745441 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LA_TS.443.793744957 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LR_TS.445.793745207 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LS_TS.444.793745039 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LA_TS.449.793745391 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LR_TS.451.793745439 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LS_TS.450.793745439 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_PUBLIC_TS.442.793744895 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICAL_PARTITION.429.793742873 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICAL_PARTITION.430.793743413 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.334.793719745 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.336.793720929 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.366.793731459 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.333.793719745 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.335.793719745 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.367.793731469 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SBDATA.387.793728719 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SBDATA.435.793744151 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYLDGXNW.315.825765561 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y SYSAUX.446.793745257 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYSTEM.317.825765561 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYSTEM.447.793745307 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y SYSTEM.448.793745389 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.316.825765669 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y UNDOTBS1.338.793720931 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.424.793741591 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.438.793744525 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.439.793744585 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS2.388.793728719 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y UNDOTBS2.425.793742003 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNEMPLOYEE_TABLESPACE.390.793729197 DATAFILE UNPROT COARSE SEP 10 10:00:00 Y USERS.337.793720931 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.339.793722107 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.340.793722107 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.341.793722107 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.342.793723209 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.343.793723211 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.344.793723213 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.345.793724313 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.346.793724315 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.347.793724315 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.348.793725415 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.375.793725415 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.378.793725423 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.379.793726523 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.380.793726523 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.381.793726525 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.382.793726999 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.383.793727621 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.384.793727621 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.385.793727621 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.386.793728097 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.427.793742681 DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.428.793742685 N ac43_data01 => +DATA_DM01/lunars/datafile/AC43_DATA.368.793731515 N ac43_data02 => +DATA_DM01/lunars/datafile/AC43_DATA.369.793732151 N ac43_data03 => +DATA_DM01/lunars/datafile/AC43_DATA.370.793732783 N ac43_data04 => +DATA_DM01/lunars/datafile/AC43_DATA.371.793732783 N ac43_inx01 => +DATA_DM01/lunars/datafile/AC43_INX.372.793732783 N ac43_inx02 => +DATA_DM01/lunars/datafile/AC43_INX.393.793733313 N ac43_inx03 => +DATA_DM01/lunars/datafile/AC43_INX.394.793733891 N ac43_inx04 => +DATA_DM01/lunars/datafile/AC43_INX.395.793733893 N ac43_inx05 => +DATA_DM01/lunars/datafile/AC43_INX.421.793740913 N ac43_inx06 => +DATA_DM01/lunars/datafile/AC43_INX.422.793741589 N ac43_inx07 => +DATA_DM01/lunars/datafile/AC43_INX.423.793741589 N ac43_par => +DATA_DM01/lunars/datafile/AC43_PAR.389.793728721 N ac43_par01 => +DATA_DM01/lunars/datafile/AC43_PAR.426.793742681 N base_data => +DATA_DM01/lunars/datafile/BASE.441.793744845 N lunar_data01 => +DATA_DM01/lunars/datafile/lunar_DATA.404.793736097 N lunar_data02 => +DATA_DM01/lunars/datafile/lunar_DATA.405.793736561 N lunar_data03 => +DATA_DM01/lunars/datafile/lunar_DATA.406.793737193 N lunar_data04 => +DATA_DM01/lunars/datafile/lunar_DATA.407.793737193 N lunar_data05 => +DATA_DM01/lunars/datafile/lunar_DATA.408.793737195 N lunar_data06 => +DATA_DM01/lunars/datafile/lunar_DATA.409.793737659 N lunar_data07 => +DATA_DM01/lunars/datafile/lunar_DATA.410.793738289 N lunar_data08 => +DATA_DM01/lunars/datafile/lunar_DATA.411.793738291 N lunar_data09 => +DATA_DM01/lunars/datafile/lunar_DATA.412.793738291 N lunar_data10 => +DATA_DM01/lunars/datafile/lunar_DATA.413.793738745 N lunar_data11 => +DATA_DM01/lunars/datafile/lunar_DATA.414.793739389 N lunar_data12 => +DATA_DM01/lunars/datafile/lunar_DATA.415.793739389 N lunar_data13 => +DATA_DM01/lunars/datafile/lunar_DATA.416.793739391 N lunar_data14 => +DATA_DM01/lunars/datafile/lunar_DATA.417.793739835 N lunar_data15 => +DATA_DM01/lunars/datafile/lunar_DATA.418.793740489 N lunar_data16 => +DATA_DM01/lunars/datafile/lunar_DATA.419.793740489 N lunar_data17 => +DATA_DM01/lunars/datafile/lunar_DATA.420.793740491 N lunar_index_g01 => +DATA_DM01/lunars/datafile/lunar_INDEX_GLOBAL.392.793729979 N lunar_index_g02 => +DATA_DM01/lunars/datafile/lunar_INDEX_GLOBAL.436.793744213 N lunar_index_l01 => +DATA_DM01/lunars/datafile/lunar_INDEX_LOCAL.391.793729977 N lunar_index_l02 => +DATA_DM01/lunars/datafile/lunar_INDEX_LOCAL.437.793744315 N lunar_inx01 => +DATA_DM01/lunars/datafile/lunar_INX.396.793733893 N lunar_inx02 => +DATA_DM01/lunars/datafile/lunar_INX.397.793734387 N lunar_inx03 => +DATA_DM01/lunars/datafile/lunar_INX.398.793734997 N lunar_inx04 => +DATA_DM01/lunars/datafile/lunar_INX.399.793734997 N lunar_inx05 => +DATA_DM01/lunars/datafile/lunar_INX.400.793734997 N lunar_inx06 => +DATA_DM01/lunars/datafile/lunar_INX.401.793735473 N lunar_inx07 => +DATA_DM01/lunars/datafile/lunar_INX.402.793736095 N lunar_inx08 => +DATA_DM01/lunars/datafile/lunar_INX.403.793736095 N lunarothers => +DATA_DM01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417 N bxjh_data01 => +DATA_DM01/lunars/datafile/BXJH_DATA.440.793744677 N bxrlzydata01 => +DATA_DM01/lunars/datafile/BXRLZYDATA.469.795147351 N index_ac43_ts03 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.433.793743601 N index_ac43_ts04 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.434.793744149 N index_ac43_ts_02 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.432.793743487 N lr_annex_ts.dat => +DATA_DM01/lunars/datafile/LR_ANNEX_TS.452.793745441 N lr_app_la_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LA_TS.443.793744957 N lr_app_lr_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LR_TS.445.793745207 N lr_app_ls_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LS_TS.444.793745039 N lr_idx_la_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LA_TS.449.793745391 N lr_idx_lr_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LR_TS.451.793745439 N lr_idx_ls_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LS_TS.450.793745439 N lr_public_ts.dat => +DATA_DM01/lunars/datafile/LR_PUBLIC_TS.442.793744895 N lr_temp_ts.dat => +DATA_DM01/lunars/TEMPFILE/LR_TEMP_TS.360.801788791 N medical_part => +DATA_DM01/lunars/datafile/MEDICAL_PARTITION.429.793742873 N medicalpart1 => +DATA_DM01/lunars/datafile/MEDICAL_PARTITION.430.793743413 N medicare => +DATA_DM01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745 N medicare01 => +DATA_DM01/lunars/datafile/MEDICARE_TABLESPACE.336.793720929 N pension => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.333.793719745 N pension01 => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.335.793719745 N pension02 => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.367.793731469 N sbdata01 => +DATA_DM01/lunars/datafile/SBDATA.387.793728719 N sbdata02 => +DATA_DM01/lunars/datafile/SBDATA.435.793744151 N syldgx_01.dbf => +DATA_DM01/lunars/datafile/SYLDGXNW.315.825765561 N system01 => +DATA_DM01/lunars/datafile/SYSTEM.447.793745307 N system02 => +DATA_DM01/lunars/datafile/SYSTEM.317.825765561 N udotbs5 => +DATA_DM01/lunars/datafile/UNDOTBS1.316.825765669 N undotbs02 => +DATA_DM01/lunars/datafile/UNDOTBS1.424.793741591 N undotbs03 => +DATA_DM01/lunars/datafile/UNDOTBS1.438.793744525 N undotbs04 => +DATA_DM01/lunars/datafile/UNDOTBS1.439.793744585 N undotbs201 => +DATA_DM01/lunars/datafile/UNDOTBS2.388.793728719 N unemployee => +DATA_DM01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197 N users01 => +DATA_DM01/lunars/datafile/USERS.339.793722107 N users02 => +DATA_DM01/lunars/datafile/USERS.427.793742681 N users03 => +DATA_DM01/lunars/datafile/USERS.428.793742685 N users04 => +DATA_DM01/lunars/datafile/USERS.340.793722107 N users05 => +DATA_DM01/lunars/datafile/USERS.341.793722107 N users06 => +DATA_DM01/lunars/datafile/USERS.342.793723209 N users07 => +DATA_DM01/lunars/datafile/USERS.343.793723211 N users08 => +DATA_DM01/lunars/datafile/USERS.344.793723213 N users09 => +DATA_DM01/lunars/datafile/USERS.345.793724313 N users10 => +DATA_DM01/lunars/datafile/USERS.346.793724315 N users11 => +DATA_DM01/lunars/datafile/USERS.347.793724315 N users12 => +DATA_DM01/lunars/datafile/USERS.348.793725415 N users13 => +DATA_DM01/lunars/datafile/USERS.375.793725415 N users14 => +DATA_DM01/lunars/datafile/USERS.378.793725423 N users15 => +DATA_DM01/lunars/datafile/USERS.379.793726523 N users16 => +DATA_DM01/lunars/datafile/USERS.380.793726523 N users17 => +DATA_DM01/lunars/datafile/USERS.381.793726525 N users18 => +DATA_DM01/lunars/datafile/USERS.382.793726999 N users19 => +DATA_DM01/lunars/datafile/USERS.383.793727621 N users20 => +DATA_DM01/lunars/datafile/USERS.384.793727621 N users21 => +DATA_DM01/lunars/datafile/USERS.385.793727621 N users22 => +DATA_DM01/lunars/datafile/USERS.386.793728097 ASMCMD>
先把最新创建的3个文件还原出来: RMAN> restore datafile 107,108,109; Starting restore at 10-SEP-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1991 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=1710 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=1993 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=4 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=289 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=574 device type=DISK datafile 107 is already restored to file +DATA_DM01/lunars/datafile/udotbs5 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 00109 to +DATA_DM01/lunars/datafile/system02 channel ORA_DISK_1: reading from backup piece /u03/datafile_62ojg8q8_1_1 channel ORA_DISK_2: starting datafile backup set restore channel ORA_DISK_2: specifying datafile(s) to restore from backup set channel ORA_DISK_2: restoring datafile 00108 to +DATA_DM01/lunars/datafile/syldgx_01.dbf channel ORA_DISK_2: reading from backup piece /u03/datafile_61ojg8q8_1_1 channel ORA_DISK_1: piece handle=/u03/datafile_62ojg8q8_1_1 tag=DF channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:15 channel ORA_DISK_2: piece handle=/u03/datafile_61ojg8q8_1_1 tag=DF channel ORA_DISK_2: restored backup piece 1 channel ORA_DISK_2: restore complete, elapsed time: 00:00:45 Finished restore at 10-SEP-13 RMAN>
有两个错误,这个是因为上面操作时没有注意到数据库中有2个offline的数据文件,下次操作记得备份时把offline的文件不要备份就好了。。。。。。
RMAN> catalog datafilecopy '+DATA_DM01/lunars/datafile/system02'; cataloged datafile copy datafile copy file name=+DATA_DM01/lunars/datafile/system02 RECID=123 STAMP=825767730 RMAN> catalog datafilecopy '+DATA_DM01/lunars/datafile/syldgx_01.dbf'; cataloged datafile copy datafile copy file name=+DATA_DM01/lunars/datafile/syldgx_01.dbf RECID=124 STAMP=825767734 RMAN> RMAN> switch database to copy; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of switch to copy command at 09/10/2013 11:55:59 RMAN-06571: datafile 48 does not have recoverable copy RMAN> catalog datafilecopy '+DATA_DM01/index_ac43_ts_01'; catalog datafilecopy '+DATA_DM01/medicare02'; cataloged datafile copy datafile copy file name=+DATA_DM01/index_ac43_ts_01 RECID=125 STAMP=825768749 RMAN> cataloged datafile copy datafile copy file name=+DATA_DM01/medicare02 RECID=126 STAMP=825768749 RMAN> switch database to copy; datafile 1 switched to datafile copy "+DATA_DM01/lunars/datafile/system.448.793745389" datafile 2 switched to datafile copy "+DATA_DM01/lunars/datafile/sysaux.446.793745257" datafile 3 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs1.338.793720931" datafile 4 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs2.425.793742003" datafile 5 switched to datafile copy "+DATA_DM01/lunars/datafile/users.337.793720931" datafile 6 switched to datafile copy "+DATA_DM01/lunars/datafile/users01" datafile 7 switched to datafile copy "+DATA_DM01/lunars/datafile/users02" datafile 8 switched to datafile copy "+DATA_DM01/lunars/datafile/users03" datafile 9 switched to datafile copy "+DATA_DM01/lunars/datafile/users04" datafile 10 switched to datafile copy "+DATA_DM01/lunars/datafile/users05" datafile 11 switched to datafile copy "+DATA_DM01/lunars/datafile/users06" datafile 12 switched to datafile copy "+DATA_DM01/lunars/datafile/users07" datafile 13 switched to datafile copy "+DATA_DM01/lunars/datafile/users08" datafile 14 switched to datafile copy "+DATA_DM01/lunars/datafile/users09" datafile 15 switched to datafile copy "+DATA_DM01/lunars/datafile/users10" datafile 16 switched to datafile copy "+DATA_DM01/lunars/datafile/users11" datafile 17 switched to datafile copy "+DATA_DM01/lunars/datafile/users12" datafile 18 switched to datafile copy "+DATA_DM01/lunars/datafile/users13" datafile 19 switched to datafile copy "+DATA_DM01/lunars/datafile/users14" datafile 20 switched to datafile copy "+DATA_DM01/lunars/datafile/users15" datafile 21 switched to datafile copy "+DATA_DM01/lunars/datafile/users16" datafile 22 switched to datafile copy "+DATA_DM01/lunars/datafile/users17" datafile 23 switched to datafile copy "+DATA_DM01/lunars/datafile/users18" datafile 24 switched to datafile copy "+DATA_DM01/lunars/datafile/users19" datafile 25 switched to datafile copy "+DATA_DM01/lunars/datafile/users20" datafile 26 switched to datafile copy "+DATA_DM01/lunars/datafile/users21" datafile 27 switched to datafile copy "+DATA_DM01/lunars/datafile/users22" datafile 28 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs02" datafile 29 switched to datafile copy "+DATA_DM01/lunars/datafile/system01" datafile 30 switched to datafile copy "+DATA_DM01/lunars/datafile/sbdata01" datafile 31 switched to datafile copy "+DATA_DM01/lunars/datafile/sbdata02" datafile 32 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs201" datafile 33 switched to datafile copy "+DATA_DM01/lunars/datafile/medical_part" datafile 34 switched to datafile copy "+DATA_DM01/lunars/datafile/medicalpart1" datafile 35 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_par" datafile 36 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_par01" datafile 37 switched to datafile copy "+DATA_DM01/lunars/datafile/pension" datafile 38 switched to datafile copy "+DATA_DM01/lunars/datafile/unemployee" datafile 39 switched to datafile copy "+DATA_DM01/lunars/datafile/medicare" datafile 40 switched to datafile copy "+DATA_DM01/lunars/datafile/lunarothers" datafile 41 switched to datafile copy "+DATA_DM01/lunars/datafile/pension01" datafile 42 switched to datafile copy "+DATA_DM01/lunars/datafile/medicare01" datafile 43 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_l01" datafile 44 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_g01" datafile 45 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_g02" datafile 46 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_l02" datafile 47 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts.377.793729989" datafile 48 switched to datafile copy "+DATA_DM01/index_ac43_ts_01" datafile 49 switched to datafile copy "+DATA_DM01/lunars/datafile/dbfs_bak.374.793719745" datafile 50 switched to datafile copy "+DATA_DM01/medicare02" datafile 51 switched to datafile copy "+DATA_DM01/lunars/datafile/pension02" datafile 52 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts_02" datafile 53 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts03" datafile 54 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts04" datafile 55 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data01" datafile 56 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data02" datafile 57 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data03" datafile 58 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data04" datafile 59 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx01" datafile 60 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx02" datafile 61 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx03" datafile 62 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx04" datafile 63 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx01" datafile 64 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx02" datafile 65 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx03" datafile 66 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx04" datafile 67 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx05" datafile 68 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx06" datafile 69 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx07" datafile 70 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx08" datafile 71 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data01" datafile 72 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data02" datafile 73 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data03" datafile 74 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data04" datafile 75 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data05" datafile 76 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data06" datafile 77 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data07" datafile 78 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data08" datafile 79 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data09" datafile 80 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data10" datafile 81 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data11" datafile 82 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data12" datafile 83 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data13" datafile 84 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data14" datafile 85 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data15" datafile 86 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data16" datafile 87 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data17" datafile 88 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx05" datafile 89 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx06" datafile 90 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx07" datafile 91 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs03" datafile 92 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs04" datafile 93 switched to datafile copy "+DATA_DM01/lunars/datafile/bxjh_data01" datafile 94 switched to datafile copy "+DATA_DM01/lunars/datafile/base_data" datafile 95 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_public_ts.dat" datafile 96 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_la_ts.dat" datafile 97 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_ls_ts.dat" datafile 98 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_lr_ts.dat" datafile 99 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_la_ts.dat" datafile 100 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat" datafile 101 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat" datafile 102 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_annex_ts.dat" datafile 103 switched to datafile copy "+DATA_DM01/lunars/datafile/bxrlzydata01" datafile 104 switched to datafile copy "+DATA_DM01/lunars/datafile/bpcm.361.802046773" datafile 105 switched to datafile copy "+DATA_DM01/lunars/datafile/bpcm.362.802046921" datafile 106 switched to datafile copy "+DATA_DM01/lunars/datafile/form.363.802046993" datafile 107 switched to datafile copy "+DATA_DM01/lunars/datafile/udotbs5" datafile 108 switched to datafile copy "+DATA_DM01/lunars/datafile/syldgx_01.dbf" datafile 109 switched to datafile copy "+DATA_DM01/lunars/datafile/system02" RMAN> SQL> set linesize 149 SQL> set pages 999 SQL> col name for a70 SQL> col name for a90 SQL> select file#,name,status from v$datafile_header where status!='ONLINE'; FILE# NAME STATUS ---------- ------------------------------------------------------------------------------------------ ------- 48 +DATA_DM01/index_ac43_ts_01 OFFLINE 50 +DATA_DM01/medicare02 OFFLINE SQL> select file#,name,status from v$datafile where file# in (48,50); FILE# NAME STATUS ---------- ------------------------------------------------------------------------------------------ ------- 48 +DATA_DM01/index_ac43_ts_01 RECOVER 50 +DATA_DM01/medicare02 RECOVER SQL> 这两个文件时offline的,等recover database之后一起处理。。。。。
<bold>开始recover database,这个过程非常慢长,主要原因:
1,存储着实太差了。。。。。。
2,网络速度太差了(这个是NFS的空间)
3,ASM在recover 时需要tuning
</bold>
RMAN> recover database; Starting recover at 10-SEP-13 using channel ORA_DISK_1 using channel ORA_DISK_2 using channel ORA_DISK_3 using channel ORA_DISK_4 using channel ORA_DISK_5 using channel ORA_DISK_6 channel ORA_DISK_1: starting incremental datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00007: +DATA_DM01/lunars/datafile/users02 destination for restore of datafile 00049: +DATA_DM01/lunars/datafile/dbfs_bak.374.793719745 destination for restore of datafile 00051: +DATA_DM01/lunars/datafile/pension02 destination for restore of datafile 00053: +DATA_DM01/lunars/datafile/index_ac43_ts03 destination for restore of datafile 00060: +DATA_DM01/lunars/datafile/ac43_inx02 destination for restore of datafile 00066: +DATA_DM01/lunars/datafile/lunar_inx04 destination for restore of datafile 00072: +DATA_DM01/lunars/datafile/lunar_data02 destination for restore of datafile 00078: +DATA_DM01/lunars/datafile/lunar_data08 destination for restore of datafile 00084: +DATA_DM01/lunars/datafile/lunar_data14 destination for restore of datafile 00090: +DATA_DM01/lunars/datafile/ac43_inx07 destination for restore of datafile 00092: +DATA_DM01/lunars/datafile/undotbs04 destination for restore of datafile 00097: +DATA_DM01/lunars/datafile/lr_app_ls_ts.dat destination for restore of datafile 00101: +DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat destination for restore of datafile 00102: +DATA_DM01/lunars/datafile/lr_annex_ts.dat channel ORA_DISK_1: reading from backup piece /u03/ForStandby_5oojeeb6_1_1 channel ORA_DISK_2: starting incremental datafile backup set restore channel ORA_DISK_2: specifying datafile(s) to restore from backup set destination for restore of datafile 00001: +DATA_DM01/lunars/datafile/system.448.793745389 destination for restore of datafile 00009: +DATA_DM01/lunars/datafile/users04 destination for restore of datafile 00013: +DATA_DM01/lunars/datafile/users08 destination for restore of datafile 00018: +DATA_DM01/lunars/datafile/users13 destination for restore of datafile 00023: +DATA_DM01/lunars/datafile/users18 destination for restore of datafile 00030: +DATA_DM01/lunars/datafile/sbdata01 destination for restore of datafile 00042: +DATA_DM01/lunars/datafile/medicare01 destination for restore of datafile 00044: +DATA_DM01/lunars/datafile/lunar_index_g01 destination for restore of datafile 00046: +DATA_DM01/lunars/datafile/lunar_index_l02 destination for restore of datafile 00052: +DATA_DM01/lunars/datafile/index_ac43_ts_02 destination for restore of datafile 00056: +DATA_DM01/lunars/datafile/ac43_data02 destination for restore of datafile 00062: +DATA_DM01/lunars/datafile/ac43_inx04 destination for restore of datafile 00068: +DATA_DM01/lunars/datafile/lunar_inx06 destination for restore of datafile 00074: +DATA_DM01/lunars/datafile/lunar_data04 destination for restore of datafile 00080: +DATA_DM01/lunars/datafile/lunar_data10 destination for restore of datafile 00086: +DATA_DM01/lunars/datafile/lunar_data16 destination for restore of datafile 00103: +DATA_DM01/lunars/datafile/bxrlzydata01 destination for restore of datafile 00105: +DATA_DM01/lunars/datafile/bpcm.362.802046921 channel ORA_DISK_2: reading from backup piece /u03/ForStandby_5sojeeb7_1_1 channel ORA_DISK_3: starting incremental datafile backup set restore channel ORA_DISK_3: specifying datafile(s) to restore from backup set destination for restore of datafile 00006: +DATA_DM01/lunars/datafile/users01 destination for restore of datafile 00012: +DATA_DM01/lunars/datafile/users07 destination for restore of datafile 00017: +DATA_DM01/lunars/datafile/users12 destination for restore of datafile 00022: +DATA_DM01/lunars/datafile/users17 destination for restore of datafile 00027: +DATA_DM01/lunars/datafile/users22 destination for restore of datafile 00040: +DATA_DM01/lunars/datafile/lunarothers destination for restore of datafile 00041: +DATA_DM01/lunars/datafile/pension01 destination for restore of datafile 00043: +DATA_DM01/lunars/datafile/lunar_index_l01 destination for restore of datafile 00045: +DATA_DM01/lunars/datafile/lunar_index_g02 destination for restore of datafile 00055: +DATA_DM01/lunars/datafile/ac43_data01 destination for restore of datafile 00061: +DATA_DM01/lunars/datafile/ac43_inx03 destination for restore of datafile 00067: +DATA_DM01/lunars/datafile/lunar_inx05 destination for restore of datafile 00073: +DATA_DM01/lunars/datafile/lunar_data03 destination for restore of datafile 00079: +DATA_DM01/lunars/datafile/lunar_data09 destination for restore of datafile 00085: +DATA_DM01/lunars/datafile/lunar_data15 destination for restore of datafile 00104: +DATA_DM01/lunars/datafile/bpcm.361.802046773 destination for restore of datafile 00106: +DATA_DM01/lunars/datafile/form.363.802046993 channel ORA_DISK_3: reading from backup piece /u03/ForStandby_5rojeeb7_1_1 channel ORA_DISK_4: starting incremental datafile backup set restore channel ORA_DISK_4: specifying datafile(s) to restore from backup set destination for restore of datafile 00004: +DATA_DM01/lunars/datafile/undotbs2.425.793742003 destination for restore of datafile 00008: +DATA_DM01/lunars/datafile/users03 destination for restore of datafile 00011: +DATA_DM01/lunars/datafile/users06 destination for restore of datafile 00015: +DATA_DM01/lunars/datafile/users10 destination for restore of datafile 00020: +DATA_DM01/lunars/datafile/users15 destination for restore of datafile 00025: +DATA_DM01/lunars/datafile/users20 destination for restore of datafile 00029: +DATA_DM01/lunars/datafile/system01 destination for restore of datafile 00035: +DATA_DM01/lunars/datafile/ac43_par destination for restore of datafile 00039: +DATA_DM01/lunars/datafile/medicare destination for restore of datafile 00054: +DATA_DM01/lunars/datafile/index_ac43_ts04 destination for restore of datafile 00058: +DATA_DM01/lunars/datafile/ac43_data04 destination for restore of datafile 00064: +DATA_DM01/lunars/datafile/lunar_inx02 destination for restore of datafile 00070: +DATA_DM01/lunars/datafile/lunar_inx08 destination for restore of datafile 00076: +DATA_DM01/lunars/datafile/lunar_data06 destination for restore of datafile 00082: +DATA_DM01/lunars/datafile/lunar_data12 destination for restore of datafile 00088: +DATA_DM01/lunars/datafile/ac43_inx05 destination for restore of datafile 00095: +DATA_DM01/lunars/datafile/lr_public_ts.dat destination for restore of datafile 00099: +DATA_DM01/lunars/datafile/lr_idx_la_ts.dat channel ORA_DISK_4: reading from backup piece /u03/ForStandby_5qojeeb7_1_1 channel ORA_DISK_5: starting incremental datafile backup set restore channel ORA_DISK_5: specifying datafile(s) to restore from backup set destination for restore of datafile 00003: +DATA_DM01/lunars/datafile/undotbs1.338.793720931 destination for restore of datafile 00005: +DATA_DM01/lunars/datafile/users.337.793720931 destination for restore of datafile 00016: +DATA_DM01/lunars/datafile/users11 destination for restore of datafile 00021: +DATA_DM01/lunars/datafile/users16 destination for restore of datafile 00026: +DATA_DM01/lunars/datafile/users21 destination for restore of datafile 00033: +DATA_DM01/lunars/datafile/medical_part destination for restore of datafile 00036: +DATA_DM01/lunars/datafile/ac43_par01 destination for restore of datafile 00038: +DATA_DM01/lunars/datafile/unemployee destination for restore of datafile 00059: +DATA_DM01/lunars/datafile/ac43_inx01 destination for restore of datafile 00065: +DATA_DM01/lunars/datafile/lunar_inx03 destination for restore of datafile 00071: +DATA_DM01/lunars/datafile/lunar_data01 destination for restore of datafile 00077: +DATA_DM01/lunars/datafile/lunar_data07 destination for restore of datafile 00083: +DATA_DM01/lunars/datafile/lunar_data13 destination for restore of datafile 00089: +DATA_DM01/lunars/datafile/ac43_inx06 destination for restore of datafile 00091: +DATA_DM01/lunars/datafile/undotbs03 destination for restore of datafile 00094: +DATA_DM01/lunars/datafile/base_data destination for restore of datafile 00096: +DATA_DM01/lunars/datafile/lr_app_la_ts.dat destination for restore of datafile 00100: +DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat channel ORA_DISK_5: reading from backup piece /u03/ForStandby_5pojeeb7_1_1 channel ORA_DISK_6: starting incremental datafile backup set restore channel ORA_DISK_6: specifying datafile(s) to restore from backup set destination for restore of datafile 00002: +DATA_DM01/lunars/datafile/sysaux.446.793745257 destination for restore of datafile 00010: +DATA_DM01/lunars/datafile/users05 destination for restore of datafile 00014: +DATA_DM01/lunars/datafile/users09 destination for restore of datafile 00019: +DATA_DM01/lunars/datafile/users14 destination for restore of datafile 00024: +DATA_DM01/lunars/datafile/users19 destination for restore of datafile 00028: +DATA_DM01/lunars/datafile/undotbs02 destination for restore of datafile 00031: +DATA_DM01/lunars/datafile/sbdata02 destination for restore of datafile 00032: +DATA_DM01/lunars/datafile/undotbs201 destination for restore of datafile 00034: +DATA_DM01/lunars/datafile/medicalpart1 destination for restore of datafile 00037: +DATA_DM01/lunars/datafile/pension destination for restore of datafile 00047: +DATA_DM01/lunars/datafile/index_ac43_ts.377.793729989 destination for restore of datafile 00057: +DATA_DM01/lunars/datafile/ac43_data03 destination for restore of datafile 00063: +DATA_DM01/lunars/datafile/lunar_inx01 destination for restore of datafile 00069: +DATA_DM01/lunars/datafile/lunar_inx07 destination for restore of datafile 00075: +DATA_DM01/lunars/datafile/lunar_data05 destination for restore of datafile 00081: +DATA_DM01/lunars/datafile/lunar_data11 destination for restore of datafile 00087: +DATA_DM01/lunars/datafile/lunar_data17 destination for restore of datafile 00093: +DATA_DM01/lunars/datafile/bxjh_data01 destination for restore of datafile 00098: +DATA_DM01/lunars/datafile/lr_app_lr_ts.dat channel ORA_DISK_6: reading from backup piece /u03/ForStandby_5nojeeb6_1_1
监控rman恢复进度:
[oracle@oradg ~]$ ps -ef|grep rman oracle 15439 13614 0 11:46 pts/2 00:00:03 rman target / oracle 16382 14226 0 14:13 pts/3 00:00:00 grep rman [oracle@oradg ~]$ ps -ef|grep 15439 oracle 15439 13614 0 11:46 pts/2 00:00:03 rman target / oracle 15444 15439 0 11:46 ? 00:00:07 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15448 15439 0 11:46 ? 00:00:00 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15513 15439 0 11:53 ? 00:00:43 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15514 15439 0 11:53 ? 00:00:44 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15515 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15516 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15517 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 15518 15439 0 11:53 ? 00:00:28 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 16384 14226 0 14:14 pts/3 00:00:00 grep 15439 [oracle@oradg ~]$
可以看见,v$session_longops监控rman备份很有用,但是监控rman的恢复进度就很不靠谱了:
SQL> select sid, serial#, context, sofar, opname,totalwork, 2 round(sofar/totalwork*100,2) "%_complete" 3 from v$session_longops; SID SERIAL# CONTEXT SOFAR OPNAME TOTALWORK %_complete ---------- ---------- ---------- ---------- ---------------------------------------------------------------- ---------- ---------- 4 7 1 7.2761E+13 RMAN: incremental datafile restore 57413886 126730808 1991 3 1 131072 RMAN: full datafile restore 131072 100 1991 3 1 6.6761E+13 RMAN: incremental datafile restore 61767680 108084070 574 1 1 6.5468E+13 RMAN: incremental datafile restore 62810878 104230697 289 1 1 6.5601E+13 RMAN: incremental datafile restore 57571328 113947967 1993 1 1 6.9020E+13 RMAN: incremental datafile restore 59899776 115226071 1142 9 205 1442292 RMAN: aggregate input 1442292 100 1710 1 1 1310720 RMAN: full datafile restore 1310720 100 1710 1 1 7.2826E+13 RMAN: incremental datafile restore 59813248 121754801 9 rows selected. SQL>
事实上,监控rman恢复的利器是:v$backup_async_io 和 v$rman_status,例如:
SET lines 200 col filename FOR a40 col status for a10 col DEVICE_TYPE for a10 col "Ela(s)" for 999999 SET pages 50 SELECT a.device_type, a.TYPE, b.status, b.mbytes_processed AS "Total MB", a.filename, ROUND(a.bytes / (1024 * 1024)) AS "Size MB", TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time, ROUND(a.elapsed_time / 100) AS "Time(s)", ROUND(a.elapsed_time / 100) AS "Ela(s)", ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" FROM v$backup_async_io a, v$rman_status b WHERE a.rman_status_recid = b.recid ORDER BY a.use_count; DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------ ---------- DISK INPUT COMPLETED 0 /u03/datafile_62ojg8q8_1_1 1 10-sep-2013 11:53:05 0 0 这里面需要注意,在恢复没有完成之前,这里是没有信息的, DISK INPUT COMPLETED 0 /u03/datafile_61ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0 DISK INPUT COMPLETED 0 /u03/datafile_60ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0 DISK AGGREGATE COMPLETED 11264 1024 10-sep-2013 11:53:36 7 7 146 这里的信息是上次操作完成的监控数据(含操作完成和终止两种) DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/system02 1024 10-sep-2013 11:53:36 7 7 146 DISK INPUT COMPLETED 11264 /u03/datafile_62ojg8q8_1_1 5 10-sep-2013 11:53:36 7 7 1 DISK AGGREGATE COMPLETED 11264 10240 10-sep-2013 11:53:37 41 41 250 DISK INPUT COMPLETED 11264 /u03/datafile_61ojg8q8_1_1 43 10-sep-2013 11:53:36 42 42 1 DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/syldgx_01.dbf 10240 10-sep-2013 11:53:37 41 41 250 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 30340 10-sep-2013 12:15:17 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 30433 10-sep-2013 12:15:17 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 30485 10-sep-2013 12:15:17 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 30458 10-sep-2013 12:15:17 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 30336 10-sep-2013 12:15:17 DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 30271 10-sep-2013 12:15:20 终止rman恢复进度,放到后台重新执行: 15:06:48 SQL> / DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ---------- DISK INPUT COMPLETED 0 /u03/datafile_62ojg8q8_1_1 1 10-sep-2013 11:53:05 0 0 DISK INPUT COMPLETED 0 /u03/datafile_61ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0 DISK INPUT COMPLETED 0 /u03/datafile_60ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0 DISK AGGREGATE COMPLETED 11264 1024 10-sep-2013 11:53:36 7 7 146 DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/system02 1024 10-sep-2013 11:53:36 7 7 146 DISK INPUT COMPLETED 11264 /u03/datafile_62ojg8q8_1_1 5 10-sep-2013 11:53:36 7 7 1 DISK AGGREGATE COMPLETED 11264 10240 10-sep-2013 11:53:37 41 41 250 DISK INPUT COMPLETED 11264 /u03/datafile_61ojg8q8_1_1 43 10-sep-2013 11:53:36 42 42 1 DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/syldgx_01.dbf 10240 10-sep-2013 11:53:37 41 41 250 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 33128 10-sep-2013 12:15:17 10321 10321 3 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 33226 10-sep-2013 12:15:17 10322 10322 3 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 33290 10-sep-2013 12:15:17 10324 10324 3 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 33254 10-sep-2013 12:15:17 10325 10325 3 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 33157 10-sep-2013 12:15:17 10326 10326 3 DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 33090 10-sep-2013 12:15:20 10324 10324 3 15 rows selected. 15:07:31 SQL>
[root@oradg ~]# ps -ef|grep ora_ oracle 17068 1 0 15:39 ? 00:00:00 ora_pmon_lunars oracle 17070 1 0 15:39 ? 00:00:00 ora_psp0_lunars oracle 17072 1 0 15:39 ? 00:00:00 ora_vktm_lunars oracle 17076 1 0 15:39 ? 00:00:00 ora_gen0_lunars oracle 17078 1 0 15:39 ? 00:00:00 ora_diag_lunars oracle 17080 1 0 15:39 ? 00:00:00 ora_dbrm_lunars oracle 17082 1 0 15:39 ? 00:00:05 ora_dia0_lunars oracle 17084 1 0 15:39 ? 00:00:00 ora_mman_lunars oracle 17086 1 0 15:39 ? 00:00:00 ora_dbw0_lunars oracle 17088 1 0 15:39 ? 00:00:00 ora_lgwr_lunars oracle 17090 1 0 15:39 ? 00:00:00 ora_ckpt_lunars oracle 17092 1 0 15:39 ? 00:00:00 ora_smon_lunars oracle 17094 1 0 15:39 ? 00:00:00 ora_reco_lunars oracle 17096 1 0 15:39 ? 00:00:00 ora_rbal_lunars oracle 17098 1 0 15:39 ? 00:00:00 ora_asmb_lunars oracle 17100 1 0 15:39 ? 00:00:00 ora_mmon_lunars oracle 17104 1 0 15:39 ? 00:00:00 ora_mmnl_lunars oracle 17106 1 0 15:39 ? 00:00:00 ora_mark_lunars oracle 17127 1 0 15:40 ? 00:00:00 ora_arc0_lunars oracle 17129 1 0 15:40 ? 00:00:00 ora_arc1_lunars oracle 17131 1 0 15:40 ? 00:00:00 ora_arc2_lunars oracle 17133 1 0 15:40 ? 00:00:00 ora_arc3_lunars oracle 17135 1 0 15:40 ? 00:00:00 ora_arc4_lunars oracle 17137 1 0 15:40 ? 00:00:00 ora_arc5_lunars oracle 17139 1 0 15:40 ? 00:00:00 ora_arc6_lunars oracle 17141 1 0 15:40 ? 00:00:00 ora_arc7_lunars oracle 17143 1 0 15:40 ? 00:00:00 ora_arc8_lunars oracle 17145 1 0 15:40 ? 00:00:00 ora_arc9_lunars oracle 17521 1 0 16:13 ? 00:00:00 ora_o000_lunars --增加的进程 oracle 17543 1 0 16:13 ? 00:00:00 ora_o001_lunars --增加的进程 root 17553 17477 0 16:14 pts/5 00:00:00 grep ora_ [root@oradg ~]# Average: CPU %user %nice %system %iowait %steal %idle Average: all 0.32 0.00 1.20 42.79 0.03 55.66 Average: IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s Average: lo 0.50 0.50 24.88 24.88 0.00 0.00 0.00 Average: peth0 12723.13 6345.52 19160625.62 448873.63 0.00 0.00 0.00 Average: eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.0 6653.98 13342.29 443880.10 20044932.34 0.00 0.00 0.00 Average: eth0 13342.29 6653.98 20044932.34 443880.10 0.00 0.00 0.00 Average: vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: xenbr0 57.71 0.00 11946.27 0.00 0.00 0.00 57.71
RECOVER DATABASE过程中 tuning ASM :
当前值(DISK AIO,从PGA分配): SQL> show parameter async NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ disk_asynch_io boolean TRUE tape_asynch_io boolean TRUE SQL> show parameter slaves NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ backup_tape_io_slaves boolean FALSE dbwr_io_slaves integer 0 SQL> 启用slaves(Slaves IO,从LARGE POOL中分配): SQL> alter system set dbwr_io_slaves=8 scope=spfile; System altered. SQL> SQL> alter system set disk_asynch_io=false scope=spfile; System altered. SQL> SQL> alter system set large_pool_size=150M scope=both; System altered. SQL> 重启: SQL> show parameter large NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ large_pool_size big integer 160M use_large_pages string TRUE SQL> show parameter slave NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ backup_tape_io_slaves boolean FALSE dbwr_io_slaves integer 8 SQL> show parameter async NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ disk_asynch_io boolean FALSE tape_asynch_io boolean TRUE SQL> SQL> col KSPPINM for a30 SQL> col ksppstvl format a15 SQL> col KSPPDESC for a55 SQL> select ksppinm, ksppstvl, KSPPDESC 2 from x$ksppi pi, x$ksppcv cv 3 where cv.indx=pi.indx and pi.ksppinm like '\_%' escape '\' 4 and pi.ksppinm like '%ksfq%'; KSPPINM KSPPSTVL ------------------------------ --------------- KSPPDESC ------------------------------------------------------- _backup_ksfq_bufcnt_max 64 maximum number of buffers used for backup/restore _backup_ksfq_bufsz 0 size of buffers used for backup/restore _backup_ksfq_bufcnt 0 number of buffers used for backup/restore SQL> SQL> select group_number,count(*) from v$asm_disk group by group_number; GROUP_NUMBER COUNT(*) ------------ ---------- 1 16 2 4 SQL> alter system set "_backup_ksfq_bufsz"=1048576; alter system set "_backup_ksfq_bufcnt"=16; SQL> alter system set "_backup_ksfq_bufsz"=1048576; System altered. SQL> alter system set "_backup_ksfq_bufcnt"=16; System altered. SQL> RMAN> exit [oracle@oradg scripts]$ cat temp.sh #!/bin/sh export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/dbhome_1 export ORACLE_SID=lunars export ORACLE_BASE=/u01/app/oracle export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:. rman target / <<EOF debug on; recover database; debug off; EXIT; EOF [oracle@oradg scripts]$ SET lines 200 col filename FOR a40 col status for a10 col DEVICE_TYPE for a10 col "Ela(s)" for 999999 SET pages 50 SELECT a.buffer_size, -- a.device_type, a.TYPE, b.status, b.mbytes_processed AS "Total MB", a.filename, ROUND(a.bytes / (1024 * 1024)) AS "Size MB", TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time, ROUND(a.elapsed_time / 100) AS "Time(s)", ROUND(a.elapsed_time / 100) AS "Ela(s)", ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" FROM v$backup_async_io a, v$rman_status b WHERE a.rman_status_recid = b.recid ORDER BY a.use_count; 16:23:27 SQL> / BUFFER_SIZE TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ----------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ---------- 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 1882 10-sep-2013 16:13:50 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 2303 10-sep-2013 16:13:50 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 2257 10-sep-2013 16:13:52 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 2250 10-sep-2013 16:13:52 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 1830 10-sep-2013 16:14:53 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 1701 10-sep-2013 16:15:46 6 rows selected. 16:23:29 SQL> 16:25:35 SQL> / BUFFER_SIZE TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ----------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ---------- 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 2244 10-sep-2013 16:13:50 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 2805 10-sep-2013 16:13:50 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 2778 10-sep-2013 16:13:52 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 2744 10-sep-2013 16:13:52 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 2296 10-sep-2013 16:14:53 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 2249 10-sep-2013 16:15:46 6 rows selected. 16:25:36 SQL> 看总共还原了多少M: SET lines 200 col filename FOR a40 col status for a10 col DEVICE_TYPE for a10 col "Ela(s)" for 999999 SET pages 50 SELECT b.status, sum(b.mbytes_processed) AS "Total MB", sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB" -- ROUND(a.elapsed_time / 100) AS "Time(s)", -- ROUND(a.elapsed_time / 100) AS "Ela(s)", -- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" FROM v$backup_async_io a, v$rman_status b WHERE a.rman_status_recid = b.recid group by b.status; 16:29:40 SQL> SET lines 200 16:29:41 SQL> col filename FOR a40 16:29:41 SQL> col status for a10 16:29:41 SQL> col DEVICE_TYPE for a10 16:29:41 SQL> col "Ela(s)" for 999999 16:29:41 SQL> SET pages 50 16:29:41 SQL> SELECT 16:29:41 2 b.status, 16:29:41 3 sum(b.mbytes_processed) AS "Total MB", 16:29:41 4 sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB" 16:29:41 5 -- ROUND(a.elapsed_time / 100) AS "Time(s)", 16:29:41 6 -- ROUND(a.elapsed_time / 100) AS "Ela(s)", 16:29:41 7 -- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" 16:29:41 8 FROM v$backup_async_io a, v$rman_status b 16:29:41 9 WHERE a.rman_status_recid = b.recid 16:29:41 10 group by b.status; STATUS Total MB Size MB ---------- ---------- ---------- RUNNING 0 20756 16:29:41 SQL> 16:29:41 SQL> 16:29:53 SQL> 一分钟1.5G左右,一小时大概90G: 16:30:59 SQL> / STATUS Total MB Size MB ---------- ---------- ---------- RUNNING 0 22594 16:31:01 SQL> 16:31:33 SQL> 16:31:43 SQL> 16:31:53 SQL> 16:32:00 SQL> 16:32:02 SQL> / STATUS Total MB Size MB ---------- ---------- ---------- RUNNING 0 24055 16:32:03 SQL> 16:32:03 SQL> select 24055-22594 from dual; 24055-22594 ----------- 1461 16:32:40 SQL> 16:40:17 SQL> SELECT 16:40:17 2 b.status, 16:40:17 3 sum(b.mbytes_processed) AS "Total MB", 16:40:17 4 sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB" 16:40:17 5 -- ROUND(a.elapsed_time / 100) AS "Time(s)", 16:40:18 6 -- ROUND(a.elapsed_time / 100) AS "Ela(s)", 16:40:18 7 -- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" 16:40:18 8 FROM v$backup_async_io a, v$rman_status b 16:40:18 9 WHERE a.rman_status_recid = b.recid 16:40:18 10 group by b.status; STATUS Total MB Size MB ---------- ---------- ---------- RUNNING 0 36348 16:40:18 SQL> 16:42:54 SQL> 16:43:01 SQL> 16:43:07 SQL> 16:43:13 SQL> 16:43:18 SQL> 16:43:21 SQL> / STATUS Total MB Size MB ---------- ---------- ---------- RUNNING 0 41288 16:43:22 SQL> 16:51:54 SQL> SET lines 200 16:51:54 SQL> col filename FOR a40 16:51:54 SQL> col status for a10 16:51:54 SQL> col DEVICE_TYPE for a10 16:51:54 SQL> col "Ela(s)" for 999999 16:51:54 SQL> SET pages 50 16:51:54 SQL> SELECT a.buffer_size/1024/1024 as buffersize_mb, 16:51:54 2 -- a.device_type, 16:51:54 3 a.TYPE, 16:51:54 4 b.status, 16:51:54 5 -- b.mbytes_processed AS "Total MB", 16:51:54 6 a.filename, 16:51:54 7 ROUND(a.bytes / (1024 * 1024)) AS "Size MB", 16:51:54 8 TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time, 16:51:54 9 ROUND(a.elapsed_time / 100) AS "Time(s)", 16:51:54 10 ROUND(a.elapsed_time / 100) AS "Ela(s)", 16:51:54 11 ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" 16:51:54 12 FROM v$backup_async_io a, v$rman_status b 16:51:54 13 WHERE a.rman_status_recid = b.recid 16:51:54 14 ORDER BY a.use_count; BUFFERSIZE_MB TYPE STATUS FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ---------------- --------- ---------- ---------------------------------------- ---------------- ----------------------- ---------------- ------- ---------------- 1 INPUT RUNNING /u03/ForStandby/ForStandby_5oojeeb6_1_1 7,462 10-sep-2013 16:13:50 1 INPUT RUNNING /u03/ForStandby/ForStandby_5sojeeb7_1_1 9,682 10-sep-2013 16:13:50 1 INPUT RUNNING /u03/ForStandby/ForStandby_5rojeeb7_1_1 10,017 10-sep-2013 16:13:52 1 INPUT RUNNING /u03/ForStandby/ForStandby_5qojeeb7_1_1 9,664 10-sep-2013 16:13:52 1 INPUT RUNNING /u03/ForStandby/ForStandby_5pojeeb7_1_1 8,595 10-sep-2013 16:14:53 1 INPUT RUNNING /u03/ForStandby/ForStandby_5nojeeb6_1_1 9,634 10-sep-2013 16:15:46 6 rows selected. 16:51:55 SQL>
这个存储是NFS来的,网卡到极限了,就这个速度,IOWAIT也都27%多了。。。。。。:
[root@oradg ~]# sar -n DEV -u 2 2 Linux 2.6.18-238.el5xen (oradg) 09/10/2013 05:12:30 PM CPU %user %nice %system %iowait %steal %idle 05:12:32 PM all 0.37 0.00 1.35 27.14 0.06 71.08 05:12:30 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s 05:12:32 PM lo 1.00 1.00 50.00 50.00 0.00 0.00 0.00 05:12:32 PM peth0 21539.00 10783.00 32521089.00 758605.00 0.00 0.00 0.00 05:12:32 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM vif0.0 9291.00 18578.50 616164.00 27977989.50 0.00 0.00 0.00 05:12:32 PM eth0 18578.50 9291.00 27977989.50 616164.00 0.00 0.00 0.00 05:12:32 PM vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:32 PM xenbr0 29.50 0.00 11288.50 0.00 0.00 0.00 29.50 05:12:32 PM CPU %user %nice %system %iowait %steal %idle 05:12:34 PM all 0.31 0.00 1.68 23.12 0.00 74.89 05:12:32 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s 05:12:34 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM peth0 22215.00 11116.50 33549739.00 782637.00 0.00 0.00 0.00 05:12:34 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM vif0.0 10757.00 21491.50 714316.00 32364581.00 0.00 0.00 0.00 05:12:34 PM eth0 21491.50 10757.00 32364581.00 714316.00 0.00 0.00 0.00 05:12:34 PM vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 05:12:34 PM xenbr0 19.00 0.00 10253.00 0.00 0.00 0.00 19.00 Average: CPU %user %nice %system %iowait %steal %idle Average: all 0.34 0.00 1.52 25.14 0.03 72.97 Average: IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s Average: lo 0.50 0.50 25.00 25.00 0.00 0.00 0.00 Average: peth0 21877.00 10949.75 33035414.00 770621.00 0.00 0.00 0.00 Average: eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.0 10024.00 20035.00 665240.00 30171285.25 0.00 0.00 0.00 Average: eth0 20035.00 10024.00 30171285.25 665240.00 0.00 0.00 0.00 Average: vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: xenbr0 24.25 0.00 10770.75 0.00 0.00 0.00 24.25 [root@oradg ~]# [root@oradg ~]# SQL> SQL> set linesize 140 SQL> set pages 999 SQL> SET lines 200 col filename FOR a40 col status for a10 col DEVICE_TYPE for a10 col "Ela(s)" for 999999 SET pages 50 SELECT a.device_type, a.TYPE, b.status, b.mbytes_processed AS "Total MB", a.filename, ROUND(a.bytes / (1024 * 1024)) AS "Size MB", TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time, ROUND(a.elapsed_time / 100) AS "Time(s)", ROUND(a.elapsed_time / 100) AS "Ela(s)", ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s" FROM v$backup_async_io a, v$rman_status b WHERE a.rman_status_recid = b.recid ORDER BY a.use_count; SQL> SQL> SQL> SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13 DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s ---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ---------- DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 62203 10-sep-2013 16:13:50 13626 13626 5 DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 66335 10-sep-2013 16:13:50 13648 13648 5 DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 73345 10-sep-2013 16:13:52 14108 14108 5 DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 84269 10-sep-2013 16:13:52 14740 14740 6 DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 111184 10-sep-2013 16:14:53 15582 15582 7 DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 127680 10-sep-2013 16:15:46 15739 15739 8 6 rows selected. SQL>
恢复过程遇到的由于offline 的文件造成的问题:
[oracle@oradg ~]$ rman target / Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 21:39:41 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: bjlunar (DBID=4088537672, not open) RMAN> recover database; Starting recover at 10-SEP-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=574 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=858 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=1141 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=1423 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=1707 device type=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: SID=1993 device type=DISK allocated channel: ORA_DISK_7 channel ORA_DISK_7: SID=6 device type=DISK allocated channel: ORA_DISK_8 channel ORA_DISK_8: SID=290 device type=DISK starting media recovery unable to find archived log archived log thread=2 sequence=5875 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 09/10/2013 21:40:30 RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 5875 and starting SCN of 12030111275805 RMAN> select name,thread#,sequence#,status,to_char(COMPLETION_TIME ,'yyyymmdd hh24:mi:ss') from v$archived_log where thread#=1 and sequence#=13664; select name,thread#,sequence#,status from v$archived_log where thread#=2 and sequence#=5875; SQL> select thread#,count(*) from v$archived_log where thread#=2 and sequence#>=5875 group by thread#; THREAD# COUNT(*) ---------- ---------- 2 717 SQL> SQL> select thread#,min(sequence#) from v$log_history group by thread#; THREAD# MIN(SEQUENCE#) ---------- -------------- 1 10821 2 8294 SQL> SQL> select distinct checkpoint_change# from v$datafile; CHECKPOINT_CHANGE# ---------------------------------------------- 12030111275805 12762145943484 SQL> SQL> select distinct checkpoint_change# from v$datafile_header; CHECKPOINT_CHANGE# ---------------------------------------------- 12030111275805 12762144336474 12762144336497 12762144336582 12762144336583 12762144336585 12762144336590 12762477971858 12762477971876 12762477971883 10 rows selected. SQL> SQL> select status,file# from v$datafile_header where status!='ONLINE'; STATUS FILE# ------- ---------- OFFLINE 48 OFFLINE 50 SQL> 使用recover standby database,可以跨过这个问题,可以看见,已经找比较新的archive log了: 1 SQL> alter database recover standby database; alter database recover standby database * ERROR at line 1: ORA-00279: change 12762144336474 generated at 09/09/2013 17:52:39 needed for thread 1 ORA-00289: suggestion : /home/oracle/log1/log_1_13664_764800648.arc ORA-00280: change 12762144336474 for thread 1 is in sequence #13664 SQL> SQL> select name,thread#,sequence#,status,to_char(COMPLETION_TIME ,'yyyymmdd hh24:mi:ss') from v$archived_log where thread#=1 and sequence#=13664; 2 NAME THREAD# SEQUENCE# S TO_CHAR(COMPLETIO ------------------------------ ---------- ---------- - ----------------- lunars 1 13664 A 20130909 23:53:43 +RECO_DM01/lunar/archive/arch1/ 1 13664 A 20130909 23:53:52 1_13664_764800648.dbf SQL> 增加standby logfile: ALTER DATABASE ADD STANDBY LOGFILE GROUP 31 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 32 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 33 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 34 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 35 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 36 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 37 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 38 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 39 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 40 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 41 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 42 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 43 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 44 '+DATA_DM01' size 200m; ALTER DATABASE ADD STANDBY LOGFILE GROUP 45 '+DATA_DM01' size 200m; [oracle@oradg trace]$ tail alert_lunars.log Wed Sep 11 10:26:38 2013 Archived Log entry 42 added for thread 1 sequence 13684 ID 0xf3b1df48 dest 1: Wed Sep 11 11:48:55 2013 RFS[2]: Selected log 33 for thread 1 sequence 13686 dbid -206429624 branch 764800648 Wed Sep 11 11:49:03 2013 Media Recovery Waiting for thread 1 sequence 13686 (in transit) Recovery of Online Redo Log: Thread 1 Group 33 Seq 13686 Reading mem 0 Mem# 0: +DATA_DM01/lunars/onlinelog/group_33.295.825808103 Wed Sep 11 11:49:28 2013 Archived Log entry 43 added for thread 1 sequence 13685 ID 0xf3b1df48 dest 1: [oracle@oradg trace]$
<bold>恢复完成后,就可以把dg放到恢复模式,让他恢复几个日志,然后把数据库重新打到open read only,再次启动恢复进程,就是adg了。。。。。。。。。。</bold>
<bold>
大体思路:
在备库执行(如果是rac,只启动一个实例):
startup nomount
如果使用了rman catalog库,那么可以直接使用下面命令获取控制文件:
RESTORE STANDBY CONTROLFILE FROM TAG ‘FORSTANDBY’;
如果没有rman catalog库,那么使用主库备份的控制文件(本溪使用这个方法):
restore standby controlfile from ‘/tmp/stdbyctl.bkp’;
mount上备库:
alter database mount;
CATALOG START WITH ‘/u03/ForStandby/’;
REPORT SCHEMA;
RECOVER DATABASE NOREDO;
——————————————————————————–
针对OMF的数据文件使用下面命令:
catalog start with ‘+DATA1/MUM/DATAFILE/’;
针对非OFM的数据文件使用下面命令:
catalog datafilecopy ‘<File-Specification>’;
——————————————————————————–
switch database to copy;
——————————————————————————–
–clear all 所有 online redo log groups
select group# from v$log;
alter database clear logfile group 1;
alter database clear logfile group 2;
alter database clear logfile group 3;
——————————————————————————–
——————————————————————————–
–clear all 所有 standby redolog groups
select group# from v$standby_log;
alter database clear logfile group 4;
alter database clear logfile group 5;
alter database clear logfile group 6;
——————————————————————————–
——————————————————————————–
重建standby redo log:
select group# from v$standby_log;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 41 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 42 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 43 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 44 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 45 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 46 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 47 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 48 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 49 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 50 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 51 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 52 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 53 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 54 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 55 ‘+DATA_DM01’ size 200m;
——————————————————————————–
alter database recover managed standby database disconnect from session;
——————————————————————————–
重新enable备库的flashback:
alter database flashback off;
alter database flashback on;
——————————————————————————–
</bold>