ORACLE RAC 修改实例名(实操记录)
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
6、创建新的实例之一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.
7、Startup the database with new pfile file and create a spfile using new pfile.
8、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
9、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)))