473,618 Members | 3,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

diff


diff -u /home/system/db2inst1/nya/bin/db2filter.py ./db2filter.py
--- /home/system/db2inst1/nya/bin/db2filter.py 2007-01-12
15:23:34.000000 000 +0100
+++ ./db2filter.py 2007-04-14 02:31:58.000000 000 +0200
@@ -26,24 +26,31 @@

def main():
ignore = [ "DB20000I" ]
+ single = False
try:
- opts, args = getopt.getopt(s ys.argv[1:], "i:")
+ opts, args = getopt.getopt(s ys.argv[1:], "i:s")
except getopt.GetoptEr ror:
sys.exit(-1)
for o, a in opts:
if (o == "-i"):
args = a.split(',')
ignore += args
+ if (o == "-s"):
+ single = True

inf = sys.stdin
lines = ''
+ lastline = ''
for line in inf:
+ lastline = line
m = re.match('^\S*$ ', line)
if (m == None):
lines += line
else:
parse_line(line s, ignore)
lines = ''
+ if (single):
+ parse_line(last line, ignore)

if __name__ == "__main__":
main()
diff -u /home/system/db2inst1/nya/bin/pre_upgrade.py ./pre_upgrade.py
--- /home/system/db2inst1/nya/bin/pre_upgrade.py 2007-01-12
15:23:34.000000 000 +0100
+++ ./pre_upgrade.py 2007-04-14 07:30:54.000000 000 +0200
@@ -136,7 +136,8 @@
print line

if (current_state < 2):
- print """values 'Upgrade aborted. Database version already >=
%s' @
+ print """
+ values 'Upgrade aborted. Database version already >= %s' @
-- generate error, exit(4)
drop index sysibm.XXX @
""" % (cv)
diff -u /home/system/db2inst1/nya/bin/upgrade.sh ./upgrade.sh
--- /home/system/db2inst1/nya/bin/upgrade.sh 2007-03-12
12:08:08.000000 000 +0100
+++ ./upgrade.sh 2007-04-14 10:07:54.000000 000 +0200
@@ -1,7 +1,6 @@
#!/bin/sh

-# source helpers
-. db_helpers
+declare -i rc

############### ############### ###############
# Parse cmdline
@@ -50,7 +49,7 @@
mkdir -p ${logdir}
db=`echo ${DB} | tr a-z A-Z`
date=`date "+%Y-%m-%d_%H:%M:%S"`
-logfile=${logdi r}/${db}_${date}.l og
+logfile=${logd ir}${db}_${date }.log

export PATH=${bindir}: ${PATH}

@@ -74,7 +73,7 @@
* upgrade $db aborted `date +%Y%m%d%H%M%S`
*************** *************** *************** *******
EOF
- db2 terminate
+ db2 terminate /dev/null 2>&1;
exit 1
}

@@ -86,7 +85,7 @@
* upgrade $db finished `date +%Y%m%d%H%M%S`
*************** *************** *************** *******
EOF
- db2 terminate
+ db2 terminate /dev/null 2>&1;
exit 0
}

@@ -105,6 +104,55 @@
abort "ERROR: wrong usage";
}

+runstats_and_r ebind() {
+
+ cnt=0
+ echo "---------------------------------------------" | tee -a
${logfile}
+ echo "Doing runstats for tables with old statistics" | tee -a
${logfile}
+ echo "---------------------------------------------" | tee -a
${logfile}
+
+ for t in `db2 -x "select rtrim(tabschema ) || '.' || tabname \
+ from syscat.indexes i \
+ where tabschema in ('NYA','STUDERA ','HUBBLE','URV AL') \
+ and exists ( \
+ select 1 from syscat.tables t \
+ where (i.tabschema, i.tabname) = (t.tabschema, t.tabname) \
+ and t.type in ('S','T') \
+ ) \
+ and (stats_time + 24 hours < current timestamp or \
+ nleaf = -1 or nlevels = -1)"`; do
+ db2 -s -l ${logfile} "runstats on table $t and indexes
all" | ./db2filter.py -s 2>&1
+ cnt=`expr $cnt + 1`
+ done
+ echo ""
+ echo ""
+ echo "Updated statistics for $cnt tables" | tee -a ${logfile}
+ echo ""
+
+ cnt=0
+ echo "-------------------------------------" | tee -a ${logfile}
+ echo "Rebinding invalid procedures/packages" | tee -a ${logfile}
+ echo "-------------------------------------" | tee -a ${logfile}
+
+ for p in `db2 -x "select \
+ rtrim(z.ROUTINE SCHEMA) || '.' ||
rtrim(z.ROUTINE NAME) \
+ from syscat.packages y \
+ inner join syscat.routined ep x \
+ on (x.BSCHEMA, x.BNAME) = (y.PKGSCHEMA, y.PKGNAME) \
+ inner join syscat.routines z \
+ on (x.ROUTINESCHEM A, x.ROUTINENAME) =
(z.ROUTINESCHEM A, z.SPECIFICNAME) \
+ where y.valid <'Y' \
+ or z.valid <'Y'"`; do
+ db2 -s -l ${logfile} "call
sysproc.rebind_ routine_package ('P','$p','ANY' )" | ./db2filter.py -i
"Return Status = 0" 2>&1
+ cnt=`expr $cnt + 1`
+ done
+ echo ""
+ echo ""
+ echo "Rebinded $cnt procedures/packages" | tee -a ${logfile}
+ echo ""
+}
+
+
############### ############### ###############
# Validation of input
############### ############### ###############
@@ -116,6 +164,10 @@
[ "x${usernam e}" = "x" ] && usage
[ "x${passwd} " = "x" ] && usage

+echo "-----------------" | tee -a ${logfile}
+echo "Preparing upgrade" | tee -a ${logfile}
+echo "-----------------" | tee -a ${logfile}
+
db=`echo ${DB} | tr a-z A-Z`
if [ "x${usernam e}" = "x" ]; then
db2 connect to ${db} /dev/null 2>&1;
@@ -127,6 +179,7 @@
abort "ERROR: Unable to connect to ${db}"
fi

+
# create function to cmp versions
pushd ${basedir}/function/ /dev/null 2>&1;
dos2unix GET_DB_VERSION. sql /dev/null 2>&1;
@@ -165,25 +218,40 @@
pushd /tmp /dev/null 2>&1
dos2unix current_upgrade .sql /dev/null 2>&1;
popd /dev/null 2>&1
-db2 -s +c -l ${logfile} -td@ -f /tmp/current_upgrade .sql
-rc=$?

-echo ""
-echo "-----------------------------------------------------"
+echo "" | tee -a ${logfile}
+echo "-----------------" | tee -a ${logfile}
+echo "Executing upgrade" | tee -a ${logfile}
+echo "-----------------" | tee -a ${logfile}
+
+db2 -x -s +c -l ${logfile} -td@ -f /tmp/current_upgrade .sql |
../db2filter.py -i "Return Status = 0"
+rc=${PIPESTATU S[0]}
+
+echo "" | tee -a ${logfile}

if [ $rc -ge 4 ]; then
- echo "ERROR: Transactions where rolled back due to error"
- echo " db2 exit with $rc, see ${logfile} for details"
- db2 rollback /dev/null 2>&1;
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ echo "ERROR: Transactions where rolled back due to error" | tee
-a ${logfile}
+ echo " db2 exit with $rc, see ${logfile} for details" | tee
-a ${logfile}
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ db2 rollback /dev/null 2>&1;
+ abort
elif [ $rc -gt 0 ]; then
- echo "INFO: There where warnings but all transactions where
committed succesfully."
- echo " db2 exit with $rc, see ${logfile} for details"
db2 commit /dev/null 2>&1;
+ runstats_and_re bind
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ echo "INFO: There where warnings but all transactions where
committed succesfully." | tee -a ${logfile}
+ echo " db2 exit with $rc, see ${logfile} for details" | tee
-a ${logfile}
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ success
else
- echo "INFO: All transactions where committed succesfully."
db2 commit /dev/null 2>&1;
+ runstats_and_re bind
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ echo "INFO: All transactions where committed succesfully." | tee
-a ${logfile}
+ echo "-----------------------------------------------------" | tee
-a ${logfile}
+ success
fi

-db2 connect reset /dev/null 2>&1;
+#db2 connect reset /dev/null 2>&1;

-echo "-----------------------------------------------------"

Apr 14 '07 #1
1 1994
On Apr 14, 11:26 am, Lennart <erik.lennart.j ons...@gmail.co mwrote:

Sorry, completely wrong address

/Lennart

[...]

Apr 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2511
by: Charley | last post by:
I've got a diff file that I think is a patch for a bunch of file in a directory. How do I apply this file? I thought it was #patch myfile.diff But that does nothing. I must be missing something. The diff file contains diff's for a nuch of files, not just a single file. Do I need a
0
3307
by: python | last post by:
Hi- I have a lot of monthly time series data. I need to be able to compare two dates and get the number of months that they are apart. The datetime module is a daily-frequency data type. It has a timedelta object that returns the difference in days between two dates: >>> d1 = datetime.date(2002,1,1)
3
4203
by: Nick Allen | last post by:
After using ndiff from difflib, the function restore would return the sequence that generated the delta. Unfortunately, restore does not do the same for unified_diff. I do not see any similar function that is intended for unified_diff. Does anyone know how to "restore" from a unified diff generated delta? Thanks for all your help in advance. Best Regards, Nick
9
6506
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the delta binary is pretty huge in size. I have 1 byte file and 2 bytes file, the delta should be 1 byte but somehow it turns out to be 249 bytes using binary formatter. I guess serialization has some other things added to the delta file.
6
6442
by: Igor Shevchenko | last post by:
Hi! Suppose I have "pg_dump -s" of two pg installs, one is "dev", another is "production". Their schemas don't differ too much, and I want to get a "diff -u"-like schema diff so I can quickly add missing/remove old tables/sequences/etc to one or another (manually). Is there some quick tool for doing this ? There was a thread about it sometime in aug, 2002, but it ended without producing anything useful.
4
4949
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on the ordered or unordered xml node tree of the compared documents? - what identifiers/criteria should be used by default to match elements of the same type in different documents? - should a diff tool consider move operations or only insert/delete
3
3002
by: AirYT | last post by:
Hello, I'm looking for an implementation for diffing 2 (text) files and spitting out the output using php only. i would like to extend this to use ftp to diff two files on two ftp servers, or one local file & a remote ftp server. Anyone have any ideas on source for this before i go ahead and build it? At least the diff engine? a nice gui would be best, but not totally necessary. TIA,
4
1775
by: Shug | last post by:
Hi, We're reformatting a lot of our project code using the excellent uncrustify beautifier. However, to gain confidence that it really is only changing whitespace (forget { } issues for just now), we were hoping to do a diff - a textual comparison of the files, ignoring whitespace. However, most diffs we've tried can't handle multi-line whitespace, so
6
3299
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions in red and deletions in red strike though. There seem to be several in Perl and Python and many diff programs which all seem to be line based and work on text written in PHP.
2
1944
by: akshaycjoshi | last post by:
I have got one tree tree view control.I have three levels in it. Example- Root1 ------->child1 ------->child2 ---------------->child1 ---------------->child2 ------->child3 Root2
0
8212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8595
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8455
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7126
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.