7 Replies Latest reply: Jul 15, 2013 2:38 PM by user11983135 RSS

    12c connection to a pdb with any application framework

    Jhon Carrillo

      Hi,

       

      I already install 12c and I have configured my CDB and PDB correctly. I also created a local user in the PDB.

       

      I can connect  to the CDB but I need to connect directly to the PDB from php and adf using the local user.

       

      So, the question is:

       

      What is the procedure to config the listener to connect directly to the PDB as 11g db?

       

      I have several apps in different application  frameworks working with 11g and I need to use my PDB as 11g DB.

       

      thnaks,

       

      Jhon

       

      DB 12c

        • 1. Re: 12c connection to a pdb with any application framework
          Jhon Carrillo

          Here the listener ouput:

           

          LSNRCTL> status

          Conectßndose a (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))

          ESTADO del LISTENER

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

          Alias                     LISTENER

          Versi¾n                   TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 - Production

          Fecha de Inicio       15-JUL-2013 09:31:36

          Tiempo Actividad   0 dÝas 0 hr. 8 min. 30 seg.

          Nivel de Rastreo        off

          Seguridad               ON: Local OS Authentication

          SNMP                      OFF

          Parßmetros del Listener   C:\app\oracle12c\db\product\12.1.0\dbhome_1\network\admin\listener.ora

          Log del Listener          C:\app\oracle12c\db\diag\tnslsnr\usuario-HP\listener\alert\log.xml

          Recibiendo Resumen de Puntos Finales...

            (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1522ipc)))

            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=usuario-HP)(PORT=1522)))

            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=usuario-HP)(PORT=5500))(Security=(my_wallet_directory=C:\APP\ORACLE12C\DB\admin\medsys\xdb_wallet))(Presentation=HTTP)(Session=RAW))

          Resumen de Servicios...

          El servicio "CLRExtProc" tiene 1 instancia(s).

            La instancia "CLRExtProc", con estado UNKNOWN, tiene 1 manejador(es) para este servicio...

          El servicio "medsys" tiene 1 instancia(s).

            La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

          El servicio "medsysXDB" tiene 1 instancia(s).

            La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

          El servicio "pdbmed" tiene 1 instancia(s).

            La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

          El comando ha terminado correctamente

           

           

           

          where my CDB is medsys and the PDB is pdbmed but I need to create a entry in the tnsnames file to see this instance. the normal config for tnsnames doesnot work:

           

          PDBMED =

            (DESCRIPTION =

              (ADDRESS = (PROTOCOL = TCP)(HOST = usuario-HP)(PORT = 1522))

              (CONNECT_DATA =

                (SERVER = DEDICATED)

                (SERVICE_NAME = pdbmed)

              )

            )

           

          What is missing to connect directly to the pdb?

           

          thanks.

           

          Jhon

          • 2. Re: 12c connection to a pdb with any application framework
            rp0428

            >

            where my CDB is medsys and the PDB is pdbmed but I need to create a entry in the tnsnames file to see this instance. the normal config for tnsnames doesnot work:

            >

            Sorry - Oracle NEVER produces exceptions or messages that say 'does not work' since that would have NO value or meaning in conveying what the problem is.

             

            You do not need to 'config the listener'; databases will register with the listener when they are opened.

             

            To 'connect directly to the pdb' you provide the service_name of the open PDB that you want to connect to.

            • 3. Re: 12c connection to a pdb with any application framework
              Jhon Carrillo

              • 4. Re: 12c connection to a pdb with any application framework
                rp0428

                Sorry - sql developer NEVER responds to any attempt by just saying 'no luck'.

                 

                No one can help you if you don't post EXACTLY what you are doing and EXACTLY the response you get.

                 

                I can connect to a 12c pdb just fine using sql developer.

                 

                The V$SERVICES, V$CONTAINERS and CDB_USERS views have info about the services, containers and users available.

                • 5. Re: 12c connection to a pdb with any application framework
                  Jhon Carrillo

                  According to your suggestion, here there is more information about the case:

                   

                  SQL> select name from V$SERVICES;

                   

                   

                  NAME

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

                  pdbmed <- this is the pdb i want to connect.

                  medsysXDB

                  medsys

                  SYS$BACKGROUND

                  SYS$USERS

                   

                  I create a local user called medimanager in pdbmed.

                   

                  So, I opened SQLDeveloper and create a new connection with this parameters:

                   

                  user: medimanager

                  password:****

                  host: localhost

                  port: 1522

                  SID: pdbmed

                   

                  When I test the connection I got this error:

                  Estado: Fallo:Fallo de la prueba: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

                   

                  Here is also the lsnrctl status output:

                   

                  LSNRCTL> status

                  Conectßndose a (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))

                  ESTADO del LISTENER

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

                  Alias                     LISTENER

                  Versi¾n                   TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 - Production

                  Fecha de Inicio       15-JUL-2013 09:31:36

                  Tiempo Actividad   0 dÝas 4 hr. 9 min. 19 seg.

                  Nivel de Rastreo        off

                  Seguridad               ON: Local OS Authentication

                  SNMP                      OFF

                  Parßmetros del Listener   C:\app\oracle12c\db\product\12.1.0\dbhome_1\network\admin\listener.ora

                  Log del Listener          C:\app\oracle12c\db\diag\tnslsnr\usuario-HP\listener\alert\log.xml

                  Recibiendo Resumen de Puntos Finales...

                    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1522ipc)))

                    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=usuario-HP)(PORT=1522)))

                    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=usuario-HP)(PORT=5500))(Security=(my_wallet_directory=C:\APP\ORACLE12C\DB\admin\medsys\xdb_wallet))(Presentation=HTTP)(Session=RAW))

                  Resumen de Servicios...

                  El servicio "CLRExtProc" tiene 1 instancia(s).

                    La instancia "CLRExtProc", con estado UNKNOWN, tiene 1 manejador(es) para este servicio...

                  El servicio "medsys" tiene 1 instancia(s).

                    La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

                  El servicio "medsysXDB" tiene 1 instancia(s).

                    La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

                  El servicio "pdbmed" tiene 1 instancia(s).

                    La instancia "medsys", con estado READY, tiene 1 manejador(es) para este servicio...

                  El comando ha terminado correctamente

                  LSNRCTL>

                   

                   

                  I can connect to my roor container correclty.

                   

                  Jhon

                  • 6. Re: 12c connection to a pdb with any application framework
                    user11983135

                    You cannot connect because you are using a service name and telling SQL Developer that it's the SID. pdbmed is the service name, so when you try to connect, use the service name radio button and text box in SQL Developer, not the ones for SID

                    • 7. Re: 12c connection to a pdb with any application framework
                      Jhon Carrillo

                      That works. thanks.

                       

                      Jhon