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

前端之家收集整理的这篇文章主要介绍了关于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的个数. 原文链接:https://www.f2er.com/oracle/210059.html

猜你在找的Oracle相关文章