Thanks Mark...I'll put this into a .cmd file and use it Monday morning.
Why the RUNSTATS before the REORG? Um...because I was told to do that.
:) I didn't know about things like runstats and reorgs, since the
iSeries does this automatically. When our UDB database performance
became incredibly bad, I opened a PMR with IBM and they gave me these
instructions.
> -------- Original Message --------
> Subject: RE: Windows Connect to DB2
> From: "Gillis Mark "
> <db2udbdba-ezmlmshield-x44157523.[Email address protected]
> Date: Tue, November 28, 2006 12:32 pm
> To: "LazyDBA Discussion" <[Email address protected]
>
> Hi Michael
>
> What I'd do is put a connect into each DDL file and then have a .cmd that goes
>
> DB2CMD /c /w /i db2 -tsvf runstats.ddl > runstats_1.log
> DB2CMD /c /w /i db2 -tsvf reorg.ddlg > reorg_1.log
> DB2CMD /c /w /i db2 -tsvf runstats.ddl > runstats_2.log
> db2rbind DBNAME -l db2rbind.log
>
> Just out of interest; why a RUNSTATS before a REORG? Do you just want a comparison to see what the REORG did? I quite often use REORGCHK in those circumstances.
>
> Cheers
>
> Mark
>
> -----Original Message-----
> From: michael [mailto:db2udbdba-ezmlmshield-x29145082.[Email address protected]
> Sent: 28 November 2006 16:16
> To: LazyDBA Discussion
> Subject: Windows Connect to DB2
>
> Is there anything special I need to think of for Windows scripting? I have a WCS instance and a DB2 instance. I'm not a UDB (iSeries is my
> flavor) person, but I wrench on it. I do a runstats/reorg/db2rbind thing every week, where I use db2cmd and db2 -tvf. Do I need to do anything special to put it into a .cmd file?
>
> Thanks!
>
> > -------- Original Message --------
> > Subject: Re: connect to db2 for shell unix.
> > From: "hsteiner"
> > <db2udbdba-ezmlmshield-x6028813.[Email address protected]
> > Date: Tue, November 28, 2006 11:09 am
> > To: "LazyDBA Discussion" <[Email address protected]
> >
> > Here is a simple .sh example:
> >
> > CODE:
> > #! /usr/bin/ksh
> > . $HOME/sqllib/db2profile
> > db2 "connect to DBNAME";
> > date;
> > db2 "reorg table SCHEMA.TABLE";
> > date;
> > echo "reorg complete";
> > db2 "terminate";
> >
> > NOTE: The second line "sources" the db2profile. This might be needed
> > for example if a job is CRON'ed
> >
> > Here is something a little more sophisticated - it assumes a connection exists:
> >
> >
> > #! /usr/bin/ksh
> > . $HOME/sqllib/db2profile
> > LOG=/bb/db2/home/mydir/hal/takeover.log
> > echo "Hal's Takeover Script starting" >> $LOG; date >> $LOG
> > status=`db2 activate database DBNAME`; echo "Activate database -
> > status $status" >> $LOG; date >> $LOG
> > status=`db2 takeover hadr on database DBNAME`; rc=$?
> > echo "takeover status is $status return code is $rc" >> $LOG; if [ $rc
> > -ne 0 ]; then echo "takeover by force" >> $LOG;
> > status=`db2 takeover hadr on database DBNAME by force`; echo "Takeover
> > by force issued - status $status" >> $LOG; fi date >> $LOG echo "Hal's
> > Takeover Script complete";
> >
> > Hope this helps.
> >
> > Hal Steiner
> >
> >
> >
> >
> > -----Original Message-----
> > From: db2udbdba-ezmlmshield-x8907443.[Email address protected]
> > To: [Email address protected]
> > Sent: Tue, 28 Nov 2006 9:55 AM
> > Subject: RE: connect to db2 for shell unix.
> >
> >
> > Hi gurĂº...
> >
> > i need example Execution of script (in terminal unix)...please,
> > please, please
> >
> > Thank's
> >
> >
> > pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.
> >
> > k=(
> >
> > Atte.
> > Daniel Manque.
> > Analista de sistemas.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post
> > a dba job: http://jobs.lazydba.com To Subscribe :
> > http://www.LazyDBA.com To unsubscribe:
> > http://www.lazydba.com/unsubscribe.html
> > ______________________________________________________________________
> > __ Check out the new AOL. Most comprehensive set of free safety and
> > security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more.
> >
> >
> > ---------------------------------------------------------------------
> > TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post
> > a dba job: http://jobs.lazydba.com To Subscribe :
> > http://www.LazyDBA.com To unsubscribe:
> > http://www.lazydba.com/unsubscribe.html
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
> This e-mail (and any attachments) may contain privileged and/or confidential information. If you are not the intended recipient please do not disclose, copy, distribute, disseminate or take any action in reliance on it. If you have received this message in error please reply and tell us and then delete it. Should you wish to communicate with us by e-mail we cannot guarantee the security of any data outside our own computer systems. For the protection of Legal & General's systems and staff, incoming emails will be automatically scanned.
>
> Any information contained in this message may be subject to applicable terms and conditions and must not be construed as giving investment advice within or outside the United Kingdom.
>
> The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited
> (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments).
>
> They are registered in England under numbers shown.
> The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP.
>
> Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930
>
> They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register
>
> Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page