还原种子数据库练习(四)
le 1
ORA-01110: data file 1: '/ade/b/385031636/oracle/oradata/seeddata/system01.dbf'
-------------------->>>>果然提示报错,不能创建相关的目录。我们要修改到指定的位置/oracle/oradata/ORCL/
-------------------->>>>修改数据库文件名字,switch datafile all就是更新控制文件的意思
RMAN> run
{
set newname for datafile '/ade/b/385031636/oracle/oradata/seeddata/system01.dbf' to '/oracle/oradata/ORCL/system01.dbf';
set newname for datafile '/ade/b/385031636/oracle/oradata/seeddata/sysaux01.dbf' to '/oracle/oradata/ORCL/sysaux01.dbf';
set newname for datafile '/ade/b/385031636/oracle/oradata/seeddata/undotbs01.dbf' to '/oracle/oradata/ORCL/undotbs01.dbf';
set newname for datafile '/ade/b/385031636/oracle/oradata/seeddata/users01.dbf' to '/oracle/oradata/ORCL/users01.dbf';
restore database;
switch datafile all;
recover database;
}
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 05-SEP-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /oracle/oradata/ORCL/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /oracle/oradata/ORCL/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /oracle/oradata/ORCL/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/Seed_Database.dfb
channel ORA_DISK_1: piece handle=/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/Seed_Database.dfb tag=NULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:05
Finished restore at 05-SEP-13
datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=825343689 file name=/oracle/oradata/ORCL/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=825343689 file name=/oracle/oradata/ORCL/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=825343689 file name=/oracle/oradata/ORCL/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=825343689 file name=/oracle/oradata/ORCL/users01.dbf
Starting recover at 05-SEP-13
using channel ORA_DISK_1
starting media recovery
RMAN-08187: WARNING: media recovery until SCN 995547 complete
Finished recover at 05-SEP-13
------------->
>>>成功recover,显示这是个介质恢复,只完成SCN号995547,属于不完全恢复
RMAN> ALTER DATABASE OPEN;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 09/05/2013 14:08:19
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
------------>>>>由于是介质恢复,所以需要以resetlog的方式打开
RMAN> ALTER DATABASE OPEN RESETLOGS;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===============================