admin

oracle11g修改控制文件位置

admin 数据库 2019-04-25 2170浏览 0

oracle修改控制文件位置

[oracle@mtgrdb1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 25 10:35:06 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/data1/app/Oracle/mtgrdb/control01.ctl
/data0/app/Oracle/fast_recovery_area/mtgrdb/control02.ctl


[oracle@mtgrdb1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 25 13:40:31 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size		    2254952 bytes
Variable Size		  587204504 bytes
Database Buffers	 1526726656 bytes
Redo Buffers		   21700608 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/data1/app/Oracle/mtgrdb/control01.ctl
/data0/app/Oracle/fast_recovery_area/mtgrdb/control02.ctl

SQL> alter system set control_files='/data1/app/Oracle/mtgrdb/control01.ctl','/data1/app/Oracle/mtgrdb/control02.ctl' scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size		    2254952 bytes
Variable Size		  587204504 bytes
Database Buffers	 1526726656 bytes
Redo Buffers		   21700608 bytes
ORA-00214: control file '/data1/app/Oracle/mtgrdb/control01.ctl' version 1554
inconsistent with file '/data1/app/Oracle/mtgrdb/control02.ctl' version 1551

提示两个控制文件不匹配,这里很简单,把control02.ctl 重命名,然后拷贝一份control01.ctl 就可以了。

acle@mtgrdb1 ~]$ cd /data1/app/Oracle/mtgrdb/

[oracle@mtgrdb1 mtgrdb]$ mv control02.ctl bak

[oracle@mtgrdb1 mtgrdb]$ cp control01.ctl control02.ctl 

然后重启oracle即可!

版权声明

本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。

发表评论