Difference between revisions of "SQWareCentral:mysql"

From Wiki_dbSQWare
Jump to: navigation, search
m (Updated by Expdbtools)
Line 1: Line 1:
{{SQWareCentralPresSgbd|mysql}}
 
 
 
== auto ==
 
== auto ==
 
=== sqwmys_DeplScripts.ksh ===
 
=== sqwmys_DeplScripts.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_DeplScripts.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_DeplScripts.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_DeplScripts.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_DeplScripts.ksh.<br>
Deploiement de SQWareProduction pour Mysql
+
SQWareProduction deployment for Mysql
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 17: Line 15:
 
mkdir -p $gvsqw_RootSQWareProductionMysql/$gvsqw_VersDeplSQWareProductionMysql
 
mkdir -p $gvsqw_RootSQWareProductionMysql/$gvsqw_VersDeplSQWareProductionMysql
 
cd $gvsqw_RootSQWareProductionMysql
 
cd $gvsqw_RootSQWareProductionMysql
ln -sf $gvsqw_VersDeplSQWareProductionMysql $gvsqw_VersSQWareProductionMysql
+
rm -f $gvsqw_VersSQWareProductionMysql
 +
ln -s $gvsqw_VersDeplSQWareProductionMysql $gvsqw_VersSQWareProductionMysql
 
EOFSSH
 
EOFSSH
 
rsync -aHv $gvsqw_RsyncPathMysql --delete $gvsqw_RootSQWareProduction/mysql/$gvsqw_VersDeplSQWareProductionMysql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMysql/.
 
rsync -aHv $gvsqw_RsyncPathMysql --delete $gvsqw_RootSQWareProduction/mysql/$gvsqw_VersDeplSQWareProductionMysql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMysql/.
Line 25: Line 24:
 
<br>
 
<br>
 
=== sqwmys_GatherIndicators.ksh ===
 
=== sqwmys_GatherIndicators.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_GatherIndicators.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_GatherIndicators.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_GatherIndicators.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_GatherIndicators.ksh.<br>
Collecte des indicateurs Mysql
+
Mysql gather indicators
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 37: Line 36:
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A IndicDba
+
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A IndicDba
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 48: Line 47:
 
<br>
 
<br>
 
=== sqwmys_PurgeAlert.ksh ===
 
=== sqwmys_PurgeAlert.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_PurgeAlert.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_PurgeAlert.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_PurgeAlert.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_PurgeAlert.ksh.<br>
Rotation erreur log Mysql
+
Mysql rotate error log
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 60: Line 59:
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A PurgeAlert
+
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A PurgeAlert
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 71: Line 70:
 
<br>
 
<br>
 
=== sqwmys_SlowQuery.ksh ===
 
=== sqwmys_SlowQuery.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_SlowQuery.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_SlowQuery.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_SlowQuery.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_SlowQuery.ksh.<br>
Rotation slow query log Mysql
+
Mysql rotate slow query log
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 83: Line 82:
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
 
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A SlowQuery
+
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A SlowQuery
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 96: Line 95:
  
 
== etc ==
 
== etc ==
 +
=== CrontabRef.cfg ===
 +
Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/CrontabRef.cfg:<br>
 +
It contains the operating variables of SQWareCentral for mysql.<br>
 +
If you want to overload default variables,<br>
 +
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/CrontabRef.cfg<br>
 +
your modifications (only variables you want to modify).<br>
 +
<br>
 +
File content:
 +
<pre>
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
</pre>
 +
<br>
 
=== sqwc_DbRefVar.cfg ===
 
=== sqwc_DbRefVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_DbRefVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_DbRefVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.<br>
+
It contains the operating variables of SQWareCentral for mysql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_DbRefVar.cfg.<br>
+
If you want to overload default variables,<br>
{{Information | Vous dévez forcément adapter ce fichier à votre environnement}}
+
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_DbRefVar.cfg<br>
gvsqw_DbRefDatabase_mysql => Database du referentiel [par défaut: 'DatabaseInstanceNameForMysql']
+
your modifications (only variables you want to modify).<br>
gvsqw_DbRefInstance_mysql => Instance du referentiel [par défaut: 'InstanceNameForMysql']
+
<br>
gvsqw_DbRefPass_mysql => Mot de passe de connexion au referentiel [par défaut: 'ConnexionPassForMysql']
+
File content:
gvsqw_DbRefPort_mysql => Port du referentiel [par défaut: 'InstancePortForMysql']
+
<pre>
gvsqw_DbRefType_mysql => Type de referentiel [par défaut: 'mysql']
+
export gvsqw_DbRefType_mysql='mysql'
gvsqw_DbRefUser_mysql => User de connexion au referentiel [par défaut: 'ConnexionUserForMysql']
+
export gvsqw_DbRefPort_mysql='InstancePortForMysql'
 +
export gvsqw_DbRefInstance_mysql='InstanceNameForMysql'
 +
export gvsqw_DbRefDatabase_mysql='DatabaseInstanceNameForMysql'
 +
export gvsqw_DbRefUser_mysql='ConnexionUserForMysql'
 +
export gvsqw_DbRefPass_mysql='ConnexionPassForMysql'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_DbRefDatabase_mysql =>
 +
gvsqw_DbRefInstance_mysql =>
 +
gvsqw_DbRefPass_mysql =>
 +
gvsqw_DbRefPort_mysql =>  
 +
gvsqw_DbRefType_mysql =>  
 +
gvsqw_DbRefUser_mysql =>  
 +
</pre>
 
<br>
 
<br>
 
 
=== sqwc_ExpVar.cfg ===
 
=== sqwc_ExpVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_ExpVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_ExpVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.<br>
+
It contains the operating variables of SQWareCentral for mysql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_ExpVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_MailMsg_mysql => message de début de sujet de mail [par défaut: 'TrtMysqlAuto']
+
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_ExpVar.cfg<br>
gvsqw_Mail_mysql => adresse pour envoi des mails [par défaut: 'dba']
+
your modifications (only variables you want to modify).<br>
gvsqw_RootSQWareProductionMysql => Répertoire de déploiement de SQWareProduction [par défaut: "~$gvsqw_UserUniqueMysql/SQWareProduction/mysql"]
+
<br>
gvsqw_VersDeplSQWareProductionMysql => Version de SQWareProduction à déployer  [par défaut: 'v1.1']
+
File content:
gvsqw_VersSQWareProductionMysql => Lien utilisé pour la version courante [par défaut: 'prod']
+
<pre>
 +
export gvsqw_RootSQWareProductionMysql="~$gvsqw_UserUniqueMysql/SQWareProduction/mysql"
 +
export gvsqw_VersSQWareProductionMysql='prod'
 +
export gvsqw_VersDeplSQWareProductionMysql='v1.2'
 +
export gvsqw_Mail_mysql='dba'
 +
export gvsqw_MailMsg_mysql='TrtMysqlAuto'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_MailMsg_mysql =>
 +
gvsqw_Mail_mysql =>
 +
gvsqw_RootSQWareProductionMysql =>
 +
gvsqw_VersDeplSQWareProductionMysql =>
 +
gvsqw_VersSQWareProductionMysql =>  
 +
</pre>
 
<br>
 
<br>
 
 
=== sqwc_GlobalVar.cfg ===
 
=== sqwc_GlobalVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_GlobalVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_GlobalVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.<br>
+
It contains the operating variables of SQWareCentral for mysql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_GlobalVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_UserUniqueMysql => User Unix generique (unique) de deploiement [par défaut: 'sysdba']
+
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_GlobalVar.cfg<br>
 +
your modifications (only variables you want to modify).<br>
 +
<br>
 +
File content:
 +
<pre>
 +
export gvsqw_UserUniqueMysql='sysdba'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_UserUniqueMysql =>
 +
</pre>
 
<br>
 
<br>
 
 
=== .profile_confort ===
 
=== .profile_confort ===
Fichier de positionnement d'alias $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:<br>
+
File to put aliases $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:<br>
Il contient les alias de confort de SQWareCentral pour le SGBD mysql.<br>
+
File to put aliases $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:<br>
Peut-être surchargé par $gvsqw_RootexpdbCentral/action/mysql/etc_cust/.profile_confort.<br>
+
Contains confort aliases of SQWareCentral for RDBMS mysql.<br>
act_mys => 'cd $gvsqw_RootexpdbCentral/action/mysql/prod;ls -al'
+
Contains confort aliases of SQWareCentral for RDBMS mysql.<br>
depl_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_DeplScripts.ksh sqwmys_GenLstUnique.ksh NOLOG CONFIRM'
+
<br>
gen_mys => '$gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh'
+
Alias explanation:
repind_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_GatherIndicators.ksh sqwmys_GenLstRepind.ksh NOLOG'
+
<pre>
 +
  act_mys => 'cd $gvsqw_RootexpdbCentral/action/mysql/prod;ls -al'
 +
  depl_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_DeplScripts.ksh sqwmys_GenLstUnique.ksh NOLOG CONFIRM'
 +
  repind_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_GatherIndicators.ksh sqwmys_GenLstRepind.ksh NOLOG'
 +
  gen_mys => '$gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh'
 +
</pre>
 +
<br>
 
<br><br>
 
<br><br>
  
 
== lst ==
 
== lst ==
 
=== sqwc_GenRefDbMysql.ksh ===
 
=== sqwc_GenRefDbMysql.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefDbMysql.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefDbMysql.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefDbMysql.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefDbMysql.ksh.<br>
Génére le fichier de référence ''database'' Mysql automatiquement à partir du référentiel contenu en bdd.<br>
 
[[SQWareRepository:general|En savoir plus sur le référentiel dbb.]]<br>
 
[[SQWareRepository:mysql|En savoir plus sur le référentiel dbb mysql.]]<br>
 
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/RefDb_mysql.txt.
 
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select concat('MYS;',ref.mysql_sid,';',vol.database_name,';',ref.env,';',
 
select concat('MYS;',ref.mysql_sid,';',vol.database_name,';',ref.env,';',
  inst.version,';',hist.maj_version,';',round(vol.size_db/1024,0),';',
 
  ref.comments,';',ref.virt_host_name,';',ref.host_name,';',date_format(hist.gather_date, '%d/%m/%Y'))
 
 
from tsqw_Repository ref, tsqw_GenHisto hist, tsqw_VolInstance inst, tsqw_VolDb vol
 
from tsqw_Repository ref, tsqw_GenHisto hist, tsqw_VolInstance inst, tsqw_VolDb vol
 
where hist.month = str_to_date(concat('01/',month(now()),'/',year(now())), '%d/%m/%Y')
 
where hist.month = str_to_date(concat('01/',month(now()),'/',year(now())), '%d/%m/%Y')
Line 161: Line 217:
 
</pre>
 
</pre>
 
<br>
 
<br>
 
 
=== sqwc_GenRefMysql.ksh ===
 
=== sqwc_GenRefMysql.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefMysql.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefMysql.ksh.<br>
Génére le fichier de référence Mysql automatiquement à partir du référentiel contenu en bdd.<br>
 
[[SQWareRepository:general|En savoir plus sur le référentiel dbb.]]<br>
 
[[SQWareRepository:mysql|En savoir plus sur le référentiel dbb mysql.]]<br>
 
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/Ref_mysql.txt.
 
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select cast(virt_host_name as char(22)) "Virthost",
 
select cast(virt_host_name as char(22)) "Virthost",
cast(host_name as char(12)) "Host",
 
cast(username as char(15)) "User",
 
cast(mysql_sid as char(20)) "Mysql_sid",
 
cast(port as char(4)) "Port",
 
cast(status as char(5)) "stat",
 
cast(env as char(3)) "env",
 
cast(comments as char(26)) "description",
 
cast(contact as char(20)) "contact",
 
cast(client as char(8)) "client"
 
 
from tsqw_Repository
 
from tsqw_Repository
union
 
 
select cast(virt_host_name as char(22)) "Virthost",
 
select cast(virt_host_name as char(22)) "Virthost",
cast(host_name as char(12)) "Host",
 
cast(username as char(15)) "User",
 
cast(mysql_sid as char(20)) "Mysql_sid",
 
cast(port as char(4)) "Port",
 
cast(status as char(5)) "stat",
 
cast(env as char(3)) "env",
 
cast(comments  as char(26)) "description",
 
cast(contact as char(20)) "contact",
 
cast(client as char(8)) "client"
 
 
from tsqw_RepositoryOther
 
from tsqw_RepositoryOther
order by 6,2,1,3,4'
+
order by 6,2,1,3,4'| sed 's,\|, ,g'|grep -v '+' |sed 's,^  *,,' > $lvsqw_FicRef
 
</pre>
 
</pre>
 
<br>
 
<br>
 
 
=== sqwmys_GenLstInstance.ksh ===
 
=== sqwmys_GenLstInstance.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstInstance.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstInstance.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstInstance.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstInstance.ksh.<br>
Generation de la liste des instances Mysql (tsqw_Repository)
+
Generation of the list of Mysql instances (tsqw_Repository)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select virt_host_name, username, mysql_sid
 
select virt_host_name, username, mysql_sid
Line 213: Line 244:
 
<br>
 
<br>
 
=== sqwmys_GenLstRepind.ksh ===
 
=== sqwmys_GenLstRepind.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstRepind.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstRepind.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstRepind.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstRepind.ksh.<br>
Generation de la liste pour reprise des indicateurs (tsqw_Repository/tsqw_GenHisto)
+
Generation of the list for reprise of indicators (tsqw_Repository/tsqw_GenHisto)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select virt_host_name, username, mysql_sid
 
select virt_host_name, username, mysql_sid
Line 224: Line 255:
 
and not exists ( select 1 from tsqw_GenHisto inf
 
and not exists ( select 1 from tsqw_GenHisto inf
 
where inf.gather_date = date(now())
 
where inf.gather_date = date(now())
 +
and ref.mysql_sid = inf.mysql_sid)
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwmys_GenLstUnique.ksh ===
 
=== sqwmys_GenLstUnique.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstUnique.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstUnique.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstUnique.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstUnique.ksh.<br>
Generation liste user unique (tsqw_Repository)
+
Generation of the user unique list (tsqw_Repository)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select distinct host_name, '$gvsqw_UserUniqueMysql'
 
select distinct host_name, '$gvsqw_UserUniqueMysql'

Revision as of 21:48, 22 December 2010

auto

sqwmys_DeplScripts.ksh

Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_DeplScripts.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_DeplScripts.ksh.
SQWareProduction deployment for Mysql

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
mkdir -p $gvsqw_RootSQWareProductionMysql/$gvsqw_VersDeplSQWareProductionMysql
cd $gvsqw_RootSQWareProductionMysql
rm -f $gvsqw_VersSQWareProductionMysql
ln -s $gvsqw_VersDeplSQWareProductionMysql $gvsqw_VersSQWareProductionMysql
EOFSSH
rsync -aHv $gvsqw_RsyncPathMysql --delete $gvsqw_RootSQWareProduction/mysql/$gvsqw_VersDeplSQWareProductionMysql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMysql/.
done <$gvsqw_TmpFile.lst
}


sqwmys_GatherIndicators.ksh

Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_GatherIndicators.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_GatherIndicators.ksh.
Mysql gather indicators

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A IndicDba
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwmys_PurgeAlert.ksh

Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_PurgeAlert.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_PurgeAlert.ksh.
Mysql rotate error log

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A PurgeAlert
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwmys_SlowQuery.ksh

Action script $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_SlowQuery.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_SlowQuery.ksh.
Mysql rotate slow query log

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_MysBin/../tools/sqwmys_SetEnv.ksh $lvsqw_Instance
\$gvsqw_MysBin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A SlowQuery
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}




etc

CrontabRef.cfg

Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/CrontabRef.cfg:
It contains the operating variables of SQWareCentral for mysql.
If you want to overload default variables,
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/CrontabRef.cfg
your modifications (only variables you want to modify).

File content:




Variable explanation:



sqwc_DbRefVar.cfg

Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_DbRefVar.cfg:
It contains the operating variables of SQWareCentral for mysql.
If you want to overload default variables,
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_DbRefVar.cfg
your modifications (only variables you want to modify).

File content:

export gvsqw_DbRefType_mysql='mysql'
export gvsqw_DbRefPort_mysql='InstancePortForMysql'
export gvsqw_DbRefInstance_mysql='InstanceNameForMysql'
export gvsqw_DbRefDatabase_mysql='DatabaseInstanceNameForMysql'
export gvsqw_DbRefUser_mysql='ConnexionUserForMysql'
export gvsqw_DbRefPass_mysql='ConnexionPassForMysql'



Variable explanation:

gvsqw_DbRefDatabase_mysql => 
gvsqw_DbRefInstance_mysql => 
gvsqw_DbRefPass_mysql => 
gvsqw_DbRefPort_mysql => 
gvsqw_DbRefType_mysql => 
gvsqw_DbRefUser_mysql => 


sqwc_ExpVar.cfg

Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_ExpVar.cfg:
It contains the operating variables of SQWareCentral for mysql.
If you want to overload default variables,
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_ExpVar.cfg
your modifications (only variables you want to modify).

File content:

export gvsqw_RootSQWareProductionMysql="~$gvsqw_UserUniqueMysql/SQWareProduction/mysql"
export gvsqw_VersSQWareProductionMysql='prod'
export gvsqw_VersDeplSQWareProductionMysql='v1.2'
export gvsqw_Mail_mysql='dba'
export gvsqw_MailMsg_mysql='TrtMysqlAuto'



Variable explanation:

gvsqw_MailMsg_mysql => 
gvsqw_Mail_mysql => 
gvsqw_RootSQWareProductionMysql => 
gvsqw_VersDeplSQWareProductionMysql => 
gvsqw_VersSQWareProductionMysql => 


sqwc_GlobalVar.cfg

Configuration file $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_GlobalVar.cfg:
It contains the operating variables of SQWareCentral for mysql.
If you want to overload default variables,
put in $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_GlobalVar.cfg
your modifications (only variables you want to modify).

File content:

export gvsqw_UserUniqueMysql='sysdba'



Variable explanation:

gvsqw_UserUniqueMysql => 


.profile_confort

File to put aliases $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:
File to put aliases $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:
Contains confort aliases of SQWareCentral for RDBMS mysql.
Contains confort aliases of SQWareCentral for RDBMS mysql.

Alias explanation:

	  act_mys => 'cd $gvsqw_RootexpdbCentral/action/mysql/prod;ls -al'
	  depl_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_DeplScripts.ksh sqwmys_GenLstUnique.ksh NOLOG CONFIRM'
	  repind_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_GatherIndicators.ksh sqwmys_GenLstRepind.ksh NOLOG'
	  gen_mys => '$gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh'




lst

sqwc_GenRefDbMysql.ksh

List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefDbMysql.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefDbMysql.ksh.


Query used:

select concat('MYS;',ref.mysql_sid,';',vol.database_name,';',ref.env,';',
from tsqw_Repository ref, tsqw_GenHisto hist, tsqw_VolInstance inst, tsqw_VolDb vol
where hist.month = str_to_date(concat('01/',month(now()),'/',year(now())), '%d/%m/%Y')
    and hist.mysql_sid = ref.mysql_sid
    and hist.mysql_sid = vol.mysql_sid
    and hist.gather_date = vol.gather_date
    and hist.mysql_sid = inst.mysql_sid
    and hist.gather_date = inst.gather_date
order by 1


sqwc_GenRefMysql.ksh

List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefMysql.ksh.


Query used:

select cast(virt_host_name as char(22)) "Virthost",
from tsqw_Repository
select cast(virt_host_name as char(22)) "Virthost",
from tsqw_RepositoryOther
order by 6,2,1,3,4'| sed 's,\|, ,g'|grep -v '+' |sed 's,^  *,,' > $lvsqw_FicRef


sqwmys_GenLstInstance.ksh

List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstInstance.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstInstance.ksh.
Generation of the list of Mysql instances (tsqw_Repository)

Query used:

select virt_host_name, username, mysql_sid
from tsqw_Repository
where status = 'ON'
order by virt_host_name, username


sqwmys_GenLstRepind.ksh

List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstRepind.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstRepind.ksh.
Generation of the list for reprise of indicators (tsqw_Repository/tsqw_GenHisto)

Query used:

select virt_host_name, username, mysql_sid
from tsqw_Repository ref
where ref.status = 'ON'
and not exists ( select 1 from tsqw_GenHisto inf
where inf.gather_date = date(now())
and ref.mysql_sid = inf.mysql_sid)


sqwmys_GenLstUnique.ksh

List generator $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstUnique.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstUnique.ksh.
Generation of the user unique list (tsqw_Repository)

Query used:

select distinct host_name, '$gvsqw_UserUniqueMysql'
from tsqw_Repository
where status != 'OFF'
select distinct host_name, '$gvsqw_UserUniqueMysql'
from tsqw_RepositoryOther
order by host_name