热备后恢复,怎样让数据一致?
通过itpub进行咨询:
我的备份与恢复过程的描述:
oracle版本:10.2.0.1
以下为备份脚本 :
------------------------------------------------------------------------------------------
alter system archive log current;
alter tablespace USERS begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF F:\ykt_back /H/R/Y;
alter tablespace USERS end backup;
alter tablespace SYSAUX begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF F:\ykt_back /H/R/Y;
alter tablespace SYSAUX end backup;
alter tablespace UNDOTBS1 begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF F:\ykt_back /H/R/Y;
alter tablespace UNDOTBS1 end backup;
alter tablespace SYSTEM begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF F:\ykt_back /H/R/Y;
alter tablespace SYSTEM end backup;
alter tablespace CNPF begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CNPF_TB.DBF F:\ykt_back /H/R/Y;
alter tablespace CNPF end backup;
alter tablespace RL_TABLESPACE begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\RL_TABLESPACE.DBF F:\ykt_back /H/R/Y;
alter tablespace RL_TABLESPACE end backup;
alter tablespace INDX begin backup;
host xcopy Z:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\INDX.DBF F:\ykt_back /H/R/Y;
alter tablespace INDX end backup;
alter database backup controlfile to 'F:\ykt_back\control_ykt.000';
alter database backup controlfile to trace;
alter system archive log current;
------------------------------------------------------------------------------------------
以下为恢复:
将备份的控制文件、数据文件、归档日志文件拷入另一台机器中(已做好oracle环境)
recover database using backup controlfile until cancel;
auto
应用完归档日志文件后,用resetlogs打开数据库
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'Y:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF'
此后,为了打开数据库,使用了参数 :
ALTER SYSTEM RESET "_allow_resetlogs_corruption" SCOPE=SPFILE;
alter database open resetlogs;
问题:
在数据库不能shutdown 的情况下做的热备,在另一台环境中恢复时,还需更多的恢复保持一致时,怎么确定
恢复时还需要哪些归档文件,使数据库保持一致?
请各位大师指教。
因为数据库在热备时一直在运行,归档日志还是在不停的产生,是不是在异机恢复时,要将备份的数据库shutdown后,将所有的归档日志文件拷过来,进行recover database呢?
页:
[1]