Oracle 12c 配置和修改 CDB 和 PDB 參數,12cpdb

來源:互聯網
上載者:User

Oracle 12c 配置和修改 CDB 和 PDB 參數,12cpdb


 

1  配置CDB 執行個體參數

 

配置CDB 的執行個體參數和普通執行個體一樣,通過ALTER SYSTEM 即可設定初始化參數,一些資料庫的配置可以使用ALTERDATABASE 命令。

 

串連上rootcontainer之後,可以使用alter system命令來修改,預設僅對root container有效,也就是當前的container。 下面2個命令作用相同:

 

ALTER SYSTEM SET parameter_name=value;

ALTER SYSTEM SET parameter_name=valueCONTAINER=CURRENT;

 

 

如果想讓修改對所有的container有效,使用如下文法:

ALTER SYSTEM SET parameter_name=valueCONTAINER=ALL;

 

在root container中用all進行修改,那麼所有的PDB都會繼承這些參數,除非在PDB 中在單獨修改這個參數。

 

2  配置PDB 執行個體參數

 

如果在rootcontainer中設定CONTAINER=ALL,那麼PDB的參數也會繼承之前的值,但可以通過ALTER SYSTEM在PDB container中修改。 注意這裡能進行修改的前提是要這個參數支援,可以使用如下命令查看:

 

 

column name format a35

column value format a35

 

select name, value

from   v$system_parameter

WHERE  ispdb_modifiable = 'TRUE'

order by name;

 

--我這裡有174個參數,可以在PDB中修改:

SQL> select count(1) fromv$system_parameter where ispdb_modifiable='TRUE';

 

 COUNT(1)

----------

      174

 

 

修改步驟方式如下:

CONN / AS SYSDBA

ALTER SESSION SET CONTAINER = pdb1;

 

ALTER SYSTEM SET parameter_name=value;

ALTER SYSTEM SET parameter_name=valueCONTAINER=CURRENT;

 

 

3  修改CDB (ALTER DATABASE)

 

ALTER DATABASE 命令和non-CDB 資料庫是一樣的,一些命令可以影響CDB 和所有的PDB,有些僅對root container 有效,具體的使用可以參考官網。

 

http://docs.oracle.com/cd/E16655_01/server.121/e17636/cdb_admin.htm#ADMIN13633

 

 

4  修改PDB (ALTER PLUGGABLEDATABASE)

 

可以指定特定的PDB之後,在使用ALTERPLUGGABLE DATABASE 命令修改PDB的資訊,當然為了向後相容性,ALTER DATABASE 命令也能完成大部分的修改工作。

 

具體修改操作如下:

CONN / AS SYSDBA

ALTER SESSION SET CONTAINER = pdb1;

 

-- Default edition forPDB.

ALTER PLUGGABLE DATABASE DEFAULT EDITION =ora$base;

 

-- Default tablespacetype for PDB.

ALTER PLUGGABLE DATABASE SET DEFAULTBIGFILE TABLESPACE;

ALTER PLUGGABLE DATABASE SET DEFAULTSMALLFILE TABLESPACE;

 

-- Default tablespacesfor PDB.

ALTER PLUGGABLE DATABASE DEFAULT TABLESPACEusers;

ALTER PLUGGABLE DATABASE DEFAULT TEMPORARYTABLESPACE temp;

 

-- Change the globalname. This will change the container name and the

-- name of the defaultservice registered with the listener.

ALTER PLUGGABLE DATABASE OPEN RESTRICTEDFORCE;

ALTER PLUGGABLE DATABASE RENAME GLOBAL_NAMETO pdb1a.localdomain;

ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE OPEN;

 

-- Time zone for PDB.

ALTER PLUGGABLE DATABASE SETTIME_ZONE='GMT';

 

-- Make datafiles in thePDB offline/online and make storage changes.

ALTER PLUGGABLE DATABASE DATAFILE'/u01/app/oracle/oradata/cdb1/pdb1/pdb1_users01.dbf' OFFLINE;

ALTER PLUGGABLE DATABASE DATAFILE'/u01/app/oracle/oradata/cdb1/pdb1/pdb1_users01.dbf' ONLINE;

 

ALTER PLUGGABLE DATABASE DATAFILE'/u01/app/oracle/oradata/cdb1/pdb1/pdb1_users01.dbf'

 RESIZE 1G AUTOEXTEND ON NEXT 1M;

 

-- Supplemental loggingfor PDB.

ALTER PLUGGABLE DATABASE ADD SUPPLEMENTALLOG DATA;

ALTER PLUGGABLE DATABASE DROP SUPPLEMENTALLOG DATA;

 

 

In addition there is amechanism to control the maximum size of the PDB and the amount of the sharedtemp space it can use.

 

-- Limit the totalstorage of the the PDB (datafile and local temp files).

ALTER PLUGGABLE DATABASE STORAGE (MAXSIZE5G);

 

-- Limit the amount oftemp space used in the shared temp files.

ALTER PLUGGABLE DATABASE STORAGE(MAX_SHARED_TEMP_SIZE 2G);

 

-- Combine the two.

ALTER PLUGGABLE DATABASE STORAGE (MAXSIZE5G MAX_SHARED_TEMP_SIZE 2G);

 

-- Remove the limits.

ALTER PLUGGABLE DATABASE STORAGE UNLIMITED;

 

 

 

 

 

 

--------------------------------------------------------------------------------------------

著作權,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!

 

AboutDave:

--------------------------------------------------------------------------------------------

QQ:      251097186

Email:    tianlesoftware@gmail.com

Blog:     http://blog.csdn.net/tianlesoftware

Weibo:    http://weibo.com/tianlesoftware

Twitter:  http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

 

Dave 的QQ群:

--------------------------------------------------------------------------------------------

注意:加群必須註明資料表空間和資料檔案關係 | 不要重複加群

CNDBA_1: 104207940 (滿)    CNDBA_2: 62697716 (滿)   CNDBA_3: 283816689

CNDBA_4: 391125754   CNDBA_5: 62697850    CNDBA_6: 62697977   CNDBA_7: 142216823(滿)

相關文章

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.