SQL> create pluggable database b_pdb2
2 from MYPDB2
3 file_name_convert =
(‘E:ora12capporacleuseroradataora12cmypdb2′,’E:ora12capporacleuseroradataora12cb_pdb2’); Pluggable database created.
SQL> select dbid,name,open_mode from v$pdbs;
DBID NAME OPEN_MODE
———- —————————— ———-
4039091088 PDB$SEED READ ONLY
2213957720 B_PDB1 READ WRITE
4261134367 MYPDB2 READ ONLY
2540280635 B_PDB2 MOUNTED
SQL> alter pluggable database B_PDB2 open;
Pluggable database altered.
SQL>
常⽤检查语句:
SQL> SELECT sys_context(‘userenv’,’con_name’) MY_CONTAINER FROM dual;
MY_CONTAINER
——————–
CDB$ROOT
SQL>
SQL> SHOW con_name
CON_NAME
—
—————————
CDB$ROOT
SQL>
SQL> SELECT
2 ‘DB_NAME: ‘ ||sys_context(‘userenv’, ‘db_name’)||
3 ‘ / CDB?: ‘ ||(select cdb from v$database)||
4 ‘ / AUTH_ID: ‘ ||sys_context(‘userenv’, ‘authenticated_identity’)||
5 ‘ / USER: ‘ ||sys_context(‘userenv’, ‘current_user’)||
6 ‘ / CONTAINER: ‘||nvl(sys_Context(‘userenv’, ‘con_Name’), ‘NON-CDB’)
7 as “DB DETAILS”
8 FROM DUAL;
DB DETAILS
—————————————————————————————————-
DB_NAME: ora12c / CDB?: YES / AUTH_ID: HE-PCjijihe / USER: SYS / CONTAINER: CDB$ROOT SQL>
SQL> alter session set container=MYPDB2;
Session altered.
SQL> SELECT
2 ‘DB_NAME: ‘ ||sys_context(‘userenv’, ‘db_name’)||
3 ‘ / CDB?: ‘ ||(select cdb from v$database)||
4 ‘ / AUTH_ID: ‘ ||sys_context(‘userenv’, ‘authenticated_identity’)||
5 ‘ / USER: ‘ ||sys_context(‘userenv’, ‘current_user’)||
6 ‘ / CONTAINER: ‘||nvl(sys_Context(‘userenv’, ‘con_Name’), ‘NON-CDB’)
7 as “DB DETAILS”
8 FROM DUAL;
DB DETAILS
————————————————————————————————
DB_NAME: ora12c / CDB?: YES / AUTH_ID: HE-PCjijihe / USER: SYS / CONTAINER: MYPDB2 SQL>
SQL> select v.name, v.open_mode, stricted, ‘n/a’) “RESTRICTED”, d.status
2 from v$PDBs v inner join dba_pdbs d
3 using (GUID)
4 order ate_scn
5 /
NAME OPEN_MODE RESTRICTED STATUS
—————————— ———- ————— ————-
PDB$SEED READ ONLY NO NORMAL
MYPDB1 READ WRITE NO NORMAL
MYPDB2 READ WRITE NO NORMAL
SQL> alter pluggable database mypdb1 close;
Pluggable database altered.
SQL> select v.name, v.open_mode, stricted, ‘n/a’) “RESTRICTED”, d.status
2 from v$PDBs v inner join dba_pdbs d
3 using (GUID)
4 order ate_scn
5 /
NAME OPEN_MODE RESTRICTED STATUS
—————————— ———- ————— ————-
PDB$SEED READ ONLY NO NORMAL
MYPDB1 MOUNTED n/a NORMAL
MYPDB2 READ WRITE NO NORMAL
SQL> alter pluggable database mypdb1 open restricted;
Pluggable database altered.
SQL> select v.name, v.open_mode, stricted, ‘n/a’) “RESTRICTED”, d.status
2 from v$PDBs v inner join dba_pdbs d
3 using (GUID)
4 order ate_scn
5 /
NAME OPEN_MODE RESTRICTED STATUS
—————————— ———- ————— ————-
PDB$SEED READ ONLY NO NORMAL网络上xml是什么意思
MYPDB1 READ WRITE YES NORMAL
MYPDB2 READ WRITE NO NORMAL
SQL>
评:感觉PDB不像什么⾰命性的技术,只是将数据库⾄于mount模式后,拷贝数据⽂件,做成⼀个备份,然后将此备份plug和unplug。这样的技术,感觉跨平台的迁移不太理想。
另外,由于⼀个cdb中可以挂多个pdb,资源的分配使⽤就变得⾮常重要了,在12c中,估计原来⼏乎不常⽤的Resource Manager plan 会逐步⽤起来。
关于redo,由于redo是可以多个pdb共享,因此cdb的管理者可以通过logmnr的⽅式去挖对应pdb的⽇
志,从dump出来的redo log来看,redo log中含有container id(CON_ID,0为cdb,1为cdb$root, 2为pdb seed,3以上为pdb),pdbid和pxid,⾄少这些信息可以⽤于区分不同pdb中的事务。
我们⼀直都在努⼒坚持原创.......请不要⼀声不吭,就悄悄拿⾛。
我原创,你原创,我们的内容世界才会更加精彩!
【所有原创内容版权均属TechTarget,欢迎⼤家转发分享。但未经授权,严禁任何媒体(平⾯媒体、⽹络媒体、⾃媒体等)以及复制、转载、摘编或以其他⽅式进⾏使⽤。】
TechTarget
官⽅微博
TechTarget中国
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论