I created container orcl2
database with pluggable database pdborcl2
. When I try to connect
SQL> connect system@pdborcl2
I get this error:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
My tnsnames.ora
look as follows:
ORCL2 = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl2.localhost)))
PDBORCL2 = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl2.localhost)))
I can normally connect to orcl2
with:
SQL> connect system@orcl2
Best Answer
You have
CONNECT DATA
instead ofCONNECT_DATA
(space instead of underscore). Fix that, and try again.