Difference between revisions of "SQWareCentral:mysql"
Expdbtools (talk | contribs) (→sqwc_GenRefDbMysql.ksh) |
Expdbtools (talk | contribs) (→.profile_confort) |
||
Line 125: | Line 125: | ||
Il contient les alias de confort de SQWareCentral pour le SGBD mysql.<br> | Il contient les alias de confort de SQWareCentral pour le SGBD mysql.<br> | ||
Peut-être surchargé par $gvsqw_RootexpdbCentral/action/mysql/etc_cust/.profile_confort.<br> | Peut-être surchargé par $gvsqw_RootexpdbCentral/action/mysql/etc_cust/.profile_confort.<br> | ||
− | + | 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' | |
− | + | gen_mys => '$gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh' | |
− | + | repind_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_GatherIndicators.ksh sqwmys_GenLstRepind.ksh NOLOG' | |
− | |||
<br><br> | <br><br> | ||
Revision as of 11:03, 14 July 2010
auto
sqwmys_DeplScripts.ksh
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_DeplScripts.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_DeplScripts.ksh.
Deploiement de SQWareProduction pour Mysql
Requête utilisée:
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 ln -sf $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
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_GatherIndicators.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_GatherIndicators.ksh.
Collecte des indicateurs Mysql
Requête utilisée:
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 & . ./.profile $lvsqw_Instance $gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A IndicDba EOFSSH sleep 1 done <$gvsqw_TmpFile.lst jobs wait }
sqwmys_PurgeAlert.ksh
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_PurgeAlert.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_PurgeAlert.ksh.
Rotation erreur log Mysql
Requête utilisée:
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 & . ./.profile $lvsqw_Instance $gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A PurgeAlert EOFSSH sleep 1 done <$gvsqw_TmpFile.lst jobs wait }
sqwmys_SlowQuery.ksh
Script d'action $gvsqw_RootexpdbCentral/action/mysql/auto/sqwmys_SlowQuery.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/auto_cust/sqwmys_SlowQuery.ksh.
Rotation slow query log Mysql
Requête utilisée:
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 & . ./.profile $lvsqw_Instance $gvsqw_RootSQWareProductionMysql/$gvsqw_VersSQWareProductionMysql/bin/sqwmys_RunJob.ksh -I $lvsqw_Instance -A SlowQuery EOFSSH sleep 1 done <$gvsqw_TmpFile.lst jobs wait }
etc
sqwc_DbRefVar.cfg
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_DbRefVar.cfg:
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_DbRefVar.cfg.
gvsqw_DbRefDatabase_mysql => [par défaut: 'DatabaseInstanceNameForMysql' gvsqw_DbRefInstance_mysql => [par défaut: 'InstanceNameForMysql' gvsqw_DbRefPass_mysql => [par défaut: 'ConnexionPassForMysql' gvsqw_DbRefPort_mysql => [par défaut: 'InstancePortForMysql' gvsqw_DbRefType_mysql => [par défaut: 'mysql' gvsqw_DbRefUser_mysql => [par défaut: 'ConnexionUserForMysql'
sqwc_ExpVar.cfg
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_ExpVar.cfg:
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_ExpVar.cfg.
gvsqw_MailMsg_mysql => [par défaut: 'TrtMysqlAuto' gvsqw_Mail_mysql => [par défaut: 'dba' gvsqw_RootSQWareProductionMysql => [par défaut: "~$gvsqw_UserUniqueMysql/SQWareProduction/mysql" gvsqw_VersDeplSQWareProductionMysql => [par défaut: 'v1.1' gvsqw_VersSQWareProductionMysql => [par défaut: 'prod'
sqwc_GlobalVar.cfg
Fichier de configuration $gvsqw_RootexpdbCentral/action/mysql/etc/sqwc_GlobalVar.cfg:
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mysql.
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mysql/etc_cust/sqwc_GlobalVar.cfg.
gvsqw_UserUniqueMysql => [par défaut: 'sysdba'
.profile_confort
Fichier de positionnement d'alias $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:
Il contient les alias de confort de SQWareCentral pour le SGBD mysql.
Peut-être surchargé par $gvsqw_RootexpdbCentral/action/mysql/etc_cust/.profile_confort.
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' gen_mys => '$gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh' repind_mys => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mysql sqwmys_GatherIndicators.ksh sqwmys_GenLstRepind.ksh NOLOG'
lst
sqwc_GenRefDbMysql.ksh
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefDbMysql.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefDbMysql.ksh.
Génére le fichier de référence database Mysql automatiquement à partir du référentiel contenu en bdd.
En savoir plus sur le référentiel dbb.
En savoir plus sur le référentiel dbb mysql.
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/RefDb_mysql.txt.
Requête utilisée:
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 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
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwc_GenRefMysql.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwc_GenRefMysql.ksh.
Génére le fichier de référence Mysql automatiquement à partir du référentiel contenu en bdd.
En savoir plus sur le référentiel dbb.
En savoir plus sur le référentiel dbb mysql.
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/Ref_mysql.txt.
Requête utilisée:
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 union 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 order by 6,2,1,3,4'
sqwmys_GenLstInstance.ksh
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstInstance.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstInstance.ksh.
Generation de la liste des instances Mysql (tsqw_Repository)
Requête utilisée:
select virt_host_name, username, mysql_sid from tsqw_Repository where status = 'ON' order by virt_host_name, username
sqwmys_GenLstRepind.ksh
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstRepind.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstRepind.ksh.
Generation de la liste pour reprise des indicateurs (tsqw_Repository/tsqw_GenHisto)
Requête utilisée:
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())
sqwmys_GenLstUnique.ksh
Script de génération de liste $gvsqw_RootexpdbCentral/action/mysql/lst/sqwmys_GenLstUnique.ksh:
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mysql/lst_cust/sqwmys_GenLstUnique.ksh.
Generation liste user unique (tsqw_Repository)
Requête utilisée:
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