y18511664518
作者y18511664518·2017-09-26 15:11
技术总监·长城超云

ORACLE RAC 修改实例名(实际操作记录分享)

字数 1496阅读 2754评论 2赞 5
  1. 备份全库和spfile
    backup as compressed backupset database plus archivelog;
    expdp dbank/dbank directory=dmp_dir dumpfile=dbank_2015623.dmp logfile=dbank.log parallel=5 SCHEMAS=DBANK
    Create pfile from spfile;
  2. 收集数据库信息
    $DB_HOME/bin/srvctl config database -d <db_unique_name> -a
    $DB_HOME/bin/srvctl config service -d <db_unique_name>
  3. 创建一个新的pfile
    Create pfile from spfile;
  4. 关闭所有节点
    crsctl stop cluster -all
  5. 重命名或编辑实例名称和其他参数使用实例名称。

For example: instance_name, service_names

  1. 创建新的实例之一Sid名字节点新密码文件。复制密码文件到其他节点和重命名它与相应的新的SID的名字。
    If Data guard is in use, copy the password file from the primary $ORACLE_HOMEs to the standby server and rename it with the corresponding standby SID name.
  2. Startup the database with new pfile file and create a spfile using new pfile.
  3. Remove the old instance name and add a new instance name using srvctl command. ( Follow below for all instances whose names are changed )

$ srvctl remove instance -d <db_unique_name> -i <instance_name>
$ srvctl add instance -d <db_unique_name> -i <instance_name> -n <node>
Configure the services back (if necessary)

$ srvctl modify service -d <db_unique_name> -s <service_name>
Start the database

$ srvctl start database -d <db_unique_name>

SQL> select instance_name,status from gv$instance

  1. Check tnsnames.ora, if INSTANCE_NAME is used, rename it accordingly.

For example:

net_service_name=
(DESCRIPTION=
(ADDRESS=...)
(ADDRESS=...)
(CONNECT_DATA=

(SERVICE_NAME=sales.us.example.com)
(INSTANCE_NAME=sales1)))

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

5

添加新评论2 条评论

zhao_20020680zhao_20020680网络工程师河北唐山
2020-02-24 10:11
学习学习,感谢!
wuwenpinwuwenpin软件开发工程师南京
2017-09-26 15:32
非常不错。
Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广