Cannot redirect restore into a different database name.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sharon.zhang.ca@gmail.com

    Cannot redirect restore into a different database name.

    Hi,

    I'm using the following command to redirect restore from source
    database AAA into target database BBB:

    db2 restore db AAA from /DBBACKUP taken at 20080512100655 redirect
    into BBB without rolling forward

    Why does it always restore into AAA instead of BBB? What's wrong with
    my command?

    Thanks.
  • Lennart

    #2
    Re: Cannot redirect restore into a different database name.

    On May 13, 2:13 pm, sharon.zhang... @gmail.com wrote:
    Hi,
    >
    I'm using the following command to redirect restore from source
    database AAA into target database BBB:
    >
    db2 restore db AAA from /DBBACKUP taken at 20080512100655 redirect
    into BBB without rolling forward
    >
    Why does it always restore into AAA instead of BBB? What's wrong with
    my command?
    Not sure what redirect into means. Here is how I normally do what you
    describe:

    db2 restore db AAA from /DBBACKUP taken at 20080512100655 into BBB
    redirect without rolling forward


    /Lennart



    >
    Thanks.

    Comment

    • Larry

      #3
      Re: Cannot redirect restore into a different database name.

      Does the target database already exist? It is unique on the target system?

      Larry E.

      sharon.zhang.ca @gmail.com wrote:
      Hi,
      >
      I'm using the following command to redirect restore from source
      database AAA into target database BBB:
      >
      db2 restore db AAA from /DBBACKUP taken at 20080512100655 redirect
      into BBB without rolling forward
      >
      Why does it always restore into AAA instead of BBB? What's wrong with
      my command?
      >
      Thanks.

      Comment

      • simon.tran.ca@gmail.com

        #4
        Re: Cannot redirect restore into a different database name.

        On May 13, 11:09 am, Larry <la...@nospam.n etwrote:
        Does the target database already exist? It is unique on the target system?
        >
        Larry E.
        >
        >
        >
        sharon.zhang... @gmail.com wrote:
        Hi,
        >
        I'm using the following command to redirect restore from source
        database AAA into target database BBB:
        >
        db2 restore db AAA from /DBBACKUP taken at 20080512100655 redirect
        into BBB without rolling forward
        >
        Why does it always restore into AAA instead of BBB? What's wrong with
        my command?
        >
        Thanks.- Hide quoted text -
        >
        - Show quoted text -
        Try something like this:

        RESTORE DATABASE AAA FROM /DBBACKUP taken at 20080512100655 TO /
        Newlocation INTO BBB REDIRECT WITHOUT PROMPTING

        -- Use list tablespace containers commands to obtain a list of
        containers
        -- Change the directory for the containers for the new location.
        --

        SET TABLESPACE CONTAINERS FOR 0 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT0000.0")

        SET TABLESPACE CONTAINERS FOR 1 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT0001.0")

        SET TABLESPACE CONTAINERS FOR 2 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT_U4K_TMWIN. 0")

        SET TABLESPACE CONTAINERS FOR 3 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT_U8K_TMWIN. 0")

        SET TABLESPACE CONTAINERS FOR 4 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT9001.0")

        SET TABLESPACE CONTAINERS FOR 5 USING (PATH "/DB2/NODE0000/SQL00003/
        SQLT9002.0")

        SET TABLESPACE CONTAINERS FOR 6 USING (PATH "/DB2/NODE0000/SQL00003/
        SYSTOOLSPACE")

        RESTORE DATABASE AAA CONTINUE

        ROLLFORWARD DATABASE BBB TO END OF LOGS AND COMPLETE OVERFLOW LOG PATH
        (/DB2BAK/DB2LOGS/DB2/GRIMSHAW/NODE0000/C0000001)

        Comment

        Working...