oracle rac重建控制文件
2016-08-14 16:06 abce 阅读(1302) 评论(0) 编辑 收藏 举报1.使用sqlplus连接到已经mount或open的rac数据库
1 | sql> alter database backup controlfile to trace noresetlogs; |
2.找出对应的trace文件
3.编写脚本control.sql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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.关闭数据库所有实例
1 | $ srvctl stop database -d orcl -o immediate |
5.备份当前的控制文件
6.确保实例设置都是针对thread 1
1 2 | instance = 1 thread = 1 |
7.将参数文件中的cluster_database设置为false
如果是使用spfile:
1 2 3 | sql> startup nomount sql> alter system set cluster_database= false scope=spfile; sql> shutdown |
8.运行脚本创建新的控制文件
1 2 | sqlplus / as sysdba SQL> @control.sql |
9.将参数cluster_database设置为true
1 | sql> alter system set cluster_database= true scope=spfile; |
10.关闭数据库
1 | sql> shutdown immediate |
11.启动所有实例
1 2 | $ srvctl start database -d orcl $ srvctl status database -d orcl |
12.备份数据库
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
2015-08-14 RHCE7 -- IPv6
2015-08-14 RHEL7 -- nmcli的使用
2015-08-14 设置Adobe Reader打开PDF文件保持记忆功能