oracle rac重建控制文件

本文介绍了一种在已mount或open状态的RAC数据库中重建控制文件的方法,包括使用SQL*Plus执行命令、创建控制文件脚本、备份现有控制文件、修改参数文件等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.使用sqlplus连接到已经mount或open的rac数据库

sql> alter database backup controlfile to trace noresetlogs;

2.找出对应的trace文件
3.编写脚本control.sql

startup nomount
create controlfile reuse database "orcl" noresetlogs noarchivelog
maxlogfiles 192
maxlogmembers 3
maxdatafiles 1024
maxinstances 32
maxloghistory 292
logfile
group 1 '/ocfs01/rac/redo01.log' size 50m,
group 2 '/ocfs01/rac/redo02.log' size 50m,
group 3 '/ocfs01/rac/redo03.log' size 50m,
group 4 '/ocfs01/rac/redo04.log' size 50m
-- standby logfile
datafile
'/ocfs01/rac/system01.dbf',
'/ocfs01/rac/undotbs01.dbf',
'/ocfs01/rac/sysaux01.dbf',
'/ocfs01/rac/undotbs02.dbf',
'/ocfs01/rac/users01.dbf'
character set we8iso8859p1
recover database
alter database open;
alter tablespace temp add tempfile '/ocfs01/rac/temp01.dbf'
size 167772160 reuse autoextend off;

recover database
alter database open;
alter tablespace temp add tempfile '/ocfs01/rac/temp01.dbf'
size 524288000 reuse autoextend on next 655360 maxsize 32767m;

-- the next step is optional if gv$thread does not show all the threads:
-- alter database enable public thread 2;
-- repeat for other threads if applicable

4.关闭数据库所有实例

$ srvctl stop database -d orcl -o immediate

5.备份当前的控制文件

6.确保实例设置都是针对thread 1

instance = 1
thread = 1

7.将参数文件中的cluster_database设置为false
如果是使用spfile:

sql> startup nomount
sql> alter system set cluster_database=false scope=spfile;
sql> shutdown

8.运行脚本创建新的控制文件

sqlplus / as sysdba
SQL> @control.sql

9.将参数cluster_database设置为true

sql> alter system set cluster_database=true scope=spfile;

10.关闭数据库

sql> shutdown immediate

11.启动所有实例

$ srvctl start database -d orcl
$ srvctl status database -d orcl

12.备份数据库

 

转载于:https://www.cnblogs.com/abclife/p/5770407.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值