测试1
test
* [ ] ````
-------
>
-------
-------
-------
-------
-------
~~_***nohup rman target / cmdfile=rman.sql msglog=rman.log &
####select "set newname for datafile "||file#||" to "+R9T24DB/orat24a/datafile"||substr(name,instr(name,"/",-1))||";" from v$datafile where ts# not in (8,10);
select "set newname for datafile "||file# ||" to " || """"|| "/data1/oradata/acct"||substr(name,instr(name,"/",-1))||""""||";" from v$datafile;
同名datafile
select * from (select substr(name,instr(name,"/",-1)+1) a,count(1) b from v$datafile group by substr(name,instr(name,"/",-1)+1)) where b>1;
select a.file# from v$datafile a,v$tablespace b where a.ts#=b.ts# and b.name in ("TBS_PARTITION_INDX","TBS_USER_IBSS_DATA");
select file# from v$datafile_header where checkpoint_time is null
***********skip tablespace
export ORACLE_SID=orat24a
. ~/env11
rman target / log=restore_data.log append< run{ allocate channel c0 type "sbt_tape"; allocate channel c1 type "sbt_tape"; allocate channel c2 type "sbt_tape"; allocate channel c3 type "sbt_tape"; send "NB_ORA_CLIENT=t24db02"; set until scn 721012148933; ---------------------set until time "to_date("20190412 040000","yyyymmdd hh24miss")"; set newname for datafile 1 to "+T24DATA/orat24a/datafile/system01.dbf"; set newname for datafile 2 to "+T24DATA/orat24a/datafile/sysaux01.dbf"; set newname for datafile 3 to "+T24DATA/orat24a/datafile/undotbs101.dbf"; set newname for datafile 4 to "+T24DATA/orat24a/datafile/undo102.dbf"; set newname for datafile 5 to "+T24DATA/orat24a/datafile/undo103.dbf"; set newname for datafile 6 to "+T24DATA/orat24a/datafile/undo104.dbf"; set newname for tempfile 1 to "+T24DATA/orat24a/tempfile/temp01.dbf"; set newname for tempfile 2 to "+T24DATA/orat24a/tempfile/temp02.dbf"; set newname for tempfile 3 to "+T24DATA/orat24a/tempfile/temp03.dbf"; set newname for tempfile 4 to "+T24DATA/orat24a/tempfile/temp04.dbf"; restore database SKIP FOREVER TABLESPACE GLOBUSARCXML,T24JOBASSM; switch datafile 1; switch datafile 2; switch datafile 3; switch datafile 4; switch datafile 5; switch datafile 6; switch datafile 7; switch datafile 8; switch datafile 9; switch tempfile all; recover database SKIP FOREVER TABLESPACE GLOBUSARCXML,T24JOBASSM; sql "alter database rename file "/orat24redo/orat24a/redo01.log" to "+T24DATA/orat24a/onlinelog/redo01.log""; sql "alter database rename file "/orat24redo/orat24a/redo02.log" to "+T24DATA/orat24a/onlinelog/redo02.log""; sql "alter database rename file "/orat24redo/orat24a/redo03.log" to "+T24DATA/orat24a/onlinelog/redo03.log""; sql "alter database rename file "/orat24redo/orat24a/redo04.log" to "+T24DATA/orat24a/onlinelog/redo04.log""; sql "alter database rename file "/orat24redo/orat24a/redo05.log" to "+T24DATA/orat24a/onlinelog/redo05.log""; sql "alter database rename file "/orat24redo/orat24a/redo201.log" to "+T24DATA/orat24a/onlinelog/redo201.log""; sql "alter database rename file "/orat24redo/orat24a/redo202.log" to "+T24DATA/orat24a/onlinelog/redo202.log""; sql "alter database rename file "/orat24redo/orat24a/redo203.log" to "+T24DATA/orat24a/onlinelog/redo203.log""; sql "alter database rename file "/orat24redo/orat24a/redo204.log" to "+T24DATA/orat24a/onlinelog/redo204.log""; sql "alter database rename file "/orat24redo/orat24a/redo205.log" to "+T24DATA/orat24a/onlinelog/redo205.log""; sql "alter database clear logfile group 1"; sql "alter database clear logfile group 2"; sql "alter database clear logfile group 3"; sql "alter database clear logfile group 4"; sql "alter database clear logfile group 5"; sql "alter database clear logfile group 6"; sql "alter database clear logfile group 7"; sql "alter database clear logfile group 8"; sql "alter database clear logfile group 9"; sql "alter database clear logfile group 10"; release channel c0; release channel c1; release channel c2; release channel c3; } exit; EOF ***_~~` ``` 以上是 测试1 的全部内容,
来源链接:
utcz.com/z/531894.html