Restore db usering NBU7.5

yhj20041128001發表於2013-04-13

hrmsdb
set environment variables for restore

export NLS_LANG=American_America.UTF8
export NLS_DATE_FORMAT="mm-dd-yyyy:hh24:mi:ss"

rman target /
startup nomount;
set dbid 2948431088;

1. restore controlfile
run {
allocate channel t1 type 'sbt_tape';
send 'NB_ORA_CLIENT=hrmsdb,NB_ORA_SERV=sznbm01.szoffice.mtrsz.local';
restore controlfile from 'c-2948431088-20130406-01';
release channel t1;
}

alter database mount;

2.restore DB

run{
allocate channel t1 type 'sbt_tape';
send 'NB_ORA_CLIENT=hrmsdb,NB_ORA_SERV=sznbm01.szoffice.mtrsz.local';
allocate channel t2 type 'sbt_tape';
send 'NB_ORA_CLIENT=hrmsdb,NB_ORA_SERV=sznbm01.szoffice.mtrsz.local';
set until sequence  1724   thread 1;
restore database;
recover database;
}

3. reset log
alter database open resetlogs;
shutdown immediate;
startup

Raname Database name from HRMSPRD to HRMCLONE

alter database backup controlfile to trace as '/home/hrmsoraprd/controlfile/controlfile_20130410.ctl' resetlogs;

 

-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonedata/HRMSCLONE/temp01.dbf'
     SIZE 28311552  REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonearch/HRMSCLONE/pstemp06.dbf'
     SIZE 8192M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonearch/HRMSCLONE/pstemp05.dbf'
     SIZE 8192M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonedata/HRMSCLONE/pstemp04.dbf'
     SIZE 4096M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonedata/HRMSCLONE/pstemp03.dbf'
     SIZE 4096M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonedata/HRMSCLONE/pstemp02.dbf'
     SIZE 4096M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE PSTEMP ADD TEMPFILE '/uhrms/hrmsclone/hrmsclonedata/HRMSCLONE/pstemp01.dbf'
     SIZE 314572800  REUSE AUTOEXTEND OFF;
-- End of tempfile additions.

註冊監聽器:
alter system set local_listener='HRMCLONE' sid='HRMSCLONE';

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23757700/viewspace-758416/,如需轉載,請註明出處,否則將追究法律責任。

相關文章