Oracle 参数 NONCDB_COMPATIBLE 官方解释,作用,如何配置最优化建议
本站中文解释
NONCDB_COMPATIBLE 用来控制PDB对外建立连接是否使用SID或SERVICE_NAME,在第一个PDB创建时该参数被自动设置,也可以通过ALTER SYSTEM RESET NONCDB_COMPATIBLE命令手工设定。
NONCDB_COMPATIBLE 的可选值为TRUE或FALSE,它设定为TRUE时,CDB中的PDB只能使用SERVICE_NAME建立连接,设定为FALSE时则只能使用PDB的 SID 建立连接。
正确的设置方法:
1、首先通过SQL*Plus连接到cdb :
sqlplus / as sysdba
2、运行Alter system 命令设置参数:
alter system set noncdb_compatible = TRUE scope=spfile;
3、重启数据库实例:
shutdown immediate
startup
4、查看参数是否生效:
show parameter noncdb
官方英文解释
NONCDB_COMPATIBLE
enables you to get behavior similar to a non-CDB when issuing SQL commands inside a PDB in a CDB.
Property | Description |
---|---|
Parameter type |
Boolean |
Default value |
|
Modifiable |
No |
Modifiable in a PDB |
No |
Range of values |
|
Basic |
No |
Set this parameter if you are using a single PDB in your CDB configuration and you have legacy code that causes ORA-65040
when you run it in the PDB.
Values
-
TRUE
Indicates the behavior for SQL statements will be like a non-CDB although the statements are issued in a PDB in a CDB.
-
FALSE
Indicates the behavior will for SQL statements will be like a CDB. This is the default value of the parameter.
There are some statements (such as ALTER DB BACKUP CONTROLFILE
) which can be issued in a non-CDB, but in a CDB they must be issued in the root (because they affect the whole CDB) and would result in an error if issued in a PDB.
Some ALTER DATABASE
or ALTER SYSTEM
statements are not permitted inside a PDB, and they will fail if NONCDB_COMPATIBLE=FALSE
is set in init.ora
. However, these statements will succeed if NONCDB_COMPATIBLE=TRUE
is set.
See Also:
-
Oracle Multitenant
Administrator’s Guide for an introduction to PDBs and CDBs -
Oracle Multitenant
Administrator’s Guide for information about the initialization parameters that control the memory usage of PDBs -
Oracle Multitenant
Administrator’s Guide for information about the ALTER SYSTEM statements that can be run in a PDB.