19C创建pdb

创建容器数据库时候注意:

一: 建立容器请创建pdb自动启动触发器。
create or replace trigger open_pdbs
after startup on database
begin
execute immediate ‘alter pluggable database all open’;
end open_pdbs;
/
######################################

二:
命令行创建pdb数据库。
请手工在所有节点实例上启动pdb数据库。默认是mount状态。
alter pluggable database all open;
#####################################

三:
建议对单个PDB数据库CPU使用做限制,防止应用异常造成CPU高影响其他PDB数据库。
在各自的PDB数据库设置: cpu_count
alter system set cpu_count=6 ; 次参数最大CPU使用个数。 根据情况定,建议配置6-10个CPU左右。
PGA 内存限制:
alter system set pga_aggregate_limit=10g;
alter system set pga_aggregate_target=5g;

四:
其他参数需要检查的参数;如果不配置就是继承容器的参数。
建议单独配置!
db_file >=1000
session >=1000 <=5000
process >=1000 <=5000
open_cursor 1000
undo_retention 5400

五:
logfile 是全局的。建议适当配置大点。
2G * 8(组) * node_count(节点数)

yyjc_dba/yyjc_dba2017

19C 创建pdb

CREATE PLUGGABLE DATABASE ###
ADMIN USER ### IDENTIFIED BY “###_dba2020”
STORAGE (MAXSIZE UNLIMITED MAX_SHARED_TEMP_SIZE 2000M)
DEFAULT TABLESPACE ### DATAFILE ‘+POOLDATA’ SIZE 1G AUTOEXTEND ON;

alter pluggable database ### open instances=all;
alter session set container=###;
alter tablespace ### add datafile ‘+POOLDATA’ size 1G autoextend on next 1G;
alter USER ### IDENTIFIED BY “###_dba2020” account unlock;
grant connect,resource,unlimited tablespace to ###;
alter user ### default tablespace ###;
alter profile default limit password_life_time unlimited;
create user bps identified by “bps!1024”;
alter tablespace bpsora add datafile ‘+DATA’ size 1G autoextend on next 1G;

create tablespace bpsora datafile ‘+DATA/CDBL/98C2B8866B3F9BEBE053BAE13915B8E2/DATAFILE/bpsora.dbf’ size 1G autoextend on next 1G;
alter pluggable database yjsjgjzc close immediate instances=all;
alter pluggable database yjsjgjzc unplug into ‘/home/oracle/SJYPDB.xml’;
drop pluggable database SJYPDB keep datafiles;

drop pluggable database yjsjgjzc including datafiles;