----------------------------------------------------------------------------

                               SYBASE TECHNICAL NEWS

            Volume 8, Number 1                      January 1999

----------------------------------------------------------------------------

Introduction

This issue of Sybase Technical News contains new information about your
Sybase software. This newsletter is intended for Sybase customers. All
issues of Sybase Technical News are included on the Technical Library CD 
and web pages.

Happy New Year! Although we're one year away from the Millenium Bug, most
Sybase Inc. products are Year 2000-compliant. A matrix of Sybase products
and their Year 2000 status is available on the web at

http://www.sybase.com/inc/corpinfo/year2000_matrix.html 

Should you need assistance in migrating to these products, please contact 
Sybase Professional Services at http://www.sybase.com/services/ In the US 
and Canada, you can telephone 1-800-8SYBASE. Customers in other locations 
should contact their Sybase distributor. The staff of Sybase Technical News 
wishes you a healthy and prosperous new year.

----------------------------------------------------------------------------

In This Issue

--------------------------------------

Tip of the Month

TechNotes:

   * Device Size Limits for Backup Server, SQL Server 11.0.x and Adaptive
     Server Enterprise 11.5.x and 11.9.2
     http://techinfo.sybase.com/css/techinfo.nsf/DocId/ID=800
     
     Doc Summary:
     This TechNote documents database device and dump device size limits.
     
   * AIX Changes Affect CT-Library Multithread References
     http://techinfo.sybase.com/css/techinfo.nsf/DocId/ID=20360
     
     Doc Summary:
     Users will encounter operating system errors when attempting to compile
     CT-Library 11.1.1 multithread samples because of changes to AIX. This
     document describes how to correct the problem.
     
   * How to Use SQL Server to Analyze the Error Log (System 11)
     http://techinfo.sybase.com/css/techinfo.nsf/DocId/ID=20211
     
     Doc Summary:
     This document explains how to use SQL Server 11 to help analyze
     instances of a stacktrace in a long errorlog.

Other Useful Information

Subscription

----------------------------------------------------------------------------

Tip of the Month: Tuning Asynchronous I/O on AIX

---------------------------------------------------------------------------

To improve server asynchronous I/O on IBM R/S6000 AIX 4.2.1 and later,
Sybase and IBM recommend that you perform the following:

  1. Place only tempdb on a filesystem device for performance reasons.

  2. Use only as many asynchronous I/O daemons as the number of active
     physical disks. The default of 10 daemons is sufficient for most
     scenarios.

  3. Start all the daemons at start-up (initial=10, total=10) so that they
     are owned by root. This also eliminates confusion about running
     processes.

Background
----------

The default 10 asynchronous I/O daemons are started at boot time by
initializing only one asynchronous I/O daemon. That daemon is "owned" by
root. If the first asynchronous I/O daemon is busy, and a second
asynchronous I/O request is issued, then additional daemons are started
until the maximum number of concurrent daemons is reached. This also gives
you some idea of how many concurrent daemons are actually needed.

The additional daemons are started and "owned" by the userid responsible for
issuing the original request (usually "sybase"). Once started, the
asynchronous I/O daemons never terminate, even if the dataserver terminates.
This gives the appearance that the server has left running kernel processes
in the system, although the processes are owned by the userid which caused
them to be started.

----------------------------------------------------------------------------

TechNotes

---------------------------------------------------------------------------

Device Size Limits for Backup Server, SQL Server 11.0.x and Adaptive Server
			Enterprise 11.5.x and 11.9.2

This TechNote documents database device and dump device size limits.

Contents
--------

This document lists versions of Backup Server, Sybase SQL Server, and
Adaptive Server Enterprise that support devices greater than 2Gb in size. It
also explains why some platforms are limited to 2Gb. This information
applies only to platform versions certified to work with specified Sybase
products.

 Note: Certification reports for all platforms are available in the
       Technical Documents collection of Technical Library.
       http://techinfo.sybase.com

This TechNote contains the following sections:

   * Background

   * Maximum Device Support by Platform for Backup Server, SQL Server, and
     Adaptive Server

   * Limitations on Metadevices on Solaris

   * The Impact of the 2Gb Device Limit for UNIX

   * Action From Sybase

Background
----------

Sybase supports the largest device that the host operating system allows
with its seek utility. UNIX system calls use length or absolute offset when
writing to or reading from a file. On 32-bit platforms, the length or offset
must be a 32-bit quantity; therefore, the effective file size limit is 2Gb.
A breakdown of size limits by platform appears in the next section, "Maximum
Device Support by Platform for Backup Server, SQL Server, and Adaptive
Server".

Maximum Device Support by Platform for Backup Server, SQL Server, and
Adaptive Server

   Table 1: Platform, version and storage size matrix
   
              
-----------------------------------------------------------
Digital Unix 
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
=========================================================== 

File	Raw	File 	Raw	File 	Raw	File 	Raw	
32   	32	32   	32	32   	32	32   	32	

===========
11.9.2
===========
File 	Raw
32   	32g

-----------------------------------------------------------
IBM AIX
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File	Raw	File	Raw	File	Raw	File	Raw	
2    	2     	2    	2    	2    	2      	2    	2     

===========
11.9.2
===========
File	Raw
32	32h

-----------------------------------------------------------
HP-UX
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	4 a  	2    	4      	2    	32b   	

===========
11.9.2
===========
File	Raw
32	32i

-----------------------------------------------------------
NCR  
===========================================================         
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	2    	n/a  	n/a    	32c  	32c

=========== 
11.9.2
===========
File	Raw

-----------------------------------------------------------
Novell NetWare 
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	2    	n/a  	n/a    	n/a  	n/a

11.9.2
===========
File	Raw
===========

-----------------------------------------------------------
Pyramid
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	2    	n/a  	n/a    	n/a  	n/a

11.9.2
===========  
File	Raw 	
===========

-----------------------------------------------------------
SCO UnixWare   
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	2    	n/a  	n/a    	2    	2
-----------------------------------------------------------

===========
11.9.2
===========
File	Raw

-----------------------------------------------------------
Siemens        
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	n/a  	n/a  	n/a  	n/a    	n/a  	n/a

===========
11.9.2
===========
File	Raw

-----------------------------------------------------------
SGI IRIX       
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2     	2    	2    	n/a  	n/a    	32d  	32d

===========
11.9.2
===========
File	Raw

-----------------------------------------------------------
Sun Solaris    
===========================================================
11.0.1
11.0.2		11.0.3		11.5		11.5.1
===========================================================   
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
2    	2	2    	2    	2    	32e    	2    	32e   

===========
File	Raw
===========
2	32j

-----------------------------------------------------------
Windows NT
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1   
===========================================================
File 	Raw	File 	Raw	File 	Raw     File 	Raw	
32   	n/a   	32   	n/a  	32   	n/a    	32   	n/a   

===========
File	Raw
===========
32	n/a

-----------------------------------------------------------
OpenVMS
===========================================================
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
32   	n/a   	32   	n/a  	n/a  	n/a    	n/a  	n/a

===========
File	Raw
===========

-----------------------------------------------------------
DEC Alpha NT   
=========================================================== 
11.0.1/
11.0.2		11.0.3		11.5		11.5.1
===========================================================
File 	Raw	File 	Raw	File 	Raw	File 	Raw	
32f  	n/a   	32   	n/a  	n/a  	n/a    	32   	n/a

===========
File	Raw
===========

------------------------------------------------------------------------

a Large device support started with 11.0.3.1.

b Requires HP-UX 10.20 or higher.

c Large device support on NCR has been tested up to 4Gb.

d Large device support on SGI has been tested up to 6Gb.

e Large device support on Solaris has been tested up to 5Gb. For 11.0.x.,
see section, "Limitation with Metadevices on Solaris 1.x and 2.x".

f Released in 11.0.2.

g Requires Digital UNIX 4.0a or later. Device size limit is based on using
the logical volume manager.

h Requires AIX 4.2.1 or later.

i Requires HP-UX 10.2 or later.

j Requires Solaris 2.5.1.

Limitation with Metadevices on Solaris 1.x and 2.x
--------------------------------------------------

Solaris 1.x (SunOS) and Solaris 2.x support OnLine DiskSuite metadevices
logical devices that can be larger than 2Gb, manage more than one physical
device, and permit mirroring at the operating system level. Accessing these
devices for reading and writing requires the use of special system calls
from special system function libraries.

However, SQL Server 11.0.x uses the normal UNIX mechanism for reading and
writing to files. Therefore, SQL Server 11.0.x is still limited to a device
size of 2Gb even with OnLine DiskSuite metadevices on Solaris Systems.

The Impact of the 2Gb Device Limit for UNIX
-------------------------------------------

If the 2Gb device limit applies to you, you must configure your devices to a
size no larger than 2Gb on any UNIX platform.

Although Backup Server, SQL Server, and Adaptive Server can handle databases
larger than 2Gb, no individual device may exceed this limit, because of how
UNIX locates information for reading and writing in files. UNIX system calls
use length or absolute offset when writing to or reading from a file. The
length or offset must be a 32-bit quantity; therefore, the effective file
size limit is 2Gb.

Hazards of Using Larger Devices on a 2Gb-Limit Platform
-------------------------------------------------------

If you attempt to configure a logical device larger than 2Gb for Backup
Server, SQL Server, or Adaptive Server on a platform that does not support
large devices, you may experience the following problems:

   * Data corruption on databases, with no error message.

   * Inability to dump or load data from database that have devices greater
     than 2Gb.

      WARNING! The disk init command does not give you an error or warning
               message if you create a device larger than the limitation.

Action From Sybase
------------------

Eventually, most or all platform operating systems will permit 64-bit
addressing in their "seek" utility functions; when that occurs, Sybase will
support devices as large as the biggest disk available. See your operating
system manuals for addressing information.

----------------------------------------------------------------------------

AIX Changes Affect CT-Library Multithread References

When attempting to compile a CT-Library 11.1.1 multithread sample (or any
program that might use a call to pthread_yield) on IBM AIX 4.3.X, you may
see the following loader error:

ld: 0711-317 ERROR: Undefined symbol: .pthread_yield

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.

This occurs because pthread_yield() was removed from the Posix (XOpen
Version 5) standard, and replaced with sched_yield(). As of AIX 4.3.1,
/lib/libpthreads.a conforms to the new standard and removes pthread_yield().

IBM provides a compatibility library for the older interface
(/lib/libpthreads_compat.a) to provide support for vendor libraries which
use pthread_yield() on AIX 4.3.1. AIX is also "upward binary compatible"
--applications built using pthread_yield() in releases prior to AIX 4.3.1
will continue to operate correctly on AIX 4.3.1.

For more information on threads scheduling, see the IBM AIX documentation,
available on the World Wide Web at
http://www.austin.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/threads_sched.htm#D3A44A4268manu

These Sybase CT-Libraries reference threads scheduling:

   * libcomn_r.a

   * libcomn_r.so.a

   * libddce.so.a

   * libskrb.so.a

When you try to link, you may encounter the loader error described above.
The next section describes how to fix the problem.

Installing the /lib/libpthreads_compat.a compatibility library

The "xlc_r4" compiler alias sets the proper compiler flags and libraries to
use the pthreads compatibility library.

If libpthreads_compat.a is not installed on your system, install the
bos.rte.libpthreads AIX fileset from the AIX 4.3.1 CD-ROM.

If the "xlc_r4" command is not present on your system, it means that the
following shell script was not run on your system for the AIX 4.3.1
compiler:

/usr/ibmcxx/bin/replaceCSET

See /usr/ibmcxx/README.C++ for more details.

----------------------------------------------------------------------------
----------------------------------------------------------------------------

How to Use SQL Server to Analyze the Error Log (System 11)

If you have many instances of a stacktrace in a long errorlog you can use
Adaptive Server to help you analyze the stacktraces to see if they are
always the same or if there are differences.

The first step is to read in the errorlog into a table. For this you need to
deal with the carriage returns in the errorlog. Using the editor of your
choice, replace all occurrences of "carriage return + 0" (i.e. true line
breaks) with a string that is not going to occur in the file, like "@@@@".
Then remove all remaining carriage returns, and make sure to add a string
terminator ("@@@@") at the end of the last line. Run the script at the end
of this technote to create table tempdb..errlog_one_field and several stored
procedures.

Copy the errorlog into table errlog_one_field:

$SYBASE/bin/bcp tempdb..errlog_one_field in cleaned_up_errorlog\
 -Usa -P -SDINO_11 -c -r @@@@

Use the procedure parse_errlog to break up the table into separate fields.
This will create table tempdb..errlog_table.

 use tempdb

 go

 parse_errlog

 go

Run procedure extract_stacktrace to extract all instances of the stacktrace
from the errlog_table into table errlog_extracted. The first and last line
of the stacktrace will be whatever you specify.

 Note: The search string must begin with the first character after
       "kernel"; i.e. if you want to search for "timeslice - 201, current
       process infected", search for "timeslice" or "timeslice -201", not
       for "current process infected".

Extracting one particular kind of stacktrace defined by the starting and
ending string will get rid of everything else in the log, including other
stacktraces that don't fit the pattern.

 extract_stacktrace "timeslice", "end of stack trace"

 go

The resulting table has an id column for the line numbers. It is useful to
copy out this table and print the bcp file so that you have the line numbers
in front of you for subsequent steps.

$SYBASE/bin/bcp tempdb..errlog_extracted out\

 /usr/u/ameyer/sybase/errlog_extracted.bcp -Usa -P -SDINO_11 -c

You can read the table errlog_extracted like a normal errorlog (with line
numbers) using this procedure:

read_extracted starting_line, ending_line

If you do not supply parameters, it will read the entire table.

Use proc which_functions if you want to check which functions are in the
stacktraces and how often they occur. If the numbers are not the same you
know that the stacktraces are not identical. This step helps to identify
functions that occur only once or twice which you might overlook otherwise.

If the stacktraces are different it is useful to run a diff. You cannot do
this directly with the errorlog file since the date will always be
different, but you can do this via SQL server.

Procedure write_bcp_script creates a table that contains just the function
names (i.e. the strings between "pc: " and "+" in the stack trace). Based on
this information and the line numbers in errlog_extracted, it writes an
executable bcp script that has one bcp command per stack trace.

You need to write the results of this procedure to an output file:

 isql -Usa -P -o/usr/u/ameyer/sybase/write_bcp_script.out << EOF

 use tempdb

 go

 write_bcp_script

 go

 EOF

Make sure you have execute permissions on this file, and execute it:

write_bcp_script.out

This will write a file named stacktrace1.bcp, stacktrace2.bcp,
stacktrace3.bcp etc. for each instance of the stacktrace. These files will
contain only the function calls so you can use unix diff to compare them.
List the files by size:

ls -l stacktrace* | sort +4n

and start running diff's to see if there are any differences between the
stacktraces.

Query

 use tempdb

 go

 if exists (select * from tempdb..sysobjects

 where name like "errlog_one_field")

 drop table tempdb..errlog_one_field

 go

 create table tempdb..errlog_one_field (line varchar(250))

 go

 if exists (select * from tempdb..sysobjects

 where name like "do_parse")

 begin

 drop proc do_parse

 if exists (select * from tempdb..sysobjects

 where name like "errlog_table" )

 drop table tempdb..errlog_table

 end

 go

 create proc do_parse as

 select engine = substring(line, 1, 3),

 date = substring(line, 4, 21),

 srv_knl = substring(line, 25, 8),

 msg = substring(line, 33, 217)

 into tempdb..errlog_table from tempdb..errlog_one_field

 return

 go

 if exists (select * from tempdb..sysobjects

 where name like "parse_errlog")

 begin

 drop proc parse_errlog

 end

 go

 create proc parse_errlog

 as

 if not exists (select * from tempdb..sysobjects

 where name = "errlog_one_field")

 begin

 select "Table tempdb..errlog_one_field not found.

 You  need to create table"

 + "tempdb..errlog_one_field (line varchar(250))

 and bcp the errorlog into this table."

 return

 end

 else

 begin

 if exists (select * from tempdb..sysobjects

 where name like "errlog_table")

 drop table tempdb..errlog_table

 exec do_parse

 end

 return

 go

 exec parse_errlog

 go

 if exists (select * from tempdb..sysobjects

 where name = "run_errlog_cursor")

 begin

 drop proc run_errlog_cursor

 if exists (select * from tempdb..sysobjects

 where name like "errlog_extracted ")

 drop table tempdb..errlog_extracted

 end

 go

 create procedure run_errlog_cursor @start_string varchar(100),

 @stop_string varchar(100)

 as

 declare errlog_cursor cursor

 for select engine, date, srv_knl, msg from tempdb..errlog_table

 for read only

 declare @engine char(8),

 @date varchar(21),

 @srv_knl varchar(8),

 @msg varchar(217),

 @on_off bit

 open errlog_cursor

 fetch errlog_cursor into @engine, @date, @srv_knl, @msg

 create table tempdb..errlog_extracted

 (id numeric(6,0) identity not null,

 engine varchar(3) null,

 date varchar(21) null,

 srv_knl varchar(8) null,

 msg varchar (217) null)

 select @on_off = 0

 while @@sqlstatus != 2

 begin

 if (@@sqlstatus = 1)

 begin

 raiserror 20001, "select failed in errlog_cursor"

 return

 end

 if substring(@msg, 1, datalength(@start_string)) = @start_string

 select @on_off = 1

 else

 if substring(@msg, 1, datalength (@stop_string)) = @stop_string

 begin

 if @on_off = 1 insert tempdb..errlog_extracted values (@engine,

 @date, @srv_knl, @msg)

 select @on_off = 0

 end

 if @on_off = 1

 insert tempdb..errlog_extracted values

 (@engine, @date, @srv_knl, @msg)

 fetch errlog_cursor into @engine, @date, @srv_knl, @msg

 end

 close errlog_cursor

 deallocate cursor errlog_cursor

 return

 go

 if exists (select * from tempdb..sysobjects

 where name = "extract_stacktrace")

 drop proc extract_stacktrace

 go

 create procedure extract_stacktrace @start_string varchar(100),

 @stop_string varchar(100)

 as

 if not exists(select * from tempdb..sysobjects

 where name like "errlog_table")

 begin

 select "No errlog_table found. Please execute procedure

 parse_errlog which " +

 "creates this table."

 return

 end

 else

 begin

 if exists (select * from tempdb..sysobjects

 where name like "errlog_extracted")

 drop table tempdb..errlog_extracted

 exec run_errlog_cursor @start_string, @stop_string

 end

 return

 go

 create table tempdb..errlog_extracted

 (id numeric(6,0) identity not null,

 engine varchar(3) null,

 date varchar(21) null,

 srv_knl varchar(8) null,

 msg varchar (217) null)

 go

 if exists (select * from tempdb..sysobjects

 where name = "read_extracted")

 drop proc read_extracted

 go

 create proc read_extracted @start int = NULL, @stop int = NULL

 as

 if not exists (select * from tempdb..sysobjects

 where name = "errlog_extracted")

 begin

 select "No errlog_extracted table.

 Run proc extract_stacktrace to create this table."

 return

 end

 else

 begin

 if @start = NULL

 select @start = min(id) from errlog_extracted

 if @stop = NULL

 select @stop = max(id) from errlog_extracted

 select convert(char(6), id) + engine + date + " " + srv_knl + " " + msg

 from tempdb..errlog_extracted

 where id >= @start and id <= @stop

 return

 end

 go

 if exists (select * from tempdb..sysobjects

 where name = "which_functions")

 drop proc which_functions

 go

 create proc which_functions

 as

 if not exists (select * from tempdb..sysobjects

 where name = "errlog_extracted")

 begin

 select "No errlog_extracted table.

 Run proc extract_stacktrace to create this table."

 return

 end

 else

 begin

 select substring(msg, 5 + charindex

 (" ", substring(msg, 5, datalength(msg)) ),

 charindex ("+", msg) - charindex

 (" ", substring(msg, 5, datalength(msg)) ) - 5),

 frequency = count(*)

 from errlog_extracted where msg like "pc:%+%"

 group by substring(msg, 5 + charindex

 (" ", substring(msg, 5, datalength(msg ))),

 charindex ("+", msg) - charindex

 (" ", substring(msg, 5, datalength(msg)) ) - 5)

 order by frequency

 end

 go

 if exists (select * from tempdb..sysobjects

 where name = "create_msg_only")

 begin

 drop proc create_msg_only

 drop table msg_only

 end

 go

 create proc create_msg_only

 as

 select msg into msg_only

 from tempdb..errlog_extracted

 return

 go

 exec create_msg_only

 go

 if exists (select * from tempdb..sysobjects

 where name = "run_bcp_cursor")

 begin

 drop proc run_bcp_cursor

 end

 go

 create procedure run_bcp_cursor

 as

 update msg_only set msg = ' ' where msg not like "pc:%+%"

 update msg_only set msg = substring(msg, 5 + charindex (" ",

 substring(msg, 5, datalength(msg))), charindex ("+", msg) -

 charindex (" ", substring(msg, 5, datalength(msg))) - 5)

 where msg like "pc:%+%"

 declare @lastrow int

 select s.id

 into #tempbcp from errlog_extracted f, errlog_extracted s

 where f.msg = s.msg and f.id = 1

 select @lastrow = max (id) from errlog_extracted

 declare bcp_cursor cursor

 for select id from #tempbcp

 for read only

 declare @cur smallint,

 @startrow int,

 @endrow int,

 @filenr smallint

 open bcp_cursor

 fetch bcp_cursor into @cur

 select @filenr = 1

 select @startrow = @cur

 fetch bcp_cursor into @cur

 create table #results (cmd_string char(150))

 while @@sqlstatus != 2

 begin

 if (@@sqlstatus = 1)

 begin

 raiserror 20001, "select failed in bcp_cursor"

 return

 end

 select @endrow = @cur - 1

 insert #results select "bcp Tempdb..msg_only out stacktrace"

 + convert(varchar(6), @filenr)

 + ".bcp -F" + convert(varchar(6), @startrow)

 + " -L" + convert(varchar(6), @endrow) + " -Usa -P -c"

 select @filenr = @filenr + 1

 select @startrow = @cur

 fetch bcp_cursor into @cur

 end

 select @endrow = @lastrow

 insert #results select "bcp tempdb..msg_only out stacktrace"

 + convert(varchar(6), @filenr)

 + ".bcp -F" + convert(varchar(6), @startrow)

 + " -L" + convert(varchar(6), @endrow) + " -Usa -P -c"

 close bcp_cursor

 deallocate cursor bcp_cursor

 select "--" = cmd_string from #results

 drop table #results

 drop table #tempbcp

 return

 go

 if exists (select * from tempdb..sysobjects

 where name = "write_bcp_script")

 drop proc write_bcp_script

 go

 create procedure write_bcp_script

 as

 if not exists (select * from tempdb..sysobjects

 where name = "errlog_extracted")

 begin

 select "No errlog_extracted table.

 Run proc extract_stacktrace to create this table."

 return

 end

 else

 if exists (select * from tempdb..sysobjects

 where name = "msg_only")

 drop table msg_only

 exec create_msg_only

 exec run_bcp_cursor

 return

 go

 if exists (select * from tempdb..sysobjects where name = "lookup")

 drop proc lookup

 go

 create proc lookup @trace_no int

 as

 if not exists (select * from tempdb..sysobjects

 where name = "errlog_extracted")

 begin

 select "No errlog_extracted table.

 Run proc extract_stacktrace to create this table."

 return

 end

 else

 begin

 declare @lastrow int

 declare @max int

 create table #lookup (trace_no numeric(6,0) identity, rowid int)

 insert #lookup select s.id into #tempbcp from errlog_extracted f,

 errlog_extracted s

 where f.msg = s.msg and f.id = 1

 select @lastrow = NULL

 select @lastrow = min(rowid) - 1 from #lookup

 where rowid > (select rowid from #lookup where @trace_no = trace_no)

 if @lastrow = NULL

 select @lastrow = (select max(id) from errlog_extracted)

 select @max = max(trace_no) from #lookup

 if ( @trace_no > @max or @trace_no < 1)

 begin

 select "There are " + convert (varchar(6), max(trace_no)) +

 " stacktraces in table errlog_extracted." from #lookup

 end

 else

 begin

 select "Stacktrace " + convert (varchar(6), @trace_no) +

 " begins at line "

 + convert(varchar(6), rowid) +

 " and ends at line " + convert(varchar(6),

 @lastrow)

 + " in table errlog_extracted. Use ""read_extracted "

 + convert(varchar(6), rowid) + ", " +

 convert(varchar(6), @lastrow) +

 """ to read this stacktrace on line." from #lookup

 where @trace_no = trace_no

 drop table #lookup

 end

 return

 end

 go

----------------------------------------------------------------------------

Other Useful Information

---------------------------------------------------------------------------

   * SQL Server 11.x Bug Report

             http://techinfo.sybase.com/css/techinfo.nsf/DocID/ID=2434

     This report contains critical, severe and annoying bugs found in Sybase
     SQL Server 11, versions 11.0, 11.0.1, 11.0.1.1, 11.0.2, 11.0.2.1,
     11.0.2.2 and 11.0.3. It includes a description of the bug and a
     workaround if one has been documented.

   * Certification Reports

             http://techinfo.sybase.com/css/techinfo.nsf/Certification

     Browse by certification

   * Product Availability

             http://techinfo.sybase.com/css/techinfo.nsf/New+Products

     These Alerts feature new Sybase products which became available for
     sale during the time span listed on the Alert. Included are
     instructions on actions you need to take and an explanation of
     abbreviations.

   * End-of-Life/End-of-Support

             http://techinfo.sybase.com/css/techinfo.nsf/eolproducts

     Collection of end-of-support letters to customers having contracts for
     various products on different platforms. Each letter describes the
     end-of-support plan for these products.

   * Error Messages

             http://techinfo.sybase.com/css/techinfo.nsf/Topic

   * Migrating to Sybase Adaptive Server Enterprise 11.5

             http://techinfo.sybase.com/css/techinfo.nsf/DocID/ID=34982-01-1150-01

     A guide to help you migrate from 4.x, 10.x and 11.0.x, including
     templates and checklists.

   * What's New

             http://techinfo.sybase.com/css/techinfo.nsf/Whats+New

     Browse the most recently released documents.

For frequent updates, visit the Sybase Technical Library on the World Wide
Web at http://techinfo.sybase.com.

Electronic Case Management and Electronic Software Delivery access remains
limited to Sybase support contacts who are registered with SupportPlus
Online Services. ECM and ESD requires SSL web browser support. ECM and ESD
users also may access the Technical Library from behind the firewall in the
usual manner, allowing them to retain the security benefits of using SSL
with their web browser.

Subscription Information

--------------------------------------

Send comments to technews@sybase.com. To receive this document by regular
email, send email to majordomo@sybase.com, and in the body of your message
put subscribe inews-technews-full. For a summary version by email, put
subscribe inews-technews-summary. No subject line is necessary.

Staff

Principal Editor: Betsy Brazy

Production Editors: Deborah Blakeney, Rodney Esperanza, Leigh Ann Hussey

Contributors: Lance Andersen, Dick Dunbar, Mike Maas, Robin McCann, Sharyn
Thollaug, Jennifer Tifft

Disclaimer

--------------------------------------

No express or implied warranty is made by Sybase or its subsidiaries with
regard to any recommendations or information presented in Sybase Technical
News. Sybase and its subsidiaries hereby disclaim any and all such
warranties, including without limitation any implied warranty of
merchantability of fitness for a particular purpose. In no event will Sybase
or its subsidiaries be liable for damages of any kind resulting from use of
any recommendations or information provided herein, including without
limitation loss of profits, loss or inaccuracy of data, or indirect special
incidental or consequential damages. Each user assumes the entire risk of
acting on or utilizing any item herein including the entire cost of all
necessary remedies.

----------------------------------------------------------------------------

--------------------------------------------------
If you ever want to remove yourself from this mailing list, you can send
mail to "majordomo@sybase.com" with the following command in the body of
your email message:

unsubscribe inews-technews-full

If you ever want to add yourself from this mailing list, you can send
mail to "majordomo@sybase.com" with the following command in the body of
your email message:

subscribe inews-technews-full