BLOB 和 CLOB 的解释
我正在寻找 BLOB 和 CLOB 数据的真正好的解释。我正在寻找用简单的英语解释的伟大内容。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我正在寻找 BLOB 和 CLOB 数据的真正好的解释。我正在寻找用简单的英语解释的伟大内容。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
BLOB(Binary Large OBject)存储二进制文件:图片、文本、音频文件、word文档等任何肉眼无法阅读的东西。您无法通过 SQL*Plus 选择它们。
CLOB(字符大对象)存储字符数据。它们通常用于存储 XML 文档、JSON 或大块格式化或未格式化的文本。
BLOB's (Binary Large OBject) store binary files: pictures, text, audio files, word documents, etc. Anything you can't read with the human eye. You can't select them via SQL*Plus.
CLOB's (Character Large OBjects) store character data. They are often used to store XML docs, JSON's or just large blocks of formatted or unformatted text.
这非常简单。区别在于,您将表中的大型数据对象存储为基于字符(即 CLOB)或基于二进制(即 BLOB)的列,以与如何打开文本文件和打开文件相同的方式思考它当您将其作为二进制数据打开时。
对于相对较短且在我看来是单一数据的字符串数据类型,VARCHARS 等仍然是首选。例如,名称、街道名称、部门名称等。当您希望按照 XML 配置文件等方式存储某些内容时,您可能需要考虑将其存储为 CLOB。如果您要存储图像,那么 BLOB 将是合理的选择。有人讨论在表中存储实际图像或配置文件与存储实际文件的路径是否更好,但我将把它留给另一个问题。
It's pretty straight forward. The difference is that your storing large data objects within the table as a column that are either character based (i.e. A CLOB) or binary based (i.e. a BLOB) Think of it in the same terms of how you would open a file as text vs when you open it as binary data.
VARCHARS etc. would still be preferred for string data types that are relatively short and in my mind a singular piece of data. For example a name, a street name, dept name etc. When you're looking to store something along the lines of a XML configuration file or the like, you would want to consider storing it as a CLOB. If you're storing say images, then a BLOB would be the logical choice. There are discussions about whether it's better to store the actual image or config file within the table vs storing a path to the actual file instead but I'll leave that for another question.
BLOB 是一个二进制大对象,可以容纳您想要的任何内容,包括图像和媒体文件。任何存储为二进制文件的内容。
CLOB 是一个字符大对象,它将保存字符(文本),基本上这使它成为一个巨大的字符串字段。 CLOB 还支持字符编码,这意味着它不仅仅是 ascii 字符。
Oracle 常见问题解答的两个链接将提供每个链接的具体使用信息。
A BLOB is a Binary Large Object which can hold anything you want including images and media files. Anything stored as a binary file.
A CLOB is a Charactor Large Object, which will hold charactors (text), Basically this makes it a huge string field. CLOB also supports charactor encoding meaning it is not just ascii charactors.
The two links to Oracle's FAQ will provide specific information for the usage of each.
Oracle 概念指南 是以下内容的最佳来源: LOB 数据类型。确保您每年至少阅读一次概念指南以及特定于您所拥有的 Oracle 版本的概念指南。每次我读它我都会学到新东西。
The Oracle Concepts Guide is the best source for an explanation of LOB datatypes. make sure you read the concepts guide at least once a year and the concept guide specific to the version of oracle you have. Every time I read it I learn something new.