Running two nodes, collabn1 and collabn2 as virtual machines (could be physical does not matter).
MADRID is a 12c Oracle database with a pluggable database BERLIN.
Added a service BERLIN_SVC with a preferred server instance of MADRID2 i.e. collabn2
Check the service...
[oracle@collabn2 admin]$ srvctl status database -db MADRID -v
Instance MADRID1 is running on node collabn1. Instance status: Open.
Instance MADRID2 is running on node collabn2. Instance status: Open.
[oracle@collabn2 admin]$ srvctl add service -d MADRID -service BERLIN_SVC.RACATTACK -pdb BERLIN -preferred MADRID2
Make sure to start the service and as if by magic, new service on second node.
[oracle@collabn2 admin]$ srvctl start service -service BERLIN_SVC.RACATTACK -db MADRID
[oracle@collabn2 admin]$ srvctl status database -db MADRID -v
Instance MADRID1 is running on node collabn1. Instance status: Open.
Instance MADRID2 is running on node collabn2 with online services BERLIN_SVC.RACATTACK. Instance status: Open.
[oracle@collabn2 admin]$ . oraenv
[oracle@collabn2 admin]$ srvctl start service -service BERLIN_SVC.RACATTACK -db MADRID
[oracle@collabn2 admin]$ srvctl status database -db MADRID -v
Instance MADRID1 is running on node collabn1. Instance status: Open.
Instance MADRID2 is running on node collabn2 with online services BERLIN_SVC.RACATTACK. Instance status: Open.
[oracle@collabn2 admin]$ . oraenv
ORACLE_SID = [+ASM2] ? MADRID
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@collabn2 admin]$ export ORACLE_SID=MADRID2
[oracle@collabn2 admin]$ sqlplus system/racattack
SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 8 14:26:13 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Wed Feb 08 2017 14:04:44 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Connect with the new service
SQL> connect system/racattack@collabn-cluster-scan.racattack:1521/BERLIN_SVC.RACATTACK
Connected.
Remember this is RAC so need to gv$ not the typical v$
SQL> select host_name from gv$instance where instance_number=userenv('instance');
HOST_NAME
----------------------------------------------------------------
collabn2.racattack
SQL> exit
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@collabn2 admin]$ export ORACLE_SID=MADRID2
[oracle@collabn2 admin]$ sqlplus system/racattack
SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 8 14:26:13 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Wed Feb 08 2017 14:04:44 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Connect with the new service
SQL> connect system/racattack@collabn-cluster-scan.racattack:1521/BERLIN_SVC.RACATTACK
Connected.
Remember this is RAC so need to gv$ not the typical v$
SQL> select host_name from gv$instance where instance_number=userenv('instance');
HOST_NAME
----------------------------------------------------------------
collabn2.racattack
SQL> exit