16 Moving the Shared File System to a Database

WebCenter Sites can leverage a database to store its shared file system using the Java Nonblocking I/O (NIO) API. This eliminates the need for a network file share in a clustered environment and allows file locking to be handled by a Coherence cache. Out of the box, WebCenter Sites defaults to a disk-based shared file system (local or network). To move the shared file system to a database, complete the steps in this topic. Steps for reverting the process are also provided.

Note the following:
  • Only the Oracle 11g and 12c databases are supported.

  • Oracle recommends storing files managed by WebCenter Sites (also referred to as shared files) in a database. This helps in configuring highly available deployments along with streamlining backup and restore processes for your environments. The database can be WebCenter Sites’s own database or a separate database. Depending upon the needs of your site, you may need to plan for additional capacity or processing, or both.

  • If you are clustering WebCenter Sites, you must do the following steps before moving the shared file system:
    1. Complete the steps in Setting Up a Cluster.

    2. Add all cluster members to the Coherence Cluster:
      1. In the WebLogic Server Administration Console, navigate to Domain Name > Environment > Coherence Clusters.

      2. Select the default Coherence cluster, and then click the Members tab.

      3. In the Clusters section, enable your WebCenter Sites cluster, and then enable the All servers in the cluster option.

  • Ensure that the primary node of the cluster has been set up and registered as a cluster node as Setting Up a WebCenter Sites Cluster describes.

  • The default data source name is wcsitesDS. If you want to use a different data source name, you must set the databaseConnector bean in sites_config_dir/NIOSharedServices.xml to the new name before completing the following steps.

    Note:

    The sites_config_dir is DOMAIN_HOME/wcsites/wcsites/config/.
  • If you have already setup a traditional, file-based cluster, the wcs_properties.json would have been moved to the sites-shared/config directory as part of the cluster setup. In that case, make note of the following:
    • Move the wcs_properties.json file back to the sites_config_dir.

    • If subsequently you wish to revert from database back to disk storage, then after having run the NIO Conversion utility with revert option, copy the wcs_properties.json file back to the sites-shared/config directory.

  • If you want to store the WebCenter Sites shared file system in the WebCenter Sites repository database, increase the tablespace size for the prefix_TS_WCSITES and prefix_TS_TMP_WCSITES tablespaces.

  • If you want to store the WebCenter Sites shared file system in a database other than the WebCenter Sites repository database, do the following steps:
    1. Create a new database with the same permissions as the WebCenter Sites repository database with the following commands:

      • CREATE SEQUENCE

      • CREATE SESSION

      • CREATE TABLE

      • CREATE TRIGGER

      • CREATE VIEW

      • UNLIMITED TABLESPACE

    2. Create a new data source pointing to the new database, and deploy the new data source as a JDBC data source on the Managed Servers running WebCenter Sites.

    3. Set the databaseConnector bean in sites_config_dir/NIOSharedServices.xml to the new data source name.

To move the WebCenter Sites shared file system from disk to a database (either the WebCenter Sites repository, or a different database), do the following steps:
  1. Shut down all Managed Servers running WebCenter Sites.
  2. Back up sites_config_dir. In case of any failures, you can roll back changes made to the config folder.
  3. Make note of the location of the WebCenter Sites shared directory.
    You can look it up the location in the sites_config_dir/wcs_properties.json file by searching for "wcsites.shared".
  4. Set the databaseConnector and sitesDatabaseConnector beans in sites_config_dir/NIOConversionServices.xml to the appropriate database connection URL or URLs.
    The beans will be different only if you plan to store the WebCenter Sites shared file system table (WCS_SHAREDFILESYSTEM) in a database separate from the primary WebCenter Sites database.
  5. Open a command prompt and change to ORACLE_HOME/wcsites/webcentersites/sites-home/bin/.
  6. Run the conversion script: ./nioconversion.sh sites-home_directory sites_config_parent sites_shared_directory convert|revert database_driver_file.
    This script is on a UNIX operating system. On a Windows operating system, use the nioconversion.bat command, with the same options.

    The following table describes the options of this script.

    convert or revert Converts the shared file system to database storage, or reverts it back to disk storage.
    sites-home_directory Full path to the sites-home directory. By default, this isORACLE_HOME/wcsites/webcentersites/sites-home.
    sites_config_parent Full path to the parent directory containing the WebCenter Sites config directory, with no trailing slash. By default, this is DOMAIN_HOME/wcsites/wcsites.
    sites_shared_directory Full path of the WebCenter Sites shared file system directory (wcs_shared).
    database_driver_file Full path and name of the database driver file used for connecting to the target database.
    silent (optional) This flag minimizes messages to the console.

    UNIX example: nioconversion.sh /mySites/sites-home /mySites/config /mySites/sites-shared convert /lib/ojdbc6.jar

    Windows example: nioconversion.bat C:\mySites\sites-home C:\mySites\config C:\mySites\sites-shared convert C:\lib\ojdbc6.jar silent

    Note:

    Do not supply symbolically linked paths to the conversion utility, or the conversion will fail. Supply full hard paths only. If you have symbolic links, you must use the actual value stored in wcs_properties.json:wcsites.shared as a parameter when running the utility
  7. When prompted, enter the credentials for WebCenter Sites and the shared file system database (if you are not storing the shared file system in the WebCenter Sites repository database), and wait for the conversion process to complete.

    The passwords will be different only if you plan to store the WebCenter Sites shared file system table (WCS_SHAREDFILESYSTEM) in a database separate from the primary WebCenter Sites database.

    The program will replicate the shared file system into the database and update all configuration files (ini/json/database tables) to reference the file system in the database.

    The log file for the utility is called sites.utilities.log. It is created in the directory from which this utility is run.

  8. Locate the old shared file system directory on the disk and rename it (do not yet delete it).
  9. Start the WebCenter Sites Managed Servers and log in to the Admin interface to verify that the new configuration is fully functional.
  10. Confirm that the old shared file system directory on disk was not re-created after WebCenter Sites started up. If the directory was re-created, check for any custom code that might still be referencing it.
  11. If the old shared file system directory on disk was not re-created after WebCenter Sites started up, back up the directory and then delete it and its contents.

Note:

If you store the WebCenter Sites shared file system in a database other than the WebCenter Sites repository database, logging in to the Admin interface takes a few extra minutes the first time.