Thursday, June 23, 2016

Compacting a WebLogic Persistent File Store

Oracle WebLogic Server stores different long-term persistent objects such as diagnostic information, JMS messages, JTA transaction logs, timers, etc. in the persistent stores, which provides a built-in, high-performance storage solution for WebLogic Server subsystems and services that require persistence. There are two types of the persistent stores: File Stores and JDBC-accessible ones. An application server instance doesn't compact the stores even no object is there, e.g. all persistent JMS messages were consumed.

When the persistent store occupies a lot of space (let's say more than one GB), the process of starting a server instance takes more and more time, for example it could take 10 minutes to start a production server instance with a 1.3 GB file store configured for it, and there were about 600 messages by 1-2 KB each one.

The weblogic.store.Admin command line tool as well as WebLogic Scripting Tool (WLST) can be used for compacting file stores. The compactstore WLST method has two parameters: a path to the persistent store directory and [optional] a temporary directory, which is used for creation a backup copy. The temporary directory can't be a sub-directory of the persistent store.

Here is an example of using the compact command to compact the space occupied by a file store in the 'RTKDSVStore_1' directory.

wls:/offline> compactstore('/home/weblogic/user_projects/domains/esb_domain/store/RTKDSVStore_1')

Since the compactstore() method can only be used on unopened file stores, none of the stores that have files in the source 'dir' directory should be open. Also, the temporary 'tempdir' directory should have at least enough extra space as the source directory and should also not be under the source directory. When compact successfully completes, the newly compacted store files will be in the 'RTKDSVStore_1' directory.

More information about the Persistent Stores is available in the Managing the WebLogic Persistent Store chapter of the Fusion Middleware Administering the WebLogic Persistent Store 12c (12.2.1.1.0).

Would you like to give a 'Like'? Please follow me on Twitter!