Site icon DBA의 정석

DB 12c – 시작 및 서비스접속, CDB/PDB 시작 및 종료

배경 : 현재 12c 설치되어 있고 PDB 2개 설치 되어 있는 상태 입니다.

 
 

# 시작 및 서비스 접속방법

  1. CDB & PDB 시작

    [root@test ~]# su – oracle

    [test@cdb1 : /home/oracle]$ sqlplus

     
     

    SQL*Plus: Release 12.1.0.1.0 Production on Fri Aug 7 11:11:51 2015

     
     

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

     
     

    Enter user-name: /as sysdba

    Connected to an idle instance.

     
     

    SQL> startup (CDB시작)

    ORACLE instance started.

     
     

    Total System Global Area 835104768 bytes

    Fixed Size 2293880 bytes

    Variable Size 595595144 bytes

    Database Buffers 234881024 bytes

    Redo Buffers 2334720 bytes

    Database mounted.

    Database opened.

    SQL> !lsnrctl start

     
     

    LSNRCTL for Linux: Version 12.1.0.1.0 – Production on 07-AUG-2015 11:17:31

     
     

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

     
     

    Starting /oracle/product/12.1.0/db_1/bin/tnslsnr: please wait…

     
     

    TNSLSNR for Linux: Version 12.1.0.1.0 – Production

    System parameter file is /oracle/product/12.1.0/db_1/network/admin/listener.ora

    Log messages written to /oracle/diag/tnslsnr/test/listener/alert/log.xml

    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))

    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

     
     

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

    STATUS of the LISTENER

    ————————

    Alias LISTENER

    Version TNSLSNR for Linux: Version 12.1.0.1.0 – Production

    Start Date 07-AUG-2015 11:17:31

    Uptime 0 days 0 hr. 0 min. 0 sec

    Trace Level off

    Security ON: Local OS Authentication

    SNMP OFF

    Listener Parameter File /oracle/product/12.1.0/db_1/network/admin/listener.ora

    Listener Log File /oracle/diag/tnslsnr/test/listener/alert/log.xml

    Listening Endpoints Summary…

    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))

    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

    The listener supports no services

    The command completed successfully

     
     

    SQL> alter pluggable database all open; (PDB 전체 OPEN)

     
     

    Pluggable database altered.

     
     

    SQL> show pdbs (PDB 확인)

     
     

    CON_ID CON_NAME OPEN MODE RESTRICTED

    ———- —————————— ———- ———-

    2 PDB$SEED READ ONLY NO

    3 PDB11 READ WRITE NO

    4 PDB12 READ WRITE NO

     
     

  2. CDB 접속 방법
  1. PDB 접속 방법

# 관련 View 및 Database 파일 살펴보기

  1. v$ view 살펴보기

    SQL> select instance_name,status,con_id from v$instance;

     
     

    INSTANCE_NAME STATUS CON_ID

    ——————————– ———————— ———-

    cdb1 OPEN 0

     
     

  1. DATABASE FILE 살펴보기

    SQL> COL MEMBER FORMAT A40

    SQL> SELECT GROUP#, CON_ID, MEMBER FROM V$LOGFILE;

     
     

    GROUP# CON_ID MEMBER

    ———- —— —————————————-

    1 0 /oradata/cdb1/redo01.log

    2 0 /oradata/cdb1/redo02.log

    3 0 /oradata/cdb1/redo03.log

     
     

    SQL> COL NAME FORMAT A60;

    SQL> SELECT NAME FROM V$CONTROLFILE;

     
     

    NAME

    ————————————————————

    /oradata/cdb1/control01.ctl

    /oradata/cdb1/control02.ctl

     
     

    SQL> set line 140 pages 1000

    SQL> col TABLESPACE_NAME for a10

    SQL> COL FILE_NAME FORMAT A60

    SQL> SELECT FILE_NAME, TABLESPACE_NAME, FILE_ID FROM CDB_TEMP_FILES;

     
     

    FILE_NAME TABLESPACE FILE_ID

    ———————————————————— ———- ———-

    /oradata/cdb1/temp01.dbf TEMP 1

    /oradata/cdb1/PDB11/temp01.dbf TEMP 3

    /oradata/cdb1/PDB12/temp01.dbf TEMP 4

    /oradata/cdb1/pdbseed/temp01.dbf TEMP 2

     
     

 
 

# CDB, PDB 시작, 중지

  1. CDB SHUTDOWN & STARTUP
  1. PDB OPEN and CLOSE

 
 

Exit mobile version