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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23757700/viewspace-758416/