카테고리 없음2017. 12. 19. 17:16

오라클 12c 설치 후 pdb 에 접속하기


dbca 로 DB 설치 후 netca 로 리스너를 구성하지 않고 수동으로

listener.ora 를 만들어 구동하면 pdb 가 service 에 나오지 않는다. 

반드시 netca 를 통해서 리스너를 설정하자. 



 netca  silent 로 리스너 구성


[oracle@oracdb netca]$ netca -silent -responseFile /home/oracle/database/response/netca.rsp


Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /home/oracle/database/response/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control: 

      /oracle/product/12.1.0/dbhome_1/bin/lsnrctl start LISTENER

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

 


service 확인 


[oracle@oracdb admin]$ lsnrctl service


LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 19-DEC-2017 17:13:43


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracdb)(PORT=1521)))

Services Summary...

Service "cdbtest" has 2 instance(s).

  Instance "cdbtest", status UNKNOWN, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0

         LOCAL SERVER

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

    Handler(s):

      "DEDICATED" established:7 refused:0 state:ready

         LOCAL SERVER

Service "cdbtestXDB" has 1 instance(s).

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

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready

         DISPATCHER <machine: oracdb, pid: 2843>

         (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=32331))

Service "pdb01" has 1 instance(s).

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

    Handler(s):

      "DEDICATED" established:7 refused:0 state:ready

         LOCAL SERVER

The command completed successfully



------------  netca.rsp -------------------------------------------------------------

[GENERAL]

RESPONSEFILE_VERSION="12.1"

CREATE_TYPE="CUSTOM"

SHOW_GUI=false

[oracle.net.ca]

INSTALLED_COMPONENTS={"server","net8","javavm"}

INSTALL_TYPE=""typical""

LISTENER_NUMBER=1

LISTENER_NAMES={"LISTENER"}

LISTENER_PROTOCOLS={"TCP;1521"}

LISTENER_START=""LISTENER""

NAMING_METHODS={"TNSNAMES"}

NSN_NUMBER=1

NSN_NAMES={"EXTPROC_CONNECTION_DATA"}

NSN_SERVICE={"PLSExtProc"}

NSN_PROTOCOLS={"TCP;oracdb;1521"}


------------  netca.rsp -------------------------------------------------------------



PDB 에 접속


[oracle@oracdb admin]$ sqlplus c##test/test@pdb


SQL*Plus: Release 12.1.0.2.0 Production on Tue Dec 19 16:56:11 2017


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


Last Successful login time: Tue Dec 19 2017 09:57:37 +09:00


Connected to:

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

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


SQL> show con_name


CON_NAME

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

PDB01

SQL> 




--------------------------- tnsnames.ora --------------------------------- 

cdbtest =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oracdb)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = cdbtest)

    )

  )

 

pdb =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oracdb)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = pdb01)

    )

  )


--------------------------- tnsnames.ora --------------------------------- 


 

--------------------------- listener.ora --------------------------------- 

# listener.ora Network Configuration File: /oracle/product/12.1.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracdb)(PORT = 1521))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )



SID_LIST_LISTENER =

(SID_LIST =

  (SID_DESC =

   (GLOBAL_DBNAME = cdbtest)

   (ORACLE_HOME = /oracle/product/12.1.0/dbhome_1/)

   (SID_NAME = cdbtest)

   )

 )

--------------------------- listener.ora --------------------------------- 




끗. 공감 구걸



반응형
Posted by 돌고래트레이너