|
|
sybperl-l Archive
Up Prev Next
From: "Peter Collard" <collardp at rabo-bank dot com>
Subject: RE: running dbcc via Sybperl
Date: Jul 27 1998 8:44AM
looks like you are not sa nor have sa_role
________________________________________________________
Peter Collard
Sybase Database Administrator
0171-410-3863
"The views expressed in this correspondence are mine and not necessarily those of Rabobank International"
________________________________________________________
-----Original Message-----
From: Eli Perl [SMTP:eperl@Bear.COM]
Sent: Friday, July 24, 1998 7:29 PM
To: SybPerl Discussion List
Subject: Re: running dbcc via Sybperl
Michael:
I changed my code to set the TRACEON and the message handler to return all message. This is all I
get (I cut some of the repetitious stuff)
> use KOPS01DB
Sybase message 2528, Severity 0, state 1
Server `PCSHELLDEV'
Line 1
DBCC execution completed. If DBCC printed error messages, contact a user with System
Administrat
or (SA) role.
1> dbcc traceon(3604)
Sybase message 5701, Severity 0, state 2
Server `PCSHELLDEV'
1> dbcc page (5, 23587)
Sybase message 2528, Severity 0, state 1
Server `PCSHELLDEV'
Line 1
DBCC execution completed. If DBCC printed error messages, contact a user with System
Administrat
or (SA) role.
Michael Peppler wrote:
> The default message handler (in sybutil.pl) will *NOT* print messages
> from dbcc, because it ignores all messages with severity 10 or lower.
>
> You should write your own message handler that prints out everything,
> and then tailor it to maybe filter out the exact messages that you do
> not want to see.
>
> Michael
>
> Eli Perl writes:
> > Michael:
> > isql/10.0.4/P-EBF7430/sun_svr4/SPARC Solaris 2.3/1/Wed Jul 9 23:18:54 PDT 1997
> > SQL Server/11.0.3.2/P/Sun_svr4/OS 5.4/SWR 7578 Rollup/OPT/Mon Nov 3 22:19:21 PST 1997
> >
> > The script is a simple isql-like processor. It reads the input file which contains the T-SQL
> > I want to execute and either loops through the result table if there is one or the
> > message_handler takes over.
> > So when my input.sql file contains 'sp_sysmon 5' it gives me exactly what I want, but 'dbcc
> > page (5, 23587)' returns nothing in the message handler output file. (I know that the page
> > is valid because it gives me what I want when I set TRACEON 3604 and then run it via isql.)
> > Do I have to turn 3604 on first?
> > Thanks for your help
> >
> > Eli Perl
> >
> >
> > Michael Peppler wrote:
> >
> > > Eli Perl writes:
> > > > Thanks, but I am using the handler included in the sybperl distribution, and it works
> > > > fine for everything else.
> > >
> > > What does your script do exactly?
> > >
> > > Also, what versions of Sybase (both server and OpenClient) do you use?
> > >
> > > Michael
> > >
> > > >
> > > > Raja Sambamurty wrote:
> > > >
> > > > > Eli,
> > > > >
> > > > > It works fine, except remember that all the non-select statements go the
> > > > > the mesg/error handlers. So make sure that you have the handlers setup
> > > > > in your perl script. I have a working version that I could share with
> > > > > you, if you want.
> > > > >
> > > > > Raja
> > > > > >
> > > > > >All:
> > > > > >
> > > > > >When I try to run a dbcc page in a sybperl script, I get
> > > > > >this error:
> > > > > >
> > > > > >'Sybase error: Attempt to print unknown token.'
> > > > > >
> > > > > >If I go in via ISQL and use TRACEON 3604 ro redirect the
> > > > > >output (of the eact same dbcc page command) to my session,
> > > > > >everything's fine. How can I do this in Sybperl?
> > > > > >
> > > > > >Eli Perl
> > > > > >
> > > > > >End
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >***********************************************************************************
> > > > > >Bear Stearns is not responsible for any recommendation, solicitation,
> > > > > offer or
> > > > > >agreement or any information about any transaction, customer account or
> > > > > account
> > > > > >activity contained in this communication.
> > > > > >***********************************************************************************
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > ______________________________________________________
> > > > > Get Your Private, Free Email at http://www.hotmail.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ***********************************************************************************
> > > > Bear Stearns is not responsible for any recommendation, solicitation, offer or
> > > > agreement or any information about any transaction, customer account or account
> > > > activity contained in this communication.
> > > > ***********************************************************************************
> > > >
> > > >
> > > >
> > >
> > > --
> > > Michael Peppler -||- Data Migrations Inc.
> > > mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
> > > Int. Sybase User Group -||- http://www.isug.com
> >
> >
> >
> >
> >
> > ***********************************************************************************
> > Bear Stearns is not responsible for any recommendation, solicitation, offer or
> > agreement or any information about any transaction, customer account or account
> > activity contained in this communication.
> > ***********************************************************************************
> >
> >
> >
>
> --
> Michael Peppler -||- Data Migrations Inc.
> mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
> Int. Sybase User Group -||- http://www.isug.com
***********************************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, offer or
agreement or any information about any transaction, customer account or account
activity contained in this communication.
***********************************************************************************
|