最近帮忙基于某个时间点恢复一个库,说是备份和归档是全的。 好多年没做过这类事情了,不过这算是最基本的DBA技能,下面给出RMAN基于某个具体时间点的恢复示例脚本:
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
sql "alter session set nls_date_format = ''yyyy-mm-dd hh24:mi:ss''";
set newname for database to '/public/Others/backup/db_%U.dbf';
restore database until time '2022-01-15 00:31:18';
switch datafile all;
recover database until time '2022-01-15 00:31:18';
release channel c1;
release channel c2;
}
注意/说明: