1

我无法从备份中恢复数据文件和重做日志文件。我在 RMAN 中写道,

run{
set newname for datafile 1 to '/u02/data_redo/system01.dbf';
set newname for datafile 2 to '/u02/data_redo/sysaux01.dbf';
set newname for datafile 3 to '/u02/data_redo/undotbs01.dbf';
set newname for datafile 4 to '/u02/data_redo/users01.dbf';
set newname for datafile 5 to '/u02/data_redo/example01.dbf';
sql "alter database rename file '/u01/app/oracle/oradata/db01/redo01.log' to 
'/u02/data_redo/redo01.log'";
sql "alter database rename file '/u01/app/oracle/oradata/db01/redo02.log' to 
'/u02/data_redo/redo02.log'";
sql "alter database rename file '/u01/app/oracle/oradata/db01/redo03.log' to 
'/u02/data_redo/redo03.log'";
restore database;
switch datafile all;
recover database; 
}

但它说,

using target database control file instead of recovery catalog
sql statement: alter database rename file 
'/u01/app/oracle/oradata/db01/redo01.log' to '/u02/data_redo/redo01.log'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 07/30/2017 16:18:19
RMAN-10015: error compiling PL/SQL program

我怎样才能做到这一点?

4

2 回答 2

0

我知道这是一个老问题,但是在打开和关闭 SQL 命令时,在文件名前后使用了两个单引号和双引号。

前任:

sql "alter database rename file ''+DATA/MOOTDB/ONLINELOG/group_6.268.1067716075'' to ''+DGDATAMOTHIST/MOTHIST/ONLINELOG/group_6_member_1.log''";
于 2021-03-22T01:30:45.530 回答
0

尝试这个:

...
restore database
LOGFILE GROUP 1 ('/u/prog/oracle/oralog/MOBI6/redo01a.log') SIZE 100M, GROUP 2 ('/u/prog/oracle/oralog/MOBI6/redo02a.log') SIZE 100M;
...

或者你可以设置init参数

LOG_FILE_NAME_CONVERT=('/u02/','/disk2/')
于 2017-07-30T14:09:41.713 回答