NBU AIX ORACLE10G RAC恢复到AIX单实例(表空间恢复)

ln -s /usr/openv/netbackup/bin/libobk.a64 /oraclev3/product/10.2.0/lib/libobk.a
不建软连接会报如下错误:

using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on ch00 channel at 08/12/2015 15:25:18
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
Additional information: 2

mkdir -p /oraclev3/admin/dlsc/adump
mkdir -p /oraclev3/admin/dlsc/bdump
mkdir -p /oraclev3/admin/dlsc/cdump
mkdir -p /oraclev3/admin/dlsc/udump

*.audit_file_dest='/oraclev3/admin/dlsc/adump'
*.background_dump_dest='/oraclev3/admin/dlsc/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/dev/rcontrol1','/dev/rcontrol2','/dev/rcontrol3'
*.core_dump_dest='/oraclev3/admin/dlsc/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='dlsc'
*.global_names=FALSE
*.job_queue_processes=10
*.log_archive_dest_1='location=/arch'
*.open_cursors=1000
*.sga_target=1595591168
*.pga_aggregate_target=1277848576
*.processes=500
*.remote_login_passwordfile='exclusive'
*.sessions=555
*.undo_management='AUTO'
*.undo_retention=0
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oraclev3/admin/dlsc/udump'

注:col num for 9999 9999数num显示的位数

col name for a55
col num for 9999
set linesize 200 pagesize 100
select 'mklv -y '||substr(name,7,20)||' -T O -w n -s n -r n datavg' name,trunc(((BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/128)+1) num from v$controlfile
union
select 'mklv -y '||substr(d.name,7,20)||' -T O -w n -s n -r n datavg' name,trunc((d.bytes/1024/1024/128)+1) num from v$datafile d ,v$tablespace t where d.ts#=t.ts# and

t.name in('SYSTEM','UNDOTBS1','UNDOTBS2','SYSAUX','USERS','JYDB' )
union
select 'mklv -y '||substr(name,7,20)||' -T O -w n -s n -r n datavg' name,trunc((bytes/1024/1024/128)+1) num from v$tempfile
union
select 'mklv -y '||substr(lf.member,7,20)||' -T O -w n -s n -r n datavg' name,trunc((l.bytes/1024/1024/128)+1) num from v$logfile lf,v$log l where lf.group#=l.group# ;

mklv -y control1 -T O -w n -s n -r n datavg 1
mklv -y control2 -T O -w n -s n -r n datavg 1
mklv -y control3 -T O -w n -s n -r n datavg 1

mklv -y jy_sysaux -T O -w n -s n -r n datavg 40
mklv -y jy_sysaux02 -T O -w n -s n -r n datavg 10
mklv -y jy_system -T O -w n -s n -r n datavg 40
mklv -y jy_users -T O -w n -s n -r n datavg 40
mklv -y jy_temp -T O -w n -s n -r n datavg 80
mklv -y jy_undotbs1 -T O -w n -s n -r n datavg 40
mklv -y jy_undotbs2 -T O -w n -s n -r n datavg 40
mklv -y jy_spfile -T O -w n -s n -r n datavg 40
mklv -y jy_redolog1 -T O -w n -s n -r n datavg 4
mklv -y jy_redolog2 -T O -w n -s n -r n datavg 4
mklv -y jy_redolog3 -T O -w n -s n -r n datavg 4
mklv -y jy_redolog4 -T O -w n -s n -r n datavg 4
mklv -y jy_redolog5 -T O -w n -s n -r n datavg 4
mklv -y jy_redolog6 -T O -w n -s n -r n datavg 4
mklv -y jy_rjydb1 -T O -w n -s n -r n datavg 160
mklv -y jy_rjydb2 -T O -w n -s n -r n datavg 160
mklv -y jy_rjydb3 -T O -w n -s n -r n datavg 160
mklv -y jy_rjydb4 -T O -w n -s n -r n datavg 160
mklv -y jy_rjydb5 -T O -w n -s n -r n datavg 160
mklv -y jy_lv_sysaux_1g -T O -w n -s n -r n datavg 16

# cd /dev
chown oraclev3:oinstall rcontrol*
chown oraclev3:oinstall rjy_*
chmod 660 rjy_*

chmod 660 rcontrol*

# ./bplist -C hndljydb1 -S nbumaster -t 4 -R /

启动实例
$ export ORACLE_SID=dlsc
sqlplus / as sysdba
startup nomount pfile='/oraclev3/pfile_dlsc20150812.ora'

set dbid=335040995
run {
allocate channel ch00 type 'sbt_tape' parms='ENV=(NB_ORA_CLIENT=hndljydb1)';
restore controlfile from 'c-335040995-20150811-02';
release channel ch00;
}

alter database mount;

select ','||''''||name||'''' from v$tablespace where name not in ('SYSTEM','UNDOTBS1','UNDOTBS2','SYSAUX','USERS','JYDB' );

run {
allocate channel ch00 type 'sbt_tape' parms='ENV=(NB_ORA_CLIENT=hndljydb1)';
allocate channel ch01 type 'sbt_tape' parms='ENV=(NB_ORA_CLIENT=hndljydb1)';
set newname for datafile '/dev/rsysaux' to '/dev/rjy_sysaux' ;
set newname for datafile '/dev/rsysaux02' to '/dev/rjy_sysaux02' ;
set newname for datafile '/dev/rsystem' to '/dev/rjy_system' ;
set newname for datafile '/dev/rusers' to '/dev/rjy_users' ;
set newname for datafile '/dev/rundotbs1' to '/dev/rjy_undotbs1' ;
set newname for datafile '/dev/rundotbs2' to '/dev/rjy_undotbs2' ;
set newname for datafile '/dev/rrjydb1' to '/dev/rjy_rjydb1' ;
set newname for datafile '/dev/rrjydb2' to '/dev/rjy_rjydb2' ;
set newname for datafile '/dev/rrjydb3' to '/dev/rjy_rjydb3' ;
set newname for datafile '/dev/rrjydb4' to '/dev/rjy_rjydb4' ;
set newname for datafile '/dev/rrjydb5' to '/dev/rjy_rjydb5' ;
set newname for datafile '/dev/rlv_sysaux_1g' to '/dev/rjy_lv_sysaux_1g';
set until time "to_date('2015-08-11 1:00:00','yyyy-mm-dd hh24:mi:ss')";
restore tablespace 'SYSTEM','UNDOTBS1','UNDOTBS2','SYSAUX','USERS','JYDB' ;
switch datafile all;
release channel ch00;
release channel ch01;
}

run {
allocate channel ch00 type 'sbt_tape' parms='ENV=(NB_ORA_CLIENT=hndljydb1)';
allocate channel ch01 type 'sbt_tape' parms='ENV=(NB_ORA_CLIENT=hndljydb2)';
set until time "to_date('2015-08-11 1:00:00','yyyy-mm-dd hh24:mi:ss')";
recover database skip forever tablespace 'TEMP','KDPLAN','KDCONTRACT','KDSETTLE','KDTRADE','KDDOC';
release channel ch00;
release channel ch01;
}

alter database rename file '/dev/rredolog1' to '/dev/rjy_redolog1' ;
alter database rename file '/dev/rredolog2' to '/dev/rjy_redolog2' ;
alter database rename file '/dev/rredolog3' to '/dev/rjy_redolog3' ;
alter database rename file '/dev/rredolog4' to '/dev/rjy_redolog4' ;
alter database rename file '/dev/rredolog5' to '/dev/rjy_redolog5' ;
alter database rename file '/dev/rredolog6' to '/dev/rjy_redolog6' ;
alter database rename file '/dev/rtemp' to '/dev/rjy_temp' ;

alter database open resetlogs;

set linesize 200 pagesize 200
select GROUP#,THREAD#,STATUS ,ARCHIVED from v$log;
alter database disable thread 2 ;
alter system archive log current;
select GROUP#,THREAD#,STATUS ,ARCHIVED from v$log;

alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 6;

监听配置、tns配置
至此数据库恢复完成。

上一篇:MVC的异步,Entity Framework的异步,ADO.NET的异步,


下一篇:android之LayoutInflater讲解