How to completely move Ingres database from one location to another including the DATA and WORK locations.

Document ID : KB000054529
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document is prepared with step-by-step instructions on how to completely move your Ingres database from one location to another. The steps are combination of Ingres as well as CA Directory commands to achieve the goal.

Solution:

Purpose:

This document helps one to move the entire 'etrustadmin' database from one disk to another if disk space is a concern. E.g. Move your database from C drive to D drive.

Assumption:

  • You have your eTrust Admin Server (including Ingres r3 and CA Directory) installed on a C drive.

  • CA Directory and eTrust Admin services are shutdown.


    i.e. net stop eta_slapd
    net stop eta_connector
    dxserver stop etrustadmin
  • For this exercise, I will use the following terminology for location names:

    new_data -> Newly created data location for DB on D drive.
    new_jnl -> Newly created journal location for DB on D drive.
    new_ckp -> Newly created checkpoint location for DB on D drive.
    new_work -> Newly created work location for DB on D drive.
    new_dmp -> Newly created dump location for DB on D drive.

  • Finally, MAKE SURE YOU PERFORM THE FOLLOWING WHILE LOGGED IN AS A USER WHO PERFORMED eTrust Admin INSTALLATION .

STEPS:

  1. Create a location on your D drive for new database.

    e.g. D:\>mkdir etadmindb_locations

  2. Create a temporary folder and cd to that directory manually to perform this exercise.

    i.e. mkdir db_move

    cd db_move

  3. Generate 'copy.in' and 'copy.out' scripts using Ingers 'copydb' command.

    i.e. copydb etrustadmin

  4. Dump the existing database in LDIF format using 'dxdumpdb' command and sort the generated ldif file to reload later on once the database is moved to new location.

    i.e. dxdumpdb -S etrustadmin -p "dc=etadb" etrustadmin > etrustadmin.ldif

    ldifsort etrustadmin.ldif sorted_etrustadmin.ldif

  5. Destroy the existing 'etrustadmin' database.

    i.e. dxdestroydb etrustadmin

  6. Create a location on your D drive for new database.

    e.g. D:\>mkdir etadmindb_locations

  7. Now, at the DOS prompt, invoke Ingres 'accessdb' tool to create/define the new locations (using example give at the beginning).

    i.e. accessdb <Enter>

    Figure 1

    Press Shift+F2 to get to locations screen, and you will see:

    Figure 2

    Press Shift+F1 to define/create a new location and you will see:

    Figure 3

    In the above screen specify the new location name that we want to define. Here I will show you an example on 'new_data' on the next screen.

    USE TAB KEY TO MOVE FROM ONE FIELD TO ANOTHER.

    PLEASE REPEAT THE SAME SETPS for journal, checkpoint, dump and work locations. Make sure to put 'y' for appropriate location. As you can see by default, the Database has value assigned as 'y'. You need to change it to 'n' when you are defining the journal location and change 'n' to 'y' for Journal location.

    Figure 4

    Press F3 to save this newly created DATA location.

    Here is an example of JOURNAL location.

    Figure 5

    Repeat the same for checkpoint, work and dumps location (new_ckp, new_work, new_dmp)

    Press F10 twice to exit back to system prompt.

    NOTE: As the locations get defined in 'accessdb', Ingres will automatically create the rest of the sub-folders for you. You can check to see the following on your disk:

    D:\etadmindb_locations\ingres\data\default

    D:\etadmindb_locations\ingres\jnl\default

    D:\etadmindb_locations\ingres\ckp\default

    D:\etadmindb_locations\ingres\work\default

    D:\etadmindb_locations\ingres\dump\default

  8. Open explorer and go under D:\etadmindb_locations\ingres\data folder.

    Figure 6

  9. Right click on 'default' and choose Properties. Click on 'Security' tab and check mark all 'Allow' columns for use 'Everyone'. Click OK.

    Figure 7

  10. Recreate the 'etrustadmin' database on the new disk using new locations.

    i.e. createdb etrustadmin -dnew_data -jnew_jnl -cnew_ckp -wnew_work -bnew_dmp

  11. Make a backup of 'copy.in' script generated in step (3) and edit the original one by taking out all the COPY statements from the file. Each COPY statement starts with a word 'copy .....' and ends with \p\g. Please remove the entire chunk of text. There should be 13 copy statements in this file.

    Also you need to change the reference to DATA location within each COPY command and CREATE index commands. By default, you will see:

    location = (ii_database),

    replace the above with:

    location = (new_data),

    Save this edited file as 'create_tables.txt'.

  12. Use 'create_tables.txt' to create empty table structures within this newly created 'etrustadmin' database.

    i.e. sql etrustadmin < create_tables.txt

  13. Now copy the actual data from sorted LDIF file into this newly created database.

    e.g. dxloaddb -S etrustadmin -p "dc=etadb" etrustadmin < sorted_etrustadmin.ldif

  14. Index the required attributes using 'etaindex.bat' file provided under %ETAHOME%\bin folder.

    i.e. execute etaindex.bat file.

  15. Tune your database for optimum performance.

    i.e. dxtunedb -full etrustadmin

  16. Start you CA Directory services as well as eTrust Admin services and test your application.

    i.e. dxserver start etrustadmin

    net start eta_slapd

    net start eta_connector