SQWareProduction:postgres
Contents
- 1 Presentation
- 2 bin
- 2.1 sqwpg_AnalyzeAllDatabases.ksh
- 2.2 sqwpg_AnalyzeDatabase.ksh
- 2.3 sqwpg_CheckIndicators.ksh
- 2.4 sqwpg_DumpAllDatabases.ksh
- 2.5 sqwpg_DumpDatabase.ksh
- 2.6 sqwpg_DumpGlobalsOnly.ksh
- 2.7 sqwpg_GatherIndicators.ksh
- 2.8 sqwpg_ParallelRun.ksh
- 2.9 sqwpg_ReindexAllDatabases.ksh
- 2.10 sqwpg_ReindexDatabase.ksh
- 2.11 sqwpg_RunJob.ksh
- 2.12 sqwpg_VacuumAllDatabases.ksh
- 2.13 sqwpg_VacuumDatabase.ksh
- 3 etc
- 4 lib
- 4.1 sqwpg_CheckIndicators.lib
- 4.2 sqwpg_CheckIndicators_Overload.lib
- 4.3 sqwpg_DumpDatabase.lib
- 4.4 sqwpg_DumpGlobalsOnly.lib
- 4.5 sqwpg_GatherIndicators.lib
- 4.6 sqwpg_GatherIndicators_Overload.lib
- 4.7 sqwpg_GenerateCreateInstance.lib
- 4.8 sqwpg_Global.lib
- 4.9 sqwpg_InsertIndicators.lib
- 4.10 sqwpg_SetEnv.lib
- 5 menu
- 6 tools
- 7 help
- 8 spm
Presentation
Usage
It's the module locally operating of postgres.
It is entirely written in ksh and sql.
It allows to manage the operation for postgres.
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 postgres
Explanation of directories
Directories located in $gvsqw_PgBin:
- 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
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
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
sqwpg_AnalyzeAllDatabases.ksh
Script $gvsqw_PgBin/bin/sqwpg_AnalyzeAllDatabases.ksh:
Run of sqwpg_AnalyzeDatabase.ksh in parallel mode on all databases
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)
Filters to generate database list (you can mix all off them):
- Include list of database
- Exclude list of database
- Include like clause
- Exclude like clause
- Where clause
See the detailed help for sqwpg_AnalyzeAllDatabases.ksh
sqwpg_AnalyzeDatabase.ksh
Script $gvsqw_PgBin/bin/sqwpg_AnalyzeDatabase.ksh:
Update statistics of all tables for the database
Use command: analyse local table <TableName>
See the detailed help for sqwpg_AnalyzeDatabase.ksh
sqwpg_CheckIndicators.ksh
Script $gvsqw_PgBin/bin/sqwpg_CheckIndicators.ksh:
Checks the indicators collected by sqwpg_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 sqwpg_CheckIndicators.ksh
sqwpg_DumpAllDatabases.ksh
Script $gvsqw_PgBin/bin/sqwpg_DumpAllDatabases.ksh:
Run of sqwpg_DumpDatabase.ksh in parallel mode
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)
Filters to generate database list (you can mix all off them):
- Include list of database
- Exclude list of database
- Include like clause
- Exclude like clause
- Where clause
See the detailed help for sqwpg_DumpAllDatabases.ksh
sqwpg_DumpDatabase.ksh
Script $gvsqw_PgBin/bin/sqwpg_DumpDatabase.ksh:
Generate pg_dump of database
Script makes purge of old generation automatically
You can also choose:
- different retention policy
- add option to pg_dump command
- choose compressor
See the detailed help for sqwpg_DumpDatabase.ksh
sqwpg_DumpGlobalsOnly.ksh
Script $gvsqw_PgBin/bin/sqwpg_DumpGlobalsOnly.ksh:
Generate pg_dumpall -g (--globals-only) compressed by pipe
Script makes purge of old generation automatically
You can also choose:
- different retention policy
- add option to pg_dumpall command
- choose compressor
See the detailed help for sqwpg_DumpGlobalsOnly.ksh
sqwpg_GatherIndicators.ksh
Script $gvsqw_PgBin/bin/sqwpg_GatherIndicators.ksh:
Gather PostgreSQL indicators and put them in SQWareRepository
Summary of collection:
- Volumetry of instance
- Volumetry of databases
- Volumetry of tablespaces
- Volumetry of tables
- Volumetry (use, free) of FS
- Version, options, configuration, ... of instance
See the detailed help for sqwpg_GatherIndicators.ksh
sqwpg_ParallelRun.ksh
Script $gvsqw_PgBin/bin/sqwpg_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 sqwpg_ParallelRun.ksh
sqwpg_ReindexAllDatabases.ksh
Script $gvsqw_PgBin/bin/sqwpg_ReindexAllDatabases.ksh:
Run of sqwpg_ReindexDatabase.ksh in parallel mode
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)
Filters to generate database list (you can mix all off them):
- Include list of database
- Exclude list of database
- Include like clause
- Exclude like clause
- Where clause
See the detailed help for sqwpg_ReindexAllDatabases.ksh
sqwpg_ReindexDatabase.ksh
Script $gvsqw_PgBin/bin/sqwpg_ReindexDatabase.ksh:
Reorganize of all tables for the database
Use command: optimize local table <TableName>
See the detailed help for sqwpg_ReindexDatabase.ksh
sqwpg_RunJob.ksh
Script $gvsqw_PgBin/bin/sqwpg_RunJob.ksh:
Run PostgreSQL scripts and generate log and error file
based on $gvsqw_RootCfg/sqwpg_Jobs.cfg configuration file
compress and purge oldest log files
See the detailed help for sqwpg_RunJob.ksh
sqwpg_VacuumAllDatabases.ksh
Script $gvsqw_PgBin/bin/sqwpg_VacuumAllDatabases.ksh:
Run of sqwpg_VacuumDatabase.ksh in parallel mode
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)
Filters to generate database list (you can mix all off them):
- Include list of database
- Exclude list of database
- Include like clause
- Exclude like clause
- Where clause
See the detailed help for sqwpg_VacuumAllDatabases.ksh
sqwpg_VacuumDatabase.ksh
Script $gvsqw_PgBin/bin/sqwpg_VacuumDatabase.ksh:
VACUUM of all tables for the database
Use command: VACUUM
See the detailed help for sqwpg_VacuumDatabase.ksh
etc
sqwpg_CreInst_CrontabRef.cfg
Configuration file $gvsqw_PgBin/../etc/sqwpg_CreInst_CrontabRef.cfg:
See the detailed help for sqwpg_CreInst_CrontabRef.cfg
sqwpg_CreInst_Jobs.cfg
Configuration file $gvsqw_PgBin/../etc/sqwpg_CreInst_Jobs.cfg:
See the detailed help for sqwpg_CreInst_Jobs.cfg
sqwpg_DbRefVar.cfg
Configuration file $gvsqw_PgBin/../etc/sqwpg_DbRefVar.cfg:
Global var for indicators
It contains the operating variables of SQWareProduction.
See the detailed help for sqwpg_DbRefVar.cfg
sqwpg_GlobalVar.cfg
Configuration file $gvsqw_PgBin/../etc/sqwpg_GlobalVar.cfg:
Global var for Postgres
It contains the operating variables of SQWareProduction.
See the detailed help for sqwpg_GlobalVar.cfg
sqwpg_IndicatorsVar.cfg
Configuration file $gvsqw_PgBin/../etc/sqwpg_IndicatorsVar.cfg:
Global var for indicators scripts
It contains the operating variables of SQWareProduction.
See the detailed help for sqwpg_IndicatorsVar.cfg
.profile
Sample file for .profile $gvsqw_PgBin/../etc/.profile:
Sample of lines to add to .profile of postgres users.
See the detailed help for .profile
.profile_confort
File to put aliases $gvsqw_PgBin/../etc/.profile_confort:
Contains confort aliases of SQWareProduction for RDBMS postgres.
See the detailed help for .profile_confort
lib
sqwpg_CheckIndicators.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_CheckIndicators.lib:
lib for sqwpg_CheckIndicators.ksh
See the detailed help for sqwpg_CheckIndicators.lib
sqwpg_CheckIndicators_Overload.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_CheckIndicators_Overload.lib:
temple lib for overload sqwpg_CheckIndicators.ksh
See the detailed help for sqwpg_CheckIndicators_Overload.lib
sqwpg_DumpDatabase.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_DumpDatabase.lib:
lib for sqwpg_DumpDatabase.ksh
See the detailed help for sqwpg_DumpDatabase.lib
sqwpg_DumpGlobalsOnly.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_DumpGlobalsOnly.lib:
lib for sqwpg_DumpGlobalsOnly.ksh
See the detailed help for sqwpg_DumpGlobalsOnly.lib
sqwpg_GatherIndicators.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_GatherIndicators.lib:
lib for sqwpg_GatherIndicators.ksh
See the detailed help for sqwpg_GatherIndicators.lib
sqwpg_GatherIndicators_Overload.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_GatherIndicators_Overload.lib:
lib for overLoad sqwpg_GatherIndicators.ksh
See the detailed help for sqwpg_GatherIndicators_Overload.lib
sqwpg_GenerateCreateInstance.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_GenerateCreateInstance.lib:
lib for generate create instance
See the detailed help for sqwpg_GenerateCreateInstance.lib
sqwpg_Global.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_Global.lib:
central lib of generic fonctions for postgres
See the detailed help for sqwpg_Global.lib
sqwpg_InsertIndicators.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_InsertIndicators.lib:
generic fonctions to insert into referential
See the detailed help for sqwpg_InsertIndicators.lib
sqwpg_SetEnv.lib
shell functions library $gvsqw_PgBin/../lib/sqwpg_SetEnv.lib:
fonction to set env for $PG_SID
See the detailed help for sqwpg_SetEnv.lib
tools
sqwpg_GenerateCreateInstance.ksh
Script $gvsqw_PgBin/../tools/sqwpg_GenerateCreateInstance.ksh:
Generate create instance files
See the detailed help for sqwpg_GenerateCreateInstance.ksh
sqwpg_SetEnv.ksh
Script $gvsqw_PgBin/../tools/sqwpg_SetEnv.ksh:
set env for $PG_SID
See the detailed help for sqwpg_SetEnv.ksh
help
Contains help files for -s option of bin scripts.
spm
SQL query toolkit
See the detailed help for spm