Previous Page | Next Page

Administering the SAS Content Server

Reconfiguring the SAS Content Server to Share the Database Used by SAS Shared Services

Beginning with the third maintenance release for SAS 9.2 and later, SAS Content Server supports database persistence. By default, the SAS Content Server uses the file system for persistence, and you need not change this setup. In some environments though, there might be a compelling need to use a database back end. In such cases, you can reconfigure the SAS Content Server to share the database that is used by SAS Shared Services.

By default, SAS Shared Services uses the SAS Table Server. However, SAS Shared Services can be configured to use a different database such as TKTS, Oracle, MySQL, Postgres, DB/2, or SQL Server.


JCRCopyRepository File

To migrate the contents of the current SAS Content Server's repository to the database-based repository, obtain the JCRCopyRepository.bat or the JCRCopyRepository.sh file from SAS Technical Support. Place the script file in the SAS-configuration-directory/Web/Utilities directory. This file should be customized for your environment. After the file is customized and saved, run the batch or script file to reconfigure the SAS Content Server and share the database used by SAS Shared Services.

Note:   The JCRCopyRepository script file does not ship with your software. To obtain a copy of the JCRCopyRepository script file, contact SAS Technical Support.  [cautionend]

For information about running the JCRCopyRepository script file, see Reconfigure SAS Content Server to Share the Database Used by SAS Shared Services.


JCRCopyRepository.bat File for Windows

Here is an example of the JCRCopyRepository.bat file in Windows:

@echo on
:Script for executing the JCRCopyRepository utility

setlocal

REM Define needed environment variables
call "%~dp0..\..\level_env.bat"

set LAUNCHERJAR=%SASVJR_HOME%\eclipse\plugins\sas.launcher.jar
set UTILITIESDIR=%LEVEL_ROOT%\Web\Utilities
set PICKLISTS=%SAS_HOME%\SASWebInfrastructurePlatform\9.2\Picklists\wars\
sas.svcs.scs\picklist
set DRIVER=path-to-jdbc-driver-JAR-file
set CLASSPATH=%UTILITIESDIR%;%LAUNCHERJAR%

"%JAVA_JRE_COMMAND%" ^
  -classpath "%CLASSPATH%" ^
  -Djava.system.class.loader=com.sas.app.AppClassLoader ^
  -Dsas.app.launch.config="%PICKLISTS%" ^
  -Dsas.app.repository.path="%SASVJR_REPOSITORYPATH%" ^
  -Dsas.app.class.path="%UTILITIESDIR%;%DRIVER%" ^
  -Djava.security.auth.login.config=%LEVEL_ROOT%\Web\Common\login.config^
  -Xmx256m ^
  -Dscs.jndi.jndiName=sas/jdbc/SharedServices ^
  -Dscs.jndi.jdbcUrl=jdbc-url ^
  -Dscs.jndi.driver=jdbc-driver-class^
  -Dscs.jndi.user=database-user ^
  -Dscs.jndi.pwd=password ^
  org.apache.jackrabbit.core.JCRCopyRepository %1 %2
endlocal
if [%2] EQU [exit] exit %ERRORLEVEL%


JCRCopyRepository.sh File for UNIX and z/OS

Here is an example of the JCRCopyRepository.sh file in UNIX:

#!/bin/sh
#
# JCRCopyRepository.sh
#
._'dirname $0'/../../level_env.sh
LAUNCHERJAR=$SASVJR_HOME/eclipse/plugins/sas.launcher.jar

UTILITIESDIR=$LEVEL_ROOT/Web/Utilities
PICKLISTS=/OPT/SAS_92/SASWebInfrastructurePlatform/9.2/Picklists
/wars/sas.svcs.scs/picklist 
DRIVER=path-to-jdbc-driver-JAR-file
CLASSPATH=$UTILITIESDIR:$LAUNCHERJAR

"$JAVA_JRE COMMAND" \
  -classpath "$CLASSPATH" \
  -Djava.system.class.loader=com.sas.app.AppClassLoader 
  -Dsas.app.launch.config="$PICKLISTS" \
  -Dsas.app.repository.path="$SASVJR_REPOSITORYPATH" \
  -Dsas.app.class.path="$UTILITIESDIR:$DRIVER" \
  -Djava.security.auth.login.config=../Common/login.config\
  -Xmx256m \
  -Dscs.jndi.jndiName=sas/jdbc/SharedServices \
  -Dscs.jndi.jdbcUrl=jdbc-url \
  -Dscs.jndi.driver=jdbc-driver-class_
  -Dscs.jndi.user=database-user_
  -Dscs.jndi.pwd=password \
 org.apache.jackrabbit.core.JCRCopyRepository $1  $2

exit 0


Reconfigure SAS Content Server to Share the Database Used by SAS Shared Services

To reconfigure the SAS Content Server to share and use the same database that is used by SAS Shared Services, follow these steps.

  1. Stop the Web application server. Typically, this is SASSERVER 1 in the Web application server's configuration directory.

  2. Rename the Content Server repository from Repository to RepositoryFS.

    On Windows:

    move C:\SAS-configuration-directory\Lev1\AppData\SASContentServer\Repository C:\SAS-configuration-directory \Lev1\AppData\SASContentServer\RepositoryFS

    On UNIX and z/OS:

    mv SAS-configuration-directory/Lev1/AppData/SASContentServer/Repository SAS-configuration-directory/Lev1/AppData/SASContentServer/RepositoryFS

  3. In the previous step, you moved the Repository directory. Now, recreate the directory in that same location:

    On Windows:

    mkdir C:\SAS-configuration-directory\Lev1\AppData\SASContentServer\Repository

    On UNIX and z/OS:

    mkdir SAS-configuration-directory/Lev1/AppData/SASContentServer/Repository

  4. The contents of the repository.xml file should identify the database that is used for SAS Shared Services. Copy the repository.DatabaseName.xml file from the SAS-installation-directory/SASWebInfrastructurePlatform/9.2/Static/wars/sas.svcs.scs/WEB-INF/templates directory to the directory that you created in the previous step. Then, rename this file as repository.xml.

    Here is an example for the TKTS database on Windows:

    copy C:\SAS_HOME\SASWebInfrastructurePlatform\9.2\Static\wars

    \sas.svcs.scs\WEB-INF\templates\repository.tkts.xml C:\SAS-configuration-directory \Lev1\AppData\SASContentServer\Repository\repository.xml

    Here is an example for the TKTS database on UNIX:

    cp /$SAS_HOME//SASWebInfrastructurePlatform/9.2/Static/wars/sas.svcs.scs/WEB-INF/templates/repository.tkts.xml SAS-configuration-directory/Lev1/AppData/SASContentServer/Repository/repository.xml

  5. If this is a JBoss Web application server, open the repository.xml file and search for the following parameter:

    <param name="url" value="sas/jdbc/SharedServices

    Modify the value:

    <param name="url" value="java:sas/jdbc/SharedServices"/>

    This value should be modified in six different locations within the repository.xml file.

  6. On JBoss, if a workspace.xml file exists in the workspaces\default directory, modify the value for the url parameter in two different locations within the file:

    <param name="url" value="java:sas/jdbc/SharedServices"/>

  7. Obtain the values for the database name, host, port, user ID, and password from the Web Application Server.

    JBoss:

    Open the SharedServices-ds.xml file located in the SAS-configuration-directory/Lev1/Web/Common/jboss directory.

    WebSphere:

    In the WebSphere Admin Console, navigate to Resources [arrow] JDBC [arrow] Data Sources [arrow] Custom Properties

    WebLogic:

    In the WebLogic Admin Console, navigate to SASDomain [arrow] Services [arrow] JDBC [arrow] Data Sources [arrow] SharedServices [arrow] Configuration and click on the Connection Pool tab.

  8. In the JCRCopyRepository script file that was placed in the SAS-configuration-directory/Web/Utilities directory, modify the value of the DRIVER parameter to indicate the path to the JDBC driver for the database:

    DRIVER=path-to-jdbc-driver-JAR-file

    The directory path should include the list of JAR files. The listed JAR files should be concatenated by semi-colons (Windows) or colons (UNIX).

    Here is a short excerpt from an example on Windows:

    SAS-configuration-directory\Lev1\Web\Applications\SASSharedServices9.2\JDBCDriver\

    icu4.jar;SAS-configuration-directory\Lev1\Web\Applications\SASSharedServices9.2\

    JDBCDriver\log4j.jar;

    On UNIX and z/OS:

    SAS-configuration-directory/Lev1/Web/Applications/SASSharedServices9.2/

    JDBCDriver/icu4.jar;SAS-configuration-directory/Lev1/Web/Applications/SASSharedServices9.2/

    JDBCDriver/log4j.jar;

  9. Specify the values for user and password in the JCRCopyRepository script file. These values were retrieved earlier from your Web Application Server.

    -Dscs.jndi.user=database-user ^
    -Dscs.jndi.pwd=password ^

  10. In the same JCRCopyRepository script file, enter the values for the following parameters:

    -Dscs.jndi.jdbcUrl=jdbc-url ^
    -Dscs.jndi.driver=jdbc-driver-class ^

    The values specified for the JDBC URL and the driver are determined by the type of database used in your environment. The following table shows the examples of values for the different types of databases:

    Parameters and Values for JDBC URL and Driver
    Database Parameters Values
    TKTS -Dscs.jndi.jdbcUrl
    jdbc:sastkts://host:2171?constring=(DSN=SharedServices)
    TKTS -Dscs.jndi.driver
    com.sas.tkts.TKTSDriver
    Oracle -Dscs.jndi.jdbcUrl
    For Oracle:

    jdbc:oracle:think:@host:1521:orcl

    For XE:

    jdbc:oracle:think:@host:1521:xe

    Oracle -Dscs.jndi.driver
    oracle.jdbc.driver.OracleDriver
    Postgres -Dscs.jndi.jdbcUrl
    jdbc:postgresql://host:5432/SharedServices
    Postgres -Dscs.jndi.driver
    org.postgresql.Driver
    DB2 -Dscs.jndi.jdbcUrl
    jdbc:db2//host:50000/database
    DB2 -Dscs.jndi.driver
    com.ibm.db2.jcc.DB2Driver
    MSSQL -Dscs.jndi.jdbcUrl
    jdbc:sqlserver://host:1433;DataBaseName=SharedServices;SelectMethod=cursor
    MSSQL -Dscs.jndi.driver
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    MySql -Dscs.jndi.jdbcUrl
    jdbc:mysql://host:3306/SharedServices
    MySql -Dscs.jndi.driver
    com.mysql.jdbc.Driver

  11. In the command window, navigate to the SAS-configuration-directory/Web/Utilities directory.

  12. Run the JCRCopyRepository script command by providing the complete directory path of the old and new repository directories.

    On Windows:

    JCRCopyRepository.bat C:\SAS-configuration-directory\Lev1\AppData\SASContentServer\RepositoryFS C:\SAS-configuration-directory\Lev1\AppData\SASContentServer\Repository

    On UNIX:

    ./JCRCopyRepository.sh SAS-configuration-directory/Lev1/AppData/SASContentServer/RepositoryFS SAS-configuration-directory/Lev1/AppData/SASContentServer/Repository

  13. To enable the changes to take effect, restart the Web application server. Typically, this is the SASSERVER1.

Previous Page | Next Page | Top of Page