To Generate rman scripts Manually and to split with different mount points
select 'SET NEWNAME FOR DATAFILE '||FILE#|| ' TO '''||NAME|| ''';' from v$datafile where FILE# not in (select FILE# from v$datafile where bytes/1024/1024/1024 > 10) order by FILE#;
select 'SET NEWNAME FOR DATAFILE '||FILE#|| ' TO '''||NAME|| ''';' from v$datafile where FILE# in (select FILE# from v$datafile where bytes/1024/1024/1024 > 10) order by FILE#;
SQL> select sum(bytes)/1024/1024/1024 from v$datafile where FILE# in (select FILE# from v$datafile where bytes/1024/1024/1024 > 10) order by FILE#;
SUM(BYTES)/1024/1024/1024
-------------------------
218.71875
SQL> select sum(bytes)/1024/1024/1024 from v$datafile where FILE# not in (select FILE# from v$datafile where bytes/1024/1024/1024 > 10) order by FILE#;
SUM(BYTES)/1024/1024/1024
-------------------------
1015.71863
run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
allocate channel c6 device type disk;
allocate channel c7 device type disk;
allocate channel c8 device type disk;
SET NEWNAME FOR DATAFILE 1 TO '/tdxdbd2/SOLTESTDB/data/system01.dbf';
SET NEWNAME FOR DATAFILE 2 TO '/tdxdbd2/SOLTESTDB/data/system02.dbf';
SET NEWNAME FOR DATAFILE 3 TO '/tdxdbd2/SOLTESTDB/data/system03.dbf';
SET NEWNAME FOR DATAFILE 4 TO '/tdxdbd2/SOLTESTDB/data/system04.dbf';
SET NEWNAME FOR DATAFILE 5 TO '/tdxdbd2/SOLTESTDB/data/system05.dbf';
SET NEWNAME FOR DATAFILE 6 TO '/tdxdbd2/SOLTESTDB/data/system06.dbf';
SET NEWNAME FOR DATAFILE 7 TO '/tdxdbd2/SOLTESTDB/data/system07.dbf';
SET NEWNAME FOR DATAFILE 8 TO '/tdxdbd2/SOLTESTDB/data/system08.dbf';
SET NEWNAME FOR DATAFILE 9 TO '/tdxdbd2/SOLTESTDB/data/system09.dbf';
SET NEWNAME FOR DATAFILE 10 TO '/tdxdbd2/SOLTESTDB/data/system10.dbf';
SET NEWNAME FOR DATAFILE 11 TO '/tdxdbd2/SOLTESTDB/data/system11.dbf';
SET NEWNAME FOR DATAFILE 12 TO '/tdxdbd2/SOLTESTDB/data/sysaux_01.dbf';
……
....
....
SET NEWNAME FOR DATAFILE 18 TO '/tdxdbd3/SOLTESTDB/data/undo05.dbf';
SET NEWNAME FOR DATAFILE 107 TO '/tdxdbd3/SOLTESTDB/data/a_txn_data20.dbf';
SET NEWNAME FOR DATAFILE 129 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind21.dbf';
SET NEWNAME FOR DATAFILE 142 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind07.dbf';
SET NEWNAME FOR DATAFILE 146 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind02.dbf';
SET NEWNAME FOR DATAFILE 200 TO '/tdxdbd3/SOLTESTDB/data/a_txn_data40.dbf';
SET NEWNAME FOR DATAFILE 201 TO '/tdxdbd3/SOLTESTDB/data/a_txn_data41.dbf';
SET NEWNAME FOR DATAFILE 202 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind24.dbf';
SET NEWNAME FOR DATAFILE 208 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind25.dbf';
SET NEWNAME FOR DATAFILE 209 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind26.dbf';
SET NEWNAME FOR DATAFILE 217 TO '/tdxdbd3/SOLTESTDB/data/a_txn_data42.dbf';
SET NEWNAME FOR DATAFILE 219 TO '/tdxdbd3/SOLTESTDB/data/a_txn_ind27.dbf';
SET NEWNAME FOR DATAFILE 220 TO '/tdxdbd3/SOLTESTDB/data/a_txn_data43.dbf';
SET NEWNAME FOR DATAFILE 221 TO '/tdxdbd3/SOLTESTDB/data/a_media39.dbf';
restore database;
switch datafile all;
recover database;
}
No comments:
Post a Comment