RE: Issues Connecting to PDB

From: Scott Canaan <srcdco_at_rit.edu>
Date: Wed, 29 Jun 2022 19:52:03 +0000
Message-ID: <MWHPR16MB1550FA9ECD8A022B9CAA62A1C5BB9_at_MWHPR16MB1550.namprd16.prod.outlook.com>



I removed the pdb entry from the listener.ora file and the tnsnames.ora file and restarted the listener.

Now, I get:

oracle_at_vmora00b7:DBA2CTST>sqlplus sys_at_dba2ptst as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 29 15:51:29 2022 Version 19.15.0.0.0

Copyright (c) 1982, 2022, Oracle. All rights reserved.

Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Scott Canaan ‘88
Sr Database Administrator
Information & Technology Services
Finance & Administration
Rochester Institute of Technology
o: (585) 475-7886 | f: (585) 475-7520
srcdco_at_rit.edu<mailto:srcdco_at_rit.edu> | c: (585) 339-8659

CONFIDENTIALITY NOTE: The information transmitted, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and destroy any copies of this information.

From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> On Behalf Of Al B. Sent: Tuesday, June 28, 2022 10:21 PM
To: Scott Canaan <srcdco_at_rit.edu>
Cc: oracle-l_at_freelists.org
Subject: Re: Issues Connecting to PDB

Hi Scott,

Listener.ora does not need a separate entry for PDB, because there is no such thing as PDB instance. As soon as listener knows about container instance, the PDB inside that container should auto register with the listener as a service with the name equal to PDB name. Try to remove the PDB entry and see if it helps.

Good luck,
Albert Balbekov

On Tue, Jun 28, 2022 at 10:25 AM Scott Canaan <srcdco_at_rit.edu<mailto:srcdco_at_rit.edu>> wrote: I am playing with containers to try to learn the nuances. I have a container database and one pdb. The particulars are:

Oracle version: 19.15
O/S: Red Hat 7
Container: dba2ctst
Pdb: dba2ptst

Both the container and pdb are open:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DBA2PTST                       READ WRITE NO

I set the system password in both (I think), using the following command:

SQL> alter user system identified by xxxxxxxxxxxxxxx container=all;

User altered.

When I try to connect to the pdb, I get an ORA-01034:

SQL> conn system_at_dba2ptst
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory Additional information: 4475
Additional information: -1748254857
Process ID: 0
Session ID: 0 Serial number: 0

Warning: You are no longer connected to ORACLE.

The alert log doesn’t have any errors indicating what file might be missing.

I’m thinking the issue is really with the listener and tnsnames.ora file. The listener has the following entry:

   (SID_DESC =
(GLOBAL_DBNAME = dba2ctst.rit.edu<http://dba2ctst.rit.edu>)
(SID_NAME = DBA2CTST)
(ORACLE_HOME = /oracle/app/product/19.0.0.0<http://19.0.0.0>)
    )
    (SID_DESC =

#      (GLOBAL_DBNAME = dba2ptst.rit.edu<http://dba2ptst.rit.edu>)

(SID_NAME = DBA2PTST)
(SERVICE_NAME = DBA2PTST)
(ORACLE_HOME = /oracle/app/product/19.0.0.0<http://19.0.0.0>)
    )

The entries in the tnsnames.ora file are:

DBA2CTST =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT =1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = DBA2CTST))   )

DBA2PTST =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT =1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = DBA2PTST))   )

The lsnrctl status command returns:

Services Summary...
Service "DBA2PTST" has 1 instance(s).
  Instance "DBA2PTST", status UNKNOWN, has 1 handler(s) for this service... Service "dba2ctst.rit.edu<http://dba2ctst.rit.edu>" has 1 instance(s).   Instance "DBA2CTST", status UNKNOWN, has 1 handler(s) for this service...

I thought you were supposed to be able to connect directly to a pdb, as if it were a standalone database. I’m sure it is something simple, I just can’t see it.

Thank you,

Scott Canaan ‘88
Sr Database Administrator
Information & Technology Services
Finance & Administration
Rochester Institute of Technology
o: (585) 475-7886 | f: (585) 475-7520
srcdco_at_rit.edu<mailto:srcdco_at_rit.edu> | c: (585) 339-8659 CONFIDENTIALITY NOTE: The information transmitted, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and destroy any copies of this information.

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 29 2022 - 21:52:03 CEST

Original text of this message