5

I am working with Oracle 19c in centos 7. After Oracle installation, i created new Container Database(CDB) with Plugguble Database(PDB) using DBCA.

I am working with port number=1522

[oracle@ol8-19 ~]$ lsnrctl start LISTENER_TST

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 17-AUG-2020 16:02:02

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

Starting /opt/Oracle19c/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/Oracle19c/network/admin/listener.ora
Log messages written to /opt/oraclebase19c/diag/tnslsnr/ol8-19/listener_tst/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol8-19.localdomain)(PORT=1522)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol8-19.localdomain)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_TST
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-AUG-2020 16:02:02
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/Oracle19c/network/admin/listener.ora
Listener Log File         /opt/oraclebase19c/diag/tnslsnr/ol8-19/listener_tst/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol8-19.localdomain)(PORT=1522)))
The listener supports no services
The command completed successfully

This is my Listener.ora file.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

LISTENER_TST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))
    )
  )

This is my tnsnames.ora file.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1521))


LISTENER_ABC =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

ABC =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ABC)
    )
  )

My pluggable Database name is PDB. How can i Register PDB with my listener with port 1522??

1 Answer 1

11

Connect to an idle instance and startup the instance

[oracle@ol8-19 ~]$ sqlplus / as sysdba

SQL> startup;

change container to that pluggable database

SQL> alter session set container=pdb;
Session altered.

and open it

SQL> alter pluggable database pdb open;

Now, you set local_listener

SQL> alter system set local_listener='(address=(protocol=tcp)(host=ol8-19.localdomain)
(port=1522))' scope=spfile;

System altered.

and issue the following command in order to register the service immediately

SQL> alter system register;

System altered.

and restart pluggable database

SQL> alter pluggable database pdb close immediate;

SQL> alter pluggable database pdb open;

SQL> exit;

then start listener

[oracle@ol8-19 ~]$ lsnrctl start

and recheck listener's current status

[oracle@ol8-19 ~]$ lsnrctl status

which should start within a half minute.

2
  • alter session set container=pdb; gives ERROR at line 1: ORA-02248: invalid option for ALTER SESSION
    – Moeez
    Jun 4, 2022 at 10:01
  • I told ignore this part(related to pluggable DB) @Moeez presuming your DB is just a single instance and non-pluggable, isn't it? Just set local listener, and then restart the listener from the command line after logging out the db. Jun 4, 2022 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.