标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-00742 ORA-01110 ORA-01555 ORA-01578 ORA-01595 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (103)
- 数据库 (1,742)
- DB2 (22)
- MySQL (75)
- Oracle (1,591)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (162)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (68)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (582)
- Oracle安装升级 (95)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (84)
- PostgreSQL (27)
- pdu工具 (5)
- PostgreSQL恢复 (9)
- SQL Server (30)
- SQL Server恢复 (11)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- ora-600 kdsgrp1 错误描述
- GAM、SGAM 或 PFS 页上存在页错误处理
- ORA-600 krhpfh_03-1208
- VMware勒索加密恢复(vmdk勒索恢复)
- ORA-39773: parse of metadata stream failed故障处理
- sql数据库备份失败—失败: 23(数据错误(循环冗余检查)
- vmdk文件被加密恢复(虚拟机文件加密)
- 差点被误操作的ORA-600 kcratr_nab_less_than_odr故障
- win平台19c 打patch遭遇2个小问题汇总
- pg单个数据库目录恢复-pdu恢复单个数据库目录数据
- pg删除数据恢复—pdu恢复pg delete数据
- .[OnlyBuy@cyberfear.com].REVRAC勒索mysql恢复
- 表dml操作权限授权给public,导致只读用户失效
- 21c数据库恢复遭遇ora-600 ktugct: corruption detected
- pg_control丢失/损坏处理
- 当前主流数据库版本服务支持周期-202503
- pg启动报invalid checkpoint record处理
- 删除redo导致ORA-00313 ORA-00312故障处理
- Navicat连接postgresql时出现column “datlastsysoid” does not exist错误解决
- aix磁盘损坏oracle数据库恢复
标签归档:ORACLE 12C
ORACLE 12C创建CDB数据库脚本解析
对于ORACLE 12C 创建含pdb的脚本进行了初步的分析,欢迎一起探讨
ORACLE 12C创建CDB数据库脚本解析
ORACLE 12C RAC hub AND leaf 相互转换
感谢Lunar的指导,完成ORACLE 12C RAC hub和leaf相互转换,参考官方文档Oracle Flex Clusters部分
当前数据库状态
--集群状态 [root@rac1 ~]# crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE ONLINE rac1 Open,STABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac1 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --rac运行在flex模式 [root@rac1 ~]# crsctl get cluster mode status Cluster is running in "flex" mode --asm运行在flex模式 [grid@rac1 ~]$ asmcmd ASMCMD> showclustermode ASM cluster : Flex mode enabled --节点角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'hub' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
转换hub to leaf
--转换hub为leaf [root@rac1 ~]# crsctl set node role leaf CRS-4408: Node 'rac1' configured role successfully changed; restart Oracle High Availability Services for new role to take effect. --关闭集群 [root@rac1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.crsd' on 'rac1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.SYSDB_NEW.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.SYSDG.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.ora12c.db' on 'rac1' CRS-2673: Attempting to stop 'ora.proxy_advm' on 'rac1' CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1' CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2' CRS-2677: Stop of 'ora.ora12c.db' on 'rac1' succeeded CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2' CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded CRS-2677: Stop of 'ora.SYSDB_NEW.dg' on 'rac1' succeeded CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2' CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded CRS-2677: Stop of 'ora.SYSDG.dg' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac1' CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded CRS-2677: Stop of 'ora.proxy_advm' on 'rac1' succeeded CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ons' on 'rac1' CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1' CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.storage' on 'rac1' CRS-2673: Attempting to stop 'ora.crf' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1' CRS-2677: Stop of 'ora.storage' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac1' CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1' CRS-2673: Attempting to stop 'ora.evmd' on 'rac1' CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac1' CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. --启动集群 [root@rac1 ~]# crsctl start crs -wait CRS-4123: Starting Oracle High Availability Services-managed resources CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2672: Attempting to start 'ora.evmd' on 'rac1' CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2789: Cannot stop resource 'ora.diskmon' as it is not running on server 'rac1' CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.storage' on 'rac1' CRS-2676: Start of 'ora.storage' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crf' on 'rac1' CRS-2676: Start of 'ora.crf' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac1' CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded CRS-6017: Processing resource auto-start for servers: rac1 CRS-6016: Resource auto-start has completed for server rac1 CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources CRS-4123: Oracle High Availability Services has been started. --hub转换为leaf后状态 [root@rac1 ~]# crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE OFFLINE STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE OFFLINE Instance Shutdown,ST ABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE INTERMEDIATE rac2 FAILED OVER,STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --集群角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'leaf' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
leaf转换为hub
--leaf转换为hub [root@rac1 ~]# crsctl set node role hub CRS-4408: Node 'rac1' configured role successfully changed; restart Oracle High Availability Services for new role to take effect. --关闭集群 [root@rac1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.crsd' on 'rac1' CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.storage' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1' CRS-2677: Stop of 'ora.storage' on 'rac1' succeeded CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'rac1' CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1' CRS-2673: Attempting to stop 'ora.evmd' on 'rac1' CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac1' CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. --启动集群 [root@rac1 ~]# crsctl start crs -wait CRS-4123: Starting Oracle High Availability Services-managed resources CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2672: Attempting to start 'ora.evmd' on 'rac1' CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2789: Cannot stop resource 'ora.diskmon' as it is not running on server 'rac1' CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.asm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.storage' on 'rac1' CRS-2676: Start of 'ora.storage' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crf' on 'rac1' CRS-2676: Start of 'ora.crf' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac1' CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded CRS-6017: Processing resource auto-start for servers: rac1 CRS-2672: Attempting to start 'ora.ons' on 'rac1' CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac2' CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac2' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac2' CRS-2677: Stop of 'ora.rac1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac1' CRS-2677: Stop of 'ora.scan1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac1' CRS-2676: Start of 'ora.rac1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'rac1' CRS-2676: Start of 'ora.scan1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac1' CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' succeeded CRS-2676: Start of 'ora.ons' on 'rac1' succeeded CRS-2676: Start of 'ora.LISTENER.lsnr' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded CRS-2676: Start of 'ora.asm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.proxy_advm' on 'rac1' CRS-2676: Start of 'ora.proxy_advm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.ora12c.db' on 'rac1' CRS-2676: Start of 'ora.ora12c.db' on 'rac1' succeeded CRS-6016: Resource auto-start has completed for server rac1 CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources CRS-4123: Oracle High Availability Services has been started. --集群状态 [root@rac1 ~]# crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE ONLINE rac1 Open,STABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac1 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --集群角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'hub' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
这里实现了ORACLE 12C RAC的leaf和hub 角色相互转换,在转换的过程中需要转移确认集群和ASM均为flex mode,如果参考相关文档完成转换
ORACLE 12C RAC修改ocr/votedisk/asm spfile所在磁盘组名称
今天看着我这个单节点的12C rac,突然觉得ocr所在的磁盘组叫做+DG_SYS有点不舒服,想改成+SYS_DG。处理方法是先把ocr/votedisk/asm spfile迁移到已经存在的asm中,然后修改磁盘组名称,最后迁移到新名称磁盘组中(本次处理流程+DG_SYS—>+DATA—>+SYS_DG)
当前运行情况
[grid@xifenfei ~]$ crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE xifenfei STABLE ora.DATA.dg ONLINE ONLINE xifenfei STABLE ora.LISTENER.lsnr ONLINE ONLINE xifenfei STABLE ora.net1.network ONLINE ONLINE xifenfei STABLE ora.ons ONLINE ONLINE xifenfei STABLE ora.proxy_advm ONLINE OFFLINE xifenfei STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE xifenfei STABLE ora.MGMTLSNR 1 ONLINE ONLINE xifenfei 169.254.196.108 10.1 0.30.22,STABLE ora.asm 1 ONLINE ONLINE xifenfei Started,STABLE 2 OFFLINE OFFLINE STABLE 3 OFFLINE OFFLINE STABLE ora.cdb.db 1 ONLINE ONLINE xifenfei Open,STABLE ora.cvu 1 ONLINE ONLINE xifenfei STABLE ora.oc4j 1 ONLINE ONLINE xifenfei STABLE ora.scan1.vip 1 ONLINE ONLINE xifenfei STABLE ora.xifenfei.vip 1 ONLINE ONLINE xifenfei STABLE -------------------------------------------------------------------------------- SQL> select * from v$version; BANNER CON_ID -------------------------------------------------------------------------------- ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 0 PL/SQL Release 12.1.0.1.0 - Production 0 CORE 12.1.0.1.0 Production 0 TNS for Linux: Version 12.1.0.1.0 - Production 0 NLSRTL Version 12.1.0.1.0 - Production 0 SQL> select name,state from v$asm_diskgroup; NAME STATE ------------------------------ ----------- DG_SYS MOUNTED DATA MOUNTED [grid@xifenfei ~]$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 60a037da30714f6bbfe5d90206ff27a7 (/dev/sdc2) [DG_SYS] Located 1 voting disk(s). [grid@xifenfei ~]$ ocrcheck Status of Oracle Cluster Registry is as follows : Version : 4 Total space (kbytes) : 409568 Used space (kbytes) : 1380 Available space (kbytes) : 408188 ID : 2132096904 Device/File Name : +DG_SYS Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check bypassed due to non-privileged user SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DG_SYS/xff-cluster/ASMPARAMET ERFILE/registry.253.825640465
修改ocr路径
ocrconfig -add和ocrconfig -delete完成ocr更换磁盘组,该过程可以在线处理
[root@xifenfei ~]# ocrconfig -add +data --alert 日志 2013-09-09 22:32:40.799: [crsd(5064)]CRS-1007:The OCR/OCR mirror location was replaced by +data. [root@xifenfei ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 4 Total space (kbytes) : 409568 Used space (kbytes) : 1380 Available space (kbytes) : 408188 ID : 2132096904 Device/File Name : +DG_SYS Device/File integrity check succeeded Device/File Name : +data Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded [root@xifenfei ~]# ocrconfig -delete +DG_SYS --alert 日志 2013-09-09 22:35:53.585: [crsd(5064)]CRS-1010:The OCR mirror location +DG_SYS was removed. [root@xifenfei ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 4 Total space (kbytes) : 409568 Used space (kbytes) : 1380 Available space (kbytes) : 408188 ID : 2132096904 Device/File Name : +data Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check succeeded
修改votedisk路径
通过crsctl replace votedisk命令修改
[root@xifenfei ~]# crsctl replace votedisk +DATA Successful addition of voting disk 161ddea0a5fe4f28bfb67536e6105122. Successful deletion of voting disk 60a037da30714f6bbfe5d90206ff27a7. Successfully replaced voting disk group with +DATA. CRS-4266: Voting file(s) successfully replaced -alert日志 2013-09-09 22:38:15.259: [cssd(4685)]CRS-1605:CSSD voting file is online: /dev/sdb; details in /u01/app/12.1/grid/product/log/xifenfei/cssd/ocssd.log. 2013-09-09 22:38:15.259: [cssd(4685)]CRS-1626:A Configuration change request completed successfully 2013-09-09 22:38:15.285: [cssd(4685)]CRS-1601:CSSD Reconfiguration complete. Active nodes are xifenfei . [root@xifenfei ~]# crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 161ddea0a5fe4f28bfb67536e6105122 (/dev/sdb) [DATA] Located 1 voting disk(s).
修改asm spfile位置
[grid@xifenfei ~]$ gpnptool get -o- Success. ………… <orcl:ASM-Profile id="asm" DiscoveryString="/dev/sd*" SPFile="+DG_SYS/xff-cluster/ASMPARAMETERFILE/registry.253.825640465" Mode="legacy"/> ………… [grid@xifenfei ~]$ sqlplus / as sysasm SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 9 22:42:05 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL> create pfile='/tmp/pfile.asm' from spfile; File created. SQL> create spfile='+DATA' FROM PFILE='/tmp/pfile.asm'; File created. [grid@xifenfei ~]$ gpnptool get -o- Success. ………… <orcl:ASM-Profile id="asm" DiscoveryString="/dev/sd*" SPFile="+DATA/xff-cluster/ASMPARAMETERFILE/registry.253.825720159" Mode="legacy"/> …………
这里证明create asm spfile会自动修改spfile在gpnptool对应的profile里面的配置,无需人工干预
重启crs
为了使得asm使用新的磁盘组中的spfile文件
[root@xifenfei ~]# crsctl stop crs [root@xifenfei ~]# crsctl start crs
验证+DG_SYS磁盘组未被使用
[grid@xifenfei ~]$ sqlplus / as sysasm SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 9 22:59:49 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DATA/xff-cluster/ASMPARAMETER FILE/registry.253.825720159 ASMCMD> lsof DB_Name Instance_Name Path +ASM +ASM1 +DATA.255.819326577 cdb cdb1 +DATA/CDB/CONTROLFILE/current.274.819356503 cdb cdb1 +DATA/CDB/DATAFILE/sysaux.278.819355829 cdb cdb1 +DATA/CDB/DATAFILE/system.269.819356101 cdb cdb1 +DATA/CDB/DATAFILE/undotbs1.276.819356317 cdb cdb1 +DATA/CDB/DATAFILE/users.279.819356309 cdb cdb1 +DATA/CDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/pdbseed_temp01.dbf cdb cdb1 +DATA/CDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.272.819356709 cdb cdb1 +DATA/CDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.271.819356709 cdb cdb1 +DATA/CDB/ONLINELOG/group_1.277.822736453 cdb cdb1 +DATA/CDB/ONLINELOG/group_2.280.822736461 cdb cdb1 +DATA/CDB/ONLINELOG/group_3.275.822736397 cdb cdb1 +DATA/CDB/TEMPFILE/temp.273.819356649
dismount +DG_SYS磁盘组
ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 20480 3369 0 3369 0 Y DATA/ MOUNTED EXTERN N 512 4096 1048576 5451 5231 0 5231 0 N DG_SYS/ ASMCMD> umount dg_sys ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 20480 3369 0 3369 0 Y DATA/
修改asm dg名称
修改磁盘组+DG_SYS为+SYS_DG
[grid@xifenfei ~]$ renamedg phase=both dgname=DG_SYS newdgname=SYS_DG verbose=true Parsing parameters.. Parameters in effect: Old DG name : DG_SYS New DG name : SYS_DG Phases : Phase 1 Phase 2 Discovery str : (null) Clean : TRUE Raw only : TRUE renamedg operation: phase=both dgname=DG_SYS newdgname=SYS_DG verbose=true Executing phase 1 Discovering the group Performing discovery with string: Identified disk UFS:/dev/sdc2 with disk number:0 and timestamp (32990496 1727895552) Checking for hearbeat... Re-discovering the group Performing discovery with string: Identified disk UFS:/dev/sdc2 with disk number:0 and timestamp (32990496 1727895552) Checking if the diskgroup is mounted or used by CSS Checking disk number:0 Generating configuration file.. Completed phase 1 Executing phase 2 Looking for /dev/sdc2 Modifying the header Completed phase 2 Terminating kgfd context 0x7fceeb02a0a0
mount +SYS_DG
SQL> select name,state from v$asm_diskgroup; NAME STATE ------------------------------ ----------- DATA MOUNTED SYS_DG DISMOUNTED SQL> alter diskgroup sys_dg mount; Diskgroup altered. SQL> select name,state from v$asm_diskgroup; NAME STATE ------------------------------ ----------- DATA MOUNTED SYS_DG MOUNTED
asm spfile/ocr/votedisk迁移从+DATA到+SYS_DG
SQL> create spfile='+SYS_DG' FROM pfile='/tmp/pfile.asm'; File created. [root@xifenfei ~]# ocrconfig -add +SYS_DG [root@xifenfei ~]# ocrconfig -DELETE +DATA [root@xifenfei ~]# crsctl replace votedisk +SYS_DG Successful addition of voting disk 9694a31053ea4ff4bfb57891461a1296. Successful deletion of voting disk 161ddea0a5fe4f28bfb67536e6105122. Successfully replaced voting disk group with +SYS_DG. CRS-4266: Voting file(s) successfully replaced [root@xifenfei ~]# crsctl stop crs [root@xifenfei ~]# crsctl start crs
删除ocr里面老磁盘组(+DG_SYS)信息
[root@xifenfei ~]# crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE xifenfei STABLE ora.DATA.dg ONLINE ONLINE xifenfei STABLE ora.DG_SYS.dg ONLINE OFFLINE xifenfei STABLE ora.LISTENER.lsnr ONLINE ONLINE xifenfei STABLE ora.SYS_DG.dg ONLINE ONLINE xifenfei STABLE ora.net1.network ONLINE ONLINE xifenfei STABLE ora.ons ONLINE ONLINE xifenfei STABLE ora.proxy_advm ONLINE OFFLINE xifenfei STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE xifenfei STABLE ora.MGMTLSNR 1 ONLINE ONLINE xifenfei 169.254.196.108 10.1 0.30.22,STABLE ora.asm 1 ONLINE ONLINE xifenfei Started,STABLE 2 OFFLINE OFFLINE STABLE 3 OFFLINE OFFLINE STABLE ora.cdb.db 1 ONLINE ONLINE xifenfei Open,STABLE ora.cvu 1 ONLINE ONLINE xifenfei STABLE ora.oc4j 1 ONLINE ONLINE xifenfei STABLE ora.scan1.vip 1 ONLINE ONLINE xifenfei STABLE ora.xifenfei.vip 1 ONLINE ONLINE xifenfei STABLE -------------------------------------------------------------------------------- [root@xifenfei ~]# srvctl remove diskgroup -diskgroup dg_sys [root@xifenfei ~]# crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE xifenfei STABLE ora.DATA.dg ONLINE ONLINE xifenfei STABLE ora.LISTENER.lsnr ONLINE ONLINE xifenfei STABLE ora.SYS_DG.dg ONLINE ONLINE xifenfei STABLE ora.net1.network ONLINE ONLINE xifenfei STABLE ora.ons ONLINE ONLINE xifenfei STABLE ora.proxy_advm ONLINE OFFLINE xifenfei STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE xifenfei STABLE ora.MGMTLSNR 1 ONLINE ONLINE xifenfei 169.254.196.108 10.1 0.30.22,STABLE ora.asm 1 ONLINE ONLINE xifenfei Started,STABLE 2 OFFLINE OFFLINE STABLE 3 OFFLINE OFFLINE STABLE ora.cdb.db 1 ONLINE ONLINE xifenfei Open,STABLE ora.cvu 1 ONLINE ONLINE xifenfei STABLE ora.oc4j 1 ONLINE ONLINE xifenfei STABLE ora.scan1.vip 1 ONLINE ONLINE xifenfei STABLE ora.xifenfei.vip 1 ONLINE ONLINE xifenfei STABLE --------------------------------------------------------------------------------
至此ocr/votedisk/asm spfile所在磁盘组修改名称完成,因为该库是一个单节点的rac,如果是两个或者更多节点的rac可以实现不停机的情况下进行(分步重启节点).该处理过程和11.2 rac完全相同,未有任何的改变