RAC增加控制文件

查询现有控制文件

SQL>  SELECT NAME FROM V$CONTROLFILE ;


NAME
--------------------------------------------------------------------------------
+DATA/REPORT/CONTROLFILE/current.262.1150058049
+DATA/REPORT/CONTROLFILE/current.261.1150058049

创建pfile,防止后续调整spfile有问题无法启动库

SQL> create pfile='/home/oracle/pfile1103.ora' from spfile;

File created.

备份下控制文件

SQL> alter database backup controlfile to '/home/oracle/controlfile_report.ctl';

Database altered.
 

关闭数据库

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
启动到nomount状态

SQL> startup nomount
ORACLE instance started.

Total System Global Area 2466249664 bytes
Fixed Size                  8899520 bytes
Variable Size            1426063360 bytes
Database Buffers         1023410176 bytes
Redo Buffers                7876608 bytes


rman创建个控制文件

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.2.0.0
[oracle@tab-prd-db04 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Mon Nov 13 18:48:07 2023
Version 19.13.2.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: REPORT (not mounted)
 

RMAN> restore controlfile to '+DATA' from '+DATA/REPORT/CONTROLFILE/current.262.1150058049';

RMAN> exit


Recovery Manager complete.
切换grid用户并查看新控制文件路径

[root@tab-prd-db04 ~]# pwd&& su - grid
/root
Last login: Mon Nov 13 18:37:09 CST 2023
[grid@tab-prd-db04 ~]$ asmcmd
ASMCMD> cd '+DATA/REPORT/CONTROLFILE/
ASMCMD-8007: unclosed single quotation mark
ASMCMD> cd +DATA/REPORT/CONTROLFILE/
ASMCMD> ls
Current.261.1150058049
Current.262.1150058049
current.293.1152816497
 

ASMCMD> exit
[grid@tab-prd-db04 ~]$ exit
logout
[root@tab-prd-db04 ~]# pwd&& su - oracle
/root
Last login: Mon Nov 13 18:37:10 CST 2023
[oracle@tab-prd-db04 ~]$  sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 13 18:49:43 2023
Version 19.13.2.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.2.0.0

确认数据库状态

SQL> select status from v$instance;

STATUS
------------
STARTED

增加新建数据库控制文件

SQL> alter system set control_files='+DATA/REPORT/CONTROLFILE/Current.261.1150058049','+DATA/REPORT/CONTROLFILE/Current.262.1150058049','+DATA/REPORT/CONTROLFILE/Current.293.1152816497' scope=spfile sid='*';

System altered.

关库

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.

启动(使用spfile)
SQL> startup
ORACLE instance started.

Total System Global Area 2466249664 bytes
Fixed Size                  8899520 bytes
Variable Size            1426063360 bytes
Database Buffers         1023410176 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
 

万一修改过程中出现问题,使用原来的pfile启动,创建spfile(注意创建spfile,需要指定路径,否则启动依旧失败)

SQL> startup pfile='/home/oracle/pfile1103.ora'

SQL> create spfile='+DATA' from pfile='/home/oracle/pfile1103.ora';

File created.


其他关闭库的方式,但是不太会用(新新DBA)

[oracle@tab-prd-db04 ~]$  srvctl stop instance -d report -i report1,report2 -o immediate
 

[oracle@tab-prd-db04 ~]$  srvctl start database -d report -o nomount

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值