Oracle 12C pluggable database自啟動
實驗環境建立了兩個PDB,本實驗實現在開啟資料庫時,實現pluggable database PDB2自啟動:
原始環境:
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 943718400 bytes
Fixed Size 2931136 bytes
Variable Size 650118720 bytes
Database Buffers 285212672 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDBYCR MOUNTED
PDB2 MOUNTED
SQL>
建立trigger:
SQL> CREATE TRIGGER open_pdb_pdb2
2 AFTER STARTUP
3 ON DATABASE
4 BEGIN
5 EXECUTE IMMEDIATE 'alter pluggable database pdb2 open';
6 END open_all_pdbs;
7 /
Trigger created.
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 943718400 bytes
Fixed Size 2931136 bytes
Variable Size 650118720 bytes
Database Buffers 285212672 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDBYCR MOUNTED
PDB2 READ WRITE
已實現pdb2的自啟動,可以透過修改trigger指令碼中的sql語句實現啟動不同的pdb或者實現所有pdb的自啟動,指令碼如下:
CREATE TRIGGER open_pdb_pdb2
AFTER STARTUP
ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database pdb2 open';
END open_all_pdbs;
/
觀察alert日誌中有如下訊息:
Opening pdb PDB$SEED (2) with no Resource Manager plan active
alter pluggable database pdb2 open
Database Characterset for PDB2 is WE8MSWIN1252
Due to limited space in shared pool (need 6094848 bytes, have 3981120 bytes), limiting Resource Manager entities from 2048 to 32
Opening pdb PDB2 (4) with no Resource Manager plan active
Pluggable database PDB2 opened read write
Completed: alter pluggable database pdb2 open
Starting background process CJQ0
Completed: ALTER DATABASE OPEN
原始環境:
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 943718400 bytes
Fixed Size 2931136 bytes
Variable Size 650118720 bytes
Database Buffers 285212672 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDBYCR MOUNTED
PDB2 MOUNTED
SQL>
建立trigger:
SQL> CREATE TRIGGER open_pdb_pdb2
2 AFTER STARTUP
3 ON DATABASE
4 BEGIN
5 EXECUTE IMMEDIATE 'alter pluggable database pdb2 open';
6 END open_all_pdbs;
7 /
Trigger created.
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 943718400 bytes
Fixed Size 2931136 bytes
Variable Size 650118720 bytes
Database Buffers 285212672 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDBYCR MOUNTED
PDB2 READ WRITE
已實現pdb2的自啟動,可以透過修改trigger指令碼中的sql語句實現啟動不同的pdb或者實現所有pdb的自啟動,指令碼如下:
CREATE TRIGGER open_pdb_pdb2
AFTER STARTUP
ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database pdb2 open';
END open_all_pdbs;
/
觀察alert日誌中有如下訊息:
Opening pdb PDB$SEED (2) with no Resource Manager plan active
alter pluggable database pdb2 open
Database Characterset for PDB2 is WE8MSWIN1252
Due to limited space in shared pool (need 6094848 bytes, have 3981120 bytes), limiting Resource Manager entities from 2048 to 32
Opening pdb PDB2 (4) with no Resource Manager plan active
Pluggable database PDB2 opened read write
Completed: alter pluggable database pdb2 open
Starting background process CJQ0
Completed: ALTER DATABASE OPEN
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29135257/viewspace-2123591/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 小丸子學Oracle 12c系列之——Oracle Pluggable DatabaseOracleDatabase
- clone oracle 12c pluggable databasesOracleDatabase
- Oracle 12c啟動時PDBs的自動開啟Oracle
- 【PDB】Oracle 建立pdb說明(create pluggable database)OracleDatabase
- Oracle 12c DG備庫啟動報錯standby database requires recoveryOracleDatabaseUI
- Oracle database的啟動方式OracleDatabase
- [20181018]12c Pluggable Database save state.txtDatabase
- 12c-RECOVER PLUGGABLE DATABASEDatabase
- Oracle 12c叢集啟動故障Oracle
- UNIX自動啟動oracleOracle
- Oracle Database 12C New FeatureOracleDatabase
- Oracle RAC自啟動Oracle
- 【新炬網路名師大講堂】clone oracle 12c pluggable databasesOracleDatabase
- oracle for linux 自動啟動OracleLinux
- 自動啟動ORACLE Script ServiceOracle
- linux oracle 自動啟動LinuxOracle
- oracle 隨系統開啟,自動啟動Oracle
- oracle開機自啟動Oracle
- Oracle Database 19c中的自動索引OracleDatabase索引
- ORACLE 12C 叢集啟動順序圖Oracle
- windows開機自動啟動oracleWindowsOracle
- oracle instance and listener自動啟動Oracle
- 讓oracle自動啟動方法!(轉)Oracle
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- 解析Oracle Database Concepts 12c(4)OracleDatabase
- 解析Oracle Database Concepts 12c(2)OracleDatabase
- 解析Oracle Database Concepts 12c(1)OracleDatabase
- 【OH】Deprecated and Desupported Features for Oracle Database 12cOracleDatabase
- 解析Oracle Database Concepts 12c(5)OracleDatabase
- 解析Oracle Database Concepts 12c(3)OracleDatabase
- Oracle 12c Enterprise Manager Database ExpressOracleDatabaseExpress
- Oracle Database 12c十二大新特性OracleDatabase
- oracle12c新特點之可插拔資料庫(Pluggable Database,PDB)Oracle資料庫Database
- oracle配置開機自啟動Oracle
- 開機自動啟動ORACLE ON LinuxOracleLinux
- 自動重新啟動oracle例項 for windowsOracleWindows
- linux下oracle的自動啟動LinuxOracle
- windows下oracle自動啟動指令碼WindowsOracle指令碼