为什么在Oracle中,LOB取代了Long数据类型? [英] Why Long data type has been replaced by LOB in Oracle?

查看:157
本文介绍了为什么在Oracle中,LOB取代了Long数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LOB还具有Long数据类型的特征,它也有其自己的特殊特征.由于其具有Long的特征,因此可以将其他特殊功能赋予Long数据类型本身.因此,不需要再有一个LOB数据类型,并且Long本身可以一直使用.那么为什么Long被LOB取代了?

LOB having the features of Long data type as well it has its own special features. Since its having features of Long, the additional special features can be given to Long data type itself. So, no need of having one more data type LOB and Long itself can be used all the time. Then why Long has been replaced by LOB?

即使LOB代替了LONG,但仍使Long可以与最新版本的Oracle一起使用,以实现向后兼容性.这是额外的开销吗?

Even LOB is the replacement for LONG, still Long is made to be available with latest versions of Oracle for backward compatibility. This is additional overhead right?

推荐答案

LOB实际上是四个不同的数据类型:LONG的CLOB和LONG RAW的BLOB,以及BFILE和XMLType. Oracle在1990年代就引入了这些类型,因为LONG(和LONG RAW)都是Teh Suck!并非常努力地工作.如果数据库版本为8.0或更高,则没有理由使用LOB的LONG intsead.

LOBs are actually four distinct datatypes: CLOB for LONG and BLOB for LONG RAW, plus BFILE and XMLType. Oracle have introduced these types back in the 1990s because LONG (and LONG RAW) are Teh Suck! and terribly hard to work with. There is no reason to use LONG intsead of LOB if the database version is 8.0 or higher.

那为什么我们还有LONG?

So why do we still have LONGs?

LONG和CLOB是原始数据类型.因此,从理论上讲,Oracle可以对LONG进行修改,使其在实践中具有CLOB的附加特殊功能",这对将数据库升级到8.0(引入LOB的版本)产生了灾难性的影响.

LONG and CLOB are primitive datatypes. So while it is theoretically true that Oracle could have amended LONG to have "the additional special features" of CLOB in practice that would have had a catastrophic impact on upgrading databases to 8.0 (the version which introduced LOBs).

说灾难性的也许是双曲线的,但事实是将CLOB样式的功能改型为LONG意味着更改数据类型.因此,升级将不得不包括自动数据转换.另外,可能还有各种各样的低级例程,它们的行为需要更改.这只是数据损坏的一个巨大载体.引入新的数据类型并让各个站点处理迁移要容易得多(因此也更安全).

To say catastrophic is perhaps hyperbolic but the fact is retrofitting CLOB-style features to LONGs means changing datatypes. So the upgrade would have had to include an automatic data conversion. Plus there's probably all sorts of low level routines whose behaviour would have needed to change. It's just a massive vector for data corruption. It is much simpler (and hence safer) to introduce a new datatype and let individual sites handle the migration.

Oracle从8.0开始不推荐使用LONG,并提供了将LONG转换为CLOB的机制,因此,在理想情况下,每个人都应该继续前进,Oracle可以从数据库中删除LONG数据类型.但是,在现实生活中,许多商店仍在使用LONG,并且过多会损坏.

Oracle have deprecated LONG since 8.0 and provided mechanisms for converting LONGs to CLOBs, so in an ideal world everybody would have moved on and Oracle could drop the LONG datatypes from the database. However, in real life many shops are still using LONGs and too much would break.

因此,Oracle必须保留它们.问题的严重性可以从以下事实得出:Oracle仍然在数据字典中使用LONG本身(例如USER_/ALL_/DBA_VIEWS).

So Oracle have to retain them. The scale of the problem can be derived from the fact that Oracle still uses LONG itself in the data dictionary (such as USER_/ALL_/DBA_VIEWS).

这篇关于为什么在Oracle中,LOB取代了Long数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆