9 Reference: Site Capture Backup and Recovery

This chapter supports the previous chapters of Part III, "Upgrading Oracle WebCenter Sites: Site Capture" by providing detailed information about the backup and recovery steps you are instructed to complete in those chapters.

This chapter contains the following sections:

9.1 Prerequisites for Backing Up and Recovering

  • Before backing up any part of Site Capture application, it is best to shut down the application server. If you must make a backup of the active Site Capture application, ensure the website is not in use and no requests are being made to the application server.

  • Before recovering any part of the Site Capture application, ensure the application server is shut down.

9.2 Backup and Recovery Guidelines

This section contains steps for backing up and recovering the Site Capture installation directory, web application, and database.

This section contains the following topics:

9.2.1 Site Capture Installation Directory

This section contains the following topics:

9.2.1.1 Backup

Jar or tar the Site Capture installation directory.

For example:

tar -cvf SiteCapture_backup.tar /u01/CS/Install
jar cvf SiteCapture_backup.jar /u01/CS/Install

9.2.1.2 Recovery

Unjar or untar the backed-up Site Capture installation directory.

For example:

tar -xvf SiteCapture_backup.tar
jar xvf SiteCapture_backup.jar

9.2.2 Web Application

Refer to Table 9-1 and the sections that follow.

Table 9-1 Backup and Recovery Information for the ROOT .war File

.war Deployment Method Backup For Recovery Information, See...

Non-Exploded.For Site Capture on WebSphere

Unnecessary if the Site Capture installation directory is backed up.The ROOT.war file contained in the Site Capture installation directory:

<sc_install_dir>/ fw-site-capture/webapps/

Section 9.2.4, "Non-Exploded Files Recovery"

Exploded.For Site Capture on:

  • Apache Tomcat

  • Oracle WebLogic

  • No "development changes" to the files.

  • Backup is unnecessary if the files have not been changed during development and the Site Capture installation directory is backed up.

  • The ROOT.war file contained in the Site Capture installation directory:

    <sc_install_dir>/fw-site-capture/webapps/
    

Section 9.2.6, "Exploded Files Recovery" with no development changes

Same as previous row.

  • With "development changes" to the files.

  • Backup is required.

Section 9.2.6, "Exploded Files Recovery" with development changes


9.2.3 Non-Exploded Files Backup

See Table 9-1.

9.2.4 Non-Exploded Files Recovery

  1. Undeploy the Site Capture application.

  2. Recover the Site Capture installation directory (for instructions, see Section 9.2.1, "Site Capture Installation Directory.").

  3. Redeploy the Site Capture application.

9.2.5 Exploded Files Backup

  • To back up exploded files with no development changes, see Table 9-1.

  • To back up exploded files with development changes:

    Jar or tar the deployed Site Capture web application. Label the backup to distinguish it from the compressed ROOT.war file. For example:

    tar -cvf ROOT_web_backup.tar /u01/software/Tomcat/webapps/ROOT
    jar cvf ROOT_web_backup.jar /u01/software/Tomcat/webapps/ROOT
    

9.2.6 Exploded Files Recovery

  • To recover exploded files with no development changes:

    1. Stop the application server.

    2. Delete the exploded web application.

      For example:

      rm -rf /u01/software/Tomcat/webapps/ROOT/*
      
    3. Recover the Site Capture installation directory (for instructions, see Section 9.2.1, "Site Capture Installation Directory."

    4. Unjar the backed-up Site Capture web application. For example:

      cd /u01/software/Tomcat/webapps/ROOT
      jar xvf /ominstallinfo/app/ROOT.war
      
  • To recover exploded files with development changes:

    1. Stop the application server.

    2. Delete the exploded web application.

      For example:

      rm -rf /u01/software/Tomcat/webapps/ROOT
      
    3. Unjar the backed-up Site Capture web application. For example:

      cd /u01/software/Tomcat/webapps
      jar xvf <sc_install_dir>/ROOT_web_backup.tar
      

9.2.7 WebCenter Sites Database

This section covers the following databases: Oracle 11g; Microsoft SQL Server 2005, 2008, and 2008 R2; IBM DB2 9.7

This section contains the following topics:

9.2.7.1 Backup of Oracle, Microsoft SQL Server, and IBM DB2 Databases

  • To back up Oracle 11g

    1. Log in to the server as the oracle user.

    2. Set <ORACLE_HOME> to the Oracle database directory and ORACLE_SID to the database name.

    3. Log in to sqlplus as sys. Then, do the following:

      1. Use the create directory sql to map to the operating system directory, where the exports will be stored. For example:

        SQL> create directory exp_dp_dir as '/u01/backup/exports';
        
      2. Grant permissions for database export and directory access. For example:

        SQL> grant read,write on directory exp_dp_dir to system;
        SQL> grant EXP_FULL_DATABASE to system
        
    4. Run the expdp command to start exporting. For example:

      expdp system/<password> DIRECTORY=exp_dp_dir 
      DUMPFILE=<file_name>.dmp FULL=y SCHEMA=<YOUR_SCHEMA>;
      
  • To back up Microsoft SQL Server 2005, 2008, or 2008R2

    1. Open SQL Server Management Studio.

    2. Connect to the database server.

    3. Expand Databases.

    4. Right-click on the database to be backed up. Click Tasks > Backup.

    5. Under "Backup type," select Full. Under Destination, click Add.

    6. Enter the path and file name for the backup file. Click OK.

    7. Under "Destination," select the newly created backup location.

    8. Click OK.

  • To back up IBM DB2 9.7

    1. Log in to the server as the db2inst user.

    2. Run the following command:

      db2 force applications all
      
    3. Run the following command:

      db2 backup db <db_name> to <backup_dir>
      

    Note:

    After the command has completed, note the timestamp. This timestamp will be included in the name of the database backup file.

9.2.7.2 Recovery of Oracle, Microsoft SQL Server, and IBM DB2 Databases

  • To recover Oracle 11g

    1. Log in to the server as the oracle user.

    2. Set <ORACLE_HOME> to the oracle database directory and ORACLE_SID to the database name.

    3. Go to <$ORACLE_HOME>/bin.

    4. Run the following command:

      ./impdp system/<password> DIRECTORY=exp_dp_dir DUMPFILE=<file_name>.dmp SCHEMAS=<YOUR_SCHEMA>;
      
  • To recover SQL Server 2005, 2008 or 2008R2

    1. Open SQL Server Management Studio.

    2. Connect to the database server.

    3. Expand Databases.

    4. Right-click on the database to be restored. Select Tasks > Restore > Database.

    5. Under "Source for restore," select From database.

    6. Under "Select the backup sets to restore," select the most recent backup.

    7. Click Script at the top.

      This step opens the query editor containing the restore statement.

    8. Edit the query by adding REPLACE, after WITH. This will allow the database log to be overwritten.

    9. Click Execute.

  • To recover DB2 9.7

    1. Log in to the server as the db2inst user.

    2. Run the following command:

      db2 force applications all
      
    3. Run the following command:

      db2 restore db <db_name> from <backup_dir> replace existing
      

9.2.8 Running the Recovered Application

Before starting the application server, note the following:

  • If you are using Apache Tomcat, clear the application server cache:

    rm -rf <server_dir>/tmp/*
    rm -rf <server_dir>/work/*
    
  • For the Oracle WebLogic application server, the cache will be cleared upon redeployment of the application.