Difference between revisions of "SQWareProduction:mssql"
m (Updated by Expdbtools) |
m (Updated by Expdbtools) |
||
Line 192: | Line 192: | ||
== tools == | == tools == | ||
+ | === sqwmsq_SetEnv.ksh === | ||
+ | Script $gvsqw_MssBin/../tools/sqwmsq_SetEnv.ksh:<br> | ||
+ | {{SQWareProduction_sqwmsq_SetEnv.ksh_presentation}} | ||
+ | <br> | ||
+ | {{SQWareProductionSurchargeToo|mssql|Mss|sqwmsq_SetEnv.ksh}} | ||
+ | [[SQWareProduction:mssql:tools:sqwmsq_SetEnv.ksh|See the detailed help for sqwmsq_SetEnv.ksh]]<br><br> | ||
+ | |||
<br> | <br> | ||
Revision as of 23:39, 22 December 2010
Contents
- 1 Presentation
- 2 bin
- 2.1 sqwmsq_BackupAllDatabases.ksh
- 2.2 sqwmsq_BackupDatabase.ksh
- 2.3 sqwmsq_CheckdbAllDatabases.ksh
- 2.4 sqwmsq_CheckdbDatabase.ksh
- 2.5 sqwmsq_CheckIndicators.ksh
- 2.6 sqwmsq_GatherIndicators.ksh
- 2.7 sqwmsq_ParallelRun.ksh
- 2.8 sqwmsq_RebuildIndexAllDatabases.ksh
- 2.9 sqwmsq_RebuildIndexDatabase.ksh
- 2.10 sqwmsq_RestoreAllDatabases.ksh
- 2.11 sqwmsq_RestoreDatabase.ksh
- 2.12 sqwmsq_RotateErrorLog.ksh
- 2.13 sqwmsq_RunJob.ksh
- 2.14 sqwmsq_StatisticsAllDatabases.ksh
- 2.15 sqwmsq_StatisticsDatabase.ksh
- 3 etc
- 4 lib
- 5 menu
- 6 tools
- 7 help
- 8 spm
Presentation
Usage
It's the module locally operating of mssql.
It is entirely written in ksh and sql.
It allows to manage the operation for mssql.
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 mssql
Explanation of directories
Directories located in $gvsqw_MssBin:
- 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
sqwmsq_BackupAllDatabases.ksh
Script $gvsqw_MssBin/bin/sqwmsq_BackupAllDatabases.ksh:
Run of sqwmsq_BackupDatabase.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 sqwmsq_BackupAllDatabases.ksh
sqwmsq_BackupDatabase.ksh
Script $gvsqw_MssBin/bin/sqwmsq_BackupDatabase.ksh:
Generate backup database
You can choose type of backup (by default full):
- full
- log
- diff
Script automatically determine how many stripes
Makes purges of backup generations
You can change default values:
- change Path to put backup (by default: 'HKEY_LOCAL_MACHINE', 'BackupDirectory')
- force number of stripes
- size max of a stripe
- number of backup generations to keep online
See the detailed help for sqwmsq_BackupDatabase.ksh
sqwmsq_CheckdbAllDatabases.ksh
Script $gvsqw_MssBin/bin/sqwmsq_CheckdbAllDatabases.ksh:
Run of sqwmsq_CheckdbDatabase.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 sqwmsq_CheckdbAllDatabases.ksh
sqwmsq_CheckdbDatabase.ksh
Script $gvsqw_MssBin/bin/sqwmsq_CheckdbDatabase.ksh:
Generate checkdb commands on the database
See the detailed help for sqwmsq_CheckdbDatabase.ksh
sqwmsq_CheckIndicators.ksh
Script $gvsqw_MssBin/bin/sqwmsq_CheckIndicators.ksh:
Checks the indicators collected by sqwmsq_GatherIndicators.ksh
indicators are stored in SQWareRepository
generates email in html format with links to SQWareWeb
Standards checks:
- Instances without indicators
- Usage rate of databases
- Instances without backup succeed since ${gvsqw_NbDaysFull} days
- Databases without backup full succeed since ${gvsqw_NbDaysFull} days
See the detailed help for sqwmsq_CheckIndicators.ksh
sqwmsq_GatherIndicators.ksh
Script $gvsqw_MssBin/bin/sqwmsq_GatherIndicators.ksh:
Gather MsSql indicators and put them in SQWareRepository
Summary of collection:
- Volumetry (use, free) of instance
- Volumetry (use, free) of databases
- Volumetry (use, free) of files
- Version, options, configuration, ... of instance
See the detailed help for sqwmsq_GatherIndicators.ksh
sqwmsq_ParallelRun.ksh
Script $gvsqw_MssBin/bin/sqwmsq_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 sqwmsq_ParallelRun.ksh
sqwmsq_RebuildIndexAllDatabases.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RebuildIndexAllDatabases.ksh:
Run of sqwmsq_RebuildIndexDatabase.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 sqwmsq_RebuildIndexAllDatabases.ksh
sqwmsq_RebuildIndexDatabase.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RebuildIndexDatabase.ksh:
Rebuild indexes for all databases
version = 2000 -> Dbcc dbreindex (N'[$lvsqw_Owner].[$lvsqw_TableName]',,90)
version >= 2005 -> alter index all on [$lvsqw_Owner].[$lvsqw_TableName] Rebuild with (online = off)
See the detailed help for sqwmsq_RebuildIndexDatabase.ksh
sqwmsq_RestoreAllDatabases.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RestoreAllDatabases.ksh:
Run of sqwmsq_RestoreDatabase.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 sqwmsq_RestoreAllDatabases.ksh
sqwmsq_RestoreDatabase.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RestoreDatabase.ksh:
Standard database restore MsSql
script dynamically find backup files to restore
and makes a synchronisation of users/logins
The script can also:
- choose backup file
- change Path to find backup to restore (by default: 'HKEY_LOCAL_MACHINE', 'BackupDirectory')
- run shell script before restore
- run shell script after restore
See the detailed help for sqwmsq_RestoreDatabase.ksh
sqwmsq_RotateErrorLog.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RotateErrorLog.ksh:
Rotate errorlog and put history configuration
See the detailed help for sqwmsq_RotateErrorLog.ksh
sqwmsq_RunJob.ksh
Script $gvsqw_MssBin/bin/sqwmsq_RunJob.ksh:
Run MsSql scripts and generate log and error file
based on $gvsqw_RootCfg/sqwmsq_Jobs.cfg configuration file
compress and purge oldest log files
See the detailed help for sqwmsq_RunJob.ksh
sqwmsq_StatisticsAllDatabases.ksh
Script $gvsqw_MssBin/bin/sqwmsq_StatisticsAllDatabases.ksh:
Run of sqwmsq_StatisticsDatabase.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 sqwmsq_StatisticsAllDatabases.ksh
sqwmsq_StatisticsDatabase.ksh
Script $gvsqw_MssBin/bin/sqwmsq_StatisticsDatabase.ksh:
Update Statistics for all tables of the database
Use command: update statistics [$lvsqw_Owner].[$lvsqw_TableName] with fullscan, all
See the detailed help for sqwmsq_StatisticsDatabase.ksh
etc
sqwmsq_DbRefVar.cfg
Configuration file $gvsqw_MssBin/../etc/sqwmsq_DbRefVar.cfg:
Global var for indicators
It contains the operating variables of SQWareProduction.
See the detailed help for sqwmsq_DbRefVar.cfg
sqwmsq_GlobalVar.cfg
Configuration file $gvsqw_MssBin/../etc/sqwmsq_GlobalVar.cfg:
Global var for Mssql
It contains the operating variables of SQWareProduction.
See the detailed help for sqwmsq_GlobalVar.cfg
sqwmsq_IndicatorsVar.cfg
Configuration file $gvsqw_MssBin/../etc/sqwmsq_IndicatorsVar.cfg:
Global var for indicators scripts
It contains the operating variables of SQWareProduction.
See the detailed help for sqwmsq_IndicatorsVar.cfg
sqwmsq_Jobs.cfg
Configuration file $gvsqw_MssBin/../etc/sqwmsq_Jobs.cfg:
See the detailed help for sqwmsq_Jobs.cfg
.profile
Sample file for .profile $gvsqw_MssBin/../etc/.profile:
Sample of lines to add to .profile of mssql users.
See the detailed help for .profile
.profile_confort
File to put aliases $gvsqw_MssBin/../etc/.profile_confort:
Contains confort aliases of SQWareProduction for RDBMS mssql.
See the detailed help for .profile_confort
lib
sqwmsq_BackupDatabase.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_BackupDatabase.lib:
lib for sqwmsq_BackupDatabase.ksh
See the detailed help for sqwmsq_BackupDatabase.lib
sqwmsq_CheckIndicators.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_CheckIndicators.lib:
lib for sqwmsq_CheckIndicators.ksh
See the detailed help for sqwmsq_CheckIndicators.lib
sqwmsq_CheckIndicators_Overload.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_CheckIndicators_Overload.lib:
temple lib for overload sqwmsq_CheckIndicators.ksh
See the detailed help for sqwmsq_CheckIndicators_Overload.lib
sqwmsq_GatherIndicators.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_GatherIndicators.lib:
lib for sqwmsq_GatherIndicators.ksh
See the detailed help for sqwmsq_GatherIndicators.lib
sqwmsq_GatherIndicators_Overload.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_GatherIndicators_Overload.lib:
lib for overLoad sqwmsq_GatherIndicators.ksh
See the detailed help for sqwmsq_GatherIndicators_Overload.lib
sqwmsq_Global.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_Global.lib:
central lib of generic fonctions for mssql
See the detailed help for sqwmsq_Global.lib
sqwmsq_InsertIndicators.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_InsertIndicators.lib:
generic fonctions to insert into referential
See the detailed help for sqwmsq_InsertIndicators.lib
sqwmsq_RestoreDatabase.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_RestoreDatabase.lib:
lib for sqwmsq_RestoreDatabase.ksh
See the detailed help for sqwmsq_RestoreDatabase.lib
sqwmsq_SetEnv.lib
shell functions librairy $gvsqw_MssBin/../lib/sqwmsq_SetEnv.lib:
fonction to set env for Mssql
See the detailed help for sqwmsq_SetEnv.lib
tools
sqwmsq_SetEnv.ksh
Script $gvsqw_MssBin/../tools/sqwmsq_SetEnv.ksh:
set env for AliasFreeTds
See the detailed help for sqwmsq_SetEnv.ksh
help
Contains help files for -s option of bin scripts.
spm
SQL query toolkit
See the detailed help for spm