BFILE 定位器可以指向不同文件管理器上的目录吗?

发布于 2024-08-12 21:56:53 字数 190 浏览 1 评论 0原文

我有一个 java web 应用程序需要上传文件,我们希望将这些文件存储在文件系统上而不是数据库中。数据库将仅存储文档元数据。

问题是是否将路径作为字符串存储在 Oracle 中,还是作为 BFILE 定位器? BFILE 定位器可以指向不同文件系统上的位置吗?如果我们必须将文件存储在 Oracle 文件管理器上,那么我们不妨将其存储为 BLOB。

I have a java web application which needs to upload files and we want to store these files on the filesystem rather than in the database. The database will store the document metadata only.

The question is whether to just store the path as a string in Oracle, or as a BFILE locator? Can a BFILE locator point to a location which is on a different filesystem? If we have to store the file on the Oracle filer then we may as well just store it as a BLOB.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仲春光 2024-08-19 21:56:53

BFILE 定位器必须是从 Oracle 服务器可见的目录,并且 Oracle OS 用户对其具有读写权限。因此,虽然理论上它可能是一个远程服务器,但这种方法的管理很快就会变得相当粗糙。实际上,将 BFILE 目录放在数据库服务器上更有意义。

那么您是否可以将其存储为 BLOB 呢?好吧,如果该文件只能通过数据库访问,那么,是的,绝对可以。使用 BLOB 数据类型具有事务支持的优点。与此相关的是,它使备份和恢复变得更简单,因为文件内容保证与数据库同步。对于 BFILE 来说不一定是这样,对于驻留在不同物理服务器上的 BFILE 来说几乎肯定不是这样。

The BFILE locator must be a directory that is visible from the Oracle server and which the Oracle OS user has read and write privileges on. So, while it could theoretically be a remote server the admin of that approach would get rather gnarly rather quickly. In practical terms it makes more sense to have the BFILE directory on the database server.

So might you just as well store it as a BLOB? Well, if the file is only ever going to be accessed through the database then, yes, definitely. Using a BLOB datatype has the advantage of transactional support. And in a related point, it makes backup and recovery simpler, because the file contents are guaranteed to be in sync with the database. This is not necessarily true of BFILEs, and almost certainly not true of BFILEs which reside on a different physical server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文