Difference between revisions of "SQWareProduction:mysql"
m (Updated by BatchUser) |
m (Updated by BatchUser) |
||
Line 86: | Line 86: | ||
{{SQWareProduction_sqwmys_RotateLogSlowQuery.ksh_presentation}} | {{SQWareProduction_sqwmys_RotateLogSlowQuery.ksh_presentation}} | ||
[[SQWareProduction:mysql:bin:sqwmys_RotateLogSlowQuery.ksh|See the detailed help for sqwmys_RotateLogSlowQuery.ksh]]<br><br> | [[SQWareProduction:mysql:bin:sqwmys_RotateLogSlowQuery.ksh|See the detailed help for sqwmys_RotateLogSlowQuery.ksh]]<br><br> | ||
+ | |||
+ | === sqwmys_RsyncBackup.ksh === | ||
+ | Script $gvsqw_MysBin/bin/sqwmys_RsyncBackup.ksh:<br> | ||
+ | {{SQWareProduction_sqwmys_RsyncBackup.ksh_presentation}} | ||
+ | [[SQWareProduction:mysql:bin:sqwmys_RsyncBackup.ksh|See the detailed help for sqwmys_RsyncBackup.ksh]]<br><br> | ||
=== sqwmys_RunJob.ksh === | === sqwmys_RunJob.ksh === | ||
Line 141: | Line 146: | ||
<br> | <br> | ||
[[SQWareProduction:mysql:lib:sqwmys_CopyDumpDatabase.lib|See the detailed help for sqwmys_CopyDumpDatabase.lib]]<br><br> | [[SQWareProduction:mysql:lib:sqwmys_CopyDumpDatabase.lib|See the detailed help for sqwmys_CopyDumpDatabase.lib]]<br><br> | ||
+ | |||
+ | === sqwmys_DumpAllDatabases.lib === | ||
+ | shell functions library $gvsqw_MysBin/../lib/sqwmys_DumpAllDatabases.lib:<br> | ||
+ | {{SQWareProduction_sqwmys_DumpAllDatabases.lib_presentation}} | ||
+ | {{SQWareProductionSurchargeLib|mysql|Mys|sqwmys_DumpAllDatabases.lib}} | ||
+ | <br> | ||
+ | [[SQWareProduction:mysql:lib:sqwmys_DumpAllDatabases.lib|See the detailed help for sqwmys_DumpAllDatabases.lib]]<br><br> | ||
=== sqwmys_DumpDatabase.lib === | === sqwmys_DumpDatabase.lib === | ||
Line 204: | Line 216: | ||
<br> | <br> | ||
[[SQWareProduction:mysql:lib:sqwmys_RotateLogSlowQuery.lib|See the detailed help for sqwmys_RotateLogSlowQuery.lib]]<br><br> | [[SQWareProduction:mysql:lib:sqwmys_RotateLogSlowQuery.lib|See the detailed help for sqwmys_RotateLogSlowQuery.lib]]<br><br> | ||
+ | |||
+ | === sqwmys_RsyncBackup.lib === | ||
+ | shell functions library $gvsqw_MysBin/../lib/sqwmys_RsyncBackup.lib:<br> | ||
+ | {{SQWareProduction_sqwmys_RsyncBackup.lib_presentation}} | ||
+ | {{SQWareProductionSurchargeLib|mysql|Mys|sqwmys_RsyncBackup.lib}} | ||
+ | <br> | ||
+ | [[SQWareProduction:mysql:lib:sqwmys_RsyncBackup.lib|See the detailed help for sqwmys_RsyncBackup.lib]]<br><br> | ||
=== sqwmys_SetEnv.lib === | === sqwmys_SetEnv.lib === |
Revision as of 15:48, 23 December 2016
Contents
- 1 Presentation
- 2 bin
- 2.1 sqwmys_AnalyzeAllDatabases.ksh
- 2.2 sqwmys_AnalyzeDatabase.ksh
- 2.3 sqwmys_CheckAllDatabases.ksh
- 2.4 sqwmys_CheckDatabase.ksh
- 2.5 sqwmys_CopyDumpAllDatabases.ksh
- 2.6 sqwmys_CopyDumpDatabase.ksh
- 2.7 sqwmys_DumpAllDatabases.ksh
- 2.8 sqwmys_DumpDatabase.ksh
- 2.9 sqwmys_GatherIndicators.ksh
- 2.10 sqwmys_NetBackup.ksh
- 2.11 sqwmys_OptimizeAllDatabases.ksh
- 2.12 sqwmys_OptimizeDatabase.ksh
- 2.13 sqwmys_ParallelRun.ksh
- 2.14 sqwmys_PurgeAlert.ksh
- 2.15 sqwmys_RestoreAllDatabases.ksh
- 2.16 sqwmys_RestoreDatabase.ksh
- 2.17 sqwmys_RotateLogSlowQuery.ksh
- 2.18 sqwmys_RsyncBackup.ksh
- 2.19 sqwmys_RunJob.ksh
- 3 etc
- 4 lib
- 4.1 sqwmys_CopyDumpDatabase.lib
- 4.2 sqwmys_DumpAllDatabases.lib
- 4.3 sqwmys_DumpDatabase.lib
- 4.4 sqwmys_GatherIndicators.lib
- 4.5 sqwmys_GatherIndicators_Overload.lib
- 4.6 sqwmys_GenerateCreateInstance.lib
- 4.7 sqwmys_Global.lib
- 4.8 sqwmys_NetBackup.lib
- 4.9 sqwmys_OptimizeDatabase.lib
- 4.10 sqwmys_RestoreDatabase.lib
- 4.11 sqwmys_RotateLogSlowQuery.lib
- 4.12 sqwmys_RsyncBackup.lib
- 4.13 sqwmys_SetEnv.lib
- 4.14 sqwmys_UpdateGLPI.lib
- 5 menu
- 6 tools
- 7 help
- 8 spm
Presentation
Usage
It's the module locally operating of mysql.
It is entirely written in ksh and sql.
It allows to manage the operation for mysql.
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 mysql
Explanation of directories
Directories located in $gvsqw_MysBin:
- 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
sqwmys_AnalyzeAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_AnalyzeAllDatabases.ksh:
Run of sqwmys_AnalyzeDatabase.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 sqwmys_AnalyzeAllDatabases.ksh
sqwmys_AnalyzeDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_AnalyzeDatabase.ksh:
Analyze of all tables for the database
Use command: analyse local table <TableName>
See the detailed help for sqwmys_AnalyzeDatabase.ksh
sqwmys_CheckAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_CheckAllDatabases.ksh:
check databases in parallel
See the detailed help for sqwmys_CheckAllDatabases.ksh
sqwmys_CheckDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_CheckDatabase.ksh:
mysqlcheck of database
See the detailed help for sqwmys_CheckDatabase.ksh
sqwmys_CopyDumpAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_CopyDumpAllDatabases.ksh:
copy of dump all databases in parallel
See the detailed help for sqwmys_CopyDumpAllDatabases.ksh
sqwmys_CopyDumpDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_CopyDumpDatabase.ksh:
copy of dump \$lvsqw_CopyType
See the detailed help for sqwmys_CopyDumpDatabase.ksh
sqwmys_DumpAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_DumpAllDatabases.ksh:
Run of sqwmys_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 sqwmys_DumpAllDatabases.ksh
sqwmys_DumpDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_DumpDatabase.ksh:
Generate mysqlDump of database compressed by pipe
Script makes purge of old generation automatically
You can also choose:
- different retention policy
- add option to mysqlDump command
- make Dump in consistent mode
See the detailed help for sqwmys_DumpDatabase.ksh
sqwmys_GatherIndicators.ksh
Script $gvsqw_MysBin/bin/sqwmys_GatherIndicators.ksh:
Gather MySql indicators and put them in SQWareRepository
Summary of collection:
- Volumetry of instance
- Volumetry of databases
- Volumetry (use, free) of FS
- Version, options, configuration, ... of instance
See the detailed help for sqwmys_GatherIndicators.ksh
sqwmys_NetBackup.ksh
Script $gvsqw_MysBin/bin/sqwmys_NetBackup.ksh:
backup with NetBackup dump/backup files
See the detailed help for sqwmys_NetBackup.ksh
sqwmys_OptimizeAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_OptimizeAllDatabases.ksh:
Run of sqwmys_OptimizeDatabase.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 sqwmys_OptimizeAllDatabases.ksh
sqwmys_OptimizeDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_OptimizeDatabase.ksh:
Reorganize of all tables for the database
Use command: optimize local table <TableName>
See the detailed help for sqwmys_OptimizeDatabase.ksh
sqwmys_ParallelRun.ksh
Script $gvsqw_MysBin/bin/sqwmys_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 sqwmys_ParallelRun.ksh
sqwmys_PurgeAlert.ksh
Script $gvsqw_MysBin/bin/sqwmys_PurgeAlert.ksh:
Rotate error log of instance
Archive and purge
See the detailed help for sqwmys_PurgeAlert.ksh
sqwmys_RestoreAllDatabases.ksh
Script $gvsqw_MysBin/bin/sqwmys_RestoreAllDatabases.ksh:
restore all databases in parallel
See the detailed help for sqwmys_RestoreAllDatabases.ksh
sqwmys_RestoreDatabase.ksh
Script $gvsqw_MysBin/bin/sqwmys_RestoreDatabase.ksh:
See the detailed help for sqwmys_RestoreDatabase.ksh
sqwmys_RotateLogSlowQuery.ksh
Script $gvsqw_MysBin/bin/sqwmys_RotateLogSlowQuery.ksh:
Rotate slow_query_log_file
Archive, purge and copy to SQWareWeb
You can choose to not copy to SQWareWeb
See the detailed help for sqwmys_RotateLogSlowQuery.ksh
sqwmys_RsyncBackup.ksh
Script $gvsqw_MysBin/bin/sqwmys_RsyncBackup.ksh:
rsync dir (without delete) to an other host
See the detailed help for sqwmys_RsyncBackup.ksh
sqwmys_RunJob.ksh
Script $gvsqw_MysBin/bin/sqwmys_RunJob.ksh:
Run MySQL scripts and generate log and error file
based on $gvsqw_RootCfg/sqwmys_Jobs.cfg configuration file
compress and purge oldest log files
See the detailed help for sqwmys_RunJob.ksh
etc
sqwmys_CreInst_CrontabRef.cfg
Configuration file $gvsqw_MysBin/../etc/sqwmys_CreInst_CrontabRef.cfg:
See the detailed help for sqwmys_CreInst_CrontabRef.cfg
sqwmys_CreInst_Jobs.cfg
Configuration file $gvsqw_MysBin/../etc/sqwmys_CreInst_Jobs.cfg:
See the detailed help for sqwmys_CreInst_Jobs.cfg
sqwmys_CreInst_MyCnf_51.cfg
Configuration file $gvsqw_MysBin/../etc/sqwmys_CreInst_MyCnf_51.cfg:
See the detailed help for sqwmys_CreInst_MyCnf_51.cfg
sqwmys_GlobalVar.cfg
Configuration file $gvsqw_MysBin/../etc/sqwmys_GlobalVar.cfg:
Global var for Mysql
It contains the operating variables of SQWareProduction.
See the detailed help for sqwmys_GlobalVar.cfg
.profile
Sample file for .profile $gvsqw_MysBin/../etc/.profile:
Sample of lines to add to .profile of mysql users.
See the detailed help for .profile
.profile_confort
File to put aliases $gvsqw_MysBin/../etc/.profile_confort:
Contains confort aliases of SQWareProduction for RDBMS mysql.
See the detailed help for .profile_confort
lib
sqwmys_CopyDumpDatabase.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_CopyDumpDatabase.lib:
lib for sqwmys_CopyDumpDatabase.ksh
See the detailed help for sqwmys_CopyDumpDatabase.lib
sqwmys_DumpAllDatabases.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_DumpAllDatabases.lib:
lib for sqwmys_DumpDatabase.ksh
See the detailed help for sqwmys_DumpAllDatabases.lib
sqwmys_DumpDatabase.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_DumpDatabase.lib:
lib for sqwmys_DumpDatabase.ksh
See the detailed help for sqwmys_DumpDatabase.lib
sqwmys_GatherIndicators.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_GatherIndicators.lib:
lib for sqwmys_GatherIndicators.ksh
See the detailed help for sqwmys_GatherIndicators.lib
sqwmys_GatherIndicators_Overload.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_GatherIndicators_Overload.lib:
lib for overLoad sqwmys_GatherIndicators.ksh
See the detailed help for sqwmys_GatherIndicators_Overload.lib
sqwmys_GenerateCreateInstance.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_GenerateCreateInstance.lib:
lib for generate create instance
See the detailed help for sqwmys_GenerateCreateInstance.lib
sqwmys_Global.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_Global.lib:
central lib of generic fonctions for mysql
See the detailed help for sqwmys_Global.lib
sqwmys_NetBackup.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_NetBackup.lib:
lib for sqwgen_NetBackup.ksh
See the detailed help for sqwmys_NetBackup.lib
sqwmys_OptimizeDatabase.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_OptimizeDatabase.lib:
lib for sqwmys_OptimizeDatabase.ksh
See the detailed help for sqwmys_OptimizeDatabase.lib
sqwmys_RestoreDatabase.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_RestoreDatabase.lib:
lib for sqwmys_RestoreDatabase.ksh
See the detailed help for sqwmys_RestoreDatabase.lib
sqwmys_RotateLogSlowQuery.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_RotateLogSlowQuery.lib:
lib for sqwmys_RotateLogSlowQuery.ksh
See the detailed help for sqwmys_RotateLogSlowQuery.lib
sqwmys_RsyncBackup.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_RsyncBackup.lib:
lib for sqwgen_RsyncBackup.ksh.ksh
See the detailed help for sqwmys_RsyncBackup.lib
sqwmys_SetEnv.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_SetEnv.lib:
fonction to set env for $MYSQL_SID
See the detailed help for sqwmys_SetEnv.lib
sqwmys_UpdateGLPI.lib
shell functions library $gvsqw_MysBin/../lib/sqwmys_UpdateGLPI.lib:
lib for sqwmys_Update$lvsqw_DbName.ksh
See the detailed help for sqwmys_UpdateGLPI.lib
tools
sqwmys_ConnectMsg.ksh
Script $gvsqw_MysBin/../tools/sqwmys_ConnectMsg.ksh:
startup message
See the detailed help for sqwmys_ConnectMsg.ksh
sqwmys_GenerateCreateInstance.ksh
Script $gvsqw_MysBin/../tools/sqwmys_GenerateCreateInstance.ksh:
Generate create instance files
See the detailed help for sqwmys_GenerateCreateInstance.ksh
sqwmys_MonitorAgentAdmin.ksh
Script $gvsqw_MysBin/../tools/sqwmys_MonitorAgentAdmin.ksh:
Mysql monitor agent services
See the detailed help for sqwmys_MonitorAgentAdmin.ksh
sqwmys_MysqlAdmin.ksh
Script $gvsqw_MysBin/../tools/sqwmys_MysqlAdmin.ksh:
stop/start of mysql services
See the detailed help for sqwmys_MysqlAdmin.ksh
sqwmys_SetEnv.ksh
Script $gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh:
set env for $MYSQL_SID
See the detailed help for sqwmys_SetEnv.ksh
sqwmys_TestMySQL.ksh
Script $gvsqw_MysBin/../tools/sqwmys_TestMySQL.ksh:
Generic test MySQL connection script
See the detailed help for sqwmys_TestMySQL.ksh
sqwmys_TestSendmail.ksh
Script $gvsqw_MysBin/../tools/sqwmys_TestSendmail.ksh:
Generic test sendmail script
See the detailed help for sqwmys_TestSendmail.ksh
sqwmys_UpdateGLPI.ksh
Script $gvsqw_MysBin/../tools/sqwmys_UpdateGLPI.ksh:
Update GLPI database
See the detailed help for sqwmys_UpdateGLPI.ksh
help
Contains help files for -s option of bin scripts.
spm
SQL query toolkit
See the detailed help for spm