This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Upgrading the DB2 Database Protector

Upgrade the DB2 Database Protector.

    To upgrade the DB2 Database Protector:

    1. Drop the existing UDFs.
    2. Uninstall the existing version of the protector.
    3. Install the new version of the protector.
    4. Start the RPAgent.
    5. Create the new user-defined functions.

    Dropping the Existing User Defined Functions

    1. Log in to the DB2 Database server using the same account used to create the UDFs.
    2. Navigate to the /opt/protegrity/databaseprotector/db2/sqlscripts/ directory.
    3. To drop the UDFs, run the following command:
      db2 -tvf dropobjects.sql
      
    4. Press ENTER.
      The script deletes all the user-defined functions.
      CONNECT TO <database_name>
      
      Database Connection Information
      
       Database server        = DB2/LINUXX8664 11.5.0.0
       SQL authorization ID   = DB2INST1
       Local database alias   = <database_name>
      
      
       DROP FUNCTION pty.ins_enc_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_unicode_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_unicode_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_unicode_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_varcharfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_char
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_charfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_lvarchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_lvcfbd
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_date
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_time
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_timestamp
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_integer
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_smallint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_bigint
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_real
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_double
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_blob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_enc_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_enc_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_dec_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.sel_clob
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.have_sel_perm
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.have_ins_perm
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.have_upd_perm
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.toggle_trace
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.ins_hash_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.upd_hash_varchar
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.getversion
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.getcoreversion
       DB20000I  The SQL command completed successfully.
      
       DROP FUNCTION pty.whoami
       DB20000I  The SQL command completed successfully.
      
       CONNECT RESET
       DB20000I  The SQL command completed successfully.
      

    Uninstalling the Existing Version of the Protector

    To uninstall the existing version of the protector:

    1. Uninstall the RPAgent.
    2. Uninstall the Log Forwarder.

    Uninstalling the RPAgent

    Before uninstalling the RPAgent, Protegrity recommends creating a backup.

    1. Log in to the DB2 Database server.
    2. Navigate to the /opt/protegrity/rpagent/bin/ directory.
    3. To stop the RPAgent, run the following command:
      rpagentctrl stop
      
    4. Navigate to the /opt/protegrity/ directory.
    5. Delete the /opt/protegrity/rpagent/ directory.

    Uninstalling the Log Forwarder

    Before uninstalling the Log Forwarder, Protegrity recommends creating a backup.

    1. Log in to the DB2 Database server.
    2. Navigate to the /opt/protegrity/logforwarder/bin directory.
    3. To stop the Log Forwarder, run the following command:
      logforwarderctrl stop
      
    4. Navigate to the /opt/protegrity/ directory.
    5. Delete the /opt/protegrity/logforwarder/ directory.

    Deleting the Installation Directory

    After removing the RPAgent and the Log Forwarder, delete the installation directory.

    Note: Before deleting the installation directory, ensure the database and all the services are stopped.

    1. Log in to the DB2 Database server.
    2. Navigate to the /opt/protegrity/databaseprotector/ directory.
    3. To delete the db2 directory, run the following command:
      rm -rf db2
      

    Installing the New Version of the Protector

    After all the services are stopped and components removed, install the latest version of the protector, recreate the UDFs, and restart the RPAgent.

    Note: For more information on installing the protector, refer to Installing the DB2 Database Protector.

    Creating the User Defined Functions

    For more information on creating the UDFs, refer to Creating the User Defined Functions.

    Starting the RPAgent

    1. Log in to the DB2 Database server.
    2. Navigate to the /opt/protegrity/rpagent/bin directory.
    3. To start the RPAgent, run the following command:
      rpagentctrl start