ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle 12C 多租户(Oracle Multitenant)--CDB的管理

Oracle 12C 多租户(Oracle Multitenant)--CDB的管理

原创 Linux操作系统 作者:zerocool88888888 时间:2013-08-07 19:39:02 0 删除 编辑
Oracle Database Oracle Corporation 11.6360

CDB的启动和关闭

CDB的启动和关闭和以前数据库的启动和关闭一样,启动CDB将启动整个实例,关闭CDB将关闭整个实例。PDB的启动和关闭并不关闭或者启动实例。

 

 

查看数据库是不是CDB

SQL> SELECT CDB FROM V$DATABASE;

CDB

---

YES

 

得到当前容器的名字

SQL> SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL;

 

SYS_CONTEXT('USERENV','CON_NAME')

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

CDB$ROOT

 

SQL>

 

 

查看有多少个容器

SQL> COLUMN NAME FORMAT A8

SQL> SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;

NAME         CON_ID       DBID    CON_UID GUID

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

CDB$ROOT          1  883454903          1 DD7C48AA5A4504A2E04325AAE80A403C

PDB$SEED          2 4065159988 4065159988 E31EE23FE4340E49E0433300A8C01AD7

PDB1              3 3330272355 3330272355 E31F5B4DC25B11FEE0433300A8C07605

PDB2              4 3888812375 3888812375 E31F8C34A7E31371E0433300A8C000F9

 

查看PDB的状态

COLUMN PDB_NAME FORMAT A15

SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

SQL> COLUMN PDB_NAME FORMAT A15

SQL> SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

    PDB_ID PDB_NAME        STATUS

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

         2 PDB$SEED        NORMAL

         3 PDB1            NORMAL

         4 PDB2            NORMAL

 

查看每个PDB的打开模式         


SQL> COLUMN NAME FORMAT A15

SQL> COLUMN RESTRICTED FORMAT A10

SQL> COLUMN OPEN_TIME FORMAT A30

SQL> SELECT NAME, OPEN_MODE, RESTRICTED, OPEN_TIME FROM V$PDBS;

NAME            OPEN_MODE  RESTRICTED OPEN_TIME

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

PDB$SEED        READ ONLY  NO         04-AUG-13 08.28.43.282 AM

PDB1            READ WRITE NO         04-AUG-13 08.35.28.547 AM

PDB2            READ WRITE NO         04-AUG-13 08.45.06.852 AM

 

查看监听器监听哪些CDBPDB

[oracle@rac1 db_home]$ lsnrctl status

 

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 07-AUG-2013 05:58:13

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production

Start Date                07-AUG-2013 05:57:45

Uptime                    0 days 0 hr. 0 min. 27 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /taryartar/12c/db_base/db_home/network/admin/listener.ora

Listener Log File         /taryartar/12c/db_base/diag/tnslsnr/rac1/listener/alert/log.xml

Listening Endpoints Summary...

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

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

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=rac1)(PORT=5500))(Security=(my_wallet_directory=/taryartar/12c/db_base/admin/tcdb2/xdb_wallet))(Presentation=HTTP)(Session=RAW))

Services Summary...

Service "pdb3" has 1 instance(s).

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

Service "pdb33" has 1 instance(s).

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

Service "pdb4" has 1 instance(s).

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

Service "pdb66" has 1 instance(s).

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

Service "tcdb2" has 1 instance(s).

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

Service "tcdb2XDB" has 1 instance(s).

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

The command completed successfully

从上面大家可以看到了吧,PDB是一个服务,这与12c以前是不是大不相同了。

 

Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13804621/viewspace-767986/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2008-04-10

  • 博文量
    73
  • 访问量
    910513