rename datafile时报错ORA-01511,ORA-01121,ORA-01110
更新时间: 2021-07-17 16:42
现象:
实例启动到mount之后,rename datafile时报错ORA-01511,ORA-01121,ORA-01110
SQL>
SQL> ALTER DATABASE RENAME FILE '+DATA/rac/datafile/users01.dbf' TO '+TESTDG/rac/datafile/user01.dbf';
ALTER DATABASE RENAME FILE '+DATA/rac/datafile/users01.dbf' TO '+TESTDG/rac/datafile/user01.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01121: cannot rename database file 1 - file is in use or recovery
ORA-01110: data file 1: '+DATA/rac/datafile/users01.dbf'
分析:
出现这种情况因为DB是RAC环境,另一个节点是open状态,导致出现上面报错。
解决方案:
关闭另一个节点的实例。
[oracle@orcl2 ~]$ sqlplus / as sysdba
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
再在节点1上执行rename datafile。
SQL> ALTER DATABASE RENAME FILE '+DATA/rac/datafile/users01.dbf' TO '+TESTDG/rac/datafile/user01.dbf';
SQL> alter database open;