SQWareCentral:mysql
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).
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 => Database of SQWareRepository for Mysql gvsqw_DbRefInstance_mysql => HostName of SQWareRepository for Mysql gvsqw_DbRefPass_mysql => password to connect to SQWareRepository for Mysql gvsqw_DbRefPort_mysql => Port of instance of SQWareRepository for Mysql gvsqw_DbRefType_mysql => type of RDBMS for SQWareRepository for Mysql gvsqw_DbRefUser_mysql => user to connect to SQWareRepository for 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_mssql => begining of email subject for Mssql gvsqw_Mail_mssql => email adress for Mssql gvsqw_RootSQWareProductionMssql => SQWareProduction directory source for Mssql gvsqw_VersDeplSQWareProductionMssql => version of SQWareProduction to deploy for Mssql gvsqw_VersSQWareProductionMssql => link for current version of SQWareProduction for Mssql
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 => user to deploy SQWareProduction for Mysql
.profile_confort
File to put aliases $gvsqw_RootexpdbCentral/action/mysql/etc/.profile_confort:
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