> 데이터 베이스 > MySQL 튜토리얼 > oracle12c_pdb_SAVE STATE

oracle12c_pdb_SAVE STATE

WBOY
풀어 주다: 2016-06-07 16:37:51
원래의
2014명이 탐색했습니다.

在12.1.0.1的时候pdb不能跟随cdb自动open,如果实现自动打开基本靠触发器,在12.1.0.2的时候可以使用参数SAVE STATE来保存pdb在关闭前的状态 SQL SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- -----

在12.1.0.1的时候pdb不能跟随cdb自动open,如果实现自动打开基本靠触发器,在12.1.0.2的时候可以使用参数SAVE STATE来保存pdb在关闭前的状态
oracle12_save_stat

SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED
         6 PDB4                           MOUNTED
         7 PDB5                           MOUNTED
 
SQL> shutdown immediate;
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  838860800 bytes
Fixed SIZE                  2921400 bytes
Variable SIZE             608177224 bytes
DATABASE Buffers          222298112 bytes
Redo Buffers                5464064 bytes
DATABASE mounted.
DATABASE opened.
SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED
         6 PDB4                           MOUNTED
         7 PDB5                           MOUNTED
 
 
SQL> ALTER pluggable DATABASE ALL save state
  2  ;
 
Pluggable DATABASE altered.
 
SQL>  shutdown immediate;
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  838860800 bytes
Fixed SIZE                  2921400 bytes
Variable SIZE             608177224 bytes
DATABASE Buffers          222298112 bytes
Redo Buffers                5464064 bytes
DATABASE mounted.
DATABASE opened.
SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED
         6 PDB4                           MOUNTED
         7 PDB5                           MOUNTED
로그인 후 복사

可以看出如果pdb是mount状态的时候来设置SAVE STATE,在数据库restart的时候也是mount

SQL> ALTER pluggable DATABASE ALL DISCARD STATE;
 
Pluggable DATABASE altered.
 
SQL> ALTER pluggable DATABASE ALL OPEN;
 
Pluggable DATABASE altered.
 
SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            READ WRITE NO
         4 PDB2                           READ WRITE NO
         5 PDB3                           READ WRITE NO
         6 PDB4                           READ WRITE NO
         7 PDB5                           READ WRITE NO
SQL> ALTER pluggable DATABASE ALL save state;
 
Pluggable DATABASE altered.
 
SQL> shutdown immediate;
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
 
SQL> startup
ORACLE instance started.
 
Total System Global Area  838860800 bytes
Fixed SIZE                  2921400 bytes
Variable SIZE             608177224 bytes
DATABASE Buffers          222298112 bytes
Redo Buffers                5464064 bytes
DATABASE mounted.
DATABASE opened.
SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            READ WRITE NO
         4 PDB2                           READ WRITE NO
         5 PDB3                           READ WRITE NO
         6 PDB4                           READ WRITE NO
         7 PDB5                           READ WRITE NO
로그인 후 복사
SQL> ALTER pluggable DATABASE ALL DISCARD STATE;
 
Pluggable DATABASE altered.
 
SQL> ALTER pluggable DATABASE ALL close;
 
Pluggable DATABASE altered.
 
SQL>  ALTER pluggable DATABASE ALL save state;
 
Pluggable DATABASE altered.
 
SQL> shutdown immediate;
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  838860800 bytes
Fixed SIZE                  2921400 bytes
Variable SIZE             608177224 bytes
DATABASE Buffers          222298112 bytes
Redo Buffers                5464064 bytes
DATABASE mounted.
DATABASE opened.
SQL> SHOW pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED
         6 PDB4                           MOUNTED
         7 PDB5                           MOUNTED
로그인 후 복사
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿