重庆思庄Oracle、Redhat认证学习论坛

标题: rename datafile时报错ORA-01511,ORA-01121,ORA-01110 [打印本页]

作者: 刘泽宇    时间: 2021-7-11 17:28
标题: rename datafile时报错ORA-01511,ORA-01121,ORA-01110
现象:
实例启动到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;







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2