Results 1 to 12 of 12

Thread: restore db

  1. #1
    Join Date
    Nov 2003
    Posts
    68

    Unanswered: restore db

    hi to all
    i want to restore my database in my system 162.100.100.120.
    how to restore ? in my system.
    i have a backimage of testkala database that is from 162.100.100.130
    .
    when i was i try to restore the database that time bad container path error will come .
    i checked all the paths of table spaces in that system and create
    same folders here.
    in 162.100.100.130 two hard disk is there . in that one table space is created in /dev/raw/ device.

    in my sytem (162.100.100.120) i create /dev/raw device.
    while restoring can i mention the paths of table spaces

    but is giving error .
    pl tell me y ?

    thank u

  2. #2
    Join Date
    Mar 2003
    Posts
    343
    Please post version of db2 and OS.

    Though the kind of help you need is not very clear, it appears that you need to do a redirected restore which means that you are trying to restore a database to another database. Please lookup the backup database command in the command ref.

  3. #3
    Join Date
    Oct 2003
    Posts
    29
    In this case Redirected restore is the only solution immeterial to DB2 Version where we can specify the container path and names.

    -Racha

  4. #4
    Join Date
    Nov 2003
    Posts
    68
    linux version 6.2

    my backup image is

    TESTKALA.0.db2inst1.NODE0000.CATN0000.200310222142 51.001
    pl tell me with example how to restore database .
    while restoreing database i should be able to redirect the path.

    pl tell me

  5. #5
    Join Date
    Dec 2003
    Location
    Duesseldorf - Germany - Europe - Earth - Galaxy
    Posts
    18

    restore redirect

    Hi there,

    try

    restore database <name> from <path> redirect

    Each tablespace will have to get it's containers defined before proceeding. You are implicitly connected to the database at this moment. Never issue an explicit connect, because it will cause an error and you loose your implicit connection and have to start again ;-)

    use this commant for each tablespace:

    set tablespace containers for <number> using
    (path '/db2/data1/<mydbname>/<mytablespace>',
    [...]
    path '/db2/datan/<mydbname>/<mytablespace>') ;


    When there's no tablespace left with containers to be defined issue

    restore database <name> continue.

    Regards,
    Volker.

  6. #6
    Join Date
    Nov 2003
    Posts
    68
    hi
    now pl tell how to restore this in my system(162.100.100.120)

    i want to restore my database in 162.100.100.120 from 162.100.100.130
    present no database is there in 162.100.100.120 .
    only db2 is there.

    this is backup image of 162.100.100.130 system .
    now i want to restore database in 162.100.100.120 system

    LIST TABLESPACE CONTAINERS
    in 162.100.100.130 system

    IST TABLESPACE CONTAINERS FOR 0 SHOW DETAIL

    Tablespace Containers for Tablespace 0

    Container ID = 0
    Name = /Kala/db2inst1/db2inst1/NODE0000/SQL00003/SQLT0000.0 Type = Path
    Total pages = 23311
    Useable pages = 23311
    Accessible = Yes


    LIST TABLESPACE CONTAINERS FOR 1 SHOW DETAIL

    Tablespace Containers for Tablespace 1

    Container ID = 0
    Name = /Kala/db2inst1/db2inst1/NODE0000/dytab.f1
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes
    Container ID = 1
    Name = /Kalai/db2inst1/db2inst1/NODE0000/dytab.f2
    Type = File
    Name = /Kalanjali/db2inst1/db2inst1/NODE0000/dytab.f2
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes


    LIST TABLESPACE CONTAINERS FOR 2 SHOW DETAIL

    Tablespace Containers for Tablespace 2

    Container ID = 0
    Name = /dev/raw/raw1
    Type = Disk
    Total pages = 1408000
    Useable pages = 1407968
    Accessible = Yes


    LIST TABLESPACE CONTAINERS FOR 3 SHOW DETAIL

    Tablespace Containers for Tablespace 3

    Container ID = 0
    Name = /db2temp/tabsp/temp1
    Container ID = 0
    Name = /db2temp/tabsp/temp1
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes
    Container ID = 1
    Name = /db2temp/tabsp/temp2
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes
    Container ID = 2
    Name = /db2temp/tabsp/temp3
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes
    Container ID = 3
    Name = /db2temp/tabsp/temp4
    Type = File
    Total pages = 256000
    Useable pages = 255968
    Accessible = Yes
    ~

    pl tell me how restore the database in my system.

  7. #7
    Join Date
    Dec 2003
    Location
    Duesseldorf - Germany - Europe - Earth - Galaxy
    Posts
    18
    i want to restore my database in 162.100.100.120 from 162.100.100.130
    present no database is there in 162.100.100.120 .
    only db2 is there.
    Ok, then...

    - login at 162.100.100.130 as isntance owner.
    - force all applications (if any)
    - "backup database <name> to <path>". where path is wherever you have nough space for a backup
    - login at 162.100.100.120 as isntance owner
    - use ftp to transfer the backup image
    - use the "restore redirect" as stated in my first posting
    - decide on which path to put the data
    - restore the header information with "restore database <name> from <path> redirect"
    - issue one "set tablespace containers" for each tablespace
    - continue the backup with "restore database <name> continue"

    Which step will be a problem?

    Regards,
    Volker.

  8. #8
    Join Date
    Nov 2003
    Posts
    68

    hi

    hi VolkerK
    thank u very much for u r reply.


    restore database testkala from /db2temp taken at 20030812145940 redirect without rolling forward
    SQL1277N Restore has detected that one or more table space containers are
    inaccessible, or has set their state to 'storage must be defined'.
    DB20000I The RESTORE DATABASE command completed successfully.

    2).after issue one "set tablespace containers" for each tablespace
    pl tell me how to proced for above step.

    for set tablespace containers my 162.100.100.120 system what i have to do?

    thank u.

  9. #9
    Join Date
    Dec 2003
    Location
    Duesseldorf - Germany - Europe - Earth - Galaxy
    Posts
    18
    Hi Jagan,

    each tablespace has an ID. Decide where to store the database files and issue for each tablespace one command like this:

    set tablespace containers for <ID> using
    (path '/db2/data1/<mydbname>/<mytablespace>',
    [...]
    path '/db2/datan/<mydbname>/<mytablespace>') ;
    You can use one pathname or more for SMS tablespaces (in case you want I/O-parallelism).

    Remember: All commands associated with a single redirected restore must be executed from the same window or CLP session.

    For DMS tablespaces you can use raw devices or named files. Anthough you can't convert a DMS tablespace to an SMS one, but you can relocate a raw device into a file-based container. The manual says:

    (FILE|DEVICE 'container-string' number-of-pages,...)
    For a DMS tablespace, identifies one or more containers that will belong to the tablespace and into which the tablespace's data will be stored. The type of the container (either FILE or DEVICE) and its size (in PAGESIZE pages) are specified. The size can also be specified as an integer value followed by K (for kilobytes), M (for megabytes) or G (for gigabytes). If specified in this way, the floor of the number of bytes divided by the pagesize is used to determine the number of pages for the container. A mixture of FILE and DEVICE containers can be specified. The container-string cannot exceed 254 bytes in length.

    For a FILE container, the container-string must be an absolute or relative file name. The file name, if not absolute, is relative to the database directory. If any component of the directory name does not exist, it is created by the database manager. If the file does not exist, it will be created and initialized to the specified size by the database manager. When a tablespace is dropped, all components created by the database manager are deleted.
    So you can use

    (file '/db2/data1/<mydbname>/<mytablespace>' ...)
    as container string if it is a raw device.

    Hope you'll manage it,
    have a nive weekend.

    Regards,
    Volker.

  10. #10
    Join Date
    Dec 2002
    Location
    PUNE, INDIA
    Posts
    25

    Re: hi

    Originally posted by jagan_5378
    hi VolkerK
    thank u very much for u r reply.


    restore database testkala from /db2temp taken at 20030812145940 redirect without rolling forward
    SQL1277N Restore has detected that one or more table space containers are
    inaccessible, or has set their state to 'storage must be defined'.
    DB20000I The RESTORE DATABASE command completed successfully.

    2).after issue one "set tablespace containers" for each tablespace
    pl tell me how to proced for above step.

    for set tablespace containers my 162.100.100.120 system what i have to do?

    thank u.

    restore db DB_BACKUP TO NEW_TARGET_PATH into TARGET_NEWDB REDIRECT
    set tablespace containers for 0 using (PATH '<PATH>') -- This is for System Managed Tablespaces
    set tablespace containers for n using (PATH '<PATH>') -- This is for System Managed Tablespaces

    set tablespace containers for 0 using (FILE '<PATH>' <SIZE>) -- This is for Database Managed Tablespaces
    set tablespace containers for n using (FILE '<PATH>' <SIZE>) -- This is for Database Managed Tablespaces


    Hope, this should help ...

  11. #11
    Join Date
    Jul 2001
    Location
    Bangalore, India
    Posts
    28
    also plz add "restore db DB_BACKUP continue" after completing "SET TABLESPACE ..." commands for all tablespaces

    Ravi

  12. #12
    Join Date
    Dec 2002
    Location
    PUNE, INDIA
    Posts
    25
    Originally posted by Ravi
    also plz add "restore db DB_BACKUP continue" after completing "SET TABLESPACE ..." commands for all tablespaces

    Ravi

    Thanks Ravi, Yea, I missed that.

Posting Permissions

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