关闭

rename datafile时报错ORA-01511,ORA-01121,ORA-01110

945人阅读 评论(0) 收藏 举报
分类:
现象:
实例启动到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>

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:140412次
    • 积分:2562
    • 等级:
    • 排名:第14336名
    • 原创:111篇
    • 转载:14篇
    • 译文:1篇
    • 评论:16条
    文章分类
    最新评论