注:本文谢绝转载!
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
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(满)