Configure Tivoli Storage Manager Informix Onbar Backup
Total Page:16
File Type:pdf, Size:1020Kb
Tivoli Storage Manager – Informix ontape Backup- Restore Configuration
Level: Intermediate Amitava Chakraborty, IBM INDIA
Prerequisites
Knowledge of Informix Installation along with Server and Database configuration. Basic UNIX commands depend upon the OS used.
TSM Server Installation:
Version: TSM Server 5.3.0 and above
In the base directory of CD mount or the un-tar directories of the TSM Server there will be a README file. In this file, the directory structures and the installable software information are there depending upon different OS and their versions.
Note: If older version of TSM already exists then remove the software first then install the new version. The removal commands are also specified in the README file.
Creating required setup at TSM-SRERVER :
Please follow the below mentioned steps as a sequence: Go to TSM Server “bin” directory, there is a file called dsmserv.opt which is the configuration file for TSM server. Open the file in a text editor and search for the word “COMMTimeout”. Uncomment the line if it is commented and make the value of this property as 600, which is 10 minutes. This means a client will be connected for continuous 10 minutes while backup/restore. You may have to increase the number depending upon the size of the database and network speed and while you get an error in the administrative console as “Communication time out” while backup-restore. But the value 600 is a big enough value for at least 2 GB Dbspaces. Go to TSM Server “bin” directory and start the TSM server by running the command < ./dsmserv> as user root , you will get a prompt like “TSM:SERVER1> “ where “SERVER1” is your TSM server name. You can change the name of the server from “SERVER1” to the name you like by running the command set servername
Note:You can find these server commands more in details in the link
http://publib.boulder.ibm.com/tividd/td/SMAS4N/GC35-0316-01/en_US/HTML/a454rf02.htm#ToC_335
TSM client and Informix should be installed in the same machine.
TSM Client Installation:
Version:
For aix32, aix64, hpux32, hpux64, linux32, solaris32, and solaris64 TSM Client 5.2.0 or later For Windows 32 and zlinux64 TSM Client 5.2.2 or later For ppc64 and Linux on x86_64 TSM Client 5.3.0 or later
In the base directory of CD mount or the un-tar directories of the TSM Client there will be a README file. In this file, the directory structures and the installable software information are there depending upon different OS and their versions. Under those directories you will get the required information to install the TSM Client. For Informix Back-up and Restore through ontape, TSM Backup & Achieve Client installation is required. No need to install the TSM API Client. Informix Installation:
Please follow the Informix Installation guide to install the Informix on the required machine. Create an Informix Server and test databases on which the backup and restore will be performed.
Configuring the TSM Client for Ontape Backup-Restore:
Environment settings: ------Please ensure that the below settings are done at your environment: INFORMIXDIR
TERMCAP
Parameters settings for Informix onconfig file:
# System Archive Tape Device
TAPEDEV
# Log Archive Tape Device
LTAPEDEV
Note: Please do not mention the same name for both tape device.
After making these changes you have to bounce the Informix server to take effect of these new settings. Parameters settings for DSM_CONFIG file: servername
Now in the $DSM_DIR search for file named dsm.sys. If not exists copy the dsm.sys.smp to dsm.sys
Now change the dsm.sys
SErvername
Check the permission of /tmp/tsmlog , the directory tsmlog must be 777. Then create a file dsierror.log and change the file permission to 777.
IMP: After making these changes, please run the command dsmc as super user.It will ask for TSM Server user id and password .Please use user id “admin” and password as same as we set during the TSM server configuration. Once you enter all those correctly, it will enable you to login and give you a “tsm>” prompt. Please enter the command “quit” to come out from this prompt. Now as “Informix” user, please run the command dsmc, this time it should not asks for any user verification and directly prompt you as “tsm>”.Use command “quit” again to come out from the “tsm>”
IBM Tivoli Storage Manager Command Line Backup/Archive Client Interface Client Version 5, Release 3, Level 4.0 Client date/time: 09/14/06 09:44:36 (c) Copyright by IBM Corporation and other(s) 1990, 2006. All Rights Reserved.
Node Name: SUN3500.LENEXA.IBM.COM Session established with server SERVER1: Linux/i386 Server Version 5, Release 3, Level 2.0 Server date/time: 09/14/06 09:40:25 Last access: 09/14/06 09:40:17 tsm>
Installing the Ontape Backup-Restore Patch:
ontape_p_restore.sh ontape_backup.sh ontape_l_restore.sh
Please copy these 3 files to the directory $INFORMISDIR/bin Ontape Backup-Restore through TSM:
Backup
Pre-Condition: Database Server is online mode
Archive full system
Go to Informix Log directory. Now run the command
ontape_backup.sh | ontape –s | tee auto_ontape.log
You do not have to press any option, every thing is automated .You can keep look into your terminal to know what is happening .Sometimes you may see some error like “Bad tape”, the program is intelligent enough to take care of those error. You should receive the message like this in your terminal: sun3500% ontape_backup.sh | ontape -s | tee auto_ontape.log Please enter the level of archive to be performed (0, 1, or 2) Please mount tape 1 on /usr/informix/data/tapedev and press Return to continue ... Tape is full ...
Please label this tape as number 1 in the arc tape sequence. This tape contains the following logical logs:
7
Please mount tape 2 on /usr/informix/data/tapedev and press Return to continue ... Tape is full ...
Please label this tape as number 2 in the arc tape sequence.
Please mount tape 3 on /usr/informix/data/tapedev and press Return to continue ... Tape is full ...
Please label this tape as number 3 in the arc tape sequence.
Please mount tape 4 on /usr/informix/data/tapedev and press Return to continue ... Tape is full ...
Please label this tape as number 4 in the arc tape sequence.
Please mount tape 5 on /usr/informix/data/tapedev and press Return to continue ... 100 percent done.
Please label this tape as number 5 in the arc tape sequence.
Program over. sun3500% Continuous backup of logical logs
Go to Informix Log directory. Now run the command
ontape_backup.sh | ontape –c | tee auto_ontape.log
You do not have to press any option, every thing is automated .You can keep look into your terminal to know what is happening .Sometimes you may see some error like “Bad tape”, the program is intelligent enough to take care of those error. As soon the logical log fills the tape, it will take the backup and transfer the backed up tape files to tsm. You should receive the message like this in your terminal: sun3500% ontape_backup.sh | ontape -c | tee auto_ontape.log
Performing continuous backup of logical logs.
Please mount tape 1 on /usr/informix/data/ltapedev and press Return to continue...
Tape is full ...
Please label this tape as number 1 in the log tape sequence.
This tape contains the following logical logs: 7 (partial)
Please mount tape 2 on /usr/informix/data/ltapedev and press Return to continue... Tape is full ...
Please label this tape as number 2 in the log tape sequence.
This tape contains the following logical logs: 7 - 8
Please mount tape 3 on /usr/informix/data/ltapedev and press Return to continue... Tape is full ...
Please label this tape as number 3 in the log tape sequence.
This tape contains the following logical logs: 8 - 9
Please mount tape 4 on /usr/informix/data/ltapedev and press Return to continue... Tape is full ...
Please label this tape as number 4 in the log tape sequence.
This tape contains the following logical logs: 9 (partial)
Please mount tape 5 on /usr/informix/data/ltapedev and press Return to continue... Note: For Automatic backup of the logical log, Please use ontape_backup.sh | ontape –a | tee auto_ontape.log
Restore
Physical restore for HDR
Pre-Condition: Database Server is in shutdown mode
Go to Informix Log directory. Now run the command
ontape_p_restore.sh | ontape –p | tee auto_ontape.log
It will show you the list of 1st tape drive from different full system backup taken on different days and time .You have to choose one of them which is required and press enter and then you do not have to press any option it will bring the different backup tapes from TSM Server and restore them. The terminal message will be like this only: sun3500% ontape_p_restore.sh | ontape -p | tee auto_ontape.log
Please mount tape 1 on /usr/informix/data/tapedev and press Return to continue . .. /usr/informix/data/main950.09-12-2006-06:16.1.tapedev /usr/informix/data/main950.09-12-2006-06:24.1.tapedev /usr/informix/data/main950.09-12-2006-06:28.1.tapedev /usr/informix/data/main950.09-12-2006-06:36.1.tapedev /usr/informix/data/main950.09-12-2006-06:38.1.tapedev /usr/informix/data/main950.09-12-2006-06:45.1.tapedev /usr/informix/data/main950.09-12-2006-06:48.1.tapedev /usr/informix/data/main950.09-12-2006-08:09.1.tapedev /usr/informix/data/main950.09-14-2006-05:11.1.tapedev /usr/informix/data/main950.09-14-2006-05:25.1.tapedev /usr/informix/data/main950.09-14-2006-06:40.1.tapedev Please enter the file number with path /usr/informix/data/main950.09-14-2006-06:40.1.tapedev (I choose this file) Files retrieved successully from tsm ...
Archive Tape Information
Tape type: Archive Backup Tape Online version: IBM Informix Dynamic Server Version 7.31.UN233 Archive date: Thu Sep 14 06:40:38 2006 User id: informix Terminal id: ? Archive level: 0 Tape device: /usr/informix/data/tapedev Tape blocksize (in k): 16 Tape size (in k): 400 Tape number in series: 1
Spaces to restore:1 [rootdbs ] Archive Information
IBM Informix Dynamic Server Copyright(C) 1986-2004 IBM Informix Software, Inc. Initialization Time 09/14/2006 06:38:50 System Page Size 2048 Version 6 Archive CheckPoint Time 09/14/2006 06:40:38
Dbspaces number flags fchunk nchunks flags owner name 1 1 1 1 N informix rootdbs
Chunks chk/dbs offset size free bpages flags pathname 1 1 0 10000 4663 PO- /usr/informix/data/rootdbs
Continue restore? (y/n)Do you want to back up the logs? (y/n) Please mount tape 2 on /usr/informix/data/tapedev and press Return to continue ... Tape sequence number is 1, expecting 2
Bad tape.
Please mount tape 2 on /usr/informix/data/tapedev and press Return to continue . .. Please mount tape 3 on /usr/informix/data/tapedev and press Return to continue . .. Please mount tape 4 on /usr/informix/data/tapedev and press Return to continue ... Restore a level 1 archive (y/n) Program over. sun3500%
Logical restore for HDR
Pre-Condition: Database Server is in Fast Recovery mode ( Physical restore Completed)
1. Open 2 sessions and set the environment for both sessions 2. Now from one session run the command ontape –l It will flash you the message like :
Roll forward should start with log number 7
Please mount tape 1 on /usr/informix/data/ltapedev and press Return to continue...
3.Now from another session run the command ontape_l_restore.sh
It will list you all the logical logs back-up.Please choose the correct one and press enter.It will mount the desired tape on the logical tape device. And Confirm you on that.The message will flash in the screen like this way: /usr/informix/data/main950.7(partial).ltapedev /usr/informix/data/main950.7-8.ltapedev /usr/informix/data/main950.8-9.ltapedev /usr/informix/data/main950.9(partial).ltapedev /usr/informix/data/main950.Pleaselabelthistapeasnumber7inthearctapesequence..lta pedev Please enter the file name to restore /usr/informix/data/main950.7(partial).ltapedev ( I enter this logical log) IBM Tivoli Storage Manager Command Line Backup/Archive Client Interface Client Version 5, Release 3, Level 4.0 Client date/time: 09/14/06 09:17:21 (c) Copyright by IBM Corporation and other(s) 1990, 2006. All Rights Reserved.
Node Name: SUN3500.LENEXA.IBM.COM Session established with server SERVER1: Linux/i386 Server Version 5, Release 3, Level 2.0 Server date/time: 09/14/06 09:13:10 Last access: 09/14/06 09:13:01
Restore function invoked.
Restoring 409,600 /usr/informix/data/main950.7(partial).ltapedev [Done]
Restore processing finished.
Total number of objects restored: 1 Total number of objects failed: 0 Total number of bytes transferred: 400.07 KB Data transfer time: 0.02 sec Network data transfer rate: 15,086.17 KB/sec Aggregate data transfer rate: 131.65 KB/sec Elapsed processing time: 00:00:03 File restored successfully File mounted on tapedev ... Please continue the backup Press when you are finished else press enter ..
4. After getting the confirmation message like “File mounted on tapedev ... Please continue the backup” , Please press enter for the session showing “ Please mount tape 1 on /usr/informix/data/ltapedev and press Return to continue...”
5.Log Back up will be restore and after the restore is complete it will flash a message “Do you want to restore another log tape? (y/n)” , If you wish please press Y else N. On Pressing Y , it will show the Message like this “Please mount tape 2 on /usr/informix/data/ltapedev and press Return to continue...” and pressing N it will come out saying “Program Over” and put the database server as “Quotient” mode.”
6.If you want more logical log restore , Press enter to the 2nd session, It will again show you the list of logical logs and you have to choose the correct one , after mounting the logical log on Log tape device correctly you should press enter in the 1st session to restore the mounted log. And repeat the step 5, 6 as soon as your restoration will be in progress. Ontape simple test:
Please do a simple test to make sure ontape is working fine.
1.Backup data through ontape by running the command ontape_backup.sh | ontape –s | tee auto_ontape.log. 2.Now start the continues log backup by ontape_backup.sh | ontape –c | tee auto_ontape.log. 3.Make some transaction so that the atleast one logical log fulls 4.Make the Informix-Server down. 5.Restore the database by running the command ontape_p_restore.sh | ontape –p | tee auto_ontape.log 6.Restore the database by running the command ontape_p_restore.sh | ontape –p | tee auto_ontape.log 7.Restore the backed up logical log with the combination of the command ontape_r_restore.sh and ontape –l as described in the document 7.Make the Informix server online and try to see the changes you made after the archive backup.