ORACLE 12C VERİTABANINDA PLUGGABLE DATABASE NASIL OLUŞTURULUR?

SQL> select cdb from v$database;

CDB

YES

[[email protected] ~]$ cd /u01/app/oracle/oradata/cddb1/
[[email protected] cddb1]$ mkdir PDB2

[[email protected] cddb1]$ sqlplus / as sysdba

SQL> SHOW CON_NAME;

CON_NAME
——————————
CDB$ROOT

SQL> create pluggable database PDB2 admin user pdb2admin identified by welcome1 FILE_NAME_CONVERT=(‘/u01/app/oracle/oradata/cddb1/pdbseed/’,’/u01/app/oracle/oradata/cddb1/PDB2/’);

Pluggable database created.

SQL> select con_id, name, open_mode from v$pdbs;

CON_ID NAME OPEN_MODE
———- —————————— ———-
2 PDB$SEED READ ONLY
3 PDB1 READ WRITE
4 PDB2 MOUNTED

SQL> alter pluggable database PDB2 open;

Pluggable database altered.

SQL> select name , open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 READ WRITE

SQL> alter session set container= PDB2;

Session altered.

SQL> show con_name

CON_NAME
——————————
PDB2

SQL> select file_name from dba_data_files;

FILE_NAME
——————————————————————————–
/u01/app/oracle/oradata/cddb1/PDB2/system01.dbf
/u01/app/oracle/oradata/cddb1/PDB2/sysaux01.dbf

SQL> select name from v$services;

NAME
—————————————————————-
pdb2.localdomain
pdb1.localdomain
cddb1XDB
cddb1.localdomain
SYS$BACKGROUND
SYS$USERS

[[email protected] cddb1]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 25-DEC-2018 21:06:23

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=idb.localdomain)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 22-NOV-2018 11:31:10
Uptime 33 days 9 hr. 35 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/idb/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=idb.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=idb.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/cddb1/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary…
Service “cddb1.localdomain” has 1 instance(s).
Instance “cddb1”, status READY, has 1 handler(s) for this service…
Service “cddb1XDB.localdomain” has 1 instance(s).
Instance “cddb1”, status READY, has 1 handler(s) for this service…
Service “pdb1.localdomain” has 1 instance(s).
Instance “cddb1”, status READY, has 1 handler(s) for this service…
Service “pdb2.localdomain” has 1 instance(s).
Instance “cddb1”, status READY, has 1 handler(s) for this service…
The command completed successfully

[[email protected] cddb1]$ sqlplus pdb2admin/[email protected]:1521/pdb2.localdomain;

SQL*Plus: Release 12.1.0.2.0 Production on Tue Dec 25 21:09:16 2018

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

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> shoe con_name
SP2-0734: unknown command beginning “shoe con_n…” – rest of line ignored.
SQL> show con_name

CON_NAME
——————————
PDB2
SQL>