【PARAMETER】关于oracle兼容性参数COMPATIBLE

前一段时间没事测试了一下oracle10g RAC升级到oracle11g RAC,根据以前升级习惯,DBUA后数据库正常,升级也就算完成了,再根据系统性能调整一下系统、数据库参数就好了。在检查过程中却发现一个小小的问题,那就听俺道来。

 

SQL> select * from v$version;

 

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE    11.2.0.4.0      Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 – Production

SQL> show parameter compati

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

compatible                           string      10.2.0.5.0

plsql_v2_compatibility               boolean     FALSE

SQL>

 

发现compatible参数设置还是原来版本

 

官方介绍
 

About The COMPATIBLE Initialization Parameter

The COMPATIBLE initialization parameter enables or disables the use of features in the database that affect file format on disk. For example, if you create an Oracle Database 11g Release 2 (11.2) database, but specify COMPATIBLE=10.0.0 in the initialization parameter file, then features that require 11.2 compatibility generate an error if you try to use them. Such a database is said to be at the 10.0.0 compatibility level.

You can advance the compatibility level of your database by changing the COMPATIBLE initialization parameter. If you do, there is no way to start the database using a lower compatibility level setting, except by doing a point-in-time recovery to a time before the compatibility was advanced.

The default value for the COMPATIBLE parameter is the release number of the most recent major release.

 

·         参数设置限制(更多参数介绍请参照Oracle® Database Upgrade Guide 11g Release 2 (11.2)E23633-09 文中Compatibility and Interoperability Between Oracle Database Releases

Table 1-1 The COMPATIBLE Initialization Parameter

Oracle Database Release

Default Value

Minimum Value

Maximum Value

Oracle9i Release 2 (9.2)

8.1.0

8.1.0.0.0

9.2.0.n.n

Oracle Database 10g Release 1 (10.1)

10.0.0

9.2.0.0.0

10.1.0.n.n

Oracle Database 10g Release 2 (10.2)

10.2.0

9.2.0.0.0

10.2.0.n.n

Oracle Database 11g Release 1 (11.1)

11.0.0

10.0.0.0.0

11.1.0.n.n

Oracle Database 11g Release 2 (11.2)

11.2.0

10.0.0.0.0

11.2.0.n.n

 

 

修改参数,重启数据库查看

SQL> alter system set compatible='11.2.0.4.0' scope=spfile;

 

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

 

Total System Global Area 1068937216 bytes

Fixed Size                  2260088 bytes

Variable Size             335545224 bytes

Database Buffers          725614592 bytes

Redo Buffers                5517312 bytes

Database mounted.

Database opened.

SQL> show parameter compatible

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

compatible                           string      11.2.0.4.0

SQL>

 

ASM相关参数请用以下语句查看:
 

SQL> select name,compatibility,database_compatibility from  v$asm_diskgroup;

 

NAME            COMPATIBILITY DATABASE_COMPATIBILI

--------------- ------------- --------------------

DATA             10.2.0.5.0    10.2.0.5.0

 

SQL> alter diskgroup DATA  set attribute 'compatible.asm'='11.2.0.4.0';

 

Diskgroup altered.

 

SQL> alter diskgroup DATA set attribute 'compatible.rdbms'='11.2.0.4.0';

 

Diskgroup altered.

 

SQL> select name,compatibility,database_compatibility from v$asm_diskgroup;

 

NAME            COMPATIBILITY DATABASE_COMPATIBILI

--------------- ------------- --------------------

DATA             11.2.0.4.0    11.2.0.4.0

 

 

温馨提示:如果打算升级数据库,请认真查看相关资料、文档,以及版本间特性、区别。

上一篇:Atlassian Confluence OGNL表达式注入代码执行漏洞(CVE-2021-26084)


下一篇:[转帖]Why CockroachDB and PostgreSQL Are Compatible