日期:2014-05-16  浏览次数:20490 次

两种RECOVER TABLESPACE 方法有何区别??
一个数据文件丢失,恢复:
1.
SQL>startup mount;
SQL> alter database datafile '/u03/DB1/vol01/users01.dbf' offline;
SQL> alter database open;
2.
now, restore the backup for '/u03/DB1/vol01/users01.dbf'
3.
SQL> alter database recover tablespace users;
alter database recover tablespace users
*
ERROR at line 1:
ORA-00279: change 69356 generated at 03/07/2007 16:25:34 needed for thread 1
ORA-00289: suggestion : /u03/DB1/archvol2/arch_1_201.ARC
ORA-00280: change 69356 for thread 1 is in sequence #201

SQL>

在STEP3中,如果不用上边方法,而用下面方法,则没问题:

If I use "recover tablespace XXX", is is no problem:

SQL> recover tablespace users;
ORA-00279: change 69356 generated at 03/07/2007 16:25:34 needed for thread 1
ORA-00289: suggestion : /u03/DB1/archvol2/arch_1_201.ARC
ORA-00280: change 69356 for thread 1 is in sequence #201


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 69358 generated at 03/07/2007 16:27:23 needed for thread 1
ORA-00289: suggestion : /u03/DB1/archvol2/arch_1_202.ARC
ORA-00280: change 69358 for thread 1 is in sequence #202
ORA-00278: log file '/u03/DB1/archvol2/arch_1_201.ARC' no longer needed for
this recovery


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Log applied.
Media recovery complete.
SQL> alter database datafile '/u03/DB1/vol01/users01.dbf' online;

Database altered.

SQL>

哪位解释一下两种RECOVER TABLESPACE 方法有何区别?为何" alter database recover tablespace users" 出错?

相应的解释为:
ALTER DATABASE [database]
  { MOUNT [STANDBY DATABASE] [EXCLUSIVE | PARALLEL]
  | CONVERT
  | OPEN [RESETLOGS | NORESETLOGS]
  | ACTIVATE STANDBY DATABASE
  | ARCHIVELOG
  | NOARCHIVELOG
  | RECOVER recover_clause



看来确实有这个语法...

知道了:

alter database recover tablespace XXXX 在MOUNT 下用,

recover tablespace XXXX 在OPEN 壮态用