Re: Kshell Script to Compare One Database on One Server to t
Posted in 2005
Topics: High Availability & Replication, SQL Development & Query Writing, Migration, Import/Export & Data Conversion
You can skip the update statistics if you join systables to
sysmaster:sysptnhdr:
select st.tabname, sum(sp.nrows) nrows
from systables st
join sysmaster:systabnames sst
on sst.dbsname = 'mydatabase' and sst.tabname = st.tabname and st.tabid >= 100
join sysmaster:sysptnhdr sp
on sst.partnum = sp.partnum
order by 1;
The nrows value on the tables partition page (or its fragments' partition
pages)
is always up to date.
Art S. Kagel
----- Original Message -----
From: Jack Parker <vze2qjg5@verizon.net>
At: 2/28 23:11
> MIME? I posted MIME? Shame on me. Let's try plain text this time.
>
>
> As Clifton points out, the other is:
>
> update statistics; { DO NOT FORGET THIS PART }
> unload to datafile
> select tabname, nrows from systables where tabid > 99
> order by tabname;>
> (run on both engines)
>
> diff file1 file2
>
> I don't think it's really worth scripting, although it wouldn't be that
> hard to do.
>
> j.
> ----- Original Message -----
> From: "Jack Parker" <vze2qjg5@verizon.net>
> To: <ids@iiug.org>
> Sent: Monday, February 28, 2005 10:34 PM
> Subject: Re: Kshell Script to Compare One Database on One Server to the
> [4373]
>
>
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_0242_01C51DDC.97ADAF40
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > Re: Kshell Script to Compare One Database on One Server to the Same =
> > [4369]dbdiff2 is the schema difference tool - to be found at iiug.org.
> >
> > As Clifton points out, the other is:
> >
> > update statistics; { DO NOT FORGET THIS PART }
> > unload to datafile
> > select tabname, nrows from systables where tabid > 99
> > order by tabname;> >
> > (run on both engines)
> >
> > diff file1 file2
> >
> > I don't think it's really worth scripting, although it wouldn't be that =
> > hard to do.
> >
> > j.
> > ----- Original Message -----=20
> > From: Sebastian, Norma J.=20
> > To: vze2qjg5@verizon.net ; ids@iiug.org=20
> > Sent: Monday, February 28, 2005 9:50 PM
> > Subject: Re: Kshell Script to Compare One Database on One Server to =
> > the Same[4369]
> >
> >
> > How 'bout both J?
> > Thanks, NJ
> >
> > --------------------------
> > Sent from my BlackBerry Wireless Handheld
> >
> >
> > -----Original Message-----
> > From: forum.subscriber@iiug.org <forum.subscriber@iiug.org>
> > To: ids@iiug.org <ids@iiug.org>
> > Sent: Mon Feb 28 17:54:21 2005
> > Subject: Re: Kshell Script to Compare One Database on One Server to =
> > the Same [4369]
> >
> >
> > You interested in rowcount differences or schema differences?
> >
> > j.
> > ----- Original Message -----
> > From: "Clifton M. Bean" <cmbean@sbcglobal.net>
> > To: <ids@iiug.org>
> > Sent: Monday, February 28, 2005 4:00 PM
> > Subject: Kshell Script to Compare One Database on One Server to the =
> > Same
> > Database on Another Server [4364]
> >
> >
> > > I seem to remember someone already having written a script to do =
> > this and
> > report any row count differences found. Before re-investing the =
> > wheel, I
> > thought I would ask around. I looked through the IIUG Software =
> > Archives (or
> > at least I tried to) and couldn't find what I was looking for.
> > >
> > > Any help out there ? :)
> > >
> > > Take care.
> > > Clifton
> > >
> > >
> > >
> >
> >
> >
> >
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > The information contained in this message may be privileged
> > and confidential and protected from disclosure. If the reader
> > of this message is not the intended recipient, or an employee
> > or agent responsible for delivering this message to the
> > intended recipient, you are hereby notified that any reproduction,
> > dissemination or distribution of this communication is strictly
> > prohibited. If you have received this communication in error,
> > please notify us immediately by replying to the message and
> > deleting it from your computer. Thank you. Tellabs
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >
> > ------=_NextPart_000_0242_01C51DDC.97ADAF40
> > Content-Type: text/html;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD><TITLE>Re: Kshell Script to Compare One Database on One =
> > Server to the Same [4369]</TITLE>
> > <META http-equiv=3DContent-Type content=3D"text/html; =
> > charset=3Diso-8859-1">
> > <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=3D#ffffff>
> > <DIV><FONT face=3DArial size=3D2>dbdiff2 is the schema difference tool - =
> > to be found=20
> > at iiug.org.</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>As Clifton points out, the other =
> > is:</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>update statistics; { DO NOT =
> > FORGET THIS PART=20
> > }</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2>unload to datafile</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2>select tabname, nrows from systables =
> > where tabid=20
> > > 99</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2>order by tabname;</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>(run on both engines)</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>diff file1 file2</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>I don't think it's really worth =
> > scripting, although=20
> > it wouldn't be that hard to do.</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> > <DIV><FONT face=3DArial size=3D2>j.</FONT></DIV>
> > <BLOCKQUOTE dir=3Dltr=20
> > style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
> > BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
> > <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
> > <DIV=20
> > style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
> > black"><B>From:</B>=20
> > <A title=3DNormaJean.Sebastian@tellabs.com=20
> > href=3D"mailto:NormaJean.Sebastian@tellabs.com">Sebastian, Norma =
> > J.</A> </DIV>
> > <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
> > title=3Dvze2qjg5@verizon.net=20
> > href=3D"mailto:vze2qjg5@verizon.net">vze2qjg5@verizon.net</A> ; <A=20
> > title=3Dids@iiug.org
Related threads
- Conversion to differeent characters sets
- Problem in changing locale via dbexport/dbimport
- Re: Matches not Work in 7.30
- DATABASE vs CONNECT TO: Invalid characters error?