Last week I and several others talked about Oracle’s announcement of their new product Universal Online Archive. While UOA should be a pretty cool application, many of the features mentioned are actually available now in the 11g database and can easily be leveraged by Oracle UCM.
So what are these features?
Oracle 11g has a ton of new features, but the ones most interesting from a content repository standpoint are the new BLOB storage capabilities called SecureFiles. What they allow you to do is create a BLOB field in a table, but instead of just saving the file in the database table, you can now:
- Compress it
- Encrypt it
- Deduplicate it (ok that doesn’t make sense..but we’ll cover it soon)
Those are some pretty cool features, ones which are great from a just a database perspective, but become very pretty handy if you’re talking about a content repository. The fact that UCM has traditionally stored it’s content on the filesystem has always been a selling point for me; small databases, better performance, what would I gain by storing my content in a database? Bex Huff I think actually answers this best:
For the longest time, the folks at Stellent balked at using the database for file storage. Using the filesystem made much more sense because of performance reasons, which made up for the additional complexity of the architecture. However, if the user has 11g, there really is no better option than storing content items in the database.
There it is…No better option than storing content in the database? We have to give that a go.
Giving it a go
There are a couple prerequisites required before we can store UCM content in it’s database:
- Minimum UCM version is 10gr3
- UCM must be running on a 11g database
- A JDBC Filestore provider must be configured in UCM, here’s a link to the installation PDF
Step 1 – Verify if Secure File Support
The 11g database enabled SecureFile support by default, but if you want to make sure it’s working you can run the following commands as SYSDBA:
SQL>show parameter COMPATIBLE;
NAME TYPE VALUE
------------------------------------ ----------- -------------
compatible string 11.1.0.0.0
The database must have a version setting higher than 11.0.0.0.0
SQL> show parameter db_securefile
NAME TYPE VALUE
------------------------------------ ----------- --------------
db_securefile string PERMITTED
There are a couple different values that will work for db_securefile, PERMITTED is the default, ALWAYS or FORCE should work as well. If you need to change this value, run:
ALTER SYSTEM SET db_securefile = 'PERMITTED';
Step 2 – Drop and Recreate the BFILEDATA Column
The FILESTORAGE table created by the file store provider is configured for BASICFILE support, which unfortunately will not allow us to take advantage of any of the new BLOB features. Also unfortunate is that it appears the only way to enable SecureFiles is to drop and recreate the BLOB column.
Since I’m just using my local laptop, this isn’t really a big deal for me as my table is empty. Where I am going with this is that in these next few steps you could loose data if you’ve already stored it in the FILESTORAGE table…so be careful. Take a back up and if you’re using JDBC storage move you data somewhere else first.
As the UCM user drop the existing BFILEDATA BLOB column:
alter table FILESTORAGE drop column BFILEDATA;
Now add the column back only this time using the SECUREFILE Store As identifier:
alter table FILESTORAGE
add ("BFILEDATA" BLOB)
LOB ("BFILEDATA") STORE AS SECUREFILE filestorageblob(
TABLESPACE "UCM_SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT));
So what we’ve done is removed the old BLOB field(which was originally configured as a BASICFILE and replaced it with a BLOB configured for SecureFile support. Even though that’s set, we still aren’t taking advantage of new features. That will require a couple modifications to the column.
Compression
SecureFile compression comes in a couple different flavors; None, Medium or High which correspond to the level of compression applied to the field. SecureFile compression is completely separate from any table or index compression in place already, so if you compress the BLOB it’s just the BLOB nothing else. You’ll want to think about performance some when setting compression, as there should be an increase in latency and also CPU utilization when enabled.
Compression can be added with any of the following:
alter table FILESTORAGE
modify LOB("BFILEDATA") (
COMPRESS HIGH
);
alter table FILESTORAGE
modify LOB("BFILEDATA") (
COMPRESS MEDIUM
);
Or removed with this one
alter table FILESTORAGE
modify LOB("BFILEDATA") (
NOCOMPRESS
);
Encryption
SecureFile encryption adds an additional layer of security to your database by encrypting your BLOB files while they reside in the Oracle data file. The encryption is designed to prevent unauthorized access to the BLOB in case someone gets their paws on your data files. I have to admit that this one seems like a little bit overkill considering that like compression, encryption will cause a cpu and latency hit. I guess I just don’t think that many data files are getting hacked, but I could be wrong.
Enabling encryption requires adding a new folder named wallet to the database’s admin folder.
/oracle/product/database/admin/wallet
Then log in to the database as sysdba and run:
ALTER SYSTEM SET WALLET OPEN IDENTIFIED BY "[your password here]";
Reconnect back with your UCM account and update the BLOB:
Add encryption
ALTER TABLE FILESTORAGE
MODIFY LOB("BFILEDATA")
(ENCRYPT USING 'AES256');
Remove it
ALTER TABLE FILESTORAGE
MODIFY LOB("BFILEDATA")
(DECRYPT);
Deduplication
Deduplication may be the most clever feature included in SecureFiles. Each file checked in to a BLOB field is compared against the others, if the new file is a duplicate, only a pointer to the original is stored. Of course you as the user never knows the difference. Query either row and the file is returned.
The thing that is really cool about deduplication from a UCM perspective is that very often UCM actually stores duplicate files. In addition to user’s checking in the same file twice, quite a few file formats are simply copied over to the web layout folder. If you’re running both your vault and weblayout from the JDBC Filestore provider, even if the file type is configured to be copied out to the weblayout it will only be stored once in the database.
Adding the deduplication is pretty easy:
Enable deduplication
ALTER TABLE FILESTORAGE
MODIFY LOB("BFILEDATA") (
DEDUPLICATE
);
Disable it
ALTER TABLE FILESTORAGE
MODIFY LOB("BFILEDATA") (
KEEP_DUPLICATES
);
That’s it
As you can see there are quite a few options when it comes to configuring SecureFiles in general, but the integration with UCM is actually pretty simple. I ran through a couple test check ins while writing this post(some of the items being images that went though the refinery) all of which went though smoothly, though a little slower than a standard filesystem check in. I plan on leaving my local server with this configuration for some time, so we’ll see how it goes.
References

7 Comments
It all sounds great, but I think I`ll need more convincing before I start storing assets into a DB…
I haven`t had any experience with the Oracle DB.. But using it as a vault that could store TBs worth of data scares me..
I agree that quite a bit more testing needs to be done. UCM performs very, very well now with massive amounts of content on the filesystem. Obviously the jury is out on whether the DB can handle the same in a live environment, though I think this is the direction they will ultimately take the product.
one caveat… for web content — especially small images — the filesystem is still faster. So a split approach is optimal.
Luckily you can do that with a FileStoreProvider…
A database kind of approach will be the way to go. It has some big advantages as also Windows acknowledged with WinFS (but couldn’t get it in on time yet… http://www.liberidu.com/blog/?p=120).
Some of the advantages:
- data integrity
- solving locking problems
- search abilities build within
- handling enourmous amounts of small data as has been demonstrated the last thirty years
- out of the box live/hot backup and recovery solutions (that can handle data integrity issues)
…and by the way, “a database structure” can exist not only on solid disks…
hey Bex,
I`m still a bit confused. If Oracle 11g is supposed to be faster than a linux file system, then how is the filesystem faster at providing webcontent?
I haven`t had any experience with the Oracle DB. But in the past working on MSSQL DB content driven sites that recieve a large ammount of hits, it was found to be far better to export static data to xml on the file system and load in the xml data instead of hitting the database for each user that visited the site.
Site studio does a similar thing where it generates a static html page so it doesn`t have to abuse the DB.
I think I`ll need a lot of convincing a good explanation and time to test out performance of 11g
If webcontent assets were to be stored on the DB, is it possible to cache the images or would the DB be called for every asset?
I can see the benefits of using 11g, but it just scares me.. Is it possible to install 11g across multiple servers and split data across them? EG server 1 holds 1-1000 content items. Server 2 holds 1001-2000 content items and do a global query across both servers?
Thnx.
@JRS:
I chatted about this a bit on my blog…
Static files that are *local* to the web server are fastest. Going to the database is an extra network round trip that doesn’t make sense for small files.
However… if you have so many small files that you have to keep them on a network file system, then Oracle 11g with secure files could be much faster.
Or… if you are service up HUGE images over the web, then storing then in the database makes lots of sense.
Oracle UCM lets you do a blended approach: keep small web files on the local system, and large files in the database… with some tweaking of course
Secure files is faster because it feature a new write-gather cache that buffers data up during writes before flushing or committing to the underlying storage layer. This buffering allows for large contiguous space allocation for LOB or “secure file” data and reduces write latency. By reduceing disk seek costs, both read performance and write performance are greatly improved.