Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Mar 2013
    Posts
    10

    Exclamation Unanswered: Replacing Test database with live database DB2.

    Hello Everyone,

    I am new to this forum so i am not sure if i am posting in the right thread, please excuse me for that.

    At my work place for some stupid reason we have to copy our live database into the test database and i have no clue how to do it.

    Being a cisco guy stuck with DB2, i have no knowledge of db2.

    All i have tried to do is going into command centre and backing up the live database and tried to restore it in the Test database, which i know all of you will be laughing by now as it is not happening for me. It says that the database, day and time does not match.

    Please help.

    Thanks in advance.
    Last edited by Asingh1987; 03-11-13 at 23:33. Reason: Grammer

  2. #2
    Join Date
    Jul 2004
    Posts
    306

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    restore database xxx from /path/ taken at 201303211120014
    timestamp taken from filename or backup output
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  4. #4
    Join Date
    Mar 2013
    Posts
    10

    Exclamation

    Thanks Mate.

    As i said i am new to db2, so can you explain me do i type this command in "Command Editor". And we have 3 different database on the same db2 machine under the same db2 install.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    You can do it on Command Editor.

    But if you are a newbie and do not even know how to issue commands (no offence meant), then it is going to be practically impossible to help here.



    --
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    feel free to hire me as a consultant todo the job ...
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  7. #7
    Join Date
    Mar 2013
    Posts
    10
    Yes that what i think, Well i have contacted support and i am hopeing they will walk me through its just a matter of getting it done fast as they are not on the eastern time zone.

    I was playing around with control center, here i see there is a GUI when you right click on the database that says restore i get this.
    Attached Thumbnails Attached Thumbnails Capture323.jpg  

  8. #8
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by przytula_guy View Post
    feel free to hire me as a consultant todo the job ...
    Seriously guy??

    They are asking a Cisco person to restore DB2, do you think they have money to spend... lol

  9. #9
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    according the screenshot you are not using the correct timestamp
    take the timestamp from the filename
    eg
    Backup successful. The timestamp for this backup image is : 20130312135113

    (0)[db2inst1@dlx00031 ~]$ ll DBA*
    -rw------- 1 db2inst1 db2iadm1 132227072 Mar 12 13:51 DBASRV.0.db2inst1.NODE0000.CATN0000.20130312135113 .001
    (0)[db2inst1@dlx00031 ~]$
    .... taken at 20130312135113
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  10. #10
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by przytula_guy View Post
    according the screenshot you are not using the correct timestamp
    take the timestamp from the filename
    eg
    Backup successful. The timestamp for this backup image is : 20130312135113

    (0)[db2inst1@dlx00031 ~]$ ll DBA*
    -rw------- 1 db2inst1 db2iadm1 132227072 Mar 12 13:51 DBASRV.0.db2inst1.NODE0000.CATN0000.20130312135113 .001
    (0)[db2inst1@dlx00031 ~]$
    .... taken at 20130312135113

    I might have not explained it correct..
    I want to move everything from the Live database to the Test database.

    And restoring the backup from the Live Database to the Test database was just a thought i had.

  11. #11
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    BTW, have you tried using control center ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  12. #12
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    just what I said
    take a backup on live db
    move file to machine with test db
    restore the live db in test machine
    this will re-generate the live db on test machine if the same drives are available
    (windows I believe ?)
    otherwise a redirected restore is needed and cannot be explained to a non-dba
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  13. #13
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by sathyaram_s View Post
    BTW, have you tried using control center ?
    Yes i tried it. and the the error i pasted above.

  14. #14
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by przytula_guy View Post
    just what I said
    take a backup on live db
    move file to machine with test db
    restore the live db in test machine
    this will re-generate the live db on test machine if the same drives are available
    (windows I believe ?)
    otherwise a redirected restore is needed and cannot be explained to a non-dba
    Both the databases are on the same machine under same DB2 install.

    Yes it is windows.

    SO what i did was
    1. i took an offline backup of the Live Database to f:/March11_13 directory.
    2. then i selected the TEST database by right clicking it and selecting restore. and then direct it to f:/march11_13 directory and i got this window and got the error i have pasted above.
    Attached Thumbnails Attached Thumbnails 123.PNG  

  15. #15
    Join Date
    Mar 2013
    Posts
    10
    I got this error with restore.





    SQL2542N No match for a database image file was found based on
    the source database alias "DRIVETST" and timestamp
    "20130311230021" provided.

    Explanation:

    The backup image file filename consists of a database alias and a
    timestamp component. A filename is constructed from the source database
    alias and timestamp parameters provided in the Database Restore call. No
    filename existed in the source directory that matched based on the
    source database alias and timestamp provided.

    The following situations might apply:
    1. The path to the backup was incorrectly specified in the restore
    command.
    2. You do not have permission to access the backup image or the
    directory within which the backup image resides.
    3. You are performing an automatic incremental restore and a required
    image was not found based on the timestamp and location in the
    database history.
    4. You are restoring a database in a partitioned database environment,
    the database does not already exist, and the first database partition
    being restored is not the catalog partition.
    5. You are restoring from TSM media, and the TSM API client
    configuration used by the current instance is not able to access the
    backup image.

    User response:

    Appropriate responses for the situations described above are:
    1. Ensure that the database backup image resides on the media source.
    Resubmit the operation by specifying a correct path to the backup
    image and correct timestamp to result in a match. For more
    information on using the restore command, search the DB2 Information
    Center using phrases such as "using restore database utility".
    2. Ensure that you have permission to access the backup image and the
    directory in which it resides.
    3. Check the database history for the corresponding backup entry and
    verify that the location listed matches the actual location of the
    backup image. Either update the database history and retry the
    operation to result in a match or issue a RESTORE INCREMENTAL ABORT
    command to cleanup any resources that may have been created during
    processing.
    4. Always restore the catalog partition first when restoring a
    partitioned database. For more information about restoring in a
    partitioned database environment, search the DB2 Information Center
    using phrases such as "restore utility partitioned database".
    5. Use db2adutl utility with QUERY option to check if the image could be
    retrieved from TSM. If you are restoring a backup image taken from a
    different instance on a different server, make sure to use the
    options NODENAME, OWNER, and optionally PASSWORD corresponding to the
    TSM settings of the TSM node on which the backup image was originally
    taken. Once you have verified that the image could be retrieved, you
    could pass the same options in the options string of the RESTORE
    command. For more information about the db2adutl utility, search the
    DB2 Information Center using phrases such as "db2adutl".

    DB2 Information Center:
    DB2 Database for Linux, UNIX, and Windows

Tags for this Thread

Posting Permissions

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