Spotfire® Server and Environment - Installation and Administration

Configuring logging to a Microsoft SQL Server database using the command line

You can configure action logging to write to a Microsoft SQL Server database by running additional scripts needed for logging to a database. Sample scripts are included in the installation kit for Spotfire Server.

About this task

This topic describes the steps required to run the configuration scripts from the command line. Alternatively, you can enable and configure the action logging and system monitoring using the configuration tool.

Before you begin

  • You must have administrative credentials for Spotfire Server. If Spotfire Server is set up to authenticate with the Spotfire database using Windows Integrated Authentication, you must run commands as the same user that Spotfire Server authenticates as. Otherwise, the commands cannot authenticate with the database.
  • You must have enabled logging to a database.

Procedure

  1. Log in to Spotfire Server, and in the file system, browse to the directory containing the installation kit files that you downloaded from the TIBCO eDelivery site.
  2. In the installation kit directory, browse to the directory containing the scripts to create a new database and schema.
    For SQL Server, this directory is /scripts/mssql_install/actionlog.
  3. Using a text editor, open the script file create_actionlog_db.bat (or, for Linux, create_actionlog_db.sh).
  4. In the script file, edit the section containing the database name spotfire_actionlog, setting the variables to reflect your database environment.

    You must provide the database password in this script. If you do not have the password, consult your database administrator for assistance.

    Note: If you want to use the information layer for analyzing action logs, you should not change the ACTIONDB_DBNAME from the default spotfire_actionlog, or else, you must use the Redirect dependent elements functionality in Information Designer (in Spotfire Analyst) to fix the mapping. See the Spotfire Analyst help topic Redirecting the Information Model for more information on this functionality.
  5. Optional: If your database is running on Amazon RDS, also edit the script file create_actionlog_db_rds.bat (or, for Linux, create_actionlog_db_rds.sh), specifying the same information.
  6. Run the script to create the database.
    Information and error logs are written to a file named actionlog.txt in the directory from where you run the script. If the script takes a very long time, or if it fails, check this text file for more information.
    Note: If you encounter an error that indicates that the driver could not establish a secure connection, see the article Upgrading to 12.3 and later: Fixing Microsoft SQL Server JDBC driver-related issues.
    The database is created on the server.
  7. On Spotfire Server, from the Start menu, open a command line as an administrator (or, if you are using Windows Integrated Authentication, as the Spotfire Server database user).
  8. Browse to <installation dir>\tomcat\spotfire-bin.
  9. Export the configuration: At the command prompt, type the command config export-config.
    Example:
    config export-config --force 
    When prompted, supply the tools password. See export-config for more information.
  10. At the command prompt, run the command config-action-logger.
    Example:
    config config-action-logger --database-logging-enabled=true
  11. At the command prompt, type the command config config-action-log-database-logger, passing in the arguments specifying the details of the database.
    For example, to specify the Microsoft SQL Server database URL, driver class, user name, and password, provide the following.
    config config-action-log-database-logger --database-url="jdbc:sqlserver://[mycompany]:1433;DatabaseName=[Mydatabase]" 
    --driver-class="com.microsoft.sqlserver.jdbc.SQLServerDriver" --username="spotfire_actionlog" --password="[action-database-password]"
    If you encounter an error that indicates that the driver could not establish a secure connection, then you must add the trustServerCertificate=true parameter to your database URL, as described in Upgrading to 12.3 and later: Fixing Microsoft SQL Server JDBC driver-related issues. See the following example.
    config config-action-log-database-logger --database-url="jdbc:sqlserver://[mycompany]:1433;DatabaseName=[Mydatabase];trustServerCertificate=true" 
    --driver-class="com.microsoft.sqlserver.jdbc.SQLServerDriver" --username="spotfire_actionlog" --password="[action-database-password]"
    See config-action-log-database-logger for more information.
  12. At the command prompt, type the command config import-config.
    Example:
    config import-config --comment="adding database configuration for action logging." 
    
    When prompted, supply the tools password. See import-config for more information.
  13. Restart Spotfire Server.

Results

The database is configured.

What to do next

If desired, follow the instructions in Importing a library for analyzing action logs in Spotfire Analyst, to get a quick start with your action log analysis.