Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

12c-Reconfiguring default pluggable database service name after been removed

JuanMSep 7 2016 — edited Sep 9 2016

Hi all,

Sorry for long post but I deleted the default pluggabled database service name and now I cannot configure it again.

Is it important to know that I am practicing with 12cR1.

Here what I did:

Environment:

$ cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.2 (Maipo)

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> select banner from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

PL/SQL Release 12.1.0.2.0 - Production

CORE    12.1.0.2.0      Production

TNS for Linux: Version 12.1.0.2.0 - Production

NLSRTL Version 12.1.0.2.0 - Production

I've already delete the default pluggable databaser service using:

$ srvctl revome service -db CCGP -service PCCPG1.circulodecredito.com.mx

The command was succesful.

When I tried to add again the service, this error is faced:

$ srvctl add service -db CCGP -service PCCPG1.circulodecredito.com.mx -pdb PCCPG1

Raising the following error:

PRCD-1278 : The service name PCCPG1.circulodecredito.com.mx cannot be same as the pluggable database default service name PCCPG1.circulodecredito.com.mx

Viewing the Pluggable Databases Status I get the following:

>Viewing the Name and Open Mode of Each PDB

NAME            OPEN_MODE  RESTRICTED OPEN_TIME

--------------- ---------- ---------- -----------------------------------

PDB$SEED        READ ONLY  NO         06-SEP-16 05.56.51.654 PM -04:00

PCCGP1          READ WRITE NO         06-SEP-16 06.00.09.137 PM -04:00

The pbd PCCGP1 is in _READ WRITE_ open mode.

When I stopped the pbd PCCGP1, everithing it seems be fine.

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE;

Pluggable database altered.

Alert Log shows:

Wed Sep 07 09:05:50 2016

ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE

Wed Sep 07 09:05:50 2016

ALTER SYSTEM: Flushing buffer cache inst=0 container=3 local

Pluggable database PCCGP1 closed

Completed: ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE

The status of pbd now is _MOUNTED_

>Viewing the Name and Open Mode of Each PDB

NAME            OPEN_MODE  RESTRICTED OPEN_TIME

--------------- ---------- ---------- -----------------------------------

PDB$SEED        READ ONLY  NO         06-SEP-16 05.56.51.654 PM -04:00

PCCGP1          MOUNTED               07-SEP-16 09.05.50.961 AM -04:00

But, when I starting the pbd, the following error is showed:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE;

ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE

*

ERROR at line 1:

ORA-44304: service  does not exist

ORA-44777: Pluggable database service cannot be started.

But pbd is oppened fine...

>Viewing the Name and Open Mode of Each PDB

NAME            OPEN_MODE  RESTRICTED OPEN_TIME

--------------- ---------- ---------- -----------------------------------

PDB$SEED        READ ONLY  NO         06-SEP-16 05.56.51.654 PM -04:00

PCCGP1          READ WRITE NO         07-SEP-16 09.07.33.483 AM -04:00

Listener is not showing the Service PCCGP1.circulodecredito.com.mx

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> host lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:08:41

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 21 hr. 58 min. 18 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

I create a new service, to CCGP and the added the pbd

$ srvctl add service -db CCGP -service PCCPG1.circulodecredito.com.mx

$ srvctl modify service -db CCGP -service PCCGP1.circulodecredito.com.mx -pdb PCCGP1

$ srvctl config service -db CCGP -service PCCGP1.circulodecredito.com.mx

Service name: PCCGP1.circulodecredito.com.mx

Cardinality: SINGLETON

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: PCCGP1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Maximum lag time: ANY

SQL Translation Profile:

Retention: 86400 seconds

Replay Initiation Time: 300 seconds

Session State Consistency:

GSM Flags: 0

Service is enabled

I starting the service:

$ srvctl start service -db CCGP -service PCCGP1.circulodecredito.com.mx

$ srvctl status service -db CCGP -service PCCGP1.circulodecredito.com.mx

Service PCCGP1.circulodecredito.com.mx is running

Now, the listener shows the service:

$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:12:35

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 22 hr. 2 min. 12 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "PCCGP1.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

Oppening the pdb:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE;

Pluggable database altered.

Alert Log shows:

ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE

Wed Sep 07 09:13:18 2016

Immediate Kill Session#: 128, Serial#: 61315

Immediate Kill Session: sess: 0x1cee0db98  OS pid: 29955

ALTER SYSTEM: Flushing buffer cache inst=0 container=3 local

Pluggable database PCCGP1 closed

Completed: ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE

Pluggable database status is _MOUNTED_:

>Viewing the Name and Open Mode of Each PDB

NAME            OPEN_MODE  RESTRICTED OPEN_TIME

--------------- ---------- ---------- -----------------------------------

PDB$SEED        READ ONLY  NO         06-SEP-16 05.56.51.654 PM -04:00

PCCGP1          MOUNTED               07-SEP-16 09.13.19.804 AM -04:00

Services are shown as following:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> select con_id, name from v$services;

CON_ID NAME

------- ------------------------------

      3 PCCGP1.circulodecredito.com.mx

      1 CCGPXDB

      1 CCGP.circulodecredito.com.mx

      1 SYS$BACKGROUND

      1 SYS$USERS

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> select service_id, name, pdb from all_services;

SERVICE_ID NAME                           PDB

---------- ------------------------------ --------------------

         1 SYS$BACKGROUND                 CDB$ROOT

         2 SYS$USERS                      CDB$ROOT

         5 CCGPXDB                        CDB$ROOT

         6 CCGP.circulodecredito.com.mx   CDB$ROOT

Starting again the pdb:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE;

ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE

*

ERROR at line 1:

ORA-44304: service  does not exist

ORA-44777: Pluggable database service cannot be started.

Listener does not have the service:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> host lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:19:51

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 22 hr. 9 min. 27 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

I starting manually the service:

$ srvctl start service -db CCGP -service PCCGP1.circulodecredito.com.mx

$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:20:51

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 22 hr. 10 min. 28 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "PCCGP1.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

When I stopping the pdb, the service also is stopped:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 CLOSE IMMEDIATE;

Pluggable database altered.

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> host lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:22:38

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 22 hr. 12 min. 15 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

But, when the pdb is oppened, the service still not automatically started:

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE;

ALTER PLUGGABLE DATABASE PCCGP1 OPEN READ WRITE

*

ERROR at line 1:

ORA-44304: service  does not exist

ORA-44777: Pluggable database service cannot be started.

[SYS@CCGP:CDB$ROOT]AS SYSDBA SQL> host lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-SEP-2016 09:23:52

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                02-SEP-2016 11:10:23

Uptime                    4 days 22 hr. 13 min. 28 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora

Listener Log File         /u01/app/grid/diag/tnslsnr/liferay-bd-desarrollo/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=liferay-bd-desarrollo)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "CCGP.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

Service "CCGPXDB.circulodecredito.com.mx" has 1 instance(s).

  Instance "CCGP", status READY, has 1 handler(s) for this service...

The command completed successfully

Question is:

          Do you know how to add the default service to pdb after been removed?

Thanks in advance.

Regards,

Juan M

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 7 2016
Added on Sep 7 2016
6 comments
2,165 views