Difference between revisions of "SQWareCentral:oracle"
Expdbtools (talk | contribs) (→tnsnames.ora) |
m (Updated by BatchUser) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
== auto == | == 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 | ||
+ | |||
+ | } | ||
+ | </pre> | ||
+ | <br> | ||
=== sqwora_CheckInstance.ksh === | === sqwora_CheckInstance.ksh === | ||
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_CheckInstance.ksh:<br> | Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_CheckInstance.ksh:<br> | ||
Line 11: | 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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH & |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A CheckInstance | \$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A CheckInstance | ||
Line 35: | Line 91: | ||
do | do | ||
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}" | echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}" | ||
− | ssh | + | 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 | ||
Line 43: | Line 99: | ||
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> | ||
Line 57: | 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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH & |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A IndicDba | \$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A IndicDba | ||
Line 66: | Line 191: | ||
jobs | jobs | ||
wait | 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> | </pre> | ||
Line 80: | Line 258: | ||
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 -T $lvsqw_UserName@$lvsqw_HostName <<EOFSSH | ||
Line 88: | Line 267: | ||
EOFSSH | EOFSSH | ||
done <$gvsqw_TmpFile.lst | 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 | ||
+ | jobs | ||
+ | wait | ||
} | } | ||
</pre> | </pre> | ||
Line 94: | Line 295: | ||
Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwr.ksh:<br> | Action script $gvsqw_RootexpdbCentral/action/oracle/auto/sqwora_GenerateAwr.ksh:<br> | ||
Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwr.ksh.<br> | Can be replaced by $gvsqw_RootexpdbCentral/action/oracle/auto_cust/sqwora_GenerateAwr.ksh.<br> | ||
− | + | Generate AWR reports | |
<br><br> | <br><br> | ||
Action: | Action: | ||
Line 102: | Line 303: | ||
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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH & |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A GenAwr | \$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> | ||
+ | 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" -Dist | ||
+ | EOFSSH | ||
+ | sleep 10 | ||
+ | done <$gvsqw_TmpFile.lst | ||
+ | jobs | ||
+ | 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 | EOFSSH | ||
sleep 10 | sleep 10 | ||
Line 128: | Line 558: | ||
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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH>$lvsqw_FicRef.tmp |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/../tools/sqwora_BackupPasswd.ksh -I $lvsqw_Instance -T hash | \$gvsqw_OraBin/../tools/sqwora_BackupPasswd.ksh -I $lvsqw_Instance -T hash | ||
Line 150: | 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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH & |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanFull | \$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanFull | ||
Line 173: | 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 | + | ssh $gvsqw_SshOptions $lvsqw_UserName@$lvsqw_HostName <<EOFSSH & |
. \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | . \$gvsqw_OraBin/../tools/sqwora_SetEnv.ksh $lvsqw_Instance | ||
\$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanInc | \$gvsqw_OraBin/sqwora_RunJob.ksh -I $lvsqw_Instance -A RmanInc | ||
Line 198: | Line 631: | ||
do | do | ||
echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}" | echo "${c_info}$lvsqw_UserName@$lvsqw_HostName${c_normal}" | ||
− | ssh | + | 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 228: | Line 661: | ||
your modifications (only variables you want to modify).<br> | your modifications (only variables you want to modify).<br> | ||
<br> | <br> | ||
− | + | File content: | |
+ | <pre> | ||
+ | </pre> | ||
+ | <br> | ||
+ | <br> | ||
+ | Variable explanation: | ||
+ | <pre> | ||
+ | </pre> | ||
+ | <br> | ||
=== sqwc_DbRefVar.cfg === | === sqwc_DbRefVar.cfg === | ||
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_DbRefVar.cfg:<br> | Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_DbRefVar.cfg:<br> | ||
Line 266: | Line 707: | ||
File content: | File content: | ||
<pre> | <pre> | ||
− | export | + | export gvsqw_RootexpdbExpOracle="~$gvsqw_UserUniqueOracle/SQWareProduction/oracle" |
− | export | + | export gvsqw_VersexpdbExpOracle='prod' |
− | export | + | export gvsqw_VersDeplexpdbExpOracle='v3.1' |
export gvsqw_Mail_oracle='dba' | export gvsqw_Mail_oracle='dba' | ||
export gvsqw_MailMsg_oracle='TrtOraAuto' | export gvsqw_MailMsg_oracle='TrtOraAuto' | ||
Line 276: | Line 717: | ||
Variable explanation: | Variable explanation: | ||
<pre> | <pre> | ||
− | gvsqw_MailMsg_oracle => | + | gvsqw_MailMsg_oracle => |
− | gvsqw_Mail_oracle => | + | gvsqw_Mail_oracle => |
− | + | gvsqw_RootexpdbExpOracle => | |
− | + | gvsqw_VersDeplexpdbExpOracle => | |
− | + | gvsqw_VersexpdbExpOracle => | |
</pre> | </pre> | ||
<br> | <br> | ||
− | |||
=== sqwc_GlobalVar.cfg === | === sqwc_GlobalVar.cfg === | ||
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_GlobalVar.cfg:<br> | Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/sqwc_GlobalVar.cfg:<br> | ||
Line 293: | Line 733: | ||
File content: | File content: | ||
<pre> | <pre> | ||
− | export gvsqw_UserUniqueOracle=' | + | 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> | </pre> | ||
<br> | <br> | ||
Line 299: | Line 745: | ||
Variable explanation: | Variable explanation: | ||
<pre> | <pre> | ||
− | gvsqw_UserUniqueOracle => | + | gvsqw_DistSQWareProdUser_oracle => |
+ | gvsqw_MailMsg_oracle => | ||
+ | gvsqw_Mail_oracle => | ||
+ | gvsqw_RootSQWareProductionOracle => | ||
+ | gvsqw_UserUniqueOracle => | ||
+ | gvsqw_VersDeplSQWareProductionOracle => | ||
+ | gvsqw_VersSQWareProductionOracle => | ||
</pre> | </pre> | ||
<br> | <br> | ||
− | |||
=== tnsnames.ora === | === tnsnames.ora === | ||
Configuration file $gvsqw_RootexpdbCentral/action/oracle/etc/tnsnames.ora:<br> | 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 === | ||
− | |||
File to put aliases $gvsqw_RootexpdbCentral/action/oracle/etc/.profile_confort:<br> | File to put aliases $gvsqw_RootexpdbCentral/action/oracle/etc/.profile_confort:<br> | ||
− | |||
Contains confort aliases of SQWareCentral for RDBMS oracle.<br> | Contains confort aliases of SQWareCentral for RDBMS oracle.<br> | ||
<br> | <br> | ||
Alias explanation: | Alias explanation: | ||
<pre> | <pre> | ||
− | act_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/prod;ls -al' | + | act_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/prod;ls -al' |
− | depl_ora => '$gvsqw_RootexpdbCentral/ | + | etc_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/etc;ls -al' |
− | repind_ora => '$gvsqw_RootexpdbCentral/bin/sqwc_TrtAuto.ksh oracle sqwora_GatherIndicators.ksh sqwora_GenLstRepind.ksh NOLOG' | + | lst_ora => 'cd $gvsqw_RootexpdbCentral/action/oracle/lst;ls -al' |
− | gen_ora => '$gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefOracle.ksh' | + | 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> | </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 === | ||
List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefDbOracle.ksh:<br> | List generator $gvsqw_RootexpdbCentral/action/oracle/lst/sqwc_GenRefDbOracle.ksh:<br> | ||
Line 330: | Line 816: | ||
Query used: | Query used: | ||
<pre> | <pre> | ||
− | select 'ORA;' || | + | 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 | from tsqw_Repository ref, tsqw_VolSchema vol, tsqw_GenHisto hist | ||
where hist.MONTH=trunc(sysdate,'MM') | where hist.MONTH=trunc(sysdate,'MM') | ||
Line 348: | Line 834: | ||
Query used: | Query used: | ||
<pre> | <pre> | ||
− | select virt_host_name vip_, host_name uni_, username usr_, | + | 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 | from tsqw_Repository r | ||
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_, | ||
from tsqw_RepositoryOther r | from tsqw_RepositoryOther r | ||
order by 2,1,3,4; | order by 2,1,3,4; | ||
+ | </pre> | ||
+ | <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> | </pre> | ||
<br> | <br> | ||
Line 364: | Line 882: | ||
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 | + | where ref.STATUS in ('ON','MIX') |
and exists ( select 1 from tsqw_GenHisto inf | and exists ( select 1 from tsqw_GenHisto inf | ||
− | where inf. | + | where inf.month = trunc(sysdate, 'MONTH') |
and ref.ORACLE_SID = inf.ORACLE_SID | 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) | 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> | ||
Line 381: | Line 925: | ||
select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID | select VIRT_HOST_NAME||' '||USERNAME||' '||ORACLE_SID | ||
from tsqw_Repository | from tsqw_Repository | ||
− | where STATUS | + | where STATUS in ('ON','MIX') |
order by VIRT_HOST_NAME, USERNAME; | order by VIRT_HOST_NAME, USERNAME; | ||
</pre> | </pre> | ||
Line 396: | Line 940: | ||
where STATUS = 'ON' | where STATUS = 'ON' | ||
and ENV != 'PRD' | 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; | order by VIRT_HOST_NAME, USERNAME; | ||
</pre> | </pre> | ||
Line 411: | Line 968: | ||
and ENV = 'PRD' | 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> | ||
Line 429: | Line 1,055: | ||
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 | + | and ref.STATUS in ('ON','MIX') |
order by 1; | order by 1; | ||
</pre> | </pre> | ||
Line 449: | Line 1,075: | ||
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 | + | 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> | ||
Line 462: | Line 1,120: | ||
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 = ' | + | 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; | ||
+ | </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 | and not exists ( select 1 from tsqw_GenHisto inf | ||
where inf.GATHER_DATE = trunc(sysdate) | where inf.GATHER_DATE = trunc(sysdate) | ||
and ref.ORACLE_SID = inf.ORACLE_SID) | and ref.ORACLE_SID = inf.ORACLE_SID) | ||
− | order by VIRT_HOST_NAME, ref.USERNAME; | + | order by ref.VIRT_HOST_NAME, ref.USERNAME; |
</pre> | </pre> | ||
<br> | <br> | ||
Line 478: | Line 1,152: | ||
select distinct HOST_NAME||' $gvsqw_UserUniqueOracle' | select distinct HOST_NAME||' $gvsqw_UserUniqueOracle' | ||
from tsqw_Repository | from tsqw_Repository | ||
− | where STATUS | + | 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
- 1 auto
- 1.1 sqwora_AdddbSQWareProfile.ksh
- 1.2 sqwora_CheckInstance.ksh
- 1.3 sqwora_DeplScripts.ksh
- 1.4 sqwora_GatherDistFsSize.ksh
- 1.5 sqwora_GatherIndicatorsDG.ksh
- 1.6 sqwora_GatherIndicatorsDist.ksh
- 1.7 sqwora_GatherIndicators.ksh
- 1.8 sqwora_GatherIndicatorsOld.ksh
- 1.9 sqwora_Gen_dbSQWare.ksh
- 1.10 sqwora_GenEdt.ksh
- 1.11 sqwora_GenerateAwrDist.ksh
- 1.12 sqwora_GenerateAwr.ksh
- 1.13 sqwora_GenSshKeysInstance.ksh
- 1.14 sqwora_GenSshKeys.ksh
- 1.15 sqwora_MajTnsIfile.ksh
- 1.16 sqwora_MonitorAwrDist.ksh
- 1.17 sqwora_MonitorHourlyAwrDist.ksh
- 1.18 sqwora_RetrieveHash.ksh
- 1.19 sqwora_RmanFull.ksh
- 1.20 sqwora_RmanInc.ksh
- 1.21 sqwora_StartedInstances.ksh
- 2 etc
- 3 lst
- 3.1 sqwc_Extract_CMDB_Oracle.ksh
- 3.2 sqwc_GenRefDbOracle.ksh
- 3.3 sqwc_GenRefOracle.ksh
- 3.4 sqwc_GenTnsnames.ksh
- 3.5 sqwora_GenLstAwrDist.ksh
- 3.6 sqwora_GenLstAwr.ksh
- 3.7 sqwora_GenLstInstanceDG.ksh
- 3.8 sqwora_GenLstInstanceDist.ksh
- 3.9 sqwora_GenLstInstance.ksh
- 3.10 sqwora_GenLstInstanceNoProd.ksh
- 3.11 sqwora_GenLstInstanceOld.ksh
- 3.12 sqwora_GenLstInstanceProd.ksh
- 3.13 sqwora_GenLstInstancesSsh.ksh
- 3.14 sqwora_GenLstInstancesSshNew.ksh
- 3.15 sqwora_GenLstNewInstances.ksh
- 3.16 sqwora_GenLstNewInstancesUnique.ksh
- 3.17 sqwora_GenLstNewUnique.ksh
- 3.18 sqwora_GenLstRepBckFull.ksh
- 3.19 sqwora_GenLstRepBckInc.ksh
- 3.20 sqwora_GenLstRepindDG.ksh
- 3.21 sqwora_GenLstRepindDist.ksh
- 3.22 sqwora_GenLstRepind.ksh
- 3.23 sqwora_GenLstRepindOld.ksh
- 3.24 sqwora_GenLstUnique.ksh
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;