I am having a hard time using the Onbar tool (which relies on Onpsm primary storage manager for Informix db (server 12.1) using the cloud device (AWS s3).
https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.bar.doc/ids_bar_526.htm
- On the backup server, I have created a a DBSPOOL and LOGPOOL devices using commands similar to the following
onpsm -D add AMAZON1 \ -g DBSPOOL \ -p HIGHEST \ -t CLOUD \ --url https://ifmx-s3-dev.s3.amazonaws.com \ --provider S3 \ --user AKIAIT1111155555X4PA \ --password A2nB21111155555nvTI0X9ZxGzUJNJivoBQY9MrD \ --container ifmx-s3-dev \ --max_part_size 25600
- I then setup a cron job to perform a standard, level-0 backup of all online storage spaces and used logical logs.
onbar -b -L 0
onbar -b -l
- Reading the following IBM publication which advises to backup the storage catalog tables since are not backed up with the database instance, I set up a cron job to backup the $INFORMIXDIR/etc/psm which is supposed to contain the storage catalog tables
https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.bar.doc/ids_bar_526.htm
Copied $INFORMIXDIR/etc/psm directory and $INFORMIXDIR/etc/ixbar.? from the source server to the target and renamed the ixbar.? file replacing the IBM Informix server name that is used on the source computer with the IBM Informix server name of the target computer.
3- Changed ownership of the copied /psm directory and the ixbar file to user informix
4- Shutdown the db to perform a cold restore
onmode -yuk
5- Checked that the backup objects are there
onpsm -O list
6- Attempted to restore data and the critical files during the cold restore
onbar -r -cf yes
Got this weird error:
the environment variable BAR_BSALIB_PATH must be set in order to use
the -cf option!I checked the BAR_BSALIB_PATH in the ONCONFIG file and it is set to
$INFORMIXDIR/lib/libbsapsm.so
Even done this
BAR_BSALIB_PATH="/opt/informix-12.10.fc10/lib/libbsapsm.so"
:/home/informix echo $BAR_BSALIB_PATH
/opt/informix-12.10.fc10/lib/libbsapsm.soStill the same error!
7- Regenerate the emergency boot file – If the ixbar file is not empty and contains object data, onsmsync -b updates the sysutils database and the ixbar file so that they are in sync.
onsmsync -b
bar_act.log
2018-07-20 00:19:07 25656 25370 (-43207) Unable to open connection to
database server: . 2018-07-20 00:19:07 25656 25370 onsmsync
complete, returning 155 (0x9b) 2018-07-20 00:21:24 25933 25931
/opt/informix-12.10.fc10/bin/onbar_d -r
8- Restore the data
onbar -r
Warning: Parameter's user-configured value was adjusted. (ALARMPROGRAM)
gzip: stdin: unexpected end of file
gzip: stdin: unexpected end of file
9- The server came back in fast recovery mode
10 – bar_dbug.log
GET /awwdst13a/rootdbs/0/rootdbs.377.1 HTTP/1.1
then failure messages like
* Failed writing body (0 != 16347)
* Closing connection 0 2018-07-20 00:21:25 25937 25933 smtranid.c:155 Object Transaction List was empty. 2018-07-20 00:21:27
25933 25931 bar_ixbar_list: enter 2018-07-20 00:21:27 25933 25931
bar_ixbar_list: return 0 (0x00) 2018-07-20 00:21:27 25933 25931
bar_build_timeline: enter 2018-07-20 00:21:27 25933 25931
bar_build_timeline: return 0 (0x00) 2018-07-20 00:21:27 25933 25931
smcatalog.c:521 nsmOpenDatabase: Count: opened = 9, missing = 0.
2018-07-20 00:21:27 25933 25931 smtranid.c:84 Object Transaction List
was empty. 2018-07-20 00:21:27 25941 25933 smcatalog.c:521
nsmOpenDatabase: Count: opened = 9, missing = 0. 2018-07-20 00:21:27
25941 filter write_to_filter: Write failed on parent's output
pipe. errno = 32.. 2018-07-20 00:21:27 25941 filter
write_to_filter: Error writing to handle/fd 17 located at 0x1e05930.
11- bar_act.log
2018-07-20 00:21:27 25945 25933 Successfully connected to Storage
Manager. 2018-07-20 00:21:27 25933 25931 Begin cold level 0 restore
rootdbs (Storage Manager copy ID: 0 377). 2018-07-20 00:21:40 25945
25933 Informix Primary Storage Manager session 867 closed 2018-07-20
00:21:40 25945 25933 The child process for the backup and restore
filter is terminating with exit code 0. 2018-07-20 00:21:41 25933
25931 Completed cold level 0 restore rootdbs.2018-07-20 00:21:41 25969 25933 Begin cold level 0 restore api7dbs
(Storage Manager copy ID: 0 381). 2018-07-20 00:21:42 25968 25933
Informix Primary Storage Manager session 869 opened. 2018-07-20
00:21:42 25968 25933 Successfully connected to Storage Manager.
2018-07-20 00:21:42 25968 25933 Starting Filter /usr/bin/gunzip.
2018-07-20 00:21:42 25968 25933 Informix Primary Storage Manager
session 869 closed2018-07-20 00:21:44 25971 25933 Begin cold level 0 restore dat2dbs
(Storage Manager copy ID: 0 380). 2018-07-20 00:21:51 25983 25971
There are no more bytes to read.
ISAM Error = 0.
OS Error = 10 (No child processes). 2018-07-20 00:21:51 25983 25971 XBSA Error: (BSAGetData) A system
error occurred. Aborting XBSA session. 2018-07-20 00:21:51 25983
25971 Informix Primary Storage Manager session 875 closed 2018-07-20
00:21:51 25983 25971 The child process for the backup and restore
filter is terminating with exit code 0. 2018-07-20 00:21:53 25971
25933 Unable to close the storage space restore: The physical restore
was not completed.. 2018-07-20 00:21:53 25971 25933 Process 25971
25933 completed. 2018-07-20 00:21:53 25933 25931 (-43246) The ON-Bar
process 25971 exited with a problem (exit code 131 (0x83),
signal 0).
Best Answer
Finally had the time to make a test with
psm
andonbar
to make an Informix backup to Amazon S3.The test setup is 2
CentOS 7
virtual machines (machine1
andmachine2
) with an Informix server on each. The machines can talk to each other and with Amazon S3.machine1
will have Informix serverifx_a
andmachine2
will have Informix serverifx_b
.Informix 12.10.FC12 was installed on each machine, using the default location (
/opt/IBM/informix/12.10/
).It was a
root
installation, but everything else is run under userinformix
.On
machine1
I setup and initialize Informix serverifx_a
.I have the following environment variables:
I have the following parameters in the
onconfig.ifx_a
file:The
sqlhosts
file:Create the root dbspace file and set up permissions:
Initialize the Informix server
ifx_a
:Create a new database
test_db
on the new Informix server:Follow Back up to Amazon Simple Storage Service using ON-Bar and the PSM and setup the Amazon S3 bucket and credentials. The following steps are based on the mentioned documentation:
Initialize the
psm
catalog by just using anonpsm
command:Add the Amazon S3 bucket to the storage pools for dbspaces (DBSPOOL) and logical logs (LOGPOOL):
With a recently created Amazon S3 bucket, the
url
should point to the region of the bucket, else Amazon S3 will return a temporary redirect payload andonpsm
does not deal nicely with it (it seems to crash).Make a backup of Informix server
ifx_a
(in this case I am making a whole system backup, option "-w"):- $ onbar -b -w -L 0
Check onbar log file at
/opt/IBM/informix/12.10/tmp/bar_act.log
:Setup automatic backup on completion for logical logs.
Edit the
ALARMPROGRAM
script and changeBACKUPLOGS
toY
:Force a logical log completion/change and it will backup all logical logs that need.
Check onbar log file at
/opt/IBM/informix/12.10/tmp/bar_act.log
:Verify that the backup objects are listed in the
psm
catalog:Export the
psm
catalog so it can be moved tomachine2
.This will create a
psm_catalog.exp
in the current directory. It will contain text files to be imported into a new catalog.Another way is just to just copy the
psm
catalog tomachine2
.CLOUD
type devices, so the catalog must be copied instead.psm
catalog is not part of the backups. It should itself be backup up by an external tool, as per the documentation HCL Informix Primary Storage ManagerOn
machine2
I setup Informix serverifx_b
, but I do not initialize it.I have the following environment variables:
I have the following parameters in the
onconfig.ifx_b
file which are mostly equal to Informix serverifx_a
, but I prefer to give it a different SERVERNUM and DBSERVERNAME (it is not required, since they are in separate machines):The
sqlhosts
file:Create the root dbspace file and set up permissions:
Copy into
machine2
the Informix serverifx_a
psm
catalog export.Import the Informix server
ifx_a
psm
catalog. The imported catalog will assume all the same absolute paths from Informix serverifx_a
. But both Informix servers were setup to have the same absolute paths.In the directory where the
psm_catalog.exp
is, I run:Check the
psm
catalog:For
onbar
to work, it needs anixbar
file (it´s own offline catalog).onsmsync
command can recreate theixbar
file, but it can only do it from thesysutils
database, which does not exists in Informix serverifx_b
, since it has not been initialized (and even then, it would be empty). So we need to get it from thepsm
storage devices.Check the object catalog metadata:
Get ("dump") the
ixbar
file from the storage device:It creates a file
ifx_a_critical_files_ixbar.14
on the current directory. Copy and rename the file to the become theixbar
file for the Informix serverifx_b
(SERVERNUM 2):Launch the
onbar
restore command.$ onbar -r -w
Check onbar log file at
/opt/IBM/informix/12.10/tmp/bar_act.log
:Check online log file at
/opt/IBM/informix/12.10/tmp/online.log
:The Informix Server
ifx_b
is now inQuiescent
mode (memory is initialized, it can perform some administrative tasks). Change the Informix serverifx_b
to online mode.Check that the database
test_db
was restored.