对compatible参数的理解

从10g开始,Oracle的COMPATIBLE参数不可逆,即不能由高版本降低到低版本,但在9i中可以。本文通过测试验证了9i中COMPATIBLE参数的降级情况,并讨论了不同版本数据库与COMPATIBLE的关系,以及参数修改对文件格式和数据库功能的影响。
摘要由CSDN通过智能技术生成

compatible也能降


compatible也能由高变低,不过是在9i。


今天在看oracle 10g的文档,注意到Irreversible Compatibility这个说法。

Starting with Oracle Database 10g, the COMPATIBLE initialization parameter becomes irreversible; that is, it cannot be set to a value that is less than a previous value. Therefore, the compatibility of the database can go only forward and never backward.
For example, suppose that you set COMPATIBLE to 10.0.0 and start up the database, then shut down the database to restart with COMPATIBLE set to 9.2.0. During startup, you get an error indicating that the compatible setting cannot be reversed.
If you do advance the compatibility(的值) of your database with the COMPATIBLE initialization parameter, 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 compatibility was advanced. (so)Any changes since, are lost.

Consequently, the ALTER DATABASE RESET COMPATIBILITY command is now obsolete.



注释:

看来,有时候还得看点老版本oracle文档上的东西,即新版本和老版本都有的知识点。我在11gR2上貌似没看到上面的解释。

except by doing a point-in-time recovery to a time before compatibility was advanced.的解释:

你要使用这个参数来保持升级(oracle软件系统和数据库都升级了)前的功能,必须在升级数据文件时就指定你想要的compatiable参数值。否则开始设定一个比较高(的版本号)来升级(oracle软件系统和数据库都升级了,此时compatiable参数值也变为升级后的版本号值),升级后想让compatiable参数值revert到以前来避免使用(oracle软件系统)新功能是不可能的。除非你用以前低版本(数据文件)备份来做一次point-in-time的恢复。

好了,开始正文。

从10g开始COMPATIBLE 不能由高降低,难道9I可以?将compatiable从9.2.0.5改为9.2.0.1?我测试后果然可以。

以前我一直以为COMPATIBLE 在所有版本(包括patch set)都不能修改为更小的值,以为每次修改compatiable都会去修改所有的datafile header格式上的compatiable(或是叫 version,版本这个变量位置里的值).

先看10g的,改低compatible后,数据库在mount的时候提示错误:参数设置与控制文件格式上的compatiable(或是叫 version,版本这个变量位置里的值)不一致:

SQL> startup
ORACLE instance started.

Total System Global Area 272629760 bytes
Fixed Size 2035592 bytes
Variable Size 201330808 bytes
Database Buffers 62914560 bytes
Redo Buffers 6348800 bytes
ORA-00201: control file version 10.2.0.3.0 incompatible with ORACLE version 10.2.0.1.0(指的是参数compatiable里设置的值)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值