Connecting Guardium to Db2 sample data

Guardium Data Protection is a responsive real time monitoring solution for Db2. Now that you have Guardium and Db2 installed and configured, the commands that you run in Db2 are reflected in Guardium. If you want to reproduce the dashboards provided in marketing materials, follow these steps.

Before you begin

Trial:
  • This special trial (ISO file) is available for current and potential Db2 customers. It cannot be used for production purposes.
  • The trial license expires in 90 days from the point of installation of the license.
  • Trial clients can extend their trial for 1 more period of 90 days by applying for another trial license (with the approval of your IBM representative).
  • Previously accepted trial licenses that are expired continue to appear on the license page as accepted licenses.
  • You cannot use a regular Guardium license in addition to this trial appliance.

The files that are needed to connect to the sample data are available for download in the IBM Guardium Data Protection Trial page that you access after signing up for the trial. In that page, download the Sample Data - GDP Trial SQLs.tar file.

Procedure

  1. Add users to the database.
    useradd -g db2iadm1 polly
    useradd -g db2iadm1 liher
    useradd -g db2iadm1 jason
    useradd -g db2iadm1 john
  2. Set passwords for the users (you can use any passwords that you want).
    echo "polly:polly" | chpasswd
    echo "liher:liher" | chpasswd
    echo "jason:jason" | chpasswd
    echo "john:john"   | chpasswd 
  3. Copy Sample Data - GDP Trial SQLs.tar to the /tmp/ directory.
  4. Logged in as the db2inst1 user, extract the file.
    tar -vxf "/tmp/Sample Data - GDP Trial SQLs.tar"

    In the steps that follow this, <ScriptsDir> denotes the location that you extract the file tar file to (for example, /home/db2inst1).

  5. Optional: If you want to use your own usernames and passwords, edit the bash script.
    vi /<ScriptsDir>/DB2TrialSQLs/runDB2SQLs.sh

    And then change these lines to the values that you used.

    DB_USERS["db2inst1"]="db2inst1"
    DB_USERS["polly"]="polly"
    DB_USERS["liher"]="liher"
    DB_USERS["jason"]="jason"
    DB_USERS["john"]="john"
  6. Open crontab.
    crontab -e
  7. Add this line to run the script every hour.
    0 * * * * /<ScriptsDir>/DB2TrialSQLs/runDB2SQLs.sh > /<ScriptsDir>/db2_cron.log 2>&1
  8. The script will cause each user in the array to trigger the SQL files in this directory.
    $ ls -1 /<ScriptsDir>/DB2TrialSQLs/*.sql
    
    /<ScriptsDir>/DB2TrialSQLs/clone_data.sql
    /<ScriptsDir>/DB2TrialSQLs/DML.sql
    /<ScriptsDir>/DB2TrialSQLs/exceptions.sql
    /<ScriptsDir>/DB2TrialSQLs/failed_logins.sql
    /<ScriptsDir>/DB2TrialSQLs/grantian.sql
    /<ScriptsDir>/DB2TrialSQLs/grants.sql
    /<ScriptsDir>/DB2TrialSQLs/schema.sql

What to do next

You can now explore the Guardium dashboards with the same sample data that is provided in marketing materials. Feel free to create your own queries for the data.