关于Oracle 12c 多租户架构中的db_files参数.

本文的背景:
Oracle DB 12.2 管理文档
A CDB uses a single SPFILE or a single text initialization parameter file (PFILE).
Values of initialization parameters set for the root can be inherited by PDBs. 
You can set some initialization parameters for a PDB by using the ALTER SYSTEM statement.
上面一段英文中,请理解好"inherited".看完如下测试之后,db_files参数的"inherited"不是:每个pdb都最大可以设置db_files个datafile.
[oracle@db12cr2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat Mar 18 01:29:31 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> SQL> 
SQL> startup
ORACLE instance started.

Total System Global Area  587202560 bytes
Fixed Size		    8795424 bytes
Variable Size		  343935712 bytes
Database Buffers	  226492416 bytes
Redo Buffers		    7979008 bytes
Database mounted.
Database opened.
SQL> show parameter db_file

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count	     integer	 66
db_file_name_convert		     string
db_files			     integer	 20
pdb_file_name_convert		     string
SQL> alter session set container=highgo1;

Session altered.

SQL> select name from v$dbfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/highgo1/system01.dbf
/u01/app/oracle/oradata/orcl/highgo1/sysaux01.dbf
/u01/app/oracle/oradata/orcl/highgo1/undotbs01.dbf
/u01/app/oracle/oradata/orcl/highgo1/users01.dbf

SQL> alter tablespace users add datafile '/u01/app/oracle/oradata/orcl/highgo1/users02.dbf' size 50m;

Tablespace altered.

SQL> select count(*) from  v$dbfile;


  COUNT(*)
----------
	 5

SQL> alter tablespace users add datafile '/u01/app/oracle/oradata/orcl/highgo1/users03.dbf' size 50m;
alter tablespace users add datafile '/u01/app/oracle/oradata/orcl/highgo1/users03.dbf' size 50m
*
ERROR at line 1:
ORA-00059: maximum number of DB_FILES exceeded

SQL> show parameter db_file

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count	     integer	 66
db_file_name_convert		     string
db_files			     integer	 20
pdb_file_name_convert		     string
SQL> select count(*) from  v$dbfile;


  COUNT(*)
----------
	 5

SQL> 
SQL> select count(*) from dba_data_files;


  COUNT(*)
----------
	 5


SQL>  select count(*) from dba_data_files;


  COUNT(*)
----------
	 3

SQL> alter session set container=cdb$root;

Session altered.

SQL>  select count(*) from dba_data_files;


  COUNT(*)
----------
	 4

SQL> show pdbs


    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 HIGHGO1			  READ WRITE NO
	 4 HIGHGO2			  MOUNTED
	 5 HIGHGO3			  MOUNTED
SQL> 
下面来解释一下CDB的数据文件分布情况:
--->>>解释1:highgo1这个pdb有5个datafile(见上),
--->>>解释2:highgo2这个pdb有4个datafile(highgo2此时未open,未open不代表没有datafile)
--->>>解释3:highgo3这个pdb有4个datafile,(highgo3此时未open,未open不代表没有datafile)
--->>>解释4:pdb$seed这个seed有3个datafile(见上)
--->>>解释5:cdb$root这个root有4个datafile(见上)
--->>>>>>>以上合计有20个datafile.结合上面的"ORA-00059: maximum number of DB_FILES exceeded".
--->>>>>>>可以确定,db_files参数,指的是CDB层面的所有的datafile个数,而不是某个pdb的datafile的个数.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值