Oracle 12cR1 RAC Creating Services with PDBs
OracleOracle RACOracle Database 12c check the open modes of all the PDBs on a RAC instance when you connect to the CDB root [oracle@zhongwc1 ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) [oracle@zhongwc1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on Mon Oct 14 20:12:25 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY ZHONGWC1 READ WRITE ZHONGWC2 READ WRITE SQL> The default database service with the same name as the PDB is created automatically during PDB creation. You should only use this default service to connect to the PDB for administrative tasks. For applications to access the PDB, you need to create user-defined services for the PDB. In Oracle 12c, the database service has an optional PDB property which allows you to create a database service that is associated with a PDB. [oracle@zhongwc1 ~]$ srvctl add service -db zwc -service crm -pdb zhongwc1 -preferred zwc1 [oracle@zhongwc1 ~]$ srvctl add service -db zwc -service erp -pdb zhongwc1 -preferred zwc2 SQL> select name,pdb from dba_services; NAME PDB -------------------- -------------------- SYS$BACKGROUND CDB$ROOT SYS$USERS CDB$ROOT zwcXDB CDB$ROOT zwc CDB$ROOT SQL>conn sys/oracle10gOCP@zhongwc-cluster-scan:1521/zhongwc1 as sysdba Connected. SQL> select name,pdb from dba_services; NAME PDB -------------------- -------------------- zhongwc1 ZHONGWC1 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 ZHONGWC1 READ WRITE NO Start service [oracle@zhongwc1 ~]$ srvctl config service -db zwc Service name: crm Service is enabled Server pool: zwc_crm Cardinality: 1 Disconnect: false Service role: PRIMARY Management policy: AUTOMATIC DTP transaction: false AQ HA notifications: false Global: false Commit Outcome: false Failover type: Failover method: TAF failover retries: TAF failover delay: Connection Load Balancing Goal: LONG Runtime Load Balancing Goal: NONE TAF policy specification: NONE Edition: Pluggable database name: zhongwc1 Maximum lag time: ANY SQL Translation Profile: Retention: 86400 seconds Replay Initiation Time: 300 seconds Session State Consistency: Preferred instances: zwc1 Available instances: Service name: erp Service is enabled Server pool: zwc_erp Cardinality: 1 Disconnect: false Service role: PRIMARY Management policy: AUTOMATIC DTP transaction: false AQ HA notifications: false Global: false Commit Outcome: false Failover type: Failover method: TAF failover retries: TAF failover delay: Connection Load Balancing Goal: LONG Runtime Load Balancing Goal: NONE TAF policy specification: NONE Edition: Pluggable database name: zhongwc1 Maximum lag time: ANY SQL Translation Profile: Retention: 86400 seconds Replay Initiation Time: 300 seconds Session State Consistency: Pre