run {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
sql ‘alter system switch logfile‘;
sql ‘alter system switch logfile‘;
sql ‘alter system switch logfile‘;
sql ‘alter system archive log current‘;
backup incremental level 0
format ‘/data/app/rmanbackup/db_full_%U.bkp‘
database plus archivelog;
release channel c1;
release channel c2;
release channel c3;
}
run{
set newname for datafile 1 to ‘/data/app/oradata/source/system01.dbf‘;
set newname for datafile 2 to ‘/data/app/oradata/source/sysaux01.dbf‘;
set newname for datafile 3 to ‘/data/app/oradata/source/undotbs01.dbf‘;
restore database;
switch datafile all;
recover database;
}
时间: 2024-12-11 12:34:39