Oracle 12c Preliminary operations

Source: Internet
Author: User

See if the CDB

SQL>Select from v$database; NAME                        CDB       open_mode                                                        con_id -- ------------------------- --------- ------------------------------------------------------------ ---------- orcl12c                     YES       READ WRITE                                                            0

View Current Container

SQL>  show Con_namecon_name------------------------------cdb$root

See how many PDB

Sql> Selectcon_id, dbid, GUID, name, Open_mode fromV$pdbs; con_id DBID GUID NAME open_mode---------- ---------- ------------------------------------------------ ---------------------------- ------------- -----------------         2 4096928455ff675156e40b2f3de043b303a8c00283 Pdb$seedREAD  only         3 2301438674Ff6761430b3e311ee043b303a8c00ba6 PDBORCLREADWRITE

Turn off PDB

Sql> AlterSessionSetContainer=PDBORCL; Session altered. SQL> shutdownimmediatepluggableDatabaseclosed. SQL>Show Con_namecon_name------------------------------Pdborclsql> AlterSessionSetContainer=Cdb$root; Session altered. SQL> Selectcon_id, dbid, GUID, name, Open_mode fromV$pdbs; con_id DBID GUID NAME open_mode---------- ---------- ------------------------------------------------ ---------------------------- ------------- -----------------         2 4096928455ff675156e40b2f3de043b303a8c00283 Pdb$seedREAD  only         3 2301438674Ff6761430b3e311ee043b303a8c00ba6 PDBORCL Mounted

Start PDB

SQL>alterset container=pdborcl; Session altered. SQL>Database opened.

Go into the PDB and do some daily work.

Sql> Select file_name, Tablespace_name,file_id  fromDba_data_files;file_nameTablespace_namefile_id------------------------------------------------------------------------------------ ------------------------- --- ----------/U01/App/Oracle/Oradata/orcl12c/Pdborcl/EXAMPLE01.DBF EXAMPLE One/U01/App/Oracle/Oradata/orcl12c/Pdborcl/SAMPLE_SCHEMA_USERS01.DBF USERSTen/U01/App/Oracle/Oradata/orcl12c/Pdborcl/SYSAUX01.DBF Sysaux9/U01/App/Oracle/Oradata/orcl12c/Pdborcl/SYSTEM01.DBF SYSTEM8

Create PDB

Sql> CREATEPluggableDATABASEPdbtest1 ADMINUSERPdbtest1admin identified byPdbtest1admin2STORAGE (MAXSIZE 2G max_shared_temp_size 100M)3  DEFAULTtablespace test1tb14DataFile'/u01/app/oracle/oradata/orcl12c/pdbtest1/test1tb101.dbf'Size 50m Autoextendoff  5File_name_convert=('/u01/app/oracle/oradata/orcl12c/pdbseed','/u01/app/oracle/oradata/orcl12c/pdbtest1'); PluggableDatabaseCreated.

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.