OFS and DBFS Questions (Oracle 12.2)

I pushed out some new articles yesterday.

The SecureFiles article is mostly links to other articles, but it was requested by a reader. In the process of doing that I noticed the new OFS feature in 12.2, which took me down a rabbit hole for a few days.

I try to keep the main website for how-to articles, and the blog is where I post more opinion-based stuff. I got some questions, related to the OFS article, so I thought I would give some answers/opinions here. I could be wrong! 🙂

Q: Isn’t this just renamed DBFS?

A: No. If you compare the objects created for a DBFS and OFS file system they are different. They still do the same job (represent a file system and hold files in BLOBs in the database), but they are distinct file systems. This is not a straight “re-brand” of DBFS.

In addition, OFS is both the name of a file server, the OFSD background process is the OFS server, and a specific type of database file system, the OFS file system. The OFS file system is “similar” to DBFS. The OFS server process can mount both OFS and DBFS file systems.

I think it’s important to remember to use the terms “OFS server” and “OFS file system” so that people understand what bit you are talking about. 🙂

Q: There are now two database file systems (OFS and DBFS). Which should I use?

A: In my opinion, if you are happy with the restriction that you can only create the file system objects in the root container, or a non-CDB instance, you should probably use the OFS file system. It’s marginally easier to create and I’m guessing that is what the developers of the OFS server would prefer you to use. 🙂 If this restriction is a problem, use DBFS to create a file system in a PDB or a non-sys user.

If you need HTTP(S), WebDav or FTP access to the file system, DBFS is a better choice as those features come “out of the box” with DBFS from 12.1 onward.

Pick the one that matches your use case.

Q: Will OFS eventually replace DBFS?

A: I have no idea. What I can say is DBFS has some enhancements in 12.2 (POSIX File Locking) and it does some stuff “out of the box” that OFS doesn’t (HTTP(s), WebDav and FTP). It also plays well with multitenant. I’ve tried it and it works the same in a 12.2 PDB as it does in 11gR2.

IMHO if the plan were to replace DBFS with OFS, OFS would need to play well with multitenant and have the HTTP(S), WebDav and FTP (or preferably sFTP) support.

Until stated otherwise, I’m going to assume they will coexist and each serve slightly different use cases.

Q: Automatic mounting of DBFS using FUSE through “/etc/fstab” is confusing because of timing issues. Is OFS better?

A: Yes. The problem with any kind of auto-mount of a database file system is the database must be up before the mount is attempted. If you get the timing wrong it doesn’t work. The great thing about OFS is the mount/unmount is controlled by the OFSD process, so file systems mounted with the “persist” option will be mounted on instance startup and unmounted on instance shutdown. Great! No timing issues!

You have to be aware of the potential issues around a manual unmount of the file system and the impact of a shutdown abort, but you test all your failure situations before going live right?

From my limited testing, this aspect of OFS server feels really solid. It did what it said it would. I have no examples of heavy usage to refer to at this time.

Q: Is OFS Server a NFS Server.

A: No it isn’t and I think the term “NFS in the database” from the documentation is confusing. A file system mounted by OFS server can be exported using a NFS server, allowing NFS access to the database file system (OFS or DBFS). The database itself is not acting as a NFS server. So what you have is the NFS server on the OS exporting the FUSE file system, which is held in the DB. I would give that more emphasis in the docs if it were me. This totally confused me, so I reached out on Twitter and Oracle came to the rescue, which was cool, but I don’t feel that should be necessary to get a DB feature working. 🙂

I think it’s cool you can export it using the OS NFS server, but that doesn’t make Oracle a NFS server. 🙂

Q: Any issues with the NFS over FUSE?

A: Once you throw the NFS server into the mix you get timing issues again. During my (rather limited) testing I’ve had a few issues that could only be fixed by restarting the NFS server on the OS. Once I did that everything was golden.

From a resilience perspective, I’m not sure how I feel about this. Remember, I’m new to this feature and I’m not a NFS guru either, so don’t let me put you off.

As a general point, there does seem to be a lot of posts on the interwebs of people having issues with NFS over FUSE, so I’m not how solid this is as a technology. It does work though. Like I said, I’m no expert!

Q: How do you “feel” about the new OFS feature?

A: I used iFS in Oracle 8i. It worked fine, but was a massive resource hog. I’ve used the “file system” in the XML DB repository for some basic file handling. It works fine. I’ve used DBFS for some minor things and it’s fine, provided you are careful with mounting it using FUSE. Having used OFS for a few days I “feel” like it is the cleanest experience of accessing a database file system from the database server. I like it. 🙂