42.3 手動產生資料庫綱要

您可以在安裝後重新建立資料庫表格,而無需重新安裝。本節的內容可協助您建立資料庫綱要。

  1. 停止 Tomcat。

    例如:

    /etc/init.d/idmapps_tomcat_init stop
  2. (視情況而定) 刪除現有資料庫

  3. (視情況而定) 建立與您在步驟 2 中刪除的資料庫同名的新資料庫

  4. (視情況而定) 清除資料庫檢查總數

    1. 以 idm_rpt_cfg 身分登入資料庫。

    2. 對於 PostgresSQL,請執行以下指令︰

        DO
      $do$
       BEGIN
        IF EXISTS
         (select table_name from information_schema.tables where table_schema = 'public' and table_name = 'databasechangelog')
        THEN
         update databasechangelog set md5sum = null;
        END IF;
      END $do$

      或

      對於 Oracle,請執行以下指令︰

        BEGIN
       FOR i IN
        (select null from ALL_TABLES where OWNER = user and TABLE_NAME = 'DATABASECHANGELOG')
       LOOP
        EXECUTE IMMEDIATE 'update DATABASECHANGELOG set MD5SUM = NULL';
       END LOOP;
      END;
    3. 以 idm_rpt_data 身分登入資料庫。

    4. 以 idm_rpt_data 使用者身分重複在步驟 4.b 中發出的指令。

  5. 定義 JAVA_HOME 變數。例如:

    export JAVA_HOME=/opt/netiq/idm/apps/jre
  6. 使用安裝的程序檔重新啟始化資料庫︰

    /opt/netiq/idm/apps/IdentityReporting/bin/db-init.sh -cfg_password *** -data_password ***
    /opt/netiq/idm/apps/IdentityReporting/bin/db-init.sh -cfg_password *** -data_password *** -sql >
    /opt/netiq/idm/apps/IdentityReporting/sql/output.sql
  7. 啟動 Tomcat。例如:

    /etc/init.d/idmapps_tomcat_init start