Ugif 09 2013 psm

48
User Group Informix France PSM PSM Backup and Restore Backup and Restore faster and easier with Informix 12.1 faster and easier with Informix 12.1 Frédéric DELEST [email protected] Hyun-ju VEGA [email protected] Jeudi 12 Septembre 2013 Jeudi 12 Septembre 2013

description

User Group Informix France - PSM Backup and Restore faster and easier with Informix 12.1

Transcript of Ugif 09 2013 psm

Page 1: Ugif 09 2013   psm

User Group Informix France

PSM PSM Backup and Restore Backup and Restore faster and easier with Informix 12.1 faster and easier with Informix 12.1

Frédéric [email protected]

Hyun-ju [email protected]

Jeudi 12 Septembre 2013Jeudi 12 Septembre 2013

Page 2: Ugif 09 2013   psm

User Group Informix France

OverviewOverview� Informix backup and restore methods

– ontape

– onbar– onsmsync

� Why PSM (IBM Informix Primary Storage Manager)– onbar features– ontape performance

� PSM features and details� Summary

– Understanding backup and restore options

– Doing what makes sense for your system

� Questions and Anwsers� Appendix

Page 3: Ugif 09 2013   psm

User Group Informix France

Informix Backup and Restore MethodsInformix Backup and Restore Methods

� ontape– Serial backup/restore only– No backup/archive catalog– Backup verification with stand-alone archecker

� onbar– Requires storage manager– Backup activities log file– Backup/archive catalog (ixbar, sysutils)– Backup verification with onbar -v

� External Backup and Restore (EBR) – Integrate third-party backup utility with Informix logical recovery – Use ontape or onbar for logical log backups

(Generally) Interactive

Non-interactive

Not discussed here

Page 4: Ugif 09 2013   psm

User Group Informix France

OnbarOnbar

� Requires storage manager – In 12.1, PSM (Primary Storage Manager) is bundled with Informix

– Previous to 12.1, ISM is bundled with Informix

� Can configure parallel backup of dbspaces– Either whole system parallel or “regular” parallel

� Point-in-time Restore� Restartable Restore� Integrated archive validation (onbar –v)� onbar Parallel Whole System backup (Informix 11)� BACKUP_FILTER, RESTORE_FILTER (Informix 11)� SQL Admin API for onbar backup (11.70.xC2)

– Execute function task ("onbar backup"); – Execute function task ("onsmsync", "-g 3");

New!

Page 5: Ugif 09 2013   psm

User Group Informix France

Onbar ComponantsOnbar Componants

Troubleshooting: BAR 5

Storage Manager

(PSM, TSM, etc.)XBSAonbar

oninit

Informix Archive Interface

Informix Shared Memory

On-Bar Related Tables and Files

sysutils database (onbar catalog)

BAR_ACT_LOG

BAR_DEBUG_LOG

ixbar file (emergency boot file)

oncfg file

sm_versions

BAR_BSALIB_PATH

PSM does not use sm_versions !

PSM uses these logs by default.

Page 6: Ugif 09 2013   psm

User Group Informix France

XBSA Session and TransactionXBSA Session and Transaction

10/4/2013 Troubleshooting: BAR 6

BSAQueryApiVersion

BSAInit

BSABeginTxn

BSAGetObject

BSAGetData

BSACreateObject

BSASendData

BSAEndData

BSAEndTxn

BSATerminate

BACKUP RESTORE

Begin/End Session

Begin/End Transaction

Possible return code:

BSA_RC_NO_MORE_DATA 0x12 (18)

For backup, another transaction with call to BSAQueryObject .

BSASendData and

BSAGetData are called

for each data transfer

buffer until the backup

or restore is complete.

Page 7: Ugif 09 2013   psm

User Group Informix France

Why PSM?Why PSM?

� What people want– Features of onbar– Performance and simplicity of ontape

� Make it easy to set up and configure onbar� Make it easy for ontape users to migrate to onbar

– Provide an easy solution for parallel backups for embed users

– Provide ontape performance for onbar users

As long as I’ve been attending the IIUG conferences, people have been asking for a “parallel ontape”.

What would a parallel ontape look like?

Page 8: Ugif 09 2013   psm

User Group Informix France

What would a What would a parallelparallel ontape look like?ontape look like?

� ontape backup to directory backs up all spaces to a single file– All or nothing (easy to keep track of a single file)– In a parallel backup, each space is backed up to a separate file

– How will I know if a backup of all spaces succeeded or failed?

– How will I know which backup files are “good” (not aborted)?

� ontape backup to directory has no catalog– How will I know which logical logs go with which space backup?– How will I know which files can be removed?

Need an interface to keep track of backups and commit each successful space backup (like XBSA) with a storage manager.

Need a catalog (like sysutils and ixbar file) and a utility to expire backups (like onsmsync).

Page 9: Ugif 09 2013   psm

User Group Informix France

What People Want What People Want –– onbar with PSM !onbar with PSM !

� What people want– Point-in-time restores (onbar feature)– Parallel backups of dbspaces (onbar feature)

– Way to know which logical log backups are needed for restores (onbar feature)

– Simplicity (ontape)– Performance (ontape)

Prior to PSM, for a single space backup (which cannot be parallelized), ontape backup of the space was faster than the onbar backup of the same space because the ontape TAPEBLK could be set much larger than the BAR_XFER_BUF_SIZE.

Page 10: Ugif 09 2013   psm

User Group Informix France

PSM OverviewPSM Overview� No storage manager daemon processes

– PSM does not have a client/server architecture like ISM

� Does not use sm_versions� PSM supports devices of type FILE only� No remote backups – PSM catalogs and storage must be locally

visible � Can take a backup with no configuration (using all defaults)

– Minimum configuration recommended

• PSM is a simplified storage manager

• PSM isnot an enterprise storage manager

• Tight integration with onbar and onsmsync -- can expire/remove objects from PSM with onsmsync

Page 11: Ugif 09 2013   psm

User Group Informix France

PSM ComponentsPSM Components� onpsm ($INFORMIXDIR/bin/onpsm)

– Utility used to add devices to PSM and to administer PSM catalog

� XBSA shared library ($INFORMIXDIR/lib/libbsapsm.so on Linux)

– Set BAR_BSALIB_PATH to full path to libbsapsm.so

� PSM catalogs (Located in PSM_CATALOG_PATH or

$INFORMIXDIR/etc/psm)

– Informix C-ISAM tables (not the same as commercial product)

– Keeps track of backup objects in PSM devices (except objects in EXTPOOL devices)

– Must backup PSM catalog manually

• Export the PSM catalog using “onpsm -C export”, then backup the psm_catalog.exp directory

• PSM catalog is not backed up by onbar/PSM

Page 12: Ugif 09 2013   psm

User Group Informix France

onbar_d with PSMonbar_d with PSM� onbar_d pmap while onbar/PSM backup is in progress

– PSM shared library (libbsapsm.so) is loaded by onbar_d

– It's the onbar_d process that writes to the PSM storage devices and updates the PSM catalog (see the PID in log files)

20081 : /work2/PRODUCTS/12.10.FC1/bin/onbar_d -b -w -L 00000000000400000 3164K r-x-- /work2/PRODUCTS/12.10 .FC1/bin/onbar_d0000000000916000 96K rwx-- /work2/PRODUCTS/12.10 .FC1/bin/onbar_d000000000092e000 20496K rwx-- [ anon ]0000000009fa5000 812K rwx-- [ anon ]...00002b2d20646000 1348K r-x-- /work2/PRODUCTS/12.10 .FC1/lib/libbsapsm.so00002b2d20797000 2048K ----- /work2/PRODUCTS/12.10 .FC1/lib/libbsapsm.so00002b2d20997000 44K rwx-- /work2/PRODUCTS/12.10 .FC1/lib/libbsapsm.so00002b2d209a2000 636K rwx-- [ anon ]00002b2d20a41000 8192K rwxs- [ shmid=0x7b9002e ]00007fff8de67000 332K rwx-- [ stack ]ffffffffff600000 8192K ----- [ anon ]

total 128964K

Page 13: Ugif 09 2013   psm

User Group Informix France

Setting up onbar/PSM Setting up onbar/PSM � Decide where you will locate the PSM catalog – default

$INFORMIXDIR/etc/psm

� Add devices to DBSPOOL, LOGPOOL– onpsm -D add /backups/psm_spaces -g DBSPOOL -p HIGH -t FILE– onpsm -D add /backups/psm_logs -g LOGPOOL -p HIGH -t FILE

� In ONCONFIG– Set BAR_BSALIB_PATH to full path to libbsapsm.so– Set PSM_CATALOG_PATH to full path to PSM catalog directory– Set PSM_DBS_POOL DBSPOOL– Set PSM_LOG_POOL LOGPOOL

� Take onbar backup

� View backup objects in PSM– onpsm -O list– onpsm -O detail -o <object_id_number>– onpsm -version all

Best Practice

Increase BAR_XFER_BUF_SIZEto 128 or 256 for better performance with PSM !

If you do none of these things, then onbar backup will still work, but everything will go to defaults.

HIGH is the default priority.

Page 14: Ugif 09 2013   psm

User Group Informix France

Archive Transfer Buffer SizeArchive Transfer Buffer Size� ontape

– Size of the data transfer buffer is TAPEBLK – TAPEBLK in ONCONFIG is specified in KBytes

– Write and Read from TAPEDEV is via TAPEBLK size

� onbar– Size of the transfer buffer is BAR_XFER_BUF_SIZE * bpage size

– BAR_XFER_BUF_SIZE in ONCONFIG is specified in Informix Base Page Size for the Platform

• 2048 is base page size for Linux, Solaris, HP

• 4096 is base page size for AIX, Mac, Windows

– BSASendData and BSAGetData is via transfer buffer size

Page 15: Ugif 09 2013   psm

User Group Informix France

onbar/PSM Performance Advantageonbar/PSM Performance Advantage

� Only for PSM, can set BAR_XFER_BUF_SIZE to be larger than 15 (for AIX, Windows) and 31 (for Linux, HP, Solaris)

� BAR_XFER_BUF_SIZE is in base page sizes, so for all others

– 15 is (15 * 4k) ==> 61440 bytes

– 31 is (31 * 2k) ==> 63488 bytes– Data transfer buffer sizes are less than 64k

� For, PSM, you can set BAR_XFER_BUF_SIZE to as high 32768 (not advisable – consider memory resources)

� If you are an ontape user and have TAPEBLK set to 51 2, then the analogous BAR_XFER_BUF_SIZE would be 256 for Linux, HP, Solaris and 128 for AIX, Windows, Mac

� If you increase BAR_XFER_BUF_SIZE, you may need to decrease BAR_NB_XPORT_COUNT if you've increased it greatly from default

Page 16: Ugif 09 2013   psm

User Group Informix France

Performance: ontape, onbar/ISM, onbar/PSMPerformance: ontape, onbar/ISM, onbar/PSM

� When the data transfer buffer size is the same, onbar/PSM performance is same as ontape for a single backup stream

� Since the maximum onbar/ISM data transfer buffer size is less than 64k, onbar/PSM performance is always better when BAR_XFER_BUF_SIZE is set higher than the default va lues of 15 or 31

� In internal tests, onbar/PSM performance has been faster by any where from 30 to 300 % , depending on the scenario

One test scenario with single stream backup (BAR_MAX_BACKUP 1)

ontape: data transfer buffer size 512k: 29 min 9 seconbar/ISM: data transfer buffer size 60k: 1 hour 25 min 12 seconbar/PSM: data transfer buffer size 512k: 29 min 22 sec

Page 17: Ugif 09 2013   psm

User Group Informix France

PSM FunctionalityPSM Functionality� “onpsm -C” shows you PSM catalog options

� “onpsm -D” shows you PSM device options

� “onpsm -O” shows you PSM object options

� “onpsm -P” shows you PSM pool options

� Use onsmsync to expire objects and remove/delete obj ects from PSM storage

– PSM does not have expiration policies – use onsmsync -i, -g, or -t

– onsmsync -i, -g, -t options will delete entries from sysutils tables, ixbar file and PSM

– Example: onsmsync -g 3 -cf yes

� Use BACKUP_FILTER, RESTORE_FILTER for compression, encryption

– PSM does not have options for compression or encryption

� Use onsmsync -E to export objects from PSM

� Use onsmsync -I (capital i) to import objects into PSM

The “–cf yes” option removes the critical files.

onsmsync –i, –g, –t REMOVES

PSM objects !

Page 18: Ugif 09 2013   psm

User Group Informix France

Imported Restore with PSMImported Restore with PSM

Use onsmsync –E option to export to EXTPOOL -- objects in EXTPOOL are not tracked by the PSM catalog.

Use onsmsync –I option to import from

EXTPOOL to your PSM catalog.

Production

INFORMIXSERVER: ifx_prod

PSM_CATALOG_PATH = /informix/psm_catalog_prod

DBSPOOL : /prod/backup/psm_dbs

LOGPOOL : /prod/backup/psm_logs

EXTPOOL: /shared/psm_ext

Test

INFORMIXSERVER: ifx_test

PSM_CATALOG_PATH = /informix/psm_catalog_test

DBSPOOL: /test/backup/psm_dbs

LOGPOOL: /test/backup/psm_logs

EXTPOOL: /shared/psm_ext

Page 19: Ugif 09 2013   psm

User Group Informix France

Imported RestoreImported Restore� Imported restore with PSM

– Add a device to EXTPOOL– Export backup objects to EXTPOOL using onsmsync -E – Use any copy utility to copy the exported objects to the EXTPOOL device on

the machine where the instance will be restored– Import backup objects from EXTPOOL using onsmsync - I (capital i)– Use onbar to restore the backup

� Can also use onsmsync -E to export backup objects for “off-PSM”storage– All the objects needed to restore a backup is copied to the EXTPOOL device

– PSM does not keep track of objects in the EXTPOOL

With onsmsync -E, manifest file (named export.bom) is created that describes the objects.

Page 20: Ugif 09 2013   psm

User Group Informix France

PSM CatalogPSM Catalog� PSM catalog backup -- IMPORTANT --

– onpsm -C export– Exported directory (psm_catalog.exp) is created in current working directory

� PSM catalog import – onpsm -C -init – onpsm -C import

� PSM – THESE COMMANDS ARE NOT FOR PRODUCTION USE !– onpsm -C -init

• Deletes the current PSM catalog– onpsm -C -init -d

• Deletes the current PSM catalog and the objects referenced --deletes/removes the objects from the storage devices!!!

The exported directory, psm_catalog.exp should be backed up by the DBA or the Administrator – it is notbacked up to PSM.

Page 21: Ugif 09 2013   psm

User Group Informix France

Disaster RecoveryDisaster Recovery

� Must backup the PSM catalog, it is not backed up by PSM– Export the PSM catalog using onpsm -C export and backup the exported

catalog

� Recovery Scenarios– If you lose your Informix chunks, how will you recover?– If you lose the PSM catalog, how will you recover?– If you lose the storage devices (file systems where the backup objects are

stored), how will you recover?– If you lose $INFORMIXDIR (lose ifxbar, ONCONFIG, oncfg, sqlhosts) ?

There should be a recovery plan that covers the loss of all or any combination of above for all Informix instances!

Page 22: Ugif 09 2013   psm

User Group Informix France

onpsm onpsm --D D % onpsm -DUsage for Devices

onpsm -D <add|del|modify|list> <Device options>add <path> -g <pool> -p <prio> -t <type> [-s <si ze> -b <blksize>]del <path> -d | -g <pool> [-y]list [ -u|-l <dev_def_file.txt> ] purge <path>scan <path>update <path> -g <pool> [-p <prio> ] [-s <size> ]

add : Adds a new device to the system.del : Deletes a device from the system.list : Displays all devices in the system.purge : Removes from the catalog objects missing from the media.scan : Scans the media and adds orphan objects to the catalog.update : Modifies an existing device.

path : Full path of the device.-b : Block size (Only for tapes). -d : Deletes the pool from all Pools and dele tes backup objects.-g : Pool (ie DBSPOOL, LOGPOOL, EXTPOOL).-l : Load from a Device Definition file.-p : Priority of the device (HIGH or LOW).-s : Maximum size of the device (only for tap es).-t : Type of device (Currently only 'FILE').-u : Unload to a Device Definition file.-y : Do not ask for confirmation to complete the action requested.

Error -88303: Not enough arguments for option '-D'.

also HIGHEST and READ-ONLY

Page 23: Ugif 09 2013   psm

User Group Informix France

PSM DevicesPSM Devices� onpsm -D add <path> -g <pool> -p <prio> -t <type>

– Priority can be “LOW”, “HIGH”, “HIGHEST”, “READ-ONLY”

– “HIGHEST” is used first

– Can only have one “HIGHEST” per pool

– Can have multiple HIGH or LOW – cannot choose which device among HIGH or LOW are used first

– When a device becomes full, it is set to “READ-ONLY” (see Prio column) –priority must be changed manually if more space is added to the device

� onpsm -D purge <path>

– Removes from the catalog objects missing from the media

� onpsm -D scan <path>

– Scans the media and adds orphan objects to the catalog

– May be helpful when catalog is lost ...

Page 24: Ugif 09 2013   psm

User Group Informix France

PSM Devices PSM Devices –– Best PracticeBest Practice

� For simplicity, assign different devices to DBSPOOL, LOGPOOL, etc.

� In production, always use onsmsync to delete objects

� Do not use “onpsm –D <path> -d” in production

Best Practice

• What does “onpsm –D <path> -d” do?

– Erases ALL objects from ALL pools that use that device

– Also, the command can be used to remove objects from devices that have been removed from PSM

– Command is only for test/QA systems Do not use in production !

Page 25: Ugif 09 2013   psm

User Group Informix France

Example: onpsm Example: onpsm ––D listD list

$ onpsm -D list...Type Prio Block/Size (MB) Pool Name Devi ce NameFILE LOW --/-- DBSPOOL /work2/PRODU CTS/12.10.FC1/backupsFILE READ-ONLY --/-- DBSPOOL /work4/vegah/psm1FILE READ-ONLY --/-- DBSPOOL /work4/vegah/psm2FILE READ-ONLY --/-- DBSPOOL /work4/vegah/psm3FILE LOW --/-- DBSPOOL /work4/vegah /psm_low...

$ onpsm -D list

Informix PSM Device List

Type Prio Block/Size (MB) Pool Name Device NameFILE LOW --/-- DBSPOOL /work2/PRODUCTS/12.10.FC1/backupsFILE HIGHEST --/-- DBSPOOL /work4/vegah/psm1FILE HIGH --/-- DBSPOOL /work4/vegah/psm2FILE HIGH --/-- DBSPOOL /work4/vegah/psm3FILE LOW --/-- DBSPOOL /work4/vegah /psm_low

FILE LOW --/-- LOGPOOL /work2/PRODUCTS/12.10.FC1/backups

FILE HIGH --/-- EXTPOOL /work4/vegah/psm_export

For simplicity, assign one device per pool, but if needed, you can assign more.

Each device is used, in turn, until full, then set to READ-ONLY.

Page 26: Ugif 09 2013   psm

User Group Informix France

Example: onpsm Example: onpsm ––O listO list

$ onpsm -O detail -o 36

Informix PSM Object Detail ListObject ID : 36XBSA PATH : /vegah_tcp/rootdbs/0XBSA CopyId : 0:36Object Type : RObject version : 6Physical pieces :

/work4/vegah/psm1/vegah_tcp/rootdbs/0/vegah_tcp.6.1/work4/vegah/psm2/vegah_tcp/rootdbs/0/vegah_tcp.6.2/work4/vegah/psm3/vegah_tcp/rootdbs/0/vegah_tcp.6.3

Number of pieces: 3

$ onpsm -O list

Informix PSM Object ListObject ID Date Created Size (MB) Logical path (name.version)11 2013-02-15 14:28:27 14.5 /vegah_tcp/rootdbs/0/vegah_tcp.112 2013-02-15 14:28:28 0.0 /vegah_tcp/critical_files/ixbar/vegah_tcp.113 2013-02-15 14:28:28 0.0 /vegah_tcp/critical_files/oncfg/vegah_tcp.114 2013-02-15 14:28:28 0.1 /vegah_tcp/critical_files/onconfig/vegah_tcp.115 2013-02-15 14:28:28 0.0 /vegah_tcp/critical_files/sqlhosts/vegah_tcp.1...36 2013-02-18 17:42:43 16.2 /vegah_tcp/rootdbs/0/vegah_tcp.637 2013-02-18 17:42:44 0.0 /vegah_tcp/critical_files/ixbar/vegah_tcp.6...

To see details for multiple objects, use “–o 36 –o 37 –o 38”

format

Page 27: Ugif 09 2013   psm

User Group Informix France

Backup Object Naming ConventionBackup Object Naming Convention

� Name path is relative to device– Level # – 0, 1, or 2 for Level 0, 1, or 2

– Object version – number, starting from 1, incremented for every new backup

– Piece – number, starting from 1, notes the pieces of the same backup object

� Space -- Uses dbspace name

� Logs -- Uses servernum and log unique id

Spaces<DBSERVERNAME>/<dbspace>/<level#>/<DBSERVERNAME>.<O bj Version>.<piece>

/work4/vegah/psm1 /vegah_tcp/dbs2/0/vegah_tcp.3.1

Logs<DBSERVERNAME>/<SERVERNUM>/<UNIQUEID>/<DBSERVERNAME>.<Obj Version>.<piece>

/work4/vegah/psm_logs /vegah_tcp/15/43/vegah_tcp.1.1

Page 28: Ugif 09 2013   psm

User Group Informix France

EXTPOOL Objects ...EXTPOOL Objects ...

� Objects in EXTPOOL have a different naming convention– Filename_prefix is the name you gave in -p option to onsmsync -E

� Objects in EXTPOOL are not tracked by PSM

Spaces in EXTPOOL<device>/< filename_prefix >/<DBSERVERNAME>/<DBSPACE>/<LEVEL>

/work4/vegah/psm_export/ backup_feb27_13_34_00 /vegah_tcp/dbs2/0

Logs in EXTPOOL<device>/< filename_prefix >/<DBSERVERNAME>/<SERVERNUM>/<UNIQUEID>

/work4/vegah/psm_export/ backup_feb27_13_34_00 /vegah_tcp/15/45

Page 29: Ugif 09 2013   psm

User Group Informix France

PSM PSM –– Useful CommandsUseful Commands� onpsm -V, -version, -version all

– -version all includes information about the PSM library

� onpsm -h, onpsm -H� onpsm -C detail

– Displays the location of the PSM catalog

� onpsm -D list– Displays devices

� onpsm -O list– Displays backup objects and sizes of objects

� onpsm -O detail -o <object_id_number> -o <object_id> -o <object_id> ...– Displays detail information about the backup object(s) specified, including the

location of the backup pieces

– When a device becomes full, the backup is continued on a different device (chosen in priority order)

Page 30: Ugif 09 2013   psm

User Group Informix France

In onconfig.stdIn onconfig.std################################################### ################# Primary Storage Manager (PSM) Configuration Param eters################################################### ################# PSM_ACT_LOG - The ON-Bar activity log file location.# Do not use the /tmp directo ry. Use a# directory with restricted p ermissions.# If not set the value of BAR _ACT_LOG is used.# PSM_DEBUG_LOG - The PSM debug log file location.# Do not use the /tmp directo ry. Use a# directory with restricted p ermissions.# If not set the value of BAR _DEBUG_LOG is used.# PSM_DEBUG - The debug level for PSM. Acceptable# values are 0 (off) through 9 (high).# If not set the value of BAR _DEBUG is used.# PSM_CATALOG_PATH - The directory that will hold the PSM catalog# The default is $INFORMIXDIR /etc/psm.# PSM_DBS_POOL - The Pool where to place dbspace data.# The default is "DBSPOOL"# PSM_LOG_POOL - The Pool where to place log data.# The default is "LOGPOOL"################################################### ################

PSM_DBS_POOL DBSPOOLPSM_LOG_POOL LOGPOOL

Page 31: Ugif 09 2013   psm

User Group Informix France

PSM_CATALOG_PATH PSM_CATALOG_PATH

$ onpsm -h

The Informix PSM catalog is not present in the '/work2/PRODUCTS/12.10.FC1/etc/psm/' directory. The system will try to create it.Informix PSM catalog creation in the '/work2/PRODUCTS/12.10.FC1/etc/psm/' directory succeeded.

Usage…

� Must be set in environment or in the ONCONFIG

– Environment variable has precedence

– Set in ONCONFIG

� If not, onpsm will use the default directory – onpsm will create a new set of catalog if none exists in the default directory (see example below)

Best Practice

Tip: Need to set environment variable

for “onbar –r –cf yes”

Page 32: Ugif 09 2013   psm

User Group Informix France

Multiple Informix Instances on Same HostMultiple Informix Instances on Same Host

� Should each Informix instance on the same machine have its own unique PSM_CATALOG_PATH or share the same one?

� Each instance has its own PSM catalog– Makes sense if the activities of the Informix instances are completely

unrelated, belongs to different groups, or if one is a test instance

– Be careful that the same devices are not being tracked by different PSM instances

– Will need to set separate environment, run onpsm commands for each PSM catalog/instance

– Will need to backup multiple PSM catalogs

� One PSM instance for multiple Informix instances– Consider creating unique pools for each instance– Assign different devices to each pool

Best Practice

Page 33: Ugif 09 2013   psm

User Group Informix France

Example: onpsm Example: onpsm ––C detailC detail$ onpsm -C detail

Informix Primary Storage Manager State:

PSM Unique ID : 1360897216Catalog Location : /work4/vegah/psm_catalog/Catalog State : LockedCatalog Owner : 184Catalog Lock Mode: Regular

Sessions:Session ID Process ID184 28672

Informix PSM Locked Objects

Session Object Id Date Time Server Object Name

0 11 2013-02-18 13:29:34 /vegah_tcp /vegah_tcp/rootdbs/0

-- Can have multiple sessions running but only one can be the catalog owner

-- The process id should belong to either onbar_d, onsmsync, or onpsm

-- Can have Locked Objects without the catalog being locked

Page 34: Ugif 09 2013   psm

User Group Informix France

Example: Imported Restore (Export)Example: Imported Restore (Export)

� Run “onpsm -D list” and check that you have a device in the EXTPOOL

$ cd /work4/vegah/psm_export/backup_feb27_13_34_00

$ ls -1

export.bom <--- manifest file – contents look like an ixbar file of exported objects

vegah_tcp <--- contains directories called rootdbs, dbs1, … , critical files, 15

FILE HIGH --/-- EXTPOOL /work4/vegah/psm_export

onsmsync -E -p backup_feb27_13_34_00-t '2013-02-27 13:34:00'

SERVERNUM is 15.

• Look in EXTPOOL device (/work4/vegah/psm_export) for a subdirectory with the prefix you've specified

• Decide which generation of backups to export, and run onsmsync

Page 35: Ugif 09 2013   psm

User Group Informix France

Example: Imported Restore (Import)Example: Imported Restore (Import)

� Copy the exported directory (backup_feb27_13_34_00 ) to the EXTPOOL device of the PSM of the new instance to be restored

– onsmsync -I (capital i) command will import the backup objects from the EXTPOOL into the DBSPOOL, LOGPOOL (See notes for details.)

– Entries in the export.bom file will be used to create a new ixbar file

onsmsync -I -p backup_feb27_13_34_00

This command brings the objects from the EXTPOOL into the PSM catalog and into the PSM pools that are tracked in the catalog.

Page 36: Ugif 09 2013   psm

User Group Informix France

Example: Imported Restore (Import cont'd)Example: Imported Restore (Import cont'd)

� The instance into which the backup objects are being imported can have a different SERVERNUM and DBSERVERNAME.

� The new ixbar file that's created during the import operation will have the current instance's DBSERVERNAME.

� The imported logical log backup objects will be stored in PSM using the current instance's SERVERNUM

When the imported objects are brought into the new PSM catalog, they are brought in with the exact same copyid as in theexport.bom file. If the PSM catalog the objects are being imported into already have that copyid (object id) in use, then you will get an error.

Page 37: Ugif 09 2013   psm

User Group Informix France

Example: Imported Restore (Import cont'd)Example: Imported Restore (Import cont'd)

� Current instance DBSERVERNAME = vegah_new , servernum 30� Objects exported from DBSERVERNAME = vegah_tcp, servernum 15� onpsm -O list (after import operation)

Object ID Date Created Size (MB) Logical path (name.version)

1 2013-02-27 19:44:11 13.4 /vegah_new/rootdbs/0/vegah_new.1

2 2013-02-27 19:44:12 6.6 /vegah_new/30/3/vegah_new.1

...

31 2013-02-27 19:45:16 0.1 /vegah_new/critical_files/onconfig/vegah_new.4

32 2013-02-27 19:45:16 0.0 /vegah_new/critical_files/sqlhosts/vegah_new.4

229 2013-02-27 21:32:58 0.0 /vegah_tcp/30/45/vegah_tcp.1

230 2013-02-27 21:32:58 0.0 /vegah_tcp/30/46/vegah_tcp.1

231 2013-02-27 21:32:57 20.6 /vegah_tcp/rootdbs/0/vegah_tcp.1

232 2013-02-27 21:32:57 5.5 /vegah_tcp/dbs1/0/vegah_tcp.1

233 2013-02-27 21:32:58 5.5 /vegah_tcp/dbs3/0/vegah_tcp.1

234 2013-02-27 21:32:58 5.5 /vegah_tcp/dbs2/0/vegah_tcp.1

235 2013-02-27 21:32:58 0.1 /vegah_tcp/30/47/vegah_tcp.1

244 2013-02-27 21:32:58 0.1 /vegah_tcp/30/48/vegah_tcp.1

...

Page 38: Ugif 09 2013   psm

User Group Informix France

Local (PSM) vs Enterprise (TSM)Local (PSM) vs Enterprise (TSM)

Informix instance 1

Informix instance 2

PSM_CATALOG_PATH = /informix/psm_catalog

PSM storage must be locally visible.

Informix instance 1

PSM_CATALOG_PATH = /informix/psm_catalog1

Informix instance 2

PSM_CATALOG_PATH = /informix/psm_catalog2

PSM storage must be locally visible.

TSM Server

-- Enterprise storage server features

-- Manages multiple device types

-- May be part of an enterprise vault

Informix instance 1

Informix instance 2

TSM Client installed

Informix instance 1

Informix instance 2

TSM Client installed

Page 39: Ugif 09 2013   psm

User Group Informix France

onbar with Other Storage Managersonbar with Other Storage Managers

� PSM is not an enterprise storage manager� PSM only supports file system storage devices� Other storage managers

– May provide enterprise solutions and features

– May provide support for a variety of storage devices– May provide features like compression and encryption

-- Enterprise storage managers can provide benefits that PSM cannot.

-- For example, using an enterprise solution storage manager may mean that your Informix backups go directly into the enterprise storage vaults (something can’t go wrong between a successful Informix backup and a file system backup to storage vaults).

Page 40: Ugif 09 2013   psm

User Group Informix France

SummarySummary� With PSM, 12.1 allows users to set up their backups more easily

than ever before

� Faster backup and restore performance is possible with onbar/PSM(need to increase BAR_XFER_BUF_SIZE )

� onbar/PSM allows ontape users an easy migration path

� Can use onbar/PSM on test systems (even for those who use onbar with other storage managers)

� 12.1 provides the backup and restore option that people have been asking for

Page 41: Ugif 09 2013   psm

User Group Informix France

Questions and AnswersQuestions and Answers

PSM PSM Backup and Restore Backup and Restore faster and easier with Informix 12.1 faster and easier with Informix 12.1

Page 42: Ugif 09 2013   psm

User Group Informix France

MerciMerci

Frédéric [email protected]

Hyun-ju [email protected]

Jeudi 12 Septembre 2013Jeudi 12 Septembre 2013

Page 43: Ugif 09 2013   psm

User Group Informix France

Appendix: Miscellaneous Notes Appendix: Miscellaneous Notes

� Ontape

� Onbar

� SQL Admin API and PSM

Page 44: Ugif 09 2013   psm

User Group Informix France

OntapeOntape

� Simple to set up and run� Serial backup of dbspaces � Whole system backup only� STDIO (Informix 10 feature)� Backup to directories (Informix 11 feature)� Backup verification via stand-alone archecker� BACKUP_FILTER, RESTORE_FILTER

– ontape Logical Log backups support in 11.50.xC2� Backup to cloud (Amazon cloud aware)� SQL Admin API for ontape backup (11.70.xC2)

– Execute function task ("ontape archive", "/local/backup_dir/"); � OAT 2.73 (Configure ontape backup)

Page 45: Ugif 09 2013   psm

User Group Informix France

ontape ontape –– Quick SetupQuick Setup

� ontape backup to directory– Simple setup

– Option for non-interactive mode– No catalog – you need to keep track of restore info

In ONCONFIG:TAPEDEV /informix/backup_dirLTAPEDEV /informix/backup_dirALARMPROGRAM $INFORMIXDIR/etc/alarmprogram.sh

In alaramprogram.sh file:BACKUPLOGS=YBACKUP_CMD=“ontape –a –d”

Backup/archive files are created for you in TAPEDEV, LTAPEDEV directories.

Serial backups

Page 46: Ugif 09 2013   psm

User Group Informix France

onbar and storage manageronbar and storage manager

� onbar communicates with the Storage Manger via XBSA� Unattended operations – need to look at BAR_ACT_LOG� Multiple activity logs

– BAR_ACT_LOG– Storage manager activity logs

� BAR_BSALIB_PATH ONCONFIG– $INFORMIXDIR/lib/libbsapsm.[so]

� onbar can be used with other storage managers– For example, to use onbar with TSM, must install and configure the TSM

client on the database server machine and TSM server must be available

– Configure TSM and configure onbar to use TSM

– Set BAR_BSALIB_PATH ONCONFIG parameter to $INFORMIXDIR/lib/libtxbsa.[so]

PSM uses BAR_ACT_LOG by default !

For PSM

Page 47: Ugif 09 2013   psm

User Group Informix France

onbar ONCONFIG Parametersonbar ONCONFIG Parameters

� BAR_MAX_BACKUP– Determine number of parallel backup streams

– 0 is unlimited for backup and restore– rootdbs is always backed up first and by itself

� BAR_XFER_BUF_SIZE– Data transfer buffer size (value is in base page size)

– For PSM, this value can be as high as 32768 (for other storage managers, the max is 15 or 31, depending on platform)

� BAR_NB_XPORT_COUNT– Number of data transfer buffers PER backup stream

� BAR_ACT_LOG, BAR_DEBUG_LOG, BAR_DEBUG– PSM uses these by default

Page 48: Ugif 09 2013   psm

User Group Informix France

PSM PSM –– SQL Admin API commandsSQL Admin API commands

� onpsm commands can be run via SQL Admin API – Execute function sysadmin:task()– Execute function sysadmin:admin()

� Maximum of 6 arguments to task() and admin()� First argument is “onpsm”

Example: (in sysadmin database)

Execute function task("onpsm", "-D add", "/informix/backups", "-g DBSPOOL", "-t FILE");

Execute function task(“onpsm”, “-D list”);Execute function task (“onpsm”, “-version all”);