Difference between revisions of "SQWareCentral:mssql"

From Wiki_dbSQWare
Jump to: navigation, search
m (Updated by Expdbtools)
 
m (Updated by BatchUser)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== auto ==
 
== auto ==
 
=== sqwmsq_DeplScripts.ksh ===
 
=== sqwmsq_DeplScripts.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_DeplScripts.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_DeplScripts.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_DeplScripts.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_DeplScripts.ksh.<br>
Deploiement de SQWareProduction pour Mssql
+
SQWareProduction deployment for Mssql
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 12: Line 12:
 
do
 
do
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
 
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
+
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 
mkdir -p $gvsqw_RootSQWareProductionMssql/$gvsqw_VersDeplSQWareProductionMssql
 
mkdir -p $gvsqw_RootSQWareProductionMssql/$gvsqw_VersDeplSQWareProductionMssql
 
cd $gvsqw_RootSQWareProductionMssql
 
cd $gvsqw_RootSQWareProductionMssql
ln -sf $gvsqw_VersDeplSQWareProductionMssql $gvsqw_VersSQWareProductionMssql
+
rm -f $gvsqw_VersSQWareProductionMssql
 +
ln -s $gvsqw_VersDeplSQWareProductionMssql $gvsqw_VersSQWareProductionMssql
 
EOFSSH
 
EOFSSH
 
rsync -aHv $gvsqw_RsyncPathMssql --delete $gvsqw_RootSQWareProduction/mssql/$gvsqw_VersDeplSQWareProductionMssql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMssql/.
 
rsync -aHv $gvsqw_RsyncPathMssql --delete $gvsqw_RootSQWareProduction/mssql/$gvsqw_VersDeplSQWareProductionMssql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMssql/.
 
done <$gvsqw_TmpFile.lst
 
done <$gvsqw_TmpFile.lst
 
}
 
}
</pre>
 
<br>
 
=== sqwmsq_DeplScripts.ksh.new ===
 
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_DeplScripts.ksh.new:<br>
 
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_DeplScripts.ksh.new.<br>
 
<br><br>
 
Requête utilisée:
 
<pre>
 
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwmsq_GatherIndicators.ksh ===
 
=== sqwmsq_GatherIndicators.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_GatherIndicators.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_GatherIndicators.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_GatherIndicators.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_GatherIndicators.ksh.<br>
Collecte des indicateurs Mssql
+
Mssql gather indicators
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 42: Line 35:
 
do
 
do
 
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 $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
$gvsqw_RootSQWareProductionMssql/$gvsqw_VersSQWareProductionMssql/bin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A IndicDba
+
. \$gvsqw_MsqBin/../tools/sqwmsq_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_MsqBin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A IndicDba
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 49: Line 43:
 
wait
 
wait
 
}
 
}
</pre>
 
<br>
 
=== sqwmsq_GatherIndicators.ksh.new ===
 
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_GatherIndicators.ksh.new:<br>
 
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_GatherIndicators.ksh.new.<br>
 
<br><br>
 
Requête utilisée:
 
<pre>
 
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwmsq_RotateLog.ksh ===
 
=== sqwmsq_RotateLog.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_RotateLog.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_RotateLog.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_RotateLog.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_RotateLog.ksh.<br>
Execute l'action RotateErrorLog
+
Execute RotateErrorLog action
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 71: Line 57:
 
do
 
do
 
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 $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
$gvsqw_RootSQWareProductionMssql/$gvsqw_VersSQWareProductionMssql/bin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A RotateErrorLog
+
. \$gvsqw_MsqBin/../tools/sqwmsq_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_MsqBin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A RotateErrorLog
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 80: Line 67:
 
</pre>
 
</pre>
 
<br>
 
<br>
=== sqwmsq_RotateLog.ksh.new ===
 
Script d'action $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_RotateLog.ksh.new:<br>
 
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_RotateLog.ksh.new.<br>
 
 
<br><br>
 
<br><br>
Requête utilisée:
+
 
 +
== etc ==
 +
=== CrontabRef.cfg ===
 +
Configuration file $gvsqw_RootexpdbCentral/action/mssql/etc/CrontabRef.cfg:<br>
 +
It contains the operating variables of SQWareCentral for mssql.<br>
 +
If you want to overload default variables,<br>
 +
put in $gvsqw_RootexpdbCentral/action/mssql/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>
 
</pre>
 
</pre>
 
<br>
 
<br>
<br><br>
 
 
== etc ==
 
 
=== sqwc_DbRefVar.cfg ===
 
=== sqwc_DbRefVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_DbRefVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_DbRefVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mssql.<br>
+
It contains the operating variables of SQWareCentral for mssql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_DbRefVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_DbRefDatabase_mssql => [par défaut: 'DatabaseInstanceNameForMssql'
+
put in $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_DbRefVar.cfg<br>
gvsqw_DbRefInstance_mssql =>  [par défaut: 'InstanceNameForMssql'
+
your modifications (only variables you want to modify).<br>
gvsqw_DbRefPass_mssql =>  [par défaut: 'ConnexionPassForMssql'
+
<br>
gvsqw_DbRefPort_mssql =>  [par défaut: 'InstancePortForMssql'
+
File content:
gvsqw_DbRefType_mssql =>  [par défaut: 'mssql'
+
<pre>
gvsqw_DbRefUser_mssql =>  [par défaut: 'ConnexionUserForMssql'
+
export gvsqw_DbRefType_mssql='mssql'
gvsqw_EgrepiV_mssql =>  [par défaut: 'Sun Microsystems|you have'
+
export gvsqw_DbRefPort_mssql='InstancePortForMssql'
 +
export gvsqw_DbRefInstance_mssql='InstanceNameForMssql'
 +
export gvsqw_DbRefDatabase_mssql='DatabaseInstanceNameForMssql'
 +
export gvsqw_DbRefUser_mssql='ConnexionUserForMssql'
 +
export gvsqw_DbRefPass_mssql='ConnexionPassForMssql'
 +
export gvsqw_EgrepiV_mssql='Sun Microsystems|you have|using default charset|will not be allocated'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_DbRefDatabase_mssql =>
 +
gvsqw_DbRefInstance_mssql =>
 +
gvsqw_DbRefPass_mssql =>
 +
gvsqw_DbRefPort_mssql =>
 +
gvsqw_DbRefType_mssql =>
 +
gvsqw_DbRefUser_mssql =>
 +
gvsqw_EgrepiV_mssql =>
 +
</pre>
 
<br>
 
<br>
 
=== sqwc_ExpVar.cfg ===
 
=== sqwc_ExpVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_ExpVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_ExpVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mssql.<br>
+
It contains the operating variables of SQWareCentral for mssql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_ExpVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_MailMsg_mssql => [par défaut: 'TrtMssqlAuto'
+
put in $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_ExpVar.cfg<br>
gvsqw_Mail_mssql => [par défaut: 'dba'
+
your modifications (only variables you want to modify).<br>
gvsqw_RootSQWareProductionMssql =>  [par défaut: "~$gvsqw_UserUniqueMssql/SQWareProduction/mssql"
+
<br>
gvsqw_VersDeplSQWareProductionMssql =>  [par défaut: 'v1.1'
+
File content:
gvsqw_VersSQWareProductionMssql => [par défaut: 'prod'
+
<pre>
 +
export gvsqw_RootexpdbExpMssql="~$gvsqw_UserUniqueMssql/SQWareProduction/mssql"
 +
export gvsqw_VersexpdbExpMssql='prod'
 +
export gvsqw_VersDeplexpdbExpMssql='v3.1'
 +
export gvsqw_Mail_mssql='dba'
 +
export gvsqw_MailMsg_mssql='TrtMssqlAuto'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_MailMsg_mssql =>
 +
gvsqw_Mail_mssql =>
 +
gvsqw_RootexpdbExpMssql =>
 +
gvsqw_VersDeplexpdbExpMssql =>
 +
gvsqw_VersexpdbExpMssql =>
 +
</pre>
 
<br>
 
<br>
 
=== sqwc_GlobalVar.cfg ===
 
=== sqwc_GlobalVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_GlobalVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/mssql/etc/sqwc_GlobalVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD mssql.<br>
+
It contains the operating variables of SQWareCentral for mssql.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_GlobalVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_UserUniqueMssql => [par défaut: 'sysdba'
+
put in $gvsqw_RootexpdbCentral/action/mssql/etc_cust/sqwc_GlobalVar.cfg<br>
 +
your modifications (only variables you want to modify).<br>
 +
<br>
 +
File content:
 +
<pre>
 +
export gvsqw_Mail_mssql='default@dbsqware.com'
 +
export gvsqw_MailMsg_mssql='TrtMssqlAuto'
 +
export gvsqw_UserUniqueMssql='dbsqware'
 +
export gvsqw_UserTsql_mssql=`id| cut -d')' -f1| cut -d'(' -f2`
 +
export gvsqw_HostTsql_mssql=$(uname -n)
 +
export gvsqw_RootSQWareProductionMssql="~$gvsqw_UserUniqueMssql/SQWareProduction/mssql"
 +
export gvsqw_VersSQWareProductionMssql='prod'
 +
export gvsqw_VersDeplSQWareProductionMssql='v3.1'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_HostTsql_mssql =>
 +
gvsqw_MailMsg_mssql =>
 +
gvsqw_Mail_mssql =>
 +
gvsqw_RootSQWareProductionMssql =>
 +
gvsqw_UserTsql_mssql =>
 +
gvsqw_UserUniqueMssql =>
 +
gvsqw_VersDeplSQWareProductionMssql =>
 +
gvsqw_VersSQWareProductionMssql =>
 +
</pre>
 
<br>
 
<br>
 
=== .profile_confort ===
 
=== .profile_confort ===
Fichier de positionnement d'alias $gvsqw_RootexpdbCentral/action/mssql/etc/.profile_confort:<br>
+
File to put aliases $gvsqw_RootexpdbCentral/action/mssql/etc/.profile_confort:<br>
Il contient les alias de confort de SQWareCentral pour le SGBD mssql.<br>
+
Contains confort aliases of SQWareCentral for RDBMS mssql.<br>
Peut-être surchargé par $gvsqw_RootexpdbCentral/action/mssql/etc_cust/.profile_confort.<br>
+
<br>
 +
Alias explanation:
 +
<pre>
 
  act_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/prod;ls -al'
 
  act_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/prod;ls -al'
  depl_msq => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mssql sqwmsq_DeplScripts.ksh sqwmsq_GenLstUnix.ksh NOLOG CONFIRM'
+
  etc_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/etc;ls -al'
 +
  lst_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/lst;ls -al'
 +
  auto_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/auto;ls -al'
 +
  cetc_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/etc_cust;ls -al'
 +
  clst_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/lst_cust;ls -al'
 +
  cauto_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/auto_cust;ls -al'
 +
  depl_msq => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh mssql sqwmsq_DeplScripts.ksh sqwmsq_GenLstUnix.ksh'
 +
  repind_msq => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mssql sqwmsq_GatherIndicators.ksh sqwmsq_GenLstRepind.ksh NOLOG'
 
  gen_msq => '$gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh'
 
  gen_msq => '$gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh'
  repind_msq => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mssql sqwmsq_GatherIndicators.ksh sqwmsq_GenLstRepind.ksh NOLOG'
+
  gen_tds => '$gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenTds.ksh'
 +
  menu_msq => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh mssql'
 +
</pre>
 
<br>
 
<br>
 
<br><br>
 
<br><br>
  
 
== lst ==
 
== lst ==
 +
=== sqwc_Extract_CMDB_Mssql.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_Extract_CMDB_Mssql.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_Extract_CMDB_Mssql.ksh.<br>
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select 'MSQ;' + ref.Alias + ';' + isnull(lic.Hostname,ref.Hostname)+ ';' + ref.Env + ';' + ref.Status + ';' +
 +
from tsqw_Repository ref
 +
        on (ref.Alias = hist.Alias and hist.Month=convert(smalldatetime,'01'+substring(convert(char(10),getdate(),103),3,8),103))
 +
        on (hist.Alias = inf.Alias and hist.Gather_date = inf.Gather_date)
 +
order by 1
 +
</pre>
 +
<br>
 
=== sqwc_GenRefDbMssql.ksh ===
 
=== sqwc_GenRefDbMssql.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefDbMssql.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefDbMssql.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefDbMssql.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefDbMssql.ksh.<br>
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select 'MSQ;' + vol.Alias + ';' + vol.Database_name + ';' + ref.Env + ';' +
 
select 'MSQ;' + vol.Alias + ';' + vol.Database_name + ';' + ref.Env + ';' +
 
from tsqw_Repository ref, tsqw_GenInfos inf, tsqw_VolDb vol, tsqw_GenHisto hist
 
from tsqw_Repository ref, tsqw_GenInfos inf, tsqw_VolDb vol, tsqw_GenHisto hist
 
where hist.Month = convert(smalldatetime,'01'+substring(convert(char(10),getdate(),103),3,8),103)
 
where hist.Month = convert(smalldatetime,'01'+substring(convert(char(10),getdate(),103),3,8),103)
 +
    and inf.Alias = hist.Alias
 +
    and inf.Gather_date = hist.Gather_date
 +
    and inf.Alias = vol.Alias
 +
    and inf.Gather_date = vol.Gather_date
 +
    and ref.Alias = inf.Alias
 +
    and ref.Status!='OFF'
 +
    and vol.Database_name not in ('master','tempdb','Northwind','msdb','model','pubs')
 +
    and vol.Database_name not like 'temp%'
 
order by vol.Database_name, vol.Alias
 
order by vol.Database_name, vol.Alias
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwc_GenRefMssql.ksh ===
 
=== sqwc_GenRefMssql.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefMssql.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefMssql.ksh.<br>
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select convert(char(15),Alias) ++
 
select convert(char(15),Alias) ++
 +
from tsqw_Repository
 +
order by alias
 +
</pre>
 +
<br>
 +
=== sqwc_GenTds.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenTds.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenTds.ksh.<br>
 +
<br><br>
 +
Query used:
 +
<pre>
 +
echo "# freetds_dbsqware.conf generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
 +
select '
 +
        # Command and connection timeouts
 +
select '[' + alias + ']
 
from tsqw_Repository
 
from tsqw_Repository
 
order by alias
 
order by alias
Line 155: Line 256:
 
<br>
 
<br>
 
=== sqwmsq_GenLstInstance.ksh ===
 
=== sqwmsq_GenLstInstance.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstInstance.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstInstance.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstInstance.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstInstance.ksh.<br>
Generation de la liste des instances Mssql (tsqw_Repository)
+
Generation of the list of Mssql instances (tsqw_Repository)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
select '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
+
select 'name= ', '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
 
from tsqw_Repository
 
from tsqw_Repository
 
where STATUS = 'ON'
 
where STATUS = 'ON'
Line 168: Line 269:
 
<br>
 
<br>
 
=== sqwmsq_GenLstRepind.ksh ===
 
=== sqwmsq_GenLstRepind.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstRepind.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstRepind.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstRepind.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstRepind.ksh.<br>
Generation de la liste pour reprise des indicateurs (tsqw_Repository/tsqw_GenInfos)
+
Generation of the list for reprise of indicators (tsqw_Repository/tsqw_GenInfos)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
select '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
+
select 'name= ', '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
 
from tsqw_Repository ref
 
from tsqw_Repository ref
 
where STATUS = 'ON'
 
where STATUS = 'ON'
and not exists ( select 1 from tsqw_GenInfos inf
+
and not exists ( select 1 from tsqw_GenHisto inf
 
where inf.Gather_date = convert(smalldatetime,convert(char(10),getdate(),103),103)
 
where inf.Gather_date = convert(smalldatetime,convert(char(10),getdate(),103),103)
 +
and ref.alias = inf.alias)
 
order by alias
 
order by alias
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwmsq_GenLstUnix.ksh ===
 
=== sqwmsq_GenLstUnix.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstUnix.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstUnix.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstUnix.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstUnix.ksh.<br>
Generation de la liste des unix supportants FreeTds (tsqw_RepositoryFreeTds)
+
Generation of the list of unix users FreeTds (tsqw_RepositoryFreeTds)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
select HostName, UserName
+
select 'name= ', HostName, UserName
 
from tsqw_RepositoryFreeTds
 
from tsqw_RepositoryFreeTds
 
order by 1,2
 
order by 1,2

Latest revision as of 22:53, 17 December 2012

auto

sqwmsq_DeplScripts.ksh

Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_DeplScripts.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_DeplScripts.ksh.
SQWareProduction deployment for Mssql

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
mkdir -p $gvsqw_RootSQWareProductionMssql/$gvsqw_VersDeplSQWareProductionMssql
cd $gvsqw_RootSQWareProductionMssql
rm -f $gvsqw_VersSQWareProductionMssql
ln -s $gvsqw_VersDeplSQWareProductionMssql $gvsqw_VersSQWareProductionMssql
EOFSSH
rsync -aHv $gvsqw_RsyncPathMssql --delete $gvsqw_RootSQWareProduction/mssql/$gvsqw_VersDeplSQWareProductionMssql $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionMssql/.
done <$gvsqw_TmpFile.lst
}


sqwmsq_GatherIndicators.ksh

Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_GatherIndicators.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_GatherIndicators.ksh.
Mssql 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 $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_MsqBin/../tools/sqwmsq_SetEnv.ksh $lvsqw_Instance
\$gvsqw_MsqBin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A IndicDba
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
wait
}


sqwmsq_RotateLog.ksh

Action script $gvsqw_RootexpdbCentral/action/mssql/auto/sqwmsq_RotateLog.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/auto_cust/sqwmsq_RotateLog.ksh.
Execute RotateErrorLog action

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_MsqBin/../tools/sqwmsq_SetEnv.ksh $lvsqw_Instance
\$gvsqw_MsqBin/sqwmsq_RunJob.ksh -S $lvsqw_Instance -A RotateErrorLog
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
wait
}




etc

CrontabRef.cfg

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

File content:




Variable explanation:



sqwc_DbRefVar.cfg

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

File content:

export gvsqw_DbRefType_mssql='mssql'
export gvsqw_DbRefPort_mssql='InstancePortForMssql'
export gvsqw_DbRefInstance_mssql='InstanceNameForMssql'
export gvsqw_DbRefDatabase_mssql='DatabaseInstanceNameForMssql'
export gvsqw_DbRefUser_mssql='ConnexionUserForMssql'
export gvsqw_DbRefPass_mssql='ConnexionPassForMssql'
export gvsqw_EgrepiV_mssql='Sun Microsystems|you have|using default charset|will not be allocated'



Variable explanation:

gvsqw_DbRefDatabase_mssql => 
gvsqw_DbRefInstance_mssql => 
gvsqw_DbRefPass_mssql => 
gvsqw_DbRefPort_mssql => 
gvsqw_DbRefType_mssql => 
gvsqw_DbRefUser_mssql => 
gvsqw_EgrepiV_mssql => 


sqwc_ExpVar.cfg

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

File content:

export gvsqw_RootexpdbExpMssql="~$gvsqw_UserUniqueMssql/SQWareProduction/mssql"
export gvsqw_VersexpdbExpMssql='prod'
export gvsqw_VersDeplexpdbExpMssql='v3.1'
export gvsqw_Mail_mssql='dba'
export gvsqw_MailMsg_mssql='TrtMssqlAuto'



Variable explanation:

gvsqw_MailMsg_mssql => 
gvsqw_Mail_mssql => 
gvsqw_RootexpdbExpMssql => 
gvsqw_VersDeplexpdbExpMssql => 
gvsqw_VersexpdbExpMssql => 


sqwc_GlobalVar.cfg

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

File content:

export gvsqw_Mail_mssql='default@dbsqware.com'
export gvsqw_MailMsg_mssql='TrtMssqlAuto'
export gvsqw_UserUniqueMssql='dbsqware'
export gvsqw_UserTsql_mssql=`id| cut -d')' -f1| cut -d'(' -f2`
export gvsqw_HostTsql_mssql=$(uname -n)
export gvsqw_RootSQWareProductionMssql="~$gvsqw_UserUniqueMssql/SQWareProduction/mssql"
export gvsqw_VersSQWareProductionMssql='prod'
export gvsqw_VersDeplSQWareProductionMssql='v3.1'



Variable explanation:

gvsqw_HostTsql_mssql => 
gvsqw_MailMsg_mssql => 
gvsqw_Mail_mssql => 
gvsqw_RootSQWareProductionMssql => 
gvsqw_UserTsql_mssql => 
gvsqw_UserUniqueMssql => 
gvsqw_VersDeplSQWareProductionMssql => 
gvsqw_VersSQWareProductionMssql => 


.profile_confort

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

Alias explanation:

	  act_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/prod;ls -al'
	  etc_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/etc;ls -al'
	  lst_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/lst;ls -al'
	  auto_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/auto;ls -al'
	  cetc_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/etc_cust;ls -al'
	  clst_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/lst_cust;ls -al'
	  cauto_msq => 'cd $gvsqw_RootexpdbCentral/action/mssql/auto_cust;ls -al'
	  depl_msq => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh mssql sqwmsq_DeplScripts.ksh sqwmsq_GenLstUnix.ksh'
	  repind_msq => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh mssql sqwmsq_GatherIndicators.ksh sqwmsq_GenLstRepind.ksh NOLOG'
	  gen_msq => '$gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh'
	  gen_tds => '$gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenTds.ksh'
	  menu_msq => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh mssql'




lst

sqwc_Extract_CMDB_Mssql.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_Extract_CMDB_Mssql.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_Extract_CMDB_Mssql.ksh.


Query used:

select 'MSQ;' + ref.Alias + ';' + isnull(lic.Hostname,ref.Hostname)+ ';' + ref.Env + ';' + ref.Status + ';' +
from tsqw_Repository ref 
        on (ref.Alias = hist.Alias and hist.Month=convert(smalldatetime,'01'+substring(convert(char(10),getdate(),103),3,8),103))
        on (hist.Alias = inf.Alias and hist.Gather_date = inf.Gather_date)
order by 1


sqwc_GenRefDbMssql.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefDbMssql.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefDbMssql.ksh.


Query used:

select 'MSQ;' + vol.Alias + ';' + vol.Database_name + ';' + ref.Env + ';' +
from tsqw_Repository ref, tsqw_GenInfos inf, tsqw_VolDb vol, tsqw_GenHisto hist
where hist.Month = convert(smalldatetime,'01'+substring(convert(char(10),getdate(),103),3,8),103)
    and inf.Alias = hist.Alias
    and inf.Gather_date = hist.Gather_date
    and inf.Alias = vol.Alias
    and inf.Gather_date = vol.Gather_date
    and ref.Alias = inf.Alias
    and ref.Status!='OFF'
    and vol.Database_name not in ('master','tempdb','Northwind','msdb','model','pubs')
    and vol.Database_name not like 'temp%'
order by vol.Database_name, vol.Alias


sqwc_GenRefMssql.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenRefMssql.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenRefMssql.ksh.


Query used:

select convert(char(15),Alias) ++
from tsqw_Repository
order by alias


sqwc_GenTds.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwc_GenTds.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwc_GenTds.ksh.


Query used:

echo "# freetds_dbsqware.conf generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
select '
        # Command and connection timeouts
select '[' + alias + ']
from tsqw_Repository
order by alias


sqwmsq_GenLstInstance.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstInstance.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstInstance.ksh.
Generation of the list of Mssql instances (tsqw_Repository)

Query used:

select 'name= ', '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
from tsqw_Repository
where STATUS = 'ON'
order by alias


sqwmsq_GenLstRepind.ksh

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

Query used:

select 'name= ', '$gvsqw_HostTsql_mssql', '$gvsqw_UserTsql_mssql', alias
from tsqw_Repository ref
where STATUS = 'ON'
and not exists ( select 1 from tsqw_GenHisto inf
where inf.Gather_date = convert(smalldatetime,convert(char(10),getdate(),103),103)
and ref.alias = inf.alias)
order by alias


sqwmsq_GenLstUnix.ksh

List generator $gvsqw_RootexpdbCentral/action/mssql/lst/sqwmsq_GenLstUnix.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/mssql/lst_cust/sqwmsq_GenLstUnix.ksh.
Generation of the list of unix users FreeTds (tsqw_RepositoryFreeTds)

Query used:

select 'name= ', HostName, UserName
from tsqw_RepositoryFreeTds
order by 1,2