TSM 6.x DB Restore

Embed Size (px)

DESCRIPTION

TSM DR

Citation preview

  • 5/21/2018 TSM 6.x DB Restore

    1/4

    =================================================================================MAIN=================================================================================

    In order to backup and restore TSM 6.1.0 DB I performed the following actions:

    1) create schedule to perform daily db backup (server maintainence in ISC) - either full + incremental or dbsnapshot (but if using dbsnapshot PIT is available only that is why it is necessary to use tsm 6.1.2)

    2) copy volhist.dat and devconf.dat (dsmserv.opt is not required) to outer storage (it is possible to write them manually).

    on another machine where TSM server is going to be restored:

    1) all pools and backups available from old server must be available on a new one too2) launch dsmicfgx to create a new tsm server instance - install it under the same location as an old server (e.g. c:\tsm\server1)3) cd to db2/bin and run: 3.1) chcp 1251 3.2) net stop "tsm server1" 3.3) net stop "DB2 - DB2TSM1 - SERVER1" (or just net stop "server1")

    manual:

    3.4) db2idrop server1 3.5) db2icrt -u db2user1 server1 (then enter db2user1 password) 3.6) set DB2INSTANCE=server1 3.7) db2set -i server1 DB2_VENDOR_INI=c:\tsm\server1\tsmdbmgr.env 3.8) db2stop 3.9) db2start 3.10) set DSMI_CONFIG=c:\tsm\server1\tsmdbmgr.opt 3.11) "c:\program files\tivoli\tsm\server\dsmsutil.exe" UPDATEPW /NODE:$$_TSMDBMGR_$$ /PASSWORD:TSMDBMGR /VALIDATE:NO3.12) rd /s /q c:\SERVER1 (folder is created after creating new database - del

    ete it)3.13) del /s /q c:\tsm\server1\db\* (delete all files belonging to a newly cre

    ated database) 3.14) keep active and archive logs in server instance directory (they are deleted during restore db :( ) 3.15) create dbdir.txt file that contains path to db dir (e.g. c:\tsm\server1\db) 3.16) restore db: 3.16.1) tsm 6.1.0: "c:\program files\tivoli\tsm\server\dsmserv" restore db on=c:\tsm\server1\dbdir.txt (PIT restore along with "on" parameter causes failure- bug) 3.16.2) tsm 6.1.2: "c:\program files\tivoli\tsm\server\dsmserv" restore db source=dbsnapshot todate=today on=c:\tsm\server1\dbdir.txt

    if dsmicfgx was used to create tsm server instance:

    3.4) dsmserv removedb tsmdb1:

    http://publib.boulder.ibm.com/infocenter/tsminfo/v6/index.jsp?topic=/com.ibm.itsm.srv.ref.doc/r_cmd_dsmserv_removedb.html

    3.5) dsmserv restore db:

  • 5/21/2018 TSM 6.x DB Restore

    2/4

    http://publib.boulder.ibm.com/infocenter/tsminfo/v6/topic/com.ibm.itsm.srv.ref.doc/r_cmd_dsmserv_restore_db_current.html

    =================================================================================TROUBLESHOOTING=================================================================================

    ---------------------------------------------------------------------------------

    Q: The server failed to format the database TSMDB1A: db2cmd.exe -i -w -c db2 drop database TSMDB1

    http://www.ibm.com/developerworks/wikis/pages/viewpage.action?pageId=104532493

    ---------------------------------------------------------------------------------

    Q: PIT db restore in tsm 6.1.0?A: IC61496 (http://www-01.ibm.com/support/docview.wss?rs=663&context=SSGSG7&dc=DB550&uid=swg1IC61496&loc=en_US&cs=UTF-8&lang=en&rss=ct663other)

    workaround:

    "c:\program files\tivoli\tsm\server\dsmserv" removedb tsmdb1"c:\program files\tivoli\tsm\server\dsmserv" format ACTIVELOGD=c:\tsm\server1\alMIRRORLOGD=c:\tsm\server1\alm ARCHL=c:\tsm\server1\pal ARCHF=c:\tsm\server1\salDBD=c:\tsm\server1\db"c:\program files\tivoli\tsm\server\dsmserv" restore db todate=today source=dbsnapshot

    but in my case it caused "connection with client severed" error.

    ---------------------------------------------------------------------------------

    Q: Database backup terminated. DB2 SQLCODE -2033 SQLERRMC 406A: see 3) above -- all these tricks with db2 should fix it

    ---------------------------------------------------------------------------------

    Q: ANR0227S: Incorrect database opened. Server cannot start.A: tivoli management console -> tsm server1 -> wizards -> service configuration-> advanced -> redirect server output to c:\tsm\server1\console.log.wrong dsmserv.dbid in tsm server instance directory - delete it and start servermanually (not as a service):

    server/dsmserv.exe -S (-S to skip DB ID check and create a new one)

    the process will run in foreground (service not started). after killing the process it is possible to start tsm server service since correct dbid file has already been created.

    ---------------------------------------------------------------------------------

    Q: can't connect to new server in ISC

  • 5/21/2018 TSM 6.x DB Restore

    3/4

    A: delete current connection and create a new one

    ---------------------------------------------------------------------------------

    Q: can't delete database because it is not foundA: server1 folders might have been deleted - it necessary to uncatalog database:

    db2cmd: db2 uncatalog db tsmdb1 db2 list db directory

    ---------------------------------------------------------------------------------

    =================================================================================RESOURCES=================================================================================

    http://www.adsm.org/forum/showthread.php?t=17712 (most useful)http://publib.boulder.ibm.com/infocenter/tsminfo/v6/index.jsp?topic=/com.ibm.itsm.srv.ref.doc/r_cmd_dsmserv_restore_db_pit.html (dsmserv restore db command synt

    ax)http://www.adsm.org/forum/showthread.php?t=8427 (RL copy and restore)

    =================================================================================CREDENTIALS=================================================================================

    db2user1/db2user1 - user under which instance database manager works (the 1st screen of dsmicfgx wizard) it can be any local user and it must be in group "Administrators"

    iscadmin/iscadmin - ISC user credentials (used by default)

    admin/admin1 - TSM administrator(specified when using dsmadmc, configuration wizards in Mana

    gement Console, when creating connection to TSM server in ISC)

    =================================================================================USING DB2 STD TOOLS=================================================================================

    1) ????? ????? ????????? ?? ?????? ?? ?????? ????:

    db2cmd db2 BACKUP DATABASE TSMDB1 ONLINE TO "C:\DB2_BACKUP" INCLUDE LOGS

    2) ?????????? ?? ?? ????? ???? ?? ????? ?????

    set DB2INSTANCE=SERVER1

    db2cmd db2 RESTORE DATABASE TSMDB1 FROM "C:\DB2_BACKUP" TAKEN AT 20100410114109WITHOUT PROMPTING

  • 5/21/2018 TSM 6.x DB Restore

    4/4

    3) ??????? ????? ????? ?? ????? ????? ? ?????? ?????:

    db2cmd db2 RESTORE DATABASE TSMDB1 LOGS FROM "C:\DB2_BACKUP" TAKEN AT 20100410114109 LOGTARGET "C:\DB2_LOGS"

    4) ?????? ????? ?? ?????? ?????? ? ????? ?? ?????? ????:

    db2cmd db2 ARCHIVE LOG FOR DB TSMDB1

    5) ??????? ???? ????? ???? ? ????? C:\DB2_LOGS

    6) ?????? ????? ? ??????? ?????? ????????? ??? TSM:

    clean all directories pertaining to old database (database and logs)

    7) ????? ????? ?????? ?? ????????????? ????:

    db2cmd db2 ROLLFORWARD DATABASE TSMDB1 TO END OF LOGS AND COMPLETE OVERFLOW LOGPATH (C:\DB2_LOGS)

    8) ???????? ????????? ??? TSM:

    dsmserv

    =================================================================================1-? ????? ?? ??????? ??????????? ???? ??=================================================================================

    ???????????? ???? ?????? Tivoli Storage Manager ?????????? ?????? ? ??????? ??????? dsmserv restore db.??? ???????????? ???? ?????? Tivoli Storage Manager ???????? ????? ???? ????:

    " volhist.dat - ????? ????????? ??? ? ?????????? ??????;" devconf.dat - ?????? ? ??????? ??????.

    ??? ????????????? ???? ?????? ??? ???????? ???? ??? TSM (??? ?? ????? - "tsm server1") ? ???????? ??? ?????? ??? ??? (??? ?? ????? - "server1"):

    net stop "tsm server1"net stop "server1"

    ????? ???????? ????? ?????????? ???? ?????? TSM ? ??????? ????? ???????:

    dsmserv removedb tsmdb1

    ????? tsmdb1 - ?? ??? ???? ?????? ??? TSM ?? ?????.??? ??? ????? ??????? ? ???????????? ???? ?????? ? ??????? ????? ???????:

    dsmserv restore db

    ?????? ??????? ???? ?????? ?? ??? history.dat ? ???????? ?????????? ???? ??????,?????? ??????? ?? ??? ????? ????? (?? ???