Skip to content

Instantly share code, notes, and snippets.

@windwiny
Created June 27, 2014 12:10
Show Gist options
  • Select an option

  • Save windwiny/7483a1c69e3ab683f28c to your computer and use it in GitHub Desktop.

Select an option

Save windwiny/7483a1c69e3ab683f28c to your computer and use it in GitHub Desktop.
db2 diff db2move export load info
$load = []
File.foreach 'LOAD.out' do |line|
if line =~/^\* LOAD:\s*table(.*)$/
$load << $cc if $cc
tbs = $1.gsub /\s/,''
$cc=[tbs, -1, -1, -1, -1, -1]
elsif line =~ /Rows read:(.*)$/
$cc[1] = $1.to_i
elsif line =~ /Loaded:(.*)$/
$cc[2] = $1.to_i
elsif line =~ /Rejected:(.*)$/
$cc[3] = $1.to_i
elsif line =~ /Deleted:(.*)$/
$cc[4] = $1.to_i
elsif line =~ /Committed:(.*)$/
$cc[5] = $1.to_i
end
end
$load << $cc if $cc
p '------------ load , read and commit'
p $load.size
p $load[0]
p $load[-1]
$ld = []
$load.each do |x|
$ld << [x[0], x[5]]
if x.index(-1)
p x
end
if x[1] != x[2] || x[2] != x[5] || x[3] != 0 || x[4] != 0
p x
end
end
p '-------------- show exp.size, show diff exp and load'
$exp = []
File.foreach 'EXPORT.out' do |line|
if line =~ /(\d+) rows from table (.*)$/
l = $1.to_i
tbs = $2.gsub /\s/,''
$exp << [tbs,l]
end
end
p $exp.size
p $ld - $exp
p $exp - $ld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment