Some common query commands for CDB and PDB

Source: Internet
Author: User

[[email protected] ~]$ sqlplus/as sysdbasql*plus:release 12.1.0.2.0 Production on Sat Mar 5 19:57:04 2016Copyright  (c) 1982, Oracle. All rights reserved. Connected to:oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit productionwith The partitioning, OLAP, Adva nced Analytics and Real application testing optionssql> show Con_namecon_name------------------------------cdb$ Rootsql> select name,cdb from v$database;--->>> check if a db is Cdbname CDB------------ORCL yessql>--->    >> Check the status of the PDB sql> SELECT con_id,name,open_mode,restricted from V$pdbs; con_id NAME open_mode RES-----------------------------------------------------2 pdb$seed READ only NO 3 PN1 Moun TED 4 PN2 mountedsql>--->>> check the available servicessql> SELECT con_id,name,open_mode,restricted from V$pdbs within a PDB    ; con_id NAME open_mode RES-----------------------------------------------------2 pdb$seed READ only NO 3 PN1 Moun TED 4 PN2 mountedsql> ShowCon_name Con_name------------------------------cdb$rootsql> alter session set CONTAINER=PN1; Session altered. sql> Alter pluggable database PN1 open; Pluggable database altered.    Sql> SELECT con_id,name,open_mode,restricted from V$pdbs;  con_id NAME open_mode RES-----------------------------------------------------3 PN1 READ WRITE nosql> Set lines 100sql> col name format a20sql> Col network_name format a20sql> col pdb format A20sql>select service_id,name, Network_name,global_service,pdb,enabled from Dba_services; service_id NAME network_name GLO PDB ENA--------------------------------------------------------------------- -------6 pn1pn1 NO PN1 nosql>--->>> view service status from CDB:sql> alter session set Container=cdb$roo T Session altered. Sql> Select service_id, name,pdb from V$services; service_id NAME PDB--------------------------------------------------0 pn2pn2 6 pn1pn1 3 orclxdbcdb$root 4 ORCL Cdb$roo T 1 Sys$backgroundCdb$root 2 sys$userscdb$root6 rows selected.  Sql>

Some common query commands for CDB and PDB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.