SQWareProduction:db2

From Wiki_dbSQWare
Revision as of 22:19, 17 December 2012 by BatchUser (talk | contribs) (Updated by BatchUser)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Presentation

Usage

It's the module locally operating of db2.
It is entirely written in ksh and sql.
It allows to manage the operation for db2.
Example uses of the tool:

  • Backup
  • Recovery
  • Compute statistics
  • Indicators collection to store in referential database SQWareRepository
  • Rotate logs
  • ....

This module is deployed locally on the machine hosting the authorities to manage, in order to avoid any points of weakness related to an NFS mount or whatever. The deployment is done through a simple command SQWareCentral module using inventory located in SQWareRepository !
Installation guide for SQWareProduction for db2

Explanation of directories

Directories located in $gvsqw_D2db2Bin:

  • bin : Directory containing standard scripts
  • bin_cust : Directory containing customs scripts for your environnement
  • etc : Directory containing the standard files of configuration
  • etc_cust : Directory containing the customs files of configuration for your environnement (overload standards)
  • help : Directory containing the standard files of help
  • help_cust : Directory containing the customs files of help for your environnement
  • lib : Directory containing the generic shell function librairies
  • lib_cust : Directory containing the generic shell function librairies (overload standards)
  • spm : Contain sql query toolkit
  • tools : Directory containing the standard scripts used on an ad hoc
  • tools_cust : Directory containing the customs scripts used on an ad hoc for your environnement
  • menu : Directory containing the standard menus
  • menu_cust : Directory containing the custom menus for your environnement
Nuvola apps important.png
Warning:
Do not change the standard scripts and configuration files of dbSQWare.

Use directories *_cust for customizations. This will facilitate version upgrades.


Naming convention of files

The majority of files are named with suffixes:

  • *.ksh : for scripts
  • *.cfg : for configuration files
  • *.lib : for function librairies
  • *.hlp : for help files
Nuvola apps important.png
Warning:
Do not change the standard scripts and configuration files of dbSQWare.

Use directories *_cust for customizations. This will facilitate version upgrades.


Naming convention in scripts

In general, the following naming convention is used in all scripts of SQWareProduction:

  • gvsqw_ {} : global variable initialized by the environment and / or generic library
  • lvsqw_ {} : local variable initialized by the script and / or a specific library
  • gfsqw_ {} : function defined by a generic library
  • lfsqw_ {} : function defined by the script and / or a specific library

bin

sqwdb2_BackupAllDatabases.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_BackupAllDatabases.ksh:

Run of sqwdb2_BackupDatabase.ksh in // mode
You can choose:

  • The parallel degree
  • Aggressiveness of run (number of seconds between two run)
  • Aggressiveness of check end (number of seconds between two check of end)


Filters to generate database list (you can mix all off them):

  • Include list of database
  • Exclude list of database

See the detailed help for sqwdb2_BackupAllDatabases.ksh

sqwdb2_BackupDatabase.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_BackupDatabase.ksh:

Generate db2Dump compressed by PIPE
Script makes purge of old generation automatically
You can also choose:

  • different retention policy with -O and -T
  • use different support with -TC

See the detailed help for sqwdb2_BackupDatabase.ksh

sqwdb2_CheckIndicators.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_CheckIndicators.ksh:

Checks the indicators collected by sqwdb2_GatherIndicators.ksh
indicators are stored in SQWareRepository
generates email in html format with links to SQWareWeb
Standards checks:

  • Instances without indicators
  • Usage rate of FS
  • Instances without backup succeed since ${gvsqw_NbDaysFull} days
  • Databases without backup full succeed since ${gvsqw_NbDaysFull} days

See the detailed help for sqwdb2_CheckIndicators.ksh

sqwdb2_GatherIndicators.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_GatherIndicators.ksh:

Gather Db2 indicators and put them in SQWareRepository
Summary of collection:

  • Volumetry of instance
  • Volumetrys
  • Volumetry (use, free) of FS
  • Version, options, configuration, ... of instance

See the detailed help for sqwdb2_GatherIndicators.ksh

sqwdb2_ParallelRun.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_ParallelRun.ksh:

Manages the execution of unix commands in parallel mode
Takes in parameter file with unix command to execute
You can choose:

  • The parallel degree
  • Aggressiveness of run (number of seconds between two runs)
  • Aggressiveness of check end (number of seconds between two checks of end)


See the detailed help for sqwdb2_ParallelRun.ksh

sqwdb2_ReorganizeAllDatabases.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_ReorganizeAllDatabases.ksh:

Run of sqwdb2_ReorganizeDatabase.ksh in // mode
You can choose:

  • The parallel degree
  • Aggressiveness of run (number of seconds between two run)
  • Aggressiveness of check end (number of seconds between two check of end)


Filters to generate database list (you can mix all off them):

  • Include list of database
  • Exclude list of database

See the detailed help for sqwdb2_ReorganizeAllDatabases.ksh

sqwdb2_ReorganizeDatabase.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_ReorganizeDatabase.ksh:

Reorganize of all tables for the instance
Use command: reorg table <TableName> See the detailed help for sqwdb2_ReorganizeDatabase.ksh

sqwdb2_RunJob.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_RunJob.ksh:

Run Db2 scripts and generate log and error file
based on $gvsqw_RootCfg/sqwdb2_Jobs.cfg configuration file
compress and purge oldest log files See the detailed help for sqwdb2_RunJob.ksh

sqwdb2_RunStatsAllDatabases.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_RunStatsAllDatabases.ksh:

Run of sqwdb2_RunStatsDatabase.ksh in // mode
You can choose:

  • The parallel degree
  • Aggressiveness of run (number of seconds between two run)
  • Aggressiveness of check end (number of seconds between two check of end)


Filters to generate database list (you can mix all off them):

  • Include list of database
  • Exclude list of database

See the detailed help for sqwdb2_RunStatsAllDatabases.ksh

sqwdb2_RunStatsDatabase.ksh

Script $gvsqw_D2db2Bin/bin/sqwdb2_RunStatsDatabase.ksh:

RUNSTATS of all tables for the instance
Use command: RUNSTATS table <TableName> See the detailed help for sqwdb2_RunStatsDatabase.ksh


etc

sqwdb2_CreInst_CrontabRef.cfg

Configuration file $gvsqw_D2db2Bin/../etc/sqwdb2_CreInst_CrontabRef.cfg:


See the detailed help for sqwdb2_CreInst_CrontabRef.cfg

sqwdb2_CreInst_Jobs.cfg

Configuration file $gvsqw_D2db2Bin/../etc/sqwdb2_CreInst_Jobs.cfg:


See the detailed help for sqwdb2_CreInst_Jobs.cfg

sqwdb2_DbRefVar.cfg

Configuration file $gvsqw_D2db2Bin/../etc/sqwdb2_DbRefVar.cfg:
Global var for indicators
It contains the operating variables of SQWareProduction.

Nuvola apps information.png
Note:
You can overload variables contain in $gvsqw_D2db2Bin/../etc/sqwdb2_DbRefVar.cfg

by the same variables in $gvsqw_D2db2Bin/../etc_cust/sqwdb2_DbRefVar.cfg for all your environnement
or in $HOME/sqwConfig/sqwdb2_DbRefVar.cfg specifically for this user.

See the detailed help for sqwdb2_DbRefVar.cfg

sqwdb2_GlobalVar.cfg

Configuration file $gvsqw_D2db2Bin/../etc/sqwdb2_GlobalVar.cfg:
Global var for Db2
It contains the operating variables of SQWareProduction.

Nuvola apps information.png
Note:
You can overload variables contain in $gvsqw_D2db2Bin/../etc/sqwdb2_GlobalVar.cfg

by the same variables in $gvsqw_D2db2Bin/../etc_cust/sqwdb2_GlobalVar.cfg for all your environnement
or in $HOME/sqwConfig/sqwdb2_GlobalVar.cfg specifically for this user.

See the detailed help for sqwdb2_GlobalVar.cfg

sqwdb2_IndicatorsVar.cfg

Configuration file $gvsqw_D2db2Bin/../etc/sqwdb2_IndicatorsVar.cfg:
Global var for indicators scripts
It contains the operating variables of SQWareProduction.

Nuvola apps information.png
Note:
You can overload variables contain in $gvsqw_D2db2Bin/../etc/sqwdb2_IndicatorsVar.cfg

by the same variables in $gvsqw_D2db2Bin/../etc_cust/sqwdb2_IndicatorsVar.cfg for all your environnement
or in $HOME/sqwConfig/sqwdb2_IndicatorsVar.cfg specifically for this user.

See the detailed help for sqwdb2_IndicatorsVar.cfg

.profile

Sample file for .profile $gvsqw_D2db2Bin/../etc/.profile:
Sample of lines to add to .profile of db2 users.
See the detailed help for .profile

.profile_confort

File to put aliases $gvsqw_D2db2Bin/../etc/.profile_confort:
Contains confort aliases of SQWareProduction for RDBMS db2.

Nuvola apps information.png
Note:
You can overload confort environnement $gvsqw_D2db2Bin/../etc/.profile_confort

with $gvsqw_D2db2Bin/../etc_cust/.profile_confort for all your environnement
or with $HOME/edtConfig/.profile_confort specifically for this user .


See the detailed help for .profile_confort


lib

sqwdb2_BackupDatabase.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_BackupDatabase.lib:
lib for sqwdb2_BackupDatabase.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_BackupDatabase.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_BackupDatabase.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_BackupDatabase.lib specifically for this user .


See the detailed help for sqwdb2_BackupDatabase.lib

sqwdb2_CheckIndicators.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_CheckIndicators.lib:
lib for sqwdb2_CheckIndicators.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_CheckIndicators.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_CheckIndicators.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_CheckIndicators.lib specifically for this user .


See the detailed help for sqwdb2_CheckIndicators.lib

sqwdb2_CheckIndicators_Overload.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_CheckIndicators_Overload.lib:
temple lib for overload sqwdb2_CheckIndicators.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_CheckIndicators_Overload.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_CheckIndicators_Overload.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_CheckIndicators_Overload.lib specifically for this user .


See the detailed help for sqwdb2_CheckIndicators_Overload.lib

sqwdb2_GatherIndicators.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_GatherIndicators.lib:
lib for sqwdb2_GatherIndicators.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_GatherIndicators.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_GatherIndicators.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_GatherIndicators.lib specifically for this user .


See the detailed help for sqwdb2_GatherIndicators.lib

sqwdb2_GatherIndicators_Overload.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_GatherIndicators_Overload.lib:
lib for overLoad sqwdb2_GatherIndicators.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_GatherIndicators_Overload.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_GatherIndicators_Overload.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_GatherIndicators_Overload.lib specifically for this user .


See the detailed help for sqwdb2_GatherIndicators_Overload.lib

sqwdb2_GenerateCreateInstance.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_GenerateCreateInstance.lib:
lib for generate create instance

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_GenerateCreateInstance.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_GenerateCreateInstance.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_GenerateCreateInstance.lib specifically for this user .


See the detailed help for sqwdb2_GenerateCreateInstance.lib

sqwdb2_Global.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_Global.lib:
central lib of generic fonctions for db2

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_Global.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_Global.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_Global.lib specifically for this user .


See the detailed help for sqwdb2_Global.lib

sqwdb2_InsertIndicators.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_InsertIndicators.lib:
generic fonctions to insert into referential

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_InsertIndicators.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_InsertIndicators.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_InsertIndicators.lib specifically for this user .


See the detailed help for sqwdb2_InsertIndicators.lib

sqwdb2_ReorganizeDatabase.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_ReorganizeDatabase.lib:
lib for sqwdb2_ReorganizeDatabase.ksh

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_ReorganizeDatabase.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_ReorganizeDatabase.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_ReorganizeDatabase.lib specifically for this user .


See the detailed help for sqwdb2_ReorganizeDatabase.lib

sqwdb2_SetEnv.lib

shell functions library $gvsqw_D2db2Bin/../lib/sqwdb2_SetEnv.lib:
fonction to set env for $lvsqw_InstanceParam

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_D2db2Bin/../lib/sqwdb2_SetEnv.lib

by function with same name in $gvsqw_D2db2Bin/../lib_cust/sqwdb2_SetEnv.lib for all your environnement
or by $HOME/sqwConfig/sqwdb2_SetEnv.lib specifically for this user .


See the detailed help for sqwdb2_SetEnv.lib


menu


tools

sqwdb2_GenerateCreateInstance.ksh

Script $gvsqw_D2db2Bin/../tools/sqwdb2_GenerateCreateInstance.ksh:
Generate create instance files See the detailed help for sqwdb2_GenerateCreateInstance.ksh

sqwdb2_SetEnv.ksh

Script $gvsqw_D2db2Bin/../tools/sqwdb2_SetEnv.ksh:
set env for $lvsqw_InstanceParam

Nuvola apps information.png
Note:
You can replace the file in $gvsqw_D2db2Bin/../tools/sqwdb2_SetEnv.ksh

by $gvsqw_D2db2Bin/../tools_cust/sqwdb2_SetEnv.ksh for all your environnement
or by $HOME/edtConfig/sqwdb2_SetEnv.ksh specifically for this user .

See the detailed help for sqwdb2_SetEnv.ksh


help

Contains help files for -s option of bin scripts.


spm

SQL query toolkit
See the detailed help for spm