7 Upgrade Knowledge Base

To refresh knowledge base after TSAM Plus has been deployed with Operations Assistant enabled, follow this procedure:

7.1 Update Source Documents

  • In `CLOUD` mode, no action is required.
  • In `LOCAL` mode, download all files from the URLs listed in $TSAMDIR/deploy/README.md, then copy the downloaded files to the three folders below, ensure that the OS user who starts Oracle database process has the permissions to read the files in the three directories
    - /u02/tsam_ai/userdoc
    - /u02/tsam_ai/consoledoc
    - /u02/tsam_ai/followupdoc

7.2 Verify DIRECTORY Privileges Before AI Profile Rebuild

  • In CLOUD mode, no action is required.
  • In LOCAL mode:
    • If the given DIRECTORY objects were dropped, the DBA must recreate the DIRECTORY objects (TSAM_USERDOC_DIR, TSAM_CONSOLEDOC_DIR, and TSAM_FOLLOWUPDOC_DIR) with the same database-host paths and grant READ, WRITE to the existing TSAM Plus DB AI user.
  • Here are the SQL statements to create the DIRECTORY objects:
    • CREATE OR REPLACE DIRECTORY TSAM_USERDOC_DIR AS '/u02/tsam_ai/userdoc';
    • CREATE OR REPLACE DIRECTORY TSAM_CONSOLEDOC_DIR AS '/u02/tsam_ai/consoledoc';
    • CREATE OR REPLACE DIRECTORY TSAM_FOLLOWUPDOC_DIR AS '/u02/tsam_ai/followupdoc';
    • GRANT READ, WRITE ON DIRECTORY TSAM_USERDOC_DIR TO <TSAM_DB_AI_USER>;
    • GRANT READ, WRITE ON DIRECTORY TSAM_CONSOLEDOC_DIR TO <TSAM_DB_AI_USER>;
    • GRANT READ, WRITE ON DIRECTORY TSAM_FOLLOWUPDOC_DIR TO <TSAM_DB_AI_USER>;
  • If you need to intentionally recreate the TSAM Plus database users, Rerun TSAMDBUserProvision.sh -enableAI -aiSourceMode LOCAL .

    WARNING:

    This operation recreates the TSAM Plus database users and permanently deletes all existing data.

7.3 Regenerate the AI Helper SQL Files

Run this script as the TSAM Plus user- (not the TSAM Plus-AI user).

$TSAMDIR/deploy/TSAMDBSchemaUpdateConfig.sh <dbUser>

Table 7-1 Parameter List

Name Description
<db_user> The name of the TSAM Plus database user, not the name of the TSAM Plus database AI user
./TSAMDBSchemaUpdateConfig.sh [--validate-only] <db_user> The script accepts --validate-only only before the database user.

To generate the AI helper SQL files for the TSAM Plus database user tsamuser, run the command:

$TSAMDIR/deploy/TSAMDBSchemaUpdateConfig.sh tsamuser

To change an AI provider, model, region, Azure deployment, or maximum token value independently of a knowledge-base refresh, see Update AI Providers and Models.

7.4 Rebuild the AI profiles and Vector Indexes

Run the following command as the TSAM Plus AI user:
sqlplus -L "<dbAIUser>@<DB connection string>" @${TSAMDIR}/deploy/TSAMCreateAIProfile.sql

The script prompts for the database password. It drops and recreates the AI profiles, vector indexes, and Select AI agent objects so that the updated knowledge base content is incorporated.

If the AI credential values have also changed, run TSAMCreateAICredential.sql as the AI user before executing TSAMCreateAIProfile.sql.

sqlplus -L "<dbAIUser>@<DB connection string>" @${TSAMDIR}/deploy/ TSAMCreateAICredential.sql