RMAN-03031
Saw error RMAN-03031 like this:
RMAN> set newname for datafile 1 to '/oradata/ORCLCDB/system01.dbf';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03031: this option of set command needs to be used inside a run block
RMAN-03031 means that the SET statement you issued in RMAN cannot be done without using a RUN block. Please put the statement in a run block.
That is to say, you should issue SET NEWNAME FOR DATAFILE in a run black. For example:
run {
set newname for datafile 1 to '/oradata/ORCLCDB/system01.dbf';
set newname for datafile 3 to '/oradata/ORCLCDB/sysaux01.dbf';
...
restore database;
switch datafile all;
recover database;
alter database open;
}
Please modify the run block for your needs.