Difference between revisions of "SQWareCentral:oracle"

From Wiki_dbSQWare
Jump to: navigation, search
m (Updated by BatchUser)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{SQWareCentralPresSgbd|oracle}}
+
== auto ==
 +
=== sqwora_AdddbSQWareProfile.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_AdddbSQWareProfile.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_AdddbSQWareProfile.ksh.<br>
 +
Add dbSQWare profile
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
if [ -r ~/.profile ]
 +
then
 +
if [ \$(grep -c 'gvsqw_OraBin' ~/.profile) -eq 0 ]
 +
then
 +
cat <<EOFCAT >>~/.profile
 +
 
 +
#dbSQWare
 +
export gvsqw_Env=''
 +
export gvsqw_OraBin=\\\$HOME/SQWareProduction/oracle/bin
 +
lvsqw_IsTerminal=\\\$(tty 2>&1 >/dev/null;echo \\\$?)
 +
if [ "\\\$lvsqw_IsTerminal" = "0" ] && [ -r \\\$gvsqw_OraBin/../etc/.profile_confort ]
 +
then
 +
. \\\$gvsqw_OraBin/../etc/.profile_confort
 +
fi
 +
 
 +
EOFCAT
 +
fi
 +
elif [ -r ~/.bash_profile ]
 +
then
 +
if [ \$(grep -c 'gvsqw_OraBin' ~/.bash_profile) -eq 0 ]
 +
then
 +
cat <<EOFCAT >>~/.bash_profile
 +
 
 +
#dbSQWare
 +
export gvsqw_Env=''
 +
export gvsqw_OraBin=\\\$HOME/SQWareProduction/oracle/bin
 +
lvsqw_IsTerminal=\\\$(tty 2>&1 >/dev/null;echo \\\$?)
 +
if [ "\\\$lvsqw_IsTerminal" = "0" ] && [ -r \\\$gvsqw_OraBin/../etc/.profile_confort ]
 +
then
 +
. \\\$gvsqw_OraBin/../etc/.profile_confort
 +
fi
 +
 
 +
EOFCAT
 +
fi
 +
fi
 +
EOFSSH
 +
done <$gvsqw_TmpFile.lst
  
== auto ==
+
}
 +
</pre>
 +
<br>
 
=== sqwora_CheckInstance.ksh ===
 
=== sqwora_CheckInstance.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_CheckInstance.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_CheckInstance.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_CheckInstance.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_CheckInstance.ksh.<br>
Verifie le parametrage et la securite
+
Check parameters and security
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 13: Line 66:
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
do
 
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 
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 &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionOracle/$gvsqw_VersSQWareProductionOracle/bin/sqwora_RunJob.ksh -I $lvsqw_Instance -A CheckInstance
+
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A CheckInstance
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
Line 26: Line 80:
 
<br>
 
<br>
 
=== sqwora_DeplScripts.ksh ===
 
=== sqwora_DeplScripts.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_DeplScripts.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_DeplScripts.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_DeplScripts.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_DeplScripts.ksh.<br>
Deploiement de SQWareProduction pour Oracle
+
SQWareProduction deployment for Oracle
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 37: Line 91:
 
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_RootSQWareProductionOracle/$gvsqw_VersDeplSQWareProductionOracle
 
mkdir -p $gvsqw_RootSQWareProductionOracle/$gvsqw_VersDeplSQWareProductionOracle
 
cd $gvsqw_RootSQWareProductionOracle
 
cd $gvsqw_RootSQWareProductionOracle
ln -sf $gvsqw_VersDeplSQWareProductionOracle $gvsqw_VersSQWareProductionOracle
+
rm -f $gvsqw_VersSQWareProductionOracle
 +
ln -s $gvsqw_VersDeplSQWareProductionOracle $gvsqw_VersSQWareProductionOracle
 
EOFSSH
 
EOFSSH
 
rsync -aHv $gvsqw_RsyncPathOracle --delete $gvsqw_RootSQWareProduction/oracle/$gvsqw_VersDeplSQWareProductionOracle $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionOracle/.
 
rsync -aHv $gvsqw_RsyncPathOracle --delete $gvsqw_RootSQWareProduction/oracle/$gvsqw_VersDeplSQWareProductionOracle $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionOracle/.
 
done <$gvsqw_TmpFile.lst
 
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GatherDistFsSize.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherDistFsSize.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherDistFsSize.ksh.<br>
 +
Gather FS size
 +
<br><br>
 +
Action:
 +
<pre>
 +
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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
 +
\$gvsqw_OraBin/sqwora_GatherDistantFsSize.ksh -I "$lvsqw_Instance" -U "$lvsqw_UserName" -H "$lvsqw_HostName"
 +
EOFSSH
 +
sleep 3
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GatherIndicatorsDG.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsDG.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsDG.ksh.<br>
 +
Oracle dataguard gather indicators in distant mode
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -DG
 +
EOFSSH
 +
sleep 1
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GatherIndicatorsDist.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsDist.ksh.<br>
 +
Oracle gather indicators in distant mode
 +
<br><br>
 +
Action:
 +
<pre>
 +
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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
 +
\$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -Dist
 +
EOFSSH
 +
sleep 4
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 
}
 
}
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GatherIndicators.ksh ===
 
=== sqwora_GatherIndicators.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicators.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicators.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicators.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicators.ksh.<br>
Collecte des indicateurs Oracle
+
Oracle gather indicators
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 58: Line 181:
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
do
 
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 
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 &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionOracle/$gvsqw_VersSQWareProductionOracle/bin/sqwora_RunJob.ksh -I $lvsqw_Instance -A IndicDba
+
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A IndicDba
 
EOFSSH
 
EOFSSH
 
sleep 1
 
sleep 1
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GatherIndicatorsOld.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsOld.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsOld.ksh.<br>
 +
Oracle (old version) gather indicators in distant mode
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
if [ -r $HOME/.profile_old_oracle_client ]
 +
then
 +
. $HOME/.profile_old_oracle_client
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -Dist &
 +
sleep 5
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
else
 +
echo "To use sqwora_GatherIndicatorsOld.ksh, you must set profile for old client in $HOME/.profile_old_oracle_client"
 +
fi
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_Gen_dbSQWare.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_Gen_dbSQWare.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_Gen_dbSQWare.ksh.<br>
 +
generate dbSQWare files
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
if [ "\$ORACLE_SID" != "$lvsqw_Instance" ]
 +
then
 +
export ORACLE_SID="$lvsqw_Instance"
 +
fi
 +
\$gvsqw_OraBin/../tools/sqwora_GenerateCreateDatabase.ksh -dbsOnly <<EOF
 +
y
 +
EOF
 +
EOFSSH
 +
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GenEdt.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenEdt.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenEdt.ksh.<br>
 +
generate EDT files
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_OraBin/../tools/sqwora_GenerateCreateDatabase.ksh -P 1521 -edtOnly <<EOF
 +
y
 +
EOF
 +
EOFSSH
 +
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GenerateAwrDist.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwrDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwrDist.ksh.<br>
 +
Generate AWR reports in distant mode
 +
<br><br>
 +
Action:
 +
<pre>
 +
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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
 +
\$gvsqw_OraBin/sqwora_GenerateAwr.ksh -I "$lvsqw_Instance" -Dist
 +
EOFSSH
 +
sleep 20
 
done <$gvsqw_TmpFile.lst
 
done <$gvsqw_TmpFile.lst
 
jobs
 
jobs
Line 71: Line 293:
 
<br>
 
<br>
 
=== sqwora_GenerateAwr.ksh ===
 
=== sqwora_GenerateAwr.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwr.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwr.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwr.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwr.ksh.<br>
collecte des rapports AWR
+
Generate AWR reports
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A GenAwr
 +
EOFSSH
 +
sleep 10
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GenSshKeysInstance.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenSshKeysInstance.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenSshKeysInstance.ksh.<br>
 +
ssh keys deployment for Oracle
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
 
 +
echo "#########################################################################"
 +
echo "#Create/Retrieve key for SQWareCentral"
 +
mkdir -p $HOME/tmp
 +
if [ -r $HOME/.ssh/id_dsa.pub ]
 +
then
 +
echo "Id DSA found:"
 +
ls -l $HOME/.ssh/id_dsa.pub
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_dsa.pub)
 +
elif [ -r $HOME/.ssh/id_rsa.pub ]
 +
then
 +
echo "Id RSA found:"
 +
ls -l $HOME/.ssh/id_rsa.pub
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
 +
else
 +
ssh-keygen -t rsa -N '' -f $HOME/.ssh/id_rsa
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
 +
fi
 +
#Retrieve additionnal keys if found (your windows key for exemple)
 +
if [ -r $HOME/.ssh/id_dbSQWare.pub ]
 +
then
 +
echo "Id dbSQWare found:"
 +
ls -l $HOME/.ssh/id_dbSQWare.pub
 +
lvsqw_AdditionnalKey=$(cat $HOME/.ssh/id_dbSQWare.pub)
 +
else
 +
lvsqw_AdditionnalKey=""
 +
fi
 +
chmod go-w $HOME
 +
touch $HOME/.ssh/authorized_keys
 +
chmod 700 $HOME/.ssh
 +
chmod 600 $HOME/.ssh/authorized_keys
 +
echo "${c_menu}#########################################################################"
 +
echo "#create key if not found and put SQWareCentral key for distant users"
 +
echo "Enter password when necessary${c_normal}"
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
echo ""
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
 +
ssh -o StrictHostKeyChecking=no $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
mkdir -p \$HOME/tmp
 +
if [ -r \$HOME/.ssh/id_dsa.pub ]
 +
then
 +
echo "Id DSA found:"
 +
ls -l \$HOME/.ssh/id_dsa.pub
 +
cat \$HOME/.ssh/id_dsa.pub
 +
elif [ -r \$HOME/.ssh/id_rsa.pub ]
 +
then
 +
echo "Id RSA found:"
 +
ls -l \$HOME/.ssh/id_rsa.pub
 +
cat \$HOME/.ssh/id_rsa.pub
 +
else
 +
ssh-keygen -t rsa -N '' -f \$HOME/.ssh/id_rsa
 +
cat \$HOME/.ssh/id_rsa.pub
 +
fi
 +
chmod go-w \$HOME
 +
echo "$lvsqw_CentralKey" >>\$HOME/.ssh/authorized_keys
 +
echo "$lvsqw_AdditionnalKey" >>\$HOME/.ssh/authorized_keys
 +
chmod 700 \$HOME/.ssh
 +
chmod 600 \$HOME/.ssh/authorized_keys
 +
EOFSSH
 +
 
 +
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_GenSshKeys.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenSshKeys.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenSshKeys.ksh.<br>
 +
ssh keys deployment for Oracle
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
 
 +
echo "#########################################################################"
 +
echo "#Create/Retrieve key for SQWareCentral"
 +
mkdir -p $HOME/tmp
 +
if [ -r $HOME/.ssh/id_dsa.pub ]
 +
then
 +
echo "Id DSA found:"
 +
ls -l $HOME/.ssh/id_dsa.pub
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_dsa.pub)
 +
elif [ -r $HOME/.ssh/id_rsa.pub ]
 +
then
 +
echo "Id RSA found:"
 +
ls -l $HOME/.ssh/id_rsa.pub
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
 +
else
 +
ssh-keygen -t rsa -N '' -f $HOME/.ssh/id_rsa
 +
lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
 +
fi
 +
#Retrieve additionnal keys if found (your windows key for exemple)
 +
if [ -r $HOME/.ssh/id_dbSQWare.pub ]
 +
then
 +
echo "Id dbSQWare found:"
 +
ls -l $HOME/.ssh/id_dbSQWare.pub
 +
lvsqw_AdditionnalKey=$(cat $HOME/.ssh/id_dbSQWare.pub)
 +
else
 +
lvsqw_AdditionnalKey=""
 +
fi
 +
chmod go-w $HOME
 +
touch $HOME/.ssh/authorized_keys
 +
chmod 700 $HOME/.ssh
 +
chmod 600 $HOME/.ssh/authorized_keys
 +
echo "${c_menu}#########################################################################"
 +
echo "#create key if not found and put SQWareCentral key for distant users"
 +
echo "Enter password when necessary${c_normal}"
 +
while read lvsqw_HostName lvsqw_UserName
 +
do
 +
echo ""
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
 +
ssh -o StrictHostKeyChecking=no $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
mkdir -p \$HOME/tmp
 +
if [ -r \$HOME/.ssh/id_dsa.pub ]
 +
then
 +
echo "Id DSA found:"
 +
ls -l \$HOME/.ssh/id_dsa.pub
 +
cat \$HOME/.ssh/id_dsa.pub
 +
elif [ -r \$HOME/.ssh/id_rsa.pub ]
 +
then
 +
echo "Id RSA found:"
 +
ls -l \$HOME/.ssh/id_rsa.pub
 +
cat \$HOME/.ssh/id_rsa.pub
 +
else
 +
ssh-keygen -t rsa -N '' -f \$HOME/.ssh/id_rsa
 +
cat \$HOME/.ssh/id_rsa.pub
 +
fi
 +
chmod go-w \$HOME
 +
echo "$lvsqw_CentralKey" >>\$HOME/.ssh/authorized_keys
 +
echo "$lvsqw_AdditionnalKey" >>\$HOME/.ssh/authorized_keys
 +
chmod 700 \$HOME/.ssh
 +
chmod 600 \$HOME/.ssh/authorized_keys
 +
EOFSSH
 +
 
 +
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_MajTnsIfile.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MajTnsIfile.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MajTnsIfile.ksh.<br>
 +
Insert ifile reference to dbSQWare tnsnames.ora
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
 +
if [ -r \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh ] && [ "\$ORACLE_SID" != "$lvsqw_Instance" ]
 +
then
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
fi
 +
if [ -w \$ORACLE_HOME/network/admin/tnsnames.ora ]
 +
then
 +
if [ \$(grep -c 'SQWareProduction/oracle' \$ORACLE_HOME/network/admin/tnsnames.ora) -eq 0 ]
 +
then
 +
echo "Update \$ORACLE_HOME/network/admin/tnsnames.ora"
 +
echo "ifile=\$HOME/SQWareProduction/oracle/etc_cust/tnsnames.ora" >>\$ORACLE_HOME/network/admin/tnsnames.ora
 +
else
 +
echo "Reference of SQWareProduction found in \$ORACLE_HOME/network/admin/tnsnames.ora"
 +
grep 'SQWareProduction/oracle' \$ORACLE_HOME/network/admin/tnsnames.ora
 +
fi
 +
else
 +
echo "No write permission on \$ORACLE_HOME/network/admin/tnsnames.ora"
 +
fi
 +
EOFSSH
 +
done <$gvsqw_TmpFile.lst
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_MonitorAwrDist.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MonitorAwrDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MonitorAwrDist.ksh.<br>
 +
Monitor with AWR in distant mode
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 82: Line 512:
 
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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
. ./.profile $lvsqw_Instance
+
\$gvsqw_OraBin/sqwora_MonitorWithAwr.ksh -I "$lvsqw_Instance" -Dist
$gvsqw_RootSQWareProductionOracle/$gvsqw_VersSQWareProductionOracle/bin/sqwora_RunJob.ksh -I $lvsqw_Instance -A GenAwr
 
 
EOFSSH
 
EOFSSH
 
sleep 10
 
sleep 10
Line 90: Line 519:
 
jobs
 
jobs
 
wait
 
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_MonitorHourlyAwrDist.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MonitorHourlyAwrDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MonitorHourlyAwrDist.ksh.<br>
 +
Monitor hourly with AWR in distant mode
 +
<br><br>
 +
Action:
 +
<pre>
 +
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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
 +
\$gvsqw_OraBin/sqwora_MonitorWithAwr.ksh -I "$lvsqw_Instance" -BD 'sysdate-(1/24*2)' -Dist
 +
EOFSSH
 +
sleep 10
 +
done <$gvsqw_TmpFile.lst
 +
jobs
 +
wait
 +
}
 +
</pre>
 +
<br>
 +
=== sqwora_RetrieveHash.ksh ===
 +
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RetrieveHash.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RetrieveHash.ksh.<br>
 +
retrieve hashs for Oracle users
 +
<br><br>
 +
Action:
 +
<pre>
 +
lfsqw_Action()
 +
{
 +
lvsqw_FicRef=$gvsqw_RootexpdbCentral/etc_cust/Hash_oracle.csv
 +
> $lvsqw_FicRef
 +
chmod 600 $lvsqw_FicRef
 +
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 +
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 +
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
 +
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH>$lvsqw_FicRef.tmp
 +
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
 +
\$gvsqw_OraBin/../tools/sqwora_BackupPasswd.ksh -I $lvsqw_Instance -T hash
 +
EOFSSH
 +
cat $lvsqw_FicRef.tmp|grep "^$lvsqw_Instance;" >>$lvsqw_FicRef
 +
done <$gvsqw_TmpFile.lst
 +
 
}
 
}
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_RmanFull.ksh ===
 
=== sqwora_RmanFull.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanFull.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanFull.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanFull.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanFull.ksh.<br>
Backup full avec RMAN (incremental level 0)
+
Backup full with RMAN (incremental level 0)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 104: Line 581:
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
do
 
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 
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 &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionOracle/$gvsqw_VersSQWareProductionOracle/bin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanFull
+
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanFull
 
EOFSSH
 
EOFSSH
 
sleep 30
 
sleep 30
Line 117: Line 595:
 
<br>
 
<br>
 
=== sqwora_RmanInc.ksh ===
 
=== sqwora_RmanInc.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanInc.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanInc.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanInc.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanInc.ksh.<br>
Backup inc avec RMAN (incremental level 2)
+
Backup inc with RMAN (incremental level 2)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 127: Line 605:
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
 
do
 
do
 +
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
 
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 &
. ./.profile $lvsqw_Instance
+
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
$gvsqw_RootSQWareProductionOracle/$gvsqw_VersSQWareProductionOracle/bin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanInc
+
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanInc
 
EOFSSH
 
EOFSSH
 
sleep 30
 
sleep 30
Line 140: Line 619:
 
<br>
 
<br>
 
=== sqwora_StartedInstances.ksh ===
 
=== sqwora_StartedInstances.ksh ===
Script d'action $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_StartedInstances.ksh:<br>
+
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_StartedInstances.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_StartedInstances.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_StartedInstances.ksh.<br>
collecte des instances actives
+
collection of active instances
 
<br><br>
 
<br><br>
Requête utilisée:
+
Action:
 
<pre>
 
<pre>
 
lfsqw_Action()
 
lfsqw_Action()
Line 152: Line 631:
 
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>>$gvsqw_TmpFile
+
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH>>$gvsqw_TmpFile
 
ps -edf |grep 'pmon_[a-zA-Z][a-zA-Z]*'|grep -v grep|awk '{print "indic $lvsqw_HostName",\$1,\$NF}'|sed 's,ora_pmon_,,'
 
ps -edf |grep 'pmon_[a-zA-Z][a-zA-Z]*'|grep -v grep|awk '{print "indic $lvsqw_HostName",\$1,\$NF}'|sed 's,ora_pmon_,,'
 
EOFSSH
 
EOFSSH
Line 175: Line 654:
  
 
== etc ==
 
== etc ==
 +
=== CrontabRef.cfg ===
 +
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/CrontabRef.cfg:<br>
 +
It contains the operating variables of SQWareCentral for oracle.<br>
 +
If you want to overload default variables,<br>
 +
put in $gvsqw_RootexpdbCentral/action/oracle/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/oracle/etc/sqwc_DbRefVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_DbRefVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD oracle.<br>
+
It contains the operating variables of SQWareCentral for oracle.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/oracle/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/oracle/etc_cust/sqwc_DbRefVar.cfg<br>
gvsqw_DbRefDatabase_oracle => Database du referentiel [par défaut: 'DatabaseInstanceNameForOracle']
+
your modifications (only variables you want to modify).<br>
gvsqw_DbRefInstance_oracle => Instance du referentiel [par défaut: 'InstanceNameForOracle']
+
<br>
gvsqw_DbRefPass_oracle => Mot de passe de connexion au referentiel [par défaut: 'ConnexionPassForOracle']
+
File content:
gvsqw_DbRefPort_oracle => Port du referentiel [par défaut: 'InstancePortForOracle']
+
<pre>
gvsqw_DbRefType_oracle => Type de referentiel [par défaut: 'oracle']
+
export gvsqw_DbRefType_oracle='oracle'
gvsqw_DbRefUser_oracle => User de connexion au referentiel [par défaut: 'ConnexionUserForOracle']
+
export gvsqw_DbRefPort_oracle='InstancePortForOracle'
 +
export gvsqw_DbRefInstance_oracle='InstanceNameForOracle'
 +
export gvsqw_DbRefDatabase_oracle='DatabaseInstanceNameForOracle'
 +
export gvsqw_DbRefUser_oracle='ConnexionUserForOracle'
 +
export gvsqw_DbRefPass_oracle='ConnexionPassForOracle'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_DbRefDatabase_oracle =>
 +
gvsqw_DbRefInstance_oracle =>
 +
gvsqw_DbRefPass_oracle =>
 +
gvsqw_DbRefPort_oracle =>  
 +
gvsqw_DbRefType_oracle =>  
 +
gvsqw_DbRefUser_oracle =>  
 +
</pre>
 
<br>
 
<br>
 
 
=== sqwc_ExpVar.cfg ===
 
=== sqwc_ExpVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_ExpVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_ExpVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD oracle.<br>
+
It contains the operating variables of SQWareCentral for oracle.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/oracle/etc_cust/sqwc_ExpVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_MailMsg_oracle => message de début de sujet de mail [par défaut: 'TrtOraAuto']
+
put in $gvsqw_RootexpdbCentral/action/oracle/etc_cust/sqwc_ExpVar.cfg<br>
gvsqw_Mail_oracle => adresse pour envoi des mails [par défaut: 'dba']
+
your modifications (only variables you want to modify).<br>
gvsqw_RootSQWareProductionOracle => Répertoire de déploiement de SQWareProduction [par défaut: "~$gvsqw_UserUniqueOracle/SQWareProduction/oracle"]
+
<br>
gvsqw_VersDeplSQWareProductionOracle => Version de SQWareProduction à déployer  [par défaut: 'v1.1']
+
File content:
gvsqw_VersSQWareProductionOracle => Lien utilisé pour la version courante [par défaut: 'prod']
+
<pre>
 +
export gvsqw_RootexpdbExpOracle="~$gvsqw_UserUniqueOracle/SQWareProduction/oracle"
 +
export gvsqw_VersexpdbExpOracle='prod'
 +
export gvsqw_VersDeplexpdbExpOracle='v3.1'
 +
export gvsqw_Mail_oracle='dba'
 +
export gvsqw_MailMsg_oracle='TrtOraAuto'
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_MailMsg_oracle =>
 +
gvsqw_Mail_oracle =>
 +
gvsqw_RootexpdbExpOracle =>
 +
gvsqw_VersDeplexpdbExpOracle =>
 +
gvsqw_VersexpdbExpOracle =>
 +
</pre>
 
<br>
 
<br>
 
 
=== sqwc_GlobalVar.cfg ===
 
=== sqwc_GlobalVar.cfg ===
Fichier de configuration $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_GlobalVar.cfg:<br>
+
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_GlobalVar.cfg:<br>
Il contient les variables de fonctionnement de SQWareCentral pour le SGBD oracle.<br>
+
It contains the operating variables of SQWareCentral for oracle.<br>
Les variables que l'on veut modifier sont à placer dans $gvsqw_RootexpdbCentral/action/oracle/etc_cust/sqwc_GlobalVar.cfg.<br>
+
If you want to overload default variables,<br>
gvsqw_UserUniqueOracle => User Unix generique (unique) de deploiement [par défaut: 'sysdba']
+
put in $gvsqw_RootexpdbCentral/action/oracle/etc_cust/sqwc_GlobalVar.cfg<br>
 +
your modifications (only variables you want to modify).<br>
 +
<br>
 +
File content:
 +
<pre>
 +
export gvsqw_Mail_oracle='default@dbsqware.com'
 +
export gvsqw_MailMsg_oracle='TrtOraAuto'
 +
export gvsqw_UserUniqueOracle='dbsqware'
 +
export gvsqw_RootSQWareProductionOracle="~$gvsqw_UserUniqueOracle/SQWareProduction/oracle"
 +
export gvsqw_VersSQWareProductionOracle='prod'
 +
export gvsqw_VersDeplSQWareProductionOracle='v3.1'
 +
export gvsqw_DistSQWareProdUser_oracle="$gvsqw_UserUniqueOracle@$gvsqw_Hostname"
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
gvsqw_DistSQWareProdUser_oracle =>
 +
gvsqw_MailMsg_oracle =>
 +
gvsqw_Mail_oracle =>
 +
gvsqw_RootSQWareProductionOracle =>
 +
gvsqw_UserUniqueOracle =>
 +
gvsqw_VersDeplSQWareProductionOracle =>
 +
gvsqw_VersSQWareProductionOracle =>
 +
</pre>
 +
<br>
 +
=== tnsnames.ora ===
 +
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/tnsnames.ora:<br>
 +
It contains the operating variables of SQWareCentral for oracle.<br>
 +
If you want to overload default variables,<br>
 +
put in $gvsqw_RootexpdbCentral/action/oracle/etc_cust/tnsnames.ora<br>
 +
your modifications (only variables you want to modify).<br>
 +
<br>
 +
File content:
 +
<pre>
 +
</pre>
 +
<br>
 +
<br>
 +
Variable explanation:
 +
<pre>
 +
</pre>
 
<br>
 
<br>
 
 
=== .profile_confort ===
 
=== .profile_confort ===
Fichier de positionnement d'alias $gvsqw_RootexpdbCentral/action/oracle/etc/.profile_confort:<br>
+
File to put aliases $gvsqw_RootexpdbCentral/action/oracle/etc/.profile_confort:<br>
Il contient les alias de confort de SQWareCentral pour le SGBD oracle.<br>
+
Contains confort aliases of SQWareCentral for RDBMS oracle.<br>
Peut-être surchargé par $gvsqw_RootexpdbCentral/action/oracle/etc_cust/.profile_confort.<br>
+
<br>
act_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/prod;ls -al'
+
Alias explanation:
depl_ora => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_DeplScripts.ksh sqwora_GenLstUnique.ksh NOLOG CONFIRM'
+
<pre>
gen_ora => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh'
+
  act_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/prod;ls -al'
repind_ora => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicators.ksh sqwora_GenLstRepind.ksh NOLOG'
+
  etc_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/etc;ls -al'
 +
  lst_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/lst;ls -al'
 +
  auto_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/auto;ls -al'
 +
  cetc_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/etc_cust;ls -al'
 +
  clst_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/lst_cust;ls -al'
 +
  cauto_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/auto_cust;ls -al'
 +
  depl_ora => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh oracle sqwora_DeplScripts.ksh sqwora_GenLstUnique.ksh'
 +
  repind_ora => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicators.ksh sqwora_GenLstRepind.ksh NOLOG'
 +
  repind_ora_dist => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsDist.ksh sqwora_GenLstRepindDist.ksh NOLOG'
 +
  repind_ora_dg => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsDG.ksh sqwora_GenLstRepindDG.ksh NOLOG'
 +
  repind_ora_old => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsOld.ksh sqwora_GenLstRepindOld.ksh NOLOG'
 +
  gen_ora => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh'
 +
  gen_tns => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenTnsnames.ksh'
 +
  menu_ora => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh oracle'
 +
</pre>
 +
<br>
 
<br><br>
 
<br><br>
  
 
== lst ==
 
== lst ==
 +
=== sqwc_Extract_CMDB_Oracle.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_Extract_CMDB_Oracle.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_Extract_CMDB_Oracle.ksh.<br>
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select 'ORA;' || ref.ORACLE_SID || ';' || nvl(inf.HOST_NAME,ref.HOST_NAME)|| ';' || ref.Env || ';' || ref.Status || ';' ||
 +
from tsqw_Repository ref
 +
        on (ref.ORACLE_SID = hist.ORACLE_SID and hist.MONTH=trunc(sysdate,'MM'))
 +
        on (hist.ORACLE_SID = inf.ORACLE_SID and hist.GATHER_DATE = inf.GATHER_DATE)
 +
        on (hist.ORACLE_SID = vol.ORACLE_SID and hist.GATHER_DATE = vol.GATHER_DATE)
 +
order by 1
 +
</pre>
 +
<br>
 
=== sqwc_GenRefDbOracle.ksh ===
 
=== sqwc_GenRefDbOracle.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefDbOracle.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefDbOracle.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefDbOracle.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefDbOracle.ksh.<br>
Génére le fichier de référence ''schéma'' Oracle automatiquement à partir du référentiel contenu en bdd.<br>
 
[[SQWareRepository:general|En savoir plus sur le référentiel dbb.]]<br>
 
[[SQWareRepository:oracle|En savoir plus sur le référentiel dbb oracle.]]<br>
 
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/RefDb_oracle.txt.
 
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
select 'ORA;' || vol.ORACLE_SID || ';' || vol.OWNER || ';' || ref.Env || ';' ||
+
select 'ORA;' || decode(instr(ref.ORACLE_SID,':'),0,ref.ORACLE_SID,substr(ref.ORACLE_SID,1,instr(ref.ORACLE_SID,':')-1)) || ';' ||
  hist.Version || ';' || hist.maj_version || ';' || to_char(round(vol.size_sch/1024,0)) || ';' ||
 
  ref.Comments || ';' || ref.VIRT_HOST_NAME || ';' || ref.HOST_NAME || ';' || to_char(vol.GATHER_DATE,'DD/MM/YYYY')
 
 
from tsqw_Repository ref, tsqw_VolSchema vol, tsqw_GenHisto hist
 
from tsqw_Repository ref, tsqw_VolSchema vol, tsqw_GenHisto hist
 
where hist.MONTH=trunc(sysdate,'MM')
 
where hist.MONTH=trunc(sysdate,'MM')
Line 239: Line 826:
 
     and vol.OWNER not like 'OPS$%'
 
     and vol.OWNER not like 'OPS$%'
 
order by vol.OWNER, vol.ORACLE_SID
 
order by vol.OWNER, vol.ORACLE_SID
;
 
 
</pre>
 
</pre>
 
<br>
 
<br>
 
 
=== sqwc_GenRefOracle.ksh ===
 
=== sqwc_GenRefOracle.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefOracle.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefOracle.ksh.<br>
Génére le fichier de référence Oracle automatiquement à partir du référentiel contenu en bdd.<br>
 
[[SQWareRepository:general|En savoir plus sur le référentiel dbb.]]<br>
 
[[SQWareRepository:oracle|En savoir plus sur le référentiel dbb oracle.]]<br>
 
Le fichier de référence se trouvent dans $gvsqw_RootexpdbCentral/etc_cust/Ref_oracle.txt.
 
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
col vip_ for a22              head "VirtHost" trunc
+
echo "# generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
col uni_ for a12        head "Host"    trunc
+
select virt_host_name vip_, host_name uni_, username usr_, decode(instr(ORACLE_SID,':'),0,ORACLE_SID,substr(ORACLE_SID,1,instr(ORACLE_SID,':')-1)) bas_,
col usr_ for a12        head "User"    trunc
 
col bas_ for a8        head "Base"    trunc
 
col pot_ for 9999      head "Port"
 
col sta_ for a5        head "Stat"    trunc
 
col env_ for a3        head "Env"      trunc
 
col com_ for a30        head "Description"      trunc
 
col con_ for a20        head "Contact" trunc
 
col cli_ for a8        head "Client"  trunc
 
select virt_host_name vip_, host_name uni_, username usr_, oracle_sid bas_,
 
port pot_, status sta_, env env_, comments com_, contact con_, client cli_
 
 
from tsqw_Repository r
 
from tsqw_Repository r
union
 
 
select virt_host_name vip_, host_name uni_, username usr_, oracle_sid bas_,
 
select virt_host_name vip_, host_name uni_, username usr_, oracle_sid bas_,
port pot_, status sta_, env env_, comments com_, contact con_, client cli_
 
 
from tsqw_RepositoryOther r
 
from tsqw_RepositoryOther r
 
order by 2,1,3,4;
 
order by 2,1,3,4;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
+
=== sqwc_GenTnsnames.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenTnsnames.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenTnsnames.ksh.<br>
 +
<br><br>
 +
Query used:
 +
<pre>
 +
## @Synopsis tnsnames.ora generator from SQWareRepository
 +
echo "# tnsnames.ora generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
 +
select '#'||ENV||', '||CLIENT||', '||Contact||', '||COMMENTS||chr(10)
 +
from tsqw_Repository
 +
where STATUS!='OFF'
 +
order by ORACLE_SID
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstAwrDist.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstAwrDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstAwrDist.ksh.<br>
 +
Generation of the list of Oracle instances >= 10g for distant connection (tsqw_Repository/tsqw_GenHisto)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref
 +
where ref.STATUS in ('DIST','MIX')
 +
and exists ( select 1 from tsqw_GenHisto inf
 +
where inf.month = trunc(sysdate, 'MONTH')
 +
and ref.ORACLE_SID = inf.ORACLE_SID
 +
and to_number(substr(inf.VERSION,0,instr(inf.VERSION,'.')-1)||substr(inf.VERSION,instr(inf.VERSION,'.')+1,1)) >= 102)
 +
order by 1;
 +
</pre>
 +
<br>
 
=== sqwora_GenLstAwr.ksh ===
 
=== sqwora_GenLstAwr.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstAwr.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstAwr.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstAwr.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstAwr.ksh.<br>
Generation de la liste des instances Oracle >= 10g (tsqw_Repository/tsqw_GenHisto)
+
Generation of the list of Oracle instances >= 10g (tsqw_Repository/tsqw_GenHisto)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
from tsqw_Repository ref
 
from tsqw_Repository ref
where ref.STATUS = 'ON'
+
where ref.STATUS in ('ON','MIX')
 
and exists ( select 1 from tsqw_GenHisto inf
 
and exists ( select 1 from tsqw_GenHisto inf
where inf.GATHER_DATE = trunc(sysdate)
+
where inf.month = trunc(sysdate, 'MONTH')
 +
and ref.ORACLE_SID = inf.ORACLE_SID
 +
and to_number(substr(inf.VERSION,0,instr(inf.VERSION,'.')-1)||substr(inf.VERSION,instr(inf.VERSION,'.')+1,1)) >= 102)
 
order by 1;
 
order by 1;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstanceDG.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceDG.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceDG.ksh.<br>
 +
Generation of the list of Oracle dataguard instances (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS in ('DG')
 +
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstanceDist.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceDist.ksh.<br>
 +
Generation of the list of Oracle instances for distant connection (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS in ('DIST','MIX')
 +
order by VIRT_HOST_NAME, USERNAME;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GenLstInstance.ksh ===
 
=== sqwora_GenLstInstance.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstance.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstance.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstance.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstance.ksh.<br>
Generation de la liste des instances Oracle (tsqw_Repository)
+
Generation of the list of Oracle instances (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS in ('ON','MIX')
 +
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstanceNoProd.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceNoProd.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceNoProd.ksh.<br>
 +
Generation of the list of Oracle no production instances (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS = 'ON'
 +
and ENV != 'PRD'
 +
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstanceOld.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceOld.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceOld.ksh.<br>
 +
Generation of the list of Oracle instances (old version) for distant connection (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS like 'OLD%'
 +
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstanceProd.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceProd.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceProd.ksh.<br>
 +
Generation of the list of Oracle production instances (tsqw_Repository)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 
from tsqw_Repository
 
from tsqw_Repository
 
where STATUS = 'ON'
 
where STATUS = 'ON'
 +
and ENV = 'PRD'
 
order by VIRT_HOST_NAME, USERNAME;
 
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstancesSsh.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstancesSsh.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstancesSsh.ksh.<br>
 +
Generation of the list for ssh connection
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||cust.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref, tsqw_UserSsh cust
 +
where ref.STATUS != 'OFF'
 +
and cust.STATUS = 'ON'
 +
and ref.ORACLE_SID = cust.ORACLE_SID
 +
order by ref.VIRT_HOST_NAME, cust.USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstInstancesSshNew.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstancesSshNew.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstancesSshNew.ksh.<br>
 +
Generation of the list for ssh connection
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||cust.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref, tsqw_UserSsh cust
 +
where ref.STATUS != 'OFF'
 +
and cust.STATUS = 'NEW'
 +
and ref.ORACLE_SID = cust.ORACLE_SID
 +
order by ref.VIRT_HOST_NAME, cust.USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstNewInstances.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstNewInstances.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstNewInstances.ksh.<br>
 +
Generation of new instances list (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
 +
from tsqw_Repository
 +
where STATUS = 'NEW'
 +
order by VIRT_HOST_NAME, USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstNewInstancesUnique.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstNewInstancesUnique.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstNewInstancesUnique.ksh.<br>
 +
Generation of new instances list (unique) (tsqw_Repository)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select distinct VIRT_HOST_NAME||' '||USERNAME
 +
from tsqw_Repository
 +
where STATUS = 'NEW'
 +
order by 1;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstNewUnique.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstNewUnique.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstNewUnique.ksh.<br>
 +
Generation of the user unique list (tsqw_Repository/tsqw_RepositoryOther)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 +
from tsqw_Repository
 +
where STATUS = 'NEW'
 +
order by 1
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GenLstRepBckFull.ksh ===
 
=== sqwora_GenLstRepBckFull.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckFull.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckFull.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckFull.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckFull.ksh.<br>
Generation de la liste pour reprise des backups full (tsqw_Repository/tsqw_VolBackups)
+
Generation of the list for reprise of full backups (tsqw_Repository/tsqw_VolBackups)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
Line 313: Line 1,050:
 
where not exists ( select 1 from tsqw_VolBackups inf
 
where not exists ( select 1 from tsqw_VolBackups inf
 
                     where inf.BEGINNING >= sysdate-$gvsqw_NbDaysFull
 
                     where inf.BEGINNING >= sysdate-$gvsqw_NbDaysFull
 +
                    and ref.ORACLE_SID = inf.ORACLE_SID
 +
                    and inf.BCK_TYPE like '%incremental level 0%'
 +
                    and inf.STATUS = 0
 
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
 
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
 
                     where ref.ORACLE_SID = ecl.ORACLE_SID)
 
                     where ref.ORACLE_SID = ecl.ORACLE_SID)
 +
and ref.STATUS in ('ON','MIX')
 
order by 1;
 
order by 1;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GenLstRepBckInc.ksh ===
 
=== sqwora_GenLstRepBckInc.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckInc.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckInc.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckInc.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckInc.ksh.<br>
Generation de la liste pour reprise des backups inc (tsqw_Repository/tsqw_VolBackups)
+
Generation of the list for reprise of inc backups (tsqw_Repository/tsqw_VolBackups)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
Line 329: Line 1,070:
 
where not exists ( select 1 from tsqw_VolBackups inf
 
where not exists ( select 1 from tsqw_VolBackups inf
 
                     where inf.BEGINNING >= sysdate-$gvsqw_NbDaysInc
 
                     where inf.BEGINNING >= sysdate-$gvsqw_NbDaysInc
 +
                    and ref.ORACLE_SID = inf.ORACLE_SID
 +
                    and inf.BCK_TYPE like '%incremental level%'
 +
                    and inf.STATUS = 0
 
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
 
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
 
                     where ref.ORACLE_SID = ecl.ORACLE_SID)
 
                     where ref.ORACLE_SID = ecl.ORACLE_SID)
 +
and ref.STATUS in ('ON','MIX')
 
order by 1;
 
order by 1;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstRepindDG.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepindDG.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepindDG.ksh.<br>
 +
Generation of the list for reprise of indicators for dataguard (tsqw_Repository/tsqw_GenHisto)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref
 +
where ref.STATUS in ('DG')
 +
and not exists ( select 1 from tsqw_GenHisto inf
 +
where inf.GATHER_DATE = trunc(sysdate)
 +
and ref.ORACLE_SID = inf.ORACLE_SID)
 +
order by ref.VIRT_HOST_NAME, ref.USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstRepindDist.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepindDist.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepindDist.ksh.<br>
 +
Generation of the list for reprise of indicators for distant connection (tsqw_Repository/tsqw_GenHisto)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref
 +
where ref.STATUS in ('DIST','MIX')
 +
and not exists ( select 1 from tsqw_GenHisto inf
 +
where inf.GATHER_DATE = trunc(sysdate)
 +
and ref.ORACLE_SID = inf.ORACLE_SID)
 +
order by ref.VIRT_HOST_NAME, ref.USERNAME;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GenLstRepind.ksh ===
 
=== sqwora_GenLstRepind.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepind.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepind.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepind.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_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 ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 
from tsqw_Repository ref
 
from tsqw_Repository ref
where ref.STATUS = 'ON'
+
where ref.STATUS in ('ON','MIX')
 
and not exists ( select 1 from tsqw_GenHisto inf
 
and not exists ( select 1 from tsqw_GenHisto inf
 
where inf.GATHER_DATE = trunc(sysdate)
 
where inf.GATHER_DATE = trunc(sysdate)
order by VIRT_HOST_NAME, ref.USERNAME;
+
and ref.ORACLE_SID = inf.ORACLE_SID)
 +
order by ref.VIRT_HOST_NAME, ref.USERNAME;
 +
</pre>
 +
<br>
 +
=== sqwora_GenLstRepindOld.ksh ===
 +
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepindOld.ksh:<br>
 +
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepindOld.ksh.<br>
 +
Generation of the list for reprise of indicators (old version) for distant connection (tsqw_Repository/tsqw_GenHisto)
 +
<br><br>
 +
Query used:
 +
<pre>
 +
select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
 +
from tsqw_Repository ref
 +
where ref.STATUS like 'OLD%'
 +
and not exists ( select 1 from tsqw_GenHisto inf
 +
where inf.GATHER_DATE = trunc(sysdate)
 +
and ref.ORACLE_SID = inf.ORACLE_SID)
 +
order by ref.VIRT_HOST_NAME, ref.USERNAME;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
=== sqwora_GenLstUnique.ksh ===
 
=== sqwora_GenLstUnique.ksh ===
Script de génération de liste $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstUnique.ksh:<br>
+
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstUnique.ksh:<br>
Peut-être remplacé par $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstUnique.ksh.<br>
+
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstUnique.ksh.<br>
Generation liste user unique (tsqw_Repository/tsqw_RepositoryOther)
+
Generation of the user unique list (tsqw_Repository/tsqw_RepositoryOther)
 
<br><br>
 
<br><br>
Requête utilisée:
+
Query used:
 
<pre>
 
<pre>
 
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 
from tsqw_Repository
 
from tsqw_Repository
where STATUS = 'ON'
+
where STATUS in ('ON','MIX','DG')
 
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 
from tsqw_RepositoryOther
 
from tsqw_RepositoryOther
 +
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
 +
from tsqw_RepositoryRac
 
order by 1;
 
order by 1;
 
</pre>
 
</pre>
 
<br>
 
<br>
 
<br><br>
 
<br><br>

Latest revision as of 22:53, 17 December 2012

Contents

auto

sqwora_AdddbSQWareProfile.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_AdddbSQWareProfile.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_AdddbSQWareProfile.ksh.
Add dbSQWare profile

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
if [ -r ~/.profile ]
then
	if [ \$(grep -c 'gvsqw_OraBin' ~/.profile) -eq 0 ]
	then
		cat <<EOFCAT >>~/.profile

#dbSQWare
export gvsqw_Env=''
export gvsqw_OraBin=\\\$HOME/SQWareProduction/oracle/bin
lvsqw_IsTerminal=\\\$(tty 2>&1 >/dev/null;echo \\\$?)
if [ "\\\$lvsqw_IsTerminal" = "0" ] && [ -r \\\$gvsqw_OraBin/../etc/.profile_confort ]
then
	. \\\$gvsqw_OraBin/../etc/.profile_confort
fi

EOFCAT
	fi
elif [ -r ~/.bash_profile ]
then
	if [ \$(grep -c 'gvsqw_OraBin' ~/.bash_profile) -eq 0 ]
	then
		cat <<EOFCAT >>~/.bash_profile

#dbSQWare
export gvsqw_Env=''
export gvsqw_OraBin=\\\$HOME/SQWareProduction/oracle/bin
lvsqw_IsTerminal=\\\$(tty 2>&1 >/dev/null;echo \\\$?)
if [ "\\\$lvsqw_IsTerminal" = "0" ] && [ -r \\\$gvsqw_OraBin/../etc/.profile_confort ]
then
	. \\\$gvsqw_OraBin/../etc/.profile_confort
fi

EOFCAT
	fi
fi
EOFSSH
done <$gvsqw_TmpFile.lst

}


sqwora_CheckInstance.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_CheckInstance.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_CheckInstance.ksh.
Check parameters and security

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A CheckInstance
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_DeplScripts.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_DeplScripts.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_DeplScripts.ksh.
SQWareProduction deployment for Oracle

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_RootSQWareProductionOracle/$gvsqw_VersDeplSQWareProductionOracle
cd $gvsqw_RootSQWareProductionOracle
rm -f $gvsqw_VersSQWareProductionOracle
ln -s $gvsqw_VersDeplSQWareProductionOracle $gvsqw_VersSQWareProductionOracle
EOFSSH
rsync -aHv $gvsqw_RsyncPathOracle --delete $gvsqw_RootSQWareProduction/oracle/$gvsqw_VersDeplSQWareProductionOracle $lvsqw_UserName@$lvsqw_HostName:$gvsqw_RootSQWareProductionOracle/.
done <$gvsqw_TmpFile.lst
}


sqwora_GatherDistFsSize.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherDistFsSize.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherDistFsSize.ksh.
Gather FS size

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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
\$gvsqw_OraBin/sqwora_GatherDistantFsSize.ksh -I "$lvsqw_Instance" -U "$lvsqw_UserName" -H "$lvsqw_HostName"
EOFSSH
sleep 3
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GatherIndicatorsDG.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsDG.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsDG.ksh.
Oracle dataguard gather indicators in distant mode

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -DG
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GatherIndicatorsDist.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsDist.ksh.
Oracle gather indicators in distant mode

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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
\$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -Dist
EOFSSH
sleep 4
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GatherIndicators.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicators.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicators.ksh.
Oracle gather indicators

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A IndicDba
EOFSSH
sleep 1
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GatherIndicatorsOld.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GatherIndicatorsOld.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GatherIndicatorsOld.ksh.
Oracle (old version) gather indicators in distant mode

Action:

lfsqw_Action()
{
if [ -r $HOME/.profile_old_oracle_client ]
then
. $HOME/.profile_old_oracle_client
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
$gvsqw_OraBin/sqwora_GatherIndicators.ksh -I "$lvsqw_Instance" -Dist &
sleep 5
done <$gvsqw_TmpFile.lst
jobs
wait
else
	echo "To use sqwora_GatherIndicatorsOld.ksh, you must set profile for old client in $HOME/.profile_old_oracle_client"
fi
}


sqwora_Gen_dbSQWare.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_Gen_dbSQWare.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_Gen_dbSQWare.ksh.
generate dbSQWare files

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
if [ "\$ORACLE_SID" != "$lvsqw_Instance" ]
then
	export ORACLE_SID="$lvsqw_Instance"
fi
\$gvsqw_OraBin/../tools/sqwora_GenerateCreateDatabase.ksh -dbsOnly <<EOF
y
EOF
EOFSSH
done <$gvsqw_TmpFile.lst
}


sqwora_GenEdt.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenEdt.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenEdt.ksh.
generate EDT files

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/../tools/sqwora_GenerateCreateDatabase.ksh -P 1521 -edtOnly <<EOF
y
EOF
EOFSSH
done <$gvsqw_TmpFile.lst
}


sqwora_GenerateAwrDist.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwrDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwrDist.ksh.
Generate AWR reports in distant mode

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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
\$gvsqw_OraBin/sqwora_GenerateAwr.ksh -I "$lvsqw_Instance" -Dist
EOFSSH
sleep 20
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GenerateAwr.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwr.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwr.ksh.
Generate AWR reports

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A GenAwr
EOFSSH
sleep 10
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_GenSshKeysInstance.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenSshKeysInstance.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenSshKeysInstance.ksh.
ssh keys deployment for Oracle

Action:

lfsqw_Action()
{

echo "#########################################################################"
echo "#Create/Retrieve key for SQWareCentral"
mkdir -p $HOME/tmp
if [ -r $HOME/.ssh/id_dsa.pub ]
then
	echo "Id DSA found:"
	ls -l $HOME/.ssh/id_dsa.pub
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_dsa.pub)
elif [ -r $HOME/.ssh/id_rsa.pub ]
then
	echo "Id RSA found:"
	ls -l $HOME/.ssh/id_rsa.pub
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
else
	ssh-keygen -t rsa -N '' -f $HOME/.ssh/id_rsa
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
fi
#Retrieve additionnal keys if found (your windows key for exemple)
if [ -r $HOME/.ssh/id_dbSQWare.pub ]
then
	echo "Id dbSQWare found:"
	ls -l $HOME/.ssh/id_dbSQWare.pub
	lvsqw_AdditionnalKey=$(cat $HOME/.ssh/id_dbSQWare.pub)
else
	lvsqw_AdditionnalKey=""
fi
chmod go-w $HOME
touch $HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
echo "${c_menu}#########################################################################"
echo "#create key if not found and put SQWareCentral key for distant users"
echo "Enter password when necessary${c_normal}"
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
echo ""
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh -o StrictHostKeyChecking=no $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
mkdir -p \$HOME/tmp
if [ -r \$HOME/.ssh/id_dsa.pub ]
then
	echo "Id DSA found:"
	ls -l \$HOME/.ssh/id_dsa.pub
	cat \$HOME/.ssh/id_dsa.pub
elif [ -r \$HOME/.ssh/id_rsa.pub ]
then
	echo "Id RSA found:"
	ls -l \$HOME/.ssh/id_rsa.pub
	cat \$HOME/.ssh/id_rsa.pub
else
	ssh-keygen -t rsa -N '' -f \$HOME/.ssh/id_rsa
	cat \$HOME/.ssh/id_rsa.pub
fi
chmod go-w \$HOME
echo "$lvsqw_CentralKey" >>\$HOME/.ssh/authorized_keys
echo "$lvsqw_AdditionnalKey" >>\$HOME/.ssh/authorized_keys
chmod 700 \$HOME/.ssh
chmod 600 \$HOME/.ssh/authorized_keys
EOFSSH

done <$gvsqw_TmpFile.lst
}


sqwora_GenSshKeys.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenSshKeys.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenSshKeys.ksh.
ssh keys deployment for Oracle

Action:

lfsqw_Action()
{

echo "#########################################################################"
echo "#Create/Retrieve key for SQWareCentral"
mkdir -p $HOME/tmp
if [ -r $HOME/.ssh/id_dsa.pub ]
then
	echo "Id DSA found:"
	ls -l $HOME/.ssh/id_dsa.pub
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_dsa.pub)
elif [ -r $HOME/.ssh/id_rsa.pub ]
then
	echo "Id RSA found:"
	ls -l $HOME/.ssh/id_rsa.pub
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
else
	ssh-keygen -t rsa -N '' -f $HOME/.ssh/id_rsa
	lvsqw_CentralKey=$(cat $HOME/.ssh/id_rsa.pub)
fi
#Retrieve additionnal keys if found (your windows key for exemple)
if [ -r $HOME/.ssh/id_dbSQWare.pub ]
then
	echo "Id dbSQWare found:"
	ls -l $HOME/.ssh/id_dbSQWare.pub
	lvsqw_AdditionnalKey=$(cat $HOME/.ssh/id_dbSQWare.pub)
else
	lvsqw_AdditionnalKey=""
fi
chmod go-w $HOME
touch $HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
echo "${c_menu}#########################################################################"
echo "#create key if not found and put SQWareCentral key for distant users"
echo "Enter password when necessary${c_normal}"
while read lvsqw_HostName lvsqw_UserName
do
echo ""
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh -o StrictHostKeyChecking=no $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
mkdir -p \$HOME/tmp
if [ -r \$HOME/.ssh/id_dsa.pub ]
then
	echo "Id DSA found:"
	ls -l \$HOME/.ssh/id_dsa.pub
	cat \$HOME/.ssh/id_dsa.pub
elif [ -r \$HOME/.ssh/id_rsa.pub ]
then
	echo "Id RSA found:"
	ls -l \$HOME/.ssh/id_rsa.pub
	cat \$HOME/.ssh/id_rsa.pub
else
	ssh-keygen -t rsa -N '' -f \$HOME/.ssh/id_rsa
	cat \$HOME/.ssh/id_rsa.pub
fi
chmod go-w \$HOME
echo "$lvsqw_CentralKey" >>\$HOME/.ssh/authorized_keys
echo "$lvsqw_AdditionnalKey" >>\$HOME/.ssh/authorized_keys
chmod 700 \$HOME/.ssh
chmod 600 \$HOME/.ssh/authorized_keys
EOFSSH

done <$gvsqw_TmpFile.lst
}


sqwora_MajTnsIfile.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MajTnsIfile.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MajTnsIfile.ksh.
Insert ifile reference to dbSQWare tnsnames.ora

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH
if [ -r \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh ] && [ "\$ORACLE_SID" != "$lvsqw_Instance" ]
then
	. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
fi
if [ -w \$ORACLE_HOME/network/admin/tnsnames.ora ]
then
	if [ \$(grep -c 'SQWareProduction/oracle' \$ORACLE_HOME/network/admin/tnsnames.ora) -eq 0 ]
	then
		echo "Update \$ORACLE_HOME/network/admin/tnsnames.ora"
		echo "ifile=\$HOME/SQWareProduction/oracle/etc_cust/tnsnames.ora" >>\$ORACLE_HOME/network/admin/tnsnames.ora
	else
		echo "Reference of SQWareProduction found in \$ORACLE_HOME/network/admin/tnsnames.ora"
		grep 'SQWareProduction/oracle' \$ORACLE_HOME/network/admin/tnsnames.ora
	fi
else
	echo "No write permission on \$ORACLE_HOME/network/admin/tnsnames.ora"
fi
EOFSSH
done <$gvsqw_TmpFile.lst
}


sqwora_MonitorAwrDist.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MonitorAwrDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MonitorAwrDist.ksh.
Monitor with AWR in distant mode

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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
\$gvsqw_OraBin/sqwora_MonitorWithAwr.ksh -I "$lvsqw_Instance" -Dist
EOFSSH
sleep 10
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_MonitorHourlyAwrDist.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_MonitorHourlyAwrDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_MonitorHourlyAwrDist.ksh.
Monitor hourly with AWR in distant mode

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 $gvsqw_DistSQWareProdUser_oracle <<EOFSSH &
\$gvsqw_OraBin/sqwora_MonitorWithAwr.ksh -I "$lvsqw_Instance" -BD 'sysdate-(1/24*2)' -Dist
EOFSSH
sleep 10
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_RetrieveHash.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RetrieveHash.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RetrieveHash.ksh.
retrieve hashs for Oracle users

Action:

lfsqw_Action()
{
lvsqw_FicRef=$gvsqw_RootexpdbCentral/etc_cust/Hash_oracle.csv
> $lvsqw_FicRef
chmod 600 $lvsqw_FicRef
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH>$lvsqw_FicRef.tmp
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/../tools/sqwora_BackupPasswd.ksh -I $lvsqw_Instance -T hash
EOFSSH
cat $lvsqw_FicRef.tmp|grep "^$lvsqw_Instance;" >>$lvsqw_FicRef
done <$gvsqw_TmpFile.lst

}


sqwora_RmanFull.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanFull.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanFull.ksh.
Backup full with RMAN (incremental level 0)

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanFull
EOFSSH
sleep 30
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_RmanInc.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_RmanInc.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_RmanInc.ksh.
Backup inc with RMAN (incremental level 2)

Action:

lfsqw_Action()
{
while read lvsqw_HostName lvsqw_UserName lvsqw_Instance
do
lvsqw_Instance=$(echo "$lvsqw_Instance"|cut -d':' -f1)
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName $lvsqw_Instance${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH &
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanInc
EOFSSH
sleep 30
done <$gvsqw_TmpFile.lst
jobs
wait
}


sqwora_StartedInstances.ksh

Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_StartedInstances.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_StartedInstances.ksh.
collection of active instances

Action:

lfsqw_Action()
{
>$gvsqw_TmpFile
while read lvsqw_HostName lvsqw_UserName
do
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}"
ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH>>$gvsqw_TmpFile
ps -edf |grep 'pmon_[a-zA-Z][a-zA-Z]*'|grep -v grep|awk '{print "indic $lvsqw_HostName",\$1,\$NF}'|sed 's,ora_pmon_,,'
EOFSSH
done <$gvsqw_TmpFile.lst

grep '^indic ' $gvsqw_TmpFile >$gvsqw_TmpFile.bis
echo "delete tsqw_StartedInstances;">$gvsqw_TmpFile.sql
while read lvsqw_Tmp lvsqw_Host lvsqw_User lvsqw_Instance
do
	echo "insert into tsqw_StartedInstances (ORACLE_SID,GATHER_DATE,HOST_NAME,USERNAME) values ('$lvsqw_Instance',trunc(sysdate),'$lvsqw_Host','$lvsqw_User');">>$gvsqw_TmpFile.sql
done <$gvsqw_TmpFile.bis
echo "commit;" >>$gvsqw_TmpFile.sql
sqlplus -s -L /nolog <<EOFSQL|grep -iv 'Connected'
conn $gvsqw_DbRefUser_oracle/$gvsqw_DbRefPass_oracle@$gvsqw_DbRefInstance_oracle
@$gvsqw_TmpFile.sql
EOFSQL
}




etc

CrontabRef.cfg

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

File content:




Variable explanation:



sqwc_DbRefVar.cfg

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

File content:

export gvsqw_DbRefType_oracle='oracle'
export gvsqw_DbRefPort_oracle='InstancePortForOracle'
export gvsqw_DbRefInstance_oracle='InstanceNameForOracle'
export gvsqw_DbRefDatabase_oracle='DatabaseInstanceNameForOracle'
export gvsqw_DbRefUser_oracle='ConnexionUserForOracle'
export gvsqw_DbRefPass_oracle='ConnexionPassForOracle'



Variable explanation:

gvsqw_DbRefDatabase_oracle => 
gvsqw_DbRefInstance_oracle => 
gvsqw_DbRefPass_oracle => 
gvsqw_DbRefPort_oracle => 
gvsqw_DbRefType_oracle => 
gvsqw_DbRefUser_oracle => 


sqwc_ExpVar.cfg

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

File content:

export gvsqw_RootexpdbExpOracle="~$gvsqw_UserUniqueOracle/SQWareProduction/oracle"
export gvsqw_VersexpdbExpOracle='prod'
export gvsqw_VersDeplexpdbExpOracle='v3.1'
export gvsqw_Mail_oracle='dba'
export gvsqw_MailMsg_oracle='TrtOraAuto'



Variable explanation:

gvsqw_MailMsg_oracle => 
gvsqw_Mail_oracle => 
gvsqw_RootexpdbExpOracle => 
gvsqw_VersDeplexpdbExpOracle => 
gvsqw_VersexpdbExpOracle => 


sqwc_GlobalVar.cfg

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

File content:

export gvsqw_Mail_oracle='default@dbsqware.com'
export gvsqw_MailMsg_oracle='TrtOraAuto'
export gvsqw_UserUniqueOracle='dbsqware'
export gvsqw_RootSQWareProductionOracle="~$gvsqw_UserUniqueOracle/SQWareProduction/oracle"
export gvsqw_VersSQWareProductionOracle='prod'
export gvsqw_VersDeplSQWareProductionOracle='v3.1'
export gvsqw_DistSQWareProdUser_oracle="$gvsqw_UserUniqueOracle@$gvsqw_Hostname"



Variable explanation:

gvsqw_DistSQWareProdUser_oracle => 
gvsqw_MailMsg_oracle => 
gvsqw_Mail_oracle => 
gvsqw_RootSQWareProductionOracle => 
gvsqw_UserUniqueOracle => 
gvsqw_VersDeplSQWareProductionOracle => 
gvsqw_VersSQWareProductionOracle => 


tnsnames.ora

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

File content:




Variable explanation:



.profile_confort

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

Alias explanation:

	  act_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/prod;ls -al'
	  etc_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/etc;ls -al'
	  lst_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/lst;ls -al'
	  auto_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/auto;ls -al'
	  cetc_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/etc_cust;ls -al'
	  clst_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/lst_cust;ls -al'
	  cauto_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/auto_cust;ls -al'
	  depl_ora => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh oracle sqwora_DeplScripts.ksh sqwora_GenLstUnique.ksh'
	  repind_ora => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicators.ksh sqwora_GenLstRepind.ksh NOLOG'
	  repind_ora_dist => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsDist.ksh sqwora_GenLstRepindDist.ksh NOLOG'
	  repind_ora_dg => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsDG.ksh sqwora_GenLstRepindDG.ksh NOLOG'
	  repind_ora_old => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicatorsOld.ksh sqwora_GenLstRepindOld.ksh NOLOG'
	  gen_ora => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh'
	  gen_tns => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenTnsnames.ksh'
	  menu_ora => '$gvsqw_RootexpdbCentral/menu/sqwc_MenuAction.ksh oracle'




lst

sqwc_Extract_CMDB_Oracle.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_Extract_CMDB_Oracle.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_Extract_CMDB_Oracle.ksh.


Query used:

select 'ORA;' || ref.ORACLE_SID || ';' || nvl(inf.HOST_NAME,ref.HOST_NAME)|| ';' || ref.Env || ';' || ref.Status || ';' ||
from tsqw_Repository ref 
        on (ref.ORACLE_SID = hist.ORACLE_SID and hist.MONTH=trunc(sysdate,'MM'))
        on (hist.ORACLE_SID = inf.ORACLE_SID and hist.GATHER_DATE = inf.GATHER_DATE)
        on (hist.ORACLE_SID = vol.ORACLE_SID and hist.GATHER_DATE = vol.GATHER_DATE)
order by 1


sqwc_GenRefDbOracle.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefDbOracle.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefDbOracle.ksh.


Query used:

select 'ORA;' || decode(instr(ref.ORACLE_SID,':'),0,ref.ORACLE_SID,substr(ref.ORACLE_SID,1,instr(ref.ORACLE_SID,':')-1)) || ';' ||
from tsqw_Repository ref, tsqw_VolSchema vol, tsqw_GenHisto hist
where hist.MONTH=trunc(sysdate,'MM')
    and ref.ORACLE_SID = hist.ORACLE_SID
    and hist.ORACLE_SID = vol.ORACLE_SID
    and hist.GATHER_DATE = vol.GATHER_DATE
    and ref.STATUS!='OFF'
    and vol.OWNER not in ('SYSTEM','SYSMAN','OTLN')
    and vol.OWNER not like 'OPS$%'
order by vol.OWNER, vol.ORACLE_SID


sqwc_GenRefOracle.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenRefOracle.ksh.


Query used:

echo "# generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
select virt_host_name vip_, host_name uni_, username usr_, decode(instr(ORACLE_SID,':'),0,ORACLE_SID,substr(ORACLE_SID,1,instr(ORACLE_SID,':')-1)) bas_,
from tsqw_Repository r
select virt_host_name vip_, host_name uni_, username usr_, oracle_sid bas_,
from tsqw_RepositoryOther r
order by 2,1,3,4;


sqwc_GenTnsnames.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenTnsnames.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwc_GenTnsnames.ksh.


Query used:

## @Synopsis	tnsnames.ora generator from SQWareRepository
echo "# tnsnames.ora generated by SQWareCentral (module of dbSQWare) from SQWareRepository" > $lvsqw_FicRef
select '#'||ENV||', '||CLIENT||', '||Contact||', '||COMMENTS||chr(10)
from tsqw_Repository
where STATUS!='OFF'
order by ORACLE_SID


sqwora_GenLstAwrDist.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstAwrDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstAwrDist.ksh.
Generation of the list of Oracle instances >= 10g for distant connection (tsqw_Repository/tsqw_GenHisto)

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS in ('DIST','MIX')
and exists ( select 1 from tsqw_GenHisto inf
where inf.month = trunc(sysdate, 'MONTH')
and ref.ORACLE_SID = inf.ORACLE_SID
and to_number(substr(inf.VERSION,0,instr(inf.VERSION,'.')-1)||substr(inf.VERSION,instr(inf.VERSION,'.')+1,1)) >= 102)
order by 1;


sqwora_GenLstAwr.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstAwr.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstAwr.ksh.
Generation of the list of Oracle instances >= 10g (tsqw_Repository/tsqw_GenHisto)

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS in ('ON','MIX')
and exists ( select 1 from tsqw_GenHisto inf
where inf.month = trunc(sysdate, 'MONTH')
and ref.ORACLE_SID = inf.ORACLE_SID
and to_number(substr(inf.VERSION,0,instr(inf.VERSION,'.')-1)||substr(inf.VERSION,instr(inf.VERSION,'.')+1,1)) >= 102)
order by 1;


sqwora_GenLstInstanceDG.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceDG.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceDG.ksh.
Generation of the list of Oracle dataguard instances (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS in ('DG')
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstanceDist.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceDist.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceDist.ksh.
Generation of the list of Oracle instances for distant connection (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS in ('DIST','MIX')
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstance.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstance.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstance.ksh.
Generation of the list of Oracle instances (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS in ('ON','MIX')
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstanceNoProd.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceNoProd.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceNoProd.ksh.
Generation of the list of Oracle no production instances (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS = 'ON'
and ENV != 'PRD'
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstanceOld.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceOld.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceOld.ksh.
Generation of the list of Oracle instances (old version) for distant connection (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS like 'OLD%'
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstanceProd.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstanceProd.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstanceProd.ksh.
Generation of the list of Oracle production instances (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS = 'ON'
and ENV = 'PRD'
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstInstancesSsh.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstancesSsh.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstancesSsh.ksh.
Generation of the list for ssh connection

Query used:

select ref.VIRT_HOST_NAME||' '||cust.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref, tsqw_UserSsh cust
where ref.STATUS != 'OFF'
and cust.STATUS = 'ON'
and ref.ORACLE_SID = cust.ORACLE_SID
order by ref.VIRT_HOST_NAME, cust.USERNAME;


sqwora_GenLstInstancesSshNew.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstInstancesSshNew.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstInstancesSshNew.ksh.
Generation of the list for ssh connection

Query used:

select ref.VIRT_HOST_NAME||' '||cust.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref, tsqw_UserSsh cust
where ref.STATUS != 'OFF'
and cust.STATUS = 'NEW'
and ref.ORACLE_SID = cust.ORACLE_SID
order by ref.VIRT_HOST_NAME, cust.USERNAME;


sqwora_GenLstNewInstances.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstNewInstances.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstNewInstances.ksh.
Generation of new instances list (tsqw_Repository)

Query used:

select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID
from tsqw_Repository
where STATUS = 'NEW'
order by VIRT_HOST_NAME, USERNAME;


sqwora_GenLstNewInstancesUnique.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstNewInstancesUnique.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstNewInstancesUnique.ksh.
Generation of new instances list (unique) (tsqw_Repository)

Query used:

select distinct VIRT_HOST_NAME||' '||USERNAME
from tsqw_Repository
where STATUS = 'NEW'
order by 1;


sqwora_GenLstNewUnique.ksh

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

Query used:

select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
from tsqw_Repository
where STATUS = 'NEW'
order by 1


sqwora_GenLstRepBckFull.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckFull.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckFull.ksh.
Generation of the list for reprise of full backups (tsqw_Repository/tsqw_VolBackups)

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where not exists ( select 1 from tsqw_VolBackups inf
                    where inf.BEGINNING >= sysdate-$gvsqw_NbDaysFull
                    and ref.ORACLE_SID = inf.ORACLE_SID
                    and inf.BCK_TYPE like '%incremental level 0%'
                    and inf.STATUS = 0
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
                    where ref.ORACLE_SID = ecl.ORACLE_SID)
and ref.STATUS in ('ON','MIX')
order by 1;


sqwora_GenLstRepBckInc.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepBckInc.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepBckInc.ksh.
Generation of the list for reprise of inc backups (tsqw_Repository/tsqw_VolBackups)

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where not exists ( select 1 from tsqw_VolBackups inf
                    where inf.BEGINNING >= sysdate-$gvsqw_NbDaysInc
                    and ref.ORACLE_SID = inf.ORACLE_SID
                    and inf.BCK_TYPE like '%incremental level%'
                    and inf.STATUS = 0
and not exists ( select 1 from tsqw_VolBackupsExclude ecl
                    where ref.ORACLE_SID = ecl.ORACLE_SID)
and ref.STATUS in ('ON','MIX')
order by 1;


sqwora_GenLstRepindDG.ksh

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

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS in ('DG')
and not exists ( select 1 from tsqw_GenHisto inf
where inf.GATHER_DATE = trunc(sysdate)
and ref.ORACLE_SID = inf.ORACLE_SID)
order by ref.VIRT_HOST_NAME, ref.USERNAME;


sqwora_GenLstRepindDist.ksh

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

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS in ('DIST','MIX')
and not exists ( select 1 from tsqw_GenHisto inf
where inf.GATHER_DATE = trunc(sysdate)
and ref.ORACLE_SID = inf.ORACLE_SID)
order by ref.VIRT_HOST_NAME, ref.USERNAME;


sqwora_GenLstRepind.ksh

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

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS in ('ON','MIX')
and not exists ( select 1 from tsqw_GenHisto inf
where inf.GATHER_DATE = trunc(sysdate)
and ref.ORACLE_SID = inf.ORACLE_SID)
order by ref.VIRT_HOST_NAME, ref.USERNAME;


sqwora_GenLstRepindOld.ksh

List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwora_GenLstRepindOld.ksh:
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/lst_cust/sqwora_GenLstRepindOld.ksh.
Generation of the list for reprise of indicators (old version) for distant connection (tsqw_Repository/tsqw_GenHisto)

Query used:

select ref.VIRT_HOST_NAME||' '||ref.USERNAME||' '||ref.ORACLE_SID
from tsqw_Repository ref
where ref.STATUS like 'OLD%'
and not exists ( select 1 from tsqw_GenHisto inf
where inf.GATHER_DATE = trunc(sysdate)
and ref.ORACLE_SID = inf.ORACLE_SID)
order by ref.VIRT_HOST_NAME, ref.USERNAME;


sqwora_GenLstUnique.ksh

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

Query used:

select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
from tsqw_Repository
where STATUS in ('ON','MIX','DG')
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
from tsqw_RepositoryOther
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle'
from tsqw_RepositoryRac
order by 1;