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_PARTIT
ioN_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<
SSM;
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
***_~~`
```
0