scottobear: (Free telephone)
[personal profile] scottobear
See entry comments for mysql code snips in use. Saving on j:/uiia/qmysql/

--
"modem wont work, on msn it says DNS and key ports with an '!' but the internet in general wont' work"

TCP/IP stack repair options for use with Windows XP with SP2.


For these commands, Start, Run, CMD to open a command prompt.

Reset WINSOCK entries to installation defaults: netsh winsock reset catalog

Reset TCP/IP stack to installation defaults. netsh int ip reset reset.log

Also try -

No?
ok, go to your start menu, click run, in the box type:
ipconfig /release

hopefully that fixes it.. it worked for me!

--
Tonight in brief - - Last Restaurant Standing (I think the Cheerful Soul is going to win LRS. ),

BHK picked me up from work, Frozen pizza for dinner, hysteria at bedtime..laughing turned to crying, and lots of itching - allergy meds?

--

1 year ago - awesome taco salad, Doc Savage 75, Clinton still in it, more things I've done (5), airborne faked clinical trials

2 years ago - interviewed at calvert, flew kites

3 years ago - animated newtcam archive, bhk chat, bat-folk, Friday 5, tmbg

4 years ago - scottobear.com renew, trip to deerfield, free fonts, chat crash w/bhk,gp puts me on to spidey bible, what? WhaT?, H2GT2G, Chimp attack, giantsteps

5 years ago - blogspam treatment, work, serial adder, 7-eared kitty, clown sweater, Ephemera, visited bro

6 years ago - book meme, palm doodles, picture issues

7 years ago - mopey, bro helping out, Dick Hymen - Master of Jazz Piano, super tugboat, Newton's name, pet name poll, magic ingredients

8 years ago - Perseus tools, loved ones sick, flying monkeys, The 30 Least-Quoted Lines from Shakespeare, nosepilot, 5k compGeotarget

mysql binary log summary

Date: 2009-03-06 01:54 pm (UTC)
From: [identity profile] scottobear.livejournal.com
CODE EXAMPLE: mysql binary log summary

Program Language bash

Code:

#!/bin/bash

###############################################################################
# #
# mysqlbinlogsummary v0.1
# #
# #
# #
# #
# #
# Usage: mysqlbinlogsummary [binlogfile] (only one binary log per time,sorry!)#
# #
# Ex: mysqlbinlogsummary mysql-bin.001 (d be nice to use wildcards for file)#
# #
# #
# #
# It will output a summary of the data changing statements grouped per table. #
# The four statements analyzed here are: update,insert,delete,drop. #
# It is useful to have an idea on the activity on some table for maintenance. #
# #
###############################################################################



echo -e "\n\nmysqlbinlogsummary: analyzaing binlog $1\n\n"
echo -e "\nchecking for [update] statements"
mysqlbinlog $1 | grep -i -e "^update" | awk '{print "UPDATE " $2}' > UPDATE.LOG
echo -e "\nchecking for [insert] statements"
mysqlbinlog $1 | grep -i -e "^insert" | awk '{print "INSERT " $3}' > INSERT.LOG
echo -e "\nchecking for [delete] statements"
mysqlbinlog $1 | grep -i -e "^delete" | awk '{print "DELETE " $3}' > DELETE.LOG
echo -e "\nchecking for [drop] statements"
mysqlbinlog $1 | grep -i -e "^drop" | awk '{print "DROP " $2 " " $3}' > DROP.LOG

echo -e "\n\nSorting statements..."
sort -u UPDATE.LOG >UPDATE.U.LOG
sort -u INSERT.LOG >INSERT.U.LOG
sort -u DELETE.LOG >DELETE.U.LOG
sort -u DROP.LOG >DROP.U.LOG

echo -e "\n\n-----------------------------------------------------------"
echo "UPDATE STATEMENTS"
echo "-----------------------------------------------------------"
while read line
do
echo -n $line | awk '{printf $2 " "}';grep -c `echo -e "$line" | awk '{print "\t\t\t" $2}'` UPDATE.LOG
done < UPDATE.U.LOG

echo -e "\n\n-----------------------------------------------------------"
echo "INSERT STATEMENTS"
echo "-----------------------------------------------------------"
while read line
do
echo -n $line | awk '{printf $2 " "}';grep -c `echo -e "$line" | awk '{print "\t\t\t" $2}'` INSERT.LOG
done < INSERT.U.LOG

echo -e "\n\n-----------------------------------------------------------"
echo "DELETE STATEMENTS"
echo "-----------------------------------------------------------"
while read line
do
echo -n $line | awk '{printf $2 " "}';grep -c `echo -e "$line" | awk '{print "\t\t\t" $2}'` DELETE.LOG
done < DELETE.U.LOG

echo -e "\n\n-----------------------------------------------------------"
echo "DROP STATEMENTS"
echo "-----------------------------------------------------------"
while read line
do
echo -n $line | awk '{printf $2 " "}';grep -c `echo -e "$line" | awk '{print "\t\t\t" $2}'` DROP.LOG
done < DROP.U.LOG
echo -e "\n\n\nDone....\n\n"

To have an idea on which DML statements are run on which tables I have written this very basic bash script. My need was to know how much activity there is on one table to schedule table maintenance like building indexes. I focus here only on statements that can change table data (insert, update, delete, drop) since I have found sometimes useful to copy the table to work offline with it when there are no changes in the table data. This is a very basic version. The aim is to be able, with this tool, to find the correct possible window with NO-WRITES to minimize table locks while maintenance.

Re: mysql binary log summary

Date: 2009-03-06 05:05 pm (UTC)
From: [identity profile] scottobear.livejournal.com
sorry - using the journal as a code-drop. :)

Re: mysql binary log summary

Date: 2009-03-06 05:13 pm (UTC)
From: [identity profile] blackhellkat.livejournal.com
I figured :D I just wish I understood it!

Re: mysql binary log summary

Date: 2009-03-06 05:17 pm (UTC)
From: [identity profile] scottobear.livejournal.com
the key to this is Grep - works like a super "find" in text.

http://en.wikipedia.org/wiki/Grep

Profile

scottobear: (Default)
scott von berg

April 2017

S M T W T F S
       1
2 345678
9 10 11 12 13 14 15
16 1718 19 20 21 22
23 2425 26 2728 29
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 2nd, 2025 11:37 am
Powered by Dreamwidth Studios