Results 1 to 7 of 7
  1. #1
    Join Date
    May 2010
    Posts
    88

    Unanswered: redirect restore

    Hi,
    I am working on DB2 V9.1 on AIX.
    Can somebody please help me in understanding the redirect restore. I read the documents but unable to help myself.
    I want to restore a backup from one server to another server. Problem I am facing is, documents say that we need to create the same directory tree on the other server as we have on the first server for the backup image but when the home directories are different, how can I achieve it. I dont have root authorities so as to create the same tree structure.
    For example:
    path to backup on server1 is: HOME1/dbname/node0000/....
    on the other server, the home directory is itself different i.e it's HOME2.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you use a redirected restore, you can redirect the tablespace containers to a different directory (and/or file name for DMS tablespaces).

    You can also specify where the database is to be placed (which is the basic database info not necessarily including all the tablespaces). This information is specified in the restore commands. See the Command Reference PDF manual for details and examples.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2010
    Posts
    335
    In Addition:

    You can use the restore database command to generate a script for a redirected restore.
    restore database ... redirect generate script <FILENAME> ...

  4. #4
    Join Date
    May 2010
    Posts
    88
    Hi Team,
    Plz have a look at the steps I am performing and the place where i am getting stuck

    $ pwd
    /db2backup/wps01/db2wpsr2/backup
    $ ls
    TESTDB.0.db2wpsp1.NODE0000.CATN0000.20100608020546 .001
    $ db2 restore database TESTDB to /db2/wps01/db2wpsr2/TESTDB
    SQL1051N The path "/db2/wps01/db2wpsp1/testdb" does not exist.
    SQLSTATE=57019

    Th directory TESTDB in the restore command have been manually created in the home directory.
    It is on an urgent basis i need to resolve it. Someone plz help

  5. #5
    Join Date
    Jan 2010
    Posts
    335
    Specifying a new directory with to is not a redirected restore! You have to use the redirect option.

    db2 restore database TESTDB redirected generate script rrestore.sql
    will generate you a script for the restore. You can edit it later on and start the redirected restore with it.

  6. #6
    Join Date
    May 2010
    Location
    India
    Posts
    84
    Provided Answers: 2
    Hi ,

    Try the following command. If you are still having problems, try generating restore script as suggested by nvk.

    db2 " restore database TESTDB on /db2/wps01/db2wpsr2/TESTDB "


    Satya...

  7. #7
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Like nvk@vhv said: Generate the script. In that script you will recognise the path-names of your source database. Change the path-names in that script to the new path-names (you must activate the lines, they are all commented out).
    On the target machine DB2 must be installed and the instance must be defined and started. You can check with the "db2 attach to instancename". This must be completed 1st.
    When you run that script on the target-machine the tablespaces will be placed on the newly defined path-names and that is the trick about redirected restore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •