http://goo.gl/EmKxy0

Home > ASE, Sybase ASE/REP Interview Questions, Sybase IQ Server > Sybase dataserver binary output and dbcc command.

Sybase dataserver binary output and dbcc command.

September 28th, 2011 Leave a comment Go to comments

When we execute dbcc sqltext without putting on traceflag 3604 and 3605
where the out put of sqltext goes? In errorlog?

No,For errorlog we have traceflag 3605.

Lets explore the RUN server file again:

/opt/sybase/ASE-15_0/bin/dataserver
-d/opt/sybase/devices/master.dat
-e/opt/sybase/ASE-15_0/install/PROD_ASE_DS1.log
-c/opt/sybase/ASE-15_0/PROD_ASE_DS1.cfg
-M/opt/sybase/ASE-15_0
-sPROD_ASE_DS1 > /dev/null

-e : denoting the errorlog file where all error message and informational messages resides.

AS we know, When we are running any binary file, the output of that binary displays on the screen.

What about the output of $SYBASE/$YSBASE_ASE/bin/dataserver binary,
generally we redirect it to null device (/dev/null) as above.

Now,I am redirecting the output to file like below as in /tmp/sybaselog.out file.

/opt/sybase/ASE-15_0/bin/dataserver
-d/opt/sybase/devices/master.dat
-e/opt/sybase/ASE-15_0/install/PROD_ASE_DS1.log
-c/opt/sybase/ASE-15_0/PROD_ASE_DS1.cfg
-M/opt/sybase/ASE-15_0
-sPROD_ASE_DS1 > /tmp/sybaselog.out

Run the dbcc sqltext command , the result would be display in dataserver output file, without any traceflag.

It means when we require any output on user screen and errorlog, need to enable the traceflag 3604 and 3605 respectively,
otherwise it will be display in sybase dataserver binary , out put file ,if we are redirecting it to file.

sybase@localhost ~]$ isql -Usa -SPROD_ASE_DS1
Password:
1> select @@spid
2> go

 ------
     14

(1 row affected)
1> select name from sysdatabases
2> go
 name
 ------------------------------------------------------------
 master
 model
 sybsecurity
 sybsystemdb
 sybsystemprocs
 tempdb

(6 rows affected)

1> dbcc sqltext(14)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
1> dbcc sqltext(14)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
1>

[sybase@localhost ~]$ tail -f /tmp/sybaselog.out
00:00:00000:00001:2011/09/28 08:51:15.11 server  ASE's default unicode sort order is 'binary'.
00:00:00000:00001:2011/09/28 08:51:15.11 server  ASE's default sort order is:
00:00:00000:00001:2011/09/28 08:51:15.11 server         'bin_iso_1' (ID = 50)
00:00:00000:00001:2011/09/28 08:51:15.11 server  on top of default character set:
00:00:00000:00001:2011/09/28 08:51:15.11 server         'iso_1' (ID = 1).
00:00:00000:00001:2011/09/28 08:51:15.11 server  Master device size: 500 megabytes, or 256000 virtual pages. (A virtual page is 2048 bytes.)
00:00:00000:00001:2011/09/28 08:51:15.11 kernel  Warning: Cannot set console to nonblocking mode, switching to blocking mode.
SQL Text: SELECT fid=right(space(80)+isnull(convert(varchar(80),fid),'NULL'),3), spid=right(space(80)+isnull(convert(varchar(80),spid),'NULL'),4), status=SUBSTRING(convert(varchar(80),status),1,10), loginame=SUBSTRING(convert(varchar(80),loginame),1,8), origname=SUBSTRING(convert(varchar(80),origname),1,8), hostname=SUBSTRING(convert(varchar(80),hostname),1,21), blk_spid=right(space(80)+isnull(convert(varchar(80),blk_spid),'NULL'),8), dbname=SUBSTRING(convert(varchar(80),dbname),1,6), tempdbname=SUBSTRIN
SQL Text: select @@spid

SQL Text: select name from sysdatabases

Please let me knwo if you have any more thoughts!!

Check the Sybase Wiki @ sybasewiki.com
  1. No comments yet.
  1. No trackbacks yet.