Oracle 的COMPATIBLE引數

charsi發表於2016-07-19
Oracle資料庫中有個引數COMPATIBLE,我們有時候會叫它為編譯版本。
對於該引數的含義,官方文件的解釋是:
COMPATIBLE allows you to use a new release of Oracle, while at the same time guaranteeing backward compatibility with an earlier release. This is helpful if it becomes necessary to revert to the earlier release.

This parameter specifies the release with which Oracle must maintain compatibility. It allows you to take advantage of the maintenance improvements of a new release immediately in your production systems without testing the new functionality in your environment. Some features of the release may be restricted.

When using a standby database, this parameter must have the same value on both the primary and standby databases.


需要注意,這個引數在Oracle 9i的時候,可以將版本往低調,但是到10g之後,只能往高調整,不能往低調。
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 10.2.0.4版本的資料庫中,會看到編譯版本為10.2.0.1。這種情況可能是因為,該資料庫是在10.2.0.1的資料庫軟體版本上建立的,而後資料庫軟體做了升級,升級之後繼承了之前的編譯版本。如果是在10.2.0.4資料庫版本上新建的資料庫,則預設其編譯版本為10.2.0.3

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23850820/viewspace-2122251/,如需轉載,請註明出處,否則將追究法律責任。

相關文章