1.创建服务
11g
[oracle@node1 ~]$ srvctl add service -d prod -s test -r prod1 -a prod2 -P PRECONNECT
[oracle@node1 ~]$ srvctl start service -d prod -s test
[oracle@node1 ~]$ srvctl status service -d prod -s test
19c
srvctl add service -db orcl -service test -preferred orcl1 -available orcl2
srvctl start service -db orcl -service test
srvctl status service -db orcl -service test
srvctl enable service -db orcl -service test
select dbs.NAME, dbs.FAILOVER_METHOD, dbs.FAILOVER_TYPE, dbs.CLB_GOAL
from dba_services dbs;
2.服务迁移
19c:
srvctl relocate service -d <db_unique_name> -s <service_name> -oldinst <old_instance_name> -newinst <new_instance_name>
srvctl relocate service -db orcl -service test -oldinst orcl1 -newinst orcl2
11g:
srvctl relocate service -d prod -s test -i prod1 -t prod2