Checklist no Informix
Um script que eu usava muito no Informix todos os dias checo o backups, se o update statistic esta rodando ou processos com prioridades (não pode estar rodando nenhum, se estiver o sistema vai ficar lento), essas são algumas coisas que checo todos os dias, pra facilitar criei um script para fazer uma checagem rápida do Informix;
Primeira tela
-------------------------------------------------------------------------------------------------
26/05/2013 ***** INFORMIX BASIC SERVICES ***** 15:30:27
-------------------------------------------------------------------------------------------------
+--------------------------+------------
| Backup Rodando | 0
+--------------------------+------------
| Usuarios Presos | 0
+--------------------------+------------
| Update Statistic | 0
+--------------------------+------------
| Processos com Prioridade | 0
+--------------------------+------------
Segunda tela
-------------------------------------------------------------------------------------------------
26/05/2013 ***** INFORMIX BASIC SERVICES ***** 15:30:03
-------------------------------------------------------------------------------------------------
+-------------------------+-------+
| Total de Logical Logs | 71 |
+-------------------------+-------+
| Total de LLOG Livres | 70 |
+-------------------------+-------+
| Necessita de Backup | 0 |
+-------------------------+-------+--------------------------+
| Currente LLOG | 37 | 99.31392669677734375 % |
+-------------------------+-------+--------------------------+
IBM Informix Dynamic Server Version 11.50.FC8W3 -- On-Line -- Up 17 days 17:47:33 -- 8760064 Kbytes
Message Log File: /export/home/informix/online.log
05/26/13 10:30:01 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 11:00:01 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 11:30:02 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 12:00:03 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 12:30:02 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 13:00:01 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 13:30:02 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 14:00:02 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 14:30:02 Attempting to free unused operating system segments. This
operation may take several minutes.
05/26/13 15:00:01 Attempting to free unused operating system segments. This
operation may take several minutes.
Terceira tela
IBM Informix Dynamic Server Version 11.50.FC8W3 -- On-Line -- Up 17 days 17:40:07 -- 8760064 Kbytes
num DBSpace Q Size Q Len Buffer partnum size scanner
Dbspaces - Archive Status
name number level date log log-position
rootdbs 1 0 10/29/2013.01:20 16043 0xbf4e018
phydbs 2 0 10/29/2013.01:20 16043 0xbf4e018
logdbs 3 0 10/29/2013.01:20 16043 0xbf4e018
fro_dbs 6 0 10/29/2013.01:20 16043 0xbf4e018
tra_dbs 7 0 10/29/2013.01:20 16043 0xbf4e018
nfe_dbs 8 0 10/29/2013.01:20 16043 0xbf4e018
sgf_dbs 9 0 10/29/2013.01:20 16043 0xbf4e018
exp_dbs 10 0 10/29/2013.01:20 16043 0xbf4e018
er_sbspace 11 0 10/29/2013.01:20 16043 0xbf4e018
====> Nao tem usuario preso.
Linux 2.6.18-400.1.1.el5 (s275) 10/29/2013
03:22:38 PM CPU %user %nice %system %iowait %steal %idle
03:22:39 PM all 0.00 0.00 0.08 0.00 0.00 99.92
03:22:40 PM all 0.08 0.00 0.08 0.00 0.00 99.83
03:22:41 PM all 0.00 0.00 0.08 0.00 0.00 99.92
03:22:42 PM all 0.08 0.00 0.00 0.00 0.00 99.92
03:22:43 PM all 0.08 0.00 0.08 0.00 0.00 99.83
03:22:44 PM all 0.08 0.00 0.08 0.08 0.00 99.75
03:22:45 PM all 0.00 0.00 0.08 0.00 0.00 99.92
03:22:46 PM all 0.08 0.00 0.08 0.50 0.00 99.33
03:22:47 PM all 0.08 0.00 0.00 0.00 0.00 99.92
03:22:48 PM all 0.17 0.00 0.08 0.00 0.00 99.75
Average: all 0.07 0.00 0.07 0.06 0.00 99.81
Script Completo
clear ;
cat /etc/*-release
LOG1="/tmp/1234_$(whoami)_pode_deletar_1234_0.log"
LOG2="/tmp/1234_$(whoami)_pode_deletar_1234_1.log"
LOG3="/tmp/1234_$(whoami)_pode_deletar_1234_2.log"
LOG4="/tmp/1234_$(whoami)_pode_deletar_1234_3.log"
LOG5="/tmp/1234_$(whoami)_pode_deletar_1234_4.log"
LOG6="/tmp/1234_$(whoami)_pode_deletar_1234_5.log"
LOG7="/tmp/1234_$(whoami)_pode_deletar_1234_4.log"
LOG8="/tmp/1234_$(whoami)_pode_deletar_1234_5.log"
clear
echo "-------------------------------------------------------------------------------------------------"
echo -n
echo -n "$(date "+%d/%m/%Y")"
echo -n " "
echo -n " ***** INFORMIX BASIC SERVICES ***** "
echo -n " "
echo "$(date "+%T")"
echo "-------------------------------------------------------------------------------------------------"
echo
echo "+--------------------------+------------ "
echo "| Backup Rodando | $(onstat -g sql | grep 'sysutils RR' | wc -l)"
echo "+--------------------------+------------ "
echo "| Usuarios Presos | $(ps -ef |grep '\?' | grep -vE 'informix|root|defunct|dba|bin|sendmail|hald|zabbix_agentd|usr|transporta|crond|sshimada|rpc|avahi|daemon|ssh|cruiz|ods|transfer|tmatas|sleep' | wc -l )"
echo "+--------------------------+------------ "
echo "| Update Statistic | $(onstat -g sql | grep 'UPDATE STATIST' | wc -l)"
echo "+--------------------------+------------ "
echo "| Processos com Prioridade | $(onstat -g mgm | grep / | grep -v Lock | wc -l) "
echo "+--------------------------+------------ "
echo "| Processos DBA Rodando | $(onstat -u | grep ' dba ' | wc -l)"
echo "+--------------------------+------------ "
echo
pause 3
clear
echo "-------------------------------------------------------------------------------------------------"
echo -n
echo -n "$(date "+%d/%m/%Y")"
echo -n " "
echo -n " ***** INFORMIX BASIC SERVICES ***** "
echo -n " "
echo "$(date "+%T")"
echo "-------------------------------------------------------------------------------------------------"
echo
dbaccess sysmaster > /dev/null <<+
unload to $LOG1
select count (*) from syslogs where is_backed_up = '1';
select ((size - used) / size)*100 from syslogs where is_current = '1'
+
cat $LOG1 | awk -F "|" '{
t_iso3=$3
if ($3 == "0")
{ t_iso3=" Online " }
if ($3 == "1")
{ t_iso3=" Offline " }
printf("| Total de LLOG Livres | %-5d | \n",$1)}' > $LOG2
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
dbaccess sysmaster > /dev/null <<+
unload to $LOG1
select number, ((size - used) / size)*100 from syslogs where is_current = '1'
+
cat $LOG1 | awk -F "|" '{
t_iso3=$3
if ($3 == "0")
{ t_iso3=" Online " }
if ($3 == "1")
{ t_iso3=" Offline " }
printf("| Currente LLOG | %-2s | %-22s % | \n",$1,$2)}' >> $LOG3
# ------------------------------ ------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
dbaccess sysmaster > /dev/null <<+
unload to $LOG1
select count (*) from syslogs where is_backed_up = '0' and is_current = '0'
+
cat $LOG1 | awk -F "|" '{
t_iso3=$3
if ($3 == "0")
{ t_iso3=" Online " }
if ($3 == "1")
{ t_iso3=" Offline " }
printf("| Necessita de Backup | %-2d | \n",$1)}' >> $LOG4
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
dbaccess sysmaster > /dev/null <<+
unload to $LOG1
select count (*) from syslogs
+
cat $LOG1 | awk -F "|" '{
t_iso3=$3
if ($3 == "0")
{ t_iso3=" Online " }
if ($3 == "1")
{ t_iso3=" Offline " }
printf("| Total de Logical Logs | %-2d | \n",$1)}' >> $LOG5
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------
clear
echo "-------------------------------------------------------------------------------------------------"
echo -n
echo -n "$(date "+%d/%m/%Y")"
echo -n " "
echo -n " ***** INFORMIX BASIC SERVICES ***** "
echo -n " "
echo "$(date "+%T")"
echo "-------------------------------------------------------------------------------------------------"
echo
echo "+-------------------------+-------+"
cat $LOG5
echo "+-------------------------+-------+"
cat $LOG2
echo "+-------------------------+-------+"
cat $LOG4
echo "+-------------------------+-------+--------------------------+"
cat $LOG3
echo "+-------------------------+-------+--------------------------+"
rm $LOG1
rm $LOG2
rm $LOG3
rm $LOG4
rm $LOG5
echo
# comandos
onstat -m ; sleep 4 ; clear ; onstat -g arc ; proc_so ; sar 1 10
0 comentários:
Enviar um comentário