How to recover database informix to another computer using Spectrum Protect
Posted in 2023
Camila Marinho de Barros asked how to restore an onbar backup to another server using Spectrum Protect. Tomas Dalebjork described proxy node redirected restore, and Mike Walker outlined copying ixbar and onconfig. Ondrej Zizka had lost the ixbar file; Dennis Melnikov advised using the same NODENAME and restoring ixbar via dsmc. Ondrej planned to test.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore
There is no information about the configuration necessary to recover the database to another computer in documentation:
https://www.ibm.com/docs/en/informix-servers/14.10?topic=manager-configuring-spectrum-protect
. I would like to know if there any environment variable to set before the onbar -r commad that indicate the client(source) or if we have to change any spectrum client's configuration file.
We are used to use the Networker, so to this, we have to set variables like:
NSR_CLIENT
NSR_LOG_VOLUME_POOL
NSR_SERVER
NSR_DATA_VOLUME_POOL
and then, execute onbar -r command.
Can anyone help me?
------------------------------
Camila Marinho de Barros
------------------------------
Hi Camila,
Tomas here from Spictera .
We have some different options for you to perform redirect restore.
Redirect restore from source to target using IBM Spectrum Protect
Alternative 1 using ASNODE:
===========================
On the Spectrum Protect server:
SP> GRANT PROXYNODE TARGET=sourcenode AGENT=targetnode
Create a redirect restore option file (dsm.opt), pointing out other configuration stanza in dsm.sys
root@targetserver# echo SERVERNAME restore > /tmp/dsm.optCreate a new stanza in dsm.sys
root@targetserver# cat >> /opt/tivoli/tsm/client/api/bin64/dsm.sys <<- EOFSERVERNAME restore
TCPSERVERADDRESS backup.server.com
NODENAME targetnode
ASNODE sourcenode
PASSWORDACCESS generate
ERRORLOGNAME /var/log/dsmerror_restore.log
EOF
Point out the new option file, by setting the DSMI_CONFIG environment variable, pointing to the location of the newly created dsm.opt file
root@targetserver# export DSMI_CONFIG=/tmp/dsm.optPerform your redirected restore
root@targetserver# onbar -rAlternative 2 using same source node credentials:
=================================================
Create a redirect restore option file (dsm.opt), pointing out other configuration stanza in dsm.sys
root@targetserver# echo SERVERNAME restore > /tmp/dsm.optCreate a redirect restore option file (dsm.opt), pointing out other configuration stanza in dsm.sys
root@targetserver# cat >> /opt/tivoli/tsm/client/api/bin64/dsm.sys <<- EOFSERVERNAME restore
TCPSERVERADDRESS backup.server.com
NODENAME sourcenode
PASSWORDACCESS generate
ERRORLOGNAME /var/log/dsmerror_restore.log
EOF
Point out the new option file, by setting the DSMI_CONFIG environment variable, pointing to the location of the newly created dsm.opt file
root@targetserver# export DSMI_CONFIG=/tmp/dsm.optPoint out the new option file, by setting the DSM_CONFIG environment variable (needed to set password), pointing to the location of the newly created dsm.opt file
root@targetserver# export DSM_CONFIG=/tmp/dsm.optPoint out location of dsm.sys file for "dsmc"
root@targetserver# export DSM_DIR=/opt/tivoli/tsm/client/api/bin64Save the source node password
root@targetserver# dsmc
# Enter the sourcenode and the password for the sourcenode
If you don't remember the source nodes password, than one can set a new password on the Spectrum Protect server
SP> UPDATE NODE sourcenode newpwd
Perform your redirected restore
root@targetserver# onbar -r
Alternative 3 using virtualnode: <<--- have never tried this
===========================================You need to add the "VIRTUALNODENAME sourcenode" to the current used dsm.opt file
root@targetserver# echo VIRTUALNODENAME sourcenode >> /opt/tivoli/tsm/client/api/bin64/dsm.optRegards Tomas
Spictera creates innovative Climate Smart Energy Efficient solutions
We have agentless solutions (Spictera SPFS) where one can mount the IBM Spectrum Protect on a path on your server (mountpoint of filesystem)
Eg
#
mount -t spfs /backup
All file operations that goes via this path is translated directly to IBM Spectrum Protect Client API calls
So a backup/restore using onbar/rman/mysqldump is more easy to manage, as the solution is agentless.
One can see all the backups using native OS commands etc.
With Spictera Snapshot, one can take application consistent snapshots directly to a IBM Spectrum Protect server, using progressive block level incremental forever techniques. Controlling the retention of the snapshot on the IBM Spectrum Protect server, and are not limited to a hardware
Restoring a snapthot is nearly instant
Contact us for more information:
https://www.spictera.com
Regards Tomas
I don't know about Networker, but Spectrum Protect appears to be based on TSM.
You can try following the steps for a redirected restore. I may well have missed something...
Let's assume that you have taken a backup on Server A and want to restore to Server B...
Shut down informix on Server B (if Informix is installed, configured, and running)
Copy the file $INFORMIXDIR/etc/ixbar.<servernum> from Server A to Server B
Edit the ixbar file on Server B and remove all entries before the last full backup. Search back from the end of the file until you find the rootdbs mentioned for a Level 0.
Copy over the $ONCONFIG file from Server A to Server B (assuming that there isn't one already - don't overwrite if there is), and make any changes necessary for Server B
Make sure that BAR_BSALIB_PATH in the $ONCONFIG file on Server B points to the correct library
Make sure that BAR_ACT_LOG and BAR_DEBUG_LOG in $ONCONFIG on Server B point to valid directories (the files do not need to exist)
Copy over the sqlhosts file ($INFORMIXDIR/etc/sqlhosts or file pointed to by $INFORMIXSQLHOSTS) from Server A to Server B (assuming that there isn't one already), and make any changes as necessary.
Copy over the $INFORMIXDIR/etc/oncfg* file from Server A to Server B. Rename to have the INFORMIXSERVER of Server B and SERVERNUM of Server B.
export IFX_SERVERNUM=<SERVERNUM of Server A>
If Server B will have a different location for the root dbs, then update the ONCONFIG on Server B to match that used on Server A. Same with the root path offset.
Set the following env variables as necessary on Server B (change as needed for your environment)
export DSMI_CONFIG=/usr/tivoli/tsm/client/api/bin64/???.opt
export DSMI_DIR=/usr/tivoli/tsm/client/api/bin64
export DSMI_LOG=/usr/tivoli/tsm/client/api/bin64
Then try a restore on Server B:
onbar -r -pCheck the file referenced by BAR_ACT_LOG for messages.
If successful (unlikely on the first try in my experience!), and you are not planning to use Server B for replicating with Server A, then perform the logical restore:
onbar -r -lI may probably missed a step or two, and you will need to determine what you need to do that is additional for Networker or Spectrum, but this may get you started.
Mike
------------------------------
Mike Walker
xDB Systems, Inc
www.xdbsystems.com
------------------------------
Hello.
Is there a way how to restore just the critical files? Especially the ixbar.<servernumber> file? I think it should be stored in Spectrum Protect (I did
onbar -b -won a source server). Unfortunately, I deleted the original server before without a manual backup of these files.
I tried
onbar -r -cf only, but there is no error even if the debug log file (BAR_DEBUG is set to 9).
Maybe the issue is that the source server had an "updated" Informix (
INFORMIXSERVER="ol_informix1410_1"), but the current server was installed with
INFORMIXSERVER="ol_informix1410".
Do exist any steps on how to restore the backup from Spectrum Protect in this situation? Thank you.
Ondrej
------------------------------
Ondřej Žižka
------------------------------
I think that ixbar.nn is backed up by the onbar tool too?
Check the -cf flags for onbar tool.
If I recall, it should also be possible to restore only the ixbar file too, but I have not been working with Informix for decades.
Regards Tomas
Spictera Ltd
https://www.spictera.com
------------------------------
Tomas Dalebjörk
------------------------------
Hello Tomas,
Thank you for your message. As I wrote above. I tried
onbar -r -cf only, but the critical files were not restored and no error or record was found in the bar_deebug.log file even if BAR_DEBUG is set to 9.
Regards
Ondrej
------------------------------
Ondřej Žižka
------------------------------
Hi
Ondřej,
Assuming old and new servers have similar configurations, TSM (aka Spectrum Protect) is set up and works well.
Give the new server same NODENAME as the old one in dsm.sys.
Via dsmc make sure you can connect to the TSM server, then query what files you can see in the backup:
query fi
If you see a directory where ixbar.0 resides, then dive into it, deeper and deeper,
query backup /directory/
When you find the ixbar.0 file, restore it,
rest /path/ixbar.0
Having ixbar.0 restored
quit
dsmc, and feel free to run onbar -r etc. Hope you have your disk space allocated to hold chunks being restored.
------------------------------
Sincerely,
Dennis
------------------------------
Thank you, Dennis. I will test that. ------------------------------ Ondřej Žižka ------------------------------