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/system.416.833384105' to '+testdg/rac/datafile/system.dbf';
alter database rename file '+data/rac/datafile/system.416.833384105' to '+testdg/rac/datafile/system.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/system.416.833384105'
分析:
只所以出现这种情况因为我的DB是RAC环境,另一个节点是open状态,导致出现上面报错。
解决方案:
关闭另一个节点的实例。
[Oracle@saprac4 ~]$ dba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Dec 5 16:15:06 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
再在节点1上执行rename datafile。
SQL> ALTER DATABASE RENAME FILE '+DATA/rac/datafile/system.416.833384105' TO '+TESTDG/rac/datafile/system.dbf';
Database altered.
SQL>
SQL>
SQL> ALTER DATABASE RENAME FILE '+DATA/rac/datafile/sysaux.417.833384107' TO '+TESTDG/rac/datafile/sysaux.dbf';
ALTER DATABASE RENAME FILE '+DATA/rac/datafile/undotbs1.418.833384107' TO '+TESTDG/rac/datafile/undotbs1.dbf';
ALTER DATABASE RENAME FILE '+DATA/rac/datafile/users.419.833384109' TO '+TESTDG/rac/datafile/users.dbf';
ALTER DATABASE RENAME FILE '+DATA/rac/datafile/undotbs2.424.833384491' TO '+TESTDG/rac/datafile/undotbs2.dbf';
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
SQL>
SQL>
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '+TESTDG/rac/datafile/system.dbf'
SQL> recover database;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+TESTDG/rac/datafile/system.dbf
+TESTDG/rac/datafile/sysaux.dbf
+TESTDG/rac/datafile/undotbs1.dbf
+TESTDG/rac/datafile/users.dbf
+TESTDG/rac/datafile/undotbs2.dbf
SQL>
相关阅读:
ORA-01172、ORA-01151错误处理
ORA-00600 [2662]错误解决
ORA-01078 和 LRM-00109 报错解决方法
ORA-00471 处理方法笔记
ORA-00314,redolog 损坏,或丢失处理方法
ORA-00257 归档日志过大导致无法存储的解决办法

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号