Oracle RAC 更改DB_UNIQUE_NAME
背景
遇到一个场景是更改 RAC 架构下的 Oracle DB_UNIQUE_NAME ,使得跟DB_NAME不一致,尝试了网上的方法,都没能成功,最后是看了官方support的solution,下面是主要操作步骤,11g203版本,已经验证是没问题的。
具体操作步骤
For example, a database that was originally created with Global Database Name "<database>" would have a db_name and db_unique_name of "<database>" and its corresponding CRS database resource would be named "ora.<database>.db". Changing the db_unique_name requires a complete restart of the database.
-
Remove the database, instance and service resources from CRS, this does NOT affect database itself.
$ srvctl stop database -d <database>
$ srvctl remove database -d <database> -
Start the database and change the db_unique_name at database level.
SQL> Startup;
SQL> alter system set db_unique_name=<database>_test scope=spfile sid='';
SQL> alter system set db_domain=<domain> scope=spfile sid=''; << only required when db_domain needs to be changed.
SQL> alter database rename global_name to <database>_test.<domain>; -
Now add the database resource to cluster-level.
$ srvctl add database -d <database>_test -n <node> -o <ORACLE_HOME>
$ srvctl add instance -d <database>_test -i <instance1> -n <node1>
$ srvctl add instance -d <database>_test -i <instance2> -n <node2> -
Create dependency between database and ASM instance so that database starts after ASM instance starts.
$ srvctl modify instance -d <database>_test -i <instance1> -s +ASM1
$ srvctl modify instance -d <database>_test -i <instance2> -s +ASM2Please
note that, for 11.2, it is no longer required to modify at instance level, it should be done at database level:
srvctl modify database -d <db_unique_name> -a "<diskgroup_list>
"5) Create database service, the following example add service with both instances as preferred
$ srvctl add service -d <database>_test -s <service> -r "<instance1>,<instance2>"
备注
IT 内容具有时效性,未避免更新后未同步,请点击查看最新内容:Oracle RAC 更改 DB_UNIQUE_NAME
文章首发于:http://nebofeng.com/2023/04/21/oracle-rac-%e6%9b%b4%e6%94%b9db_unique_name/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix