PDA

View Full Version : Useful Sybase ASE Topics


MattR
06-02-01, 22:42
Hi and welcome to the Sybase forum here at DBForums! I'm mostly an ASE guy (and those are most of the queries we get) so these are mostly ASE-related links/tips (with some exceptions).

Some important links:
Offical Sybase Documentation (http://manuals.sybase.com/onlinebooks/group-as/asg1251e) -- this is your one-stop-shop for everything ASE. If you have a question, I'm more then sure you'll find it here.

Sybase Tools and Documentation by Rob Verschoor (http://www.sypron.nl/) -- contains the Complete Sybase ASE Quick Reference Guide. Between this pocket manual (which I own) and the Sybase online documentation there isn't a question you can't find an answer to! :)

Sybase.com Downloads (http://www.sybase.com/downloads) -- Pick up an evaluation copy of ASE here!

International Sybase Users' Group (http://www.isug.com/) -- discounts, discussion lists, and more!

ISUG Presentations (http://www.sybase.com/isugpresentations) -- Ranging from PowerBuilder to RepServer to ASE, a lot of good papers/presentations are here for you to read!

Sybase Database Administration Tasks (http://www.bossconsulting.com/sybase_dba/) -- List of things that you can do to help keep your ASE instance running smooth as silk! :)

Sybase FAQ (http://www.isug.com/Sybase_FAQ/ASE/) -- This FAQ is courtesy of the International Sybase Users Group (ISUG (http://www.isug.com/)).

Ed Barlow's Sybase Shareware (http://www.edbarlow.com/) -- some useful tools.

DBA Devil.com (http://www.dbadevil.com/) -- French site with optional tools for ASE.

ASE on Linux FAQ (http://www.peppler.org/ase-linux.html) -- answers some common questions for installing and running ASE on Linux.

Dell Introduction and Installation Guide for ASE (http://service.dell.com/dell/topic/0%2C%2C33734%2032386%2C00.html) -- useful info from Dell although somewhat dated (only covers up to ASE11.9.2).

Essential DBA Tasks (courtesy of the Complete Sybase ASE Quick Reference Guide (http://www.sypron.nl/))

Perform database and transaction log dumps (daily/hourly)
Run dbcc checkstorage for all database and follow up on any problems found (weekly)
Run update index statistics on user tables (weekly/as needed)
Regular preventative stop and restart of ASE server (they suggest monthly but in my experience, other than applying EBFs you don’t ever need to take down the server)
Monitor server errorlog for anomalies (daily)
Troubleshoot unforeseen emergences (ad-hoc read: daily ;))
Attend to (end) user / developer needs (whenever)
Additional/Optional DBA Tasks (also courtesy of the Complete Sybase ASE Quick Reference Guide (http://www.sypron.nl/))

Monitor growth of data volume and log space usage (daily/weekly)
Defragment tables (reorg or (re)build clustered index) (monthly/quarterly)
Monitor/tune server resource usage with sp_sysmon (when possible)
Report problems to Sybase Technical Support (when necessary)
Install EBFs or upgrades for ASE (when necessary)
Set up the dbccdb database for dbcc checkstorage (once)
Set up the sybsyntax database (once)

Whew!

Again, welcome to the site and the world of Sybase! :D

MattR
06-02-01, 23:03
Having problems with queries? Are they running slow and you don't know why?

Chances are they are either not using indexes or you don't have the correct indexes created for the query.

In both of these cases the command
SET SHOWPLAN ON
is your greatest ally!

I also like to run
SET NOEXEC ON
so that the server doesn’t execute the query. Usefull when you want to benchmark UPDATE or DELETE commands and not accidentally change any data! :)

(Remember to run SET NOEXEC ON last because if you run it first the SET SHOWPLAN ON statement will, of course, not be run!)

As an example:

1> SET SHOWPLAN ON
2> SET NOEXEC ON
3> GO

1> SELECT *
2> FROM post,
3> users
4> WHERE post.userid = users.userid
5> GO

QUERY PLAN FOR STATEMENT 1 (at line 1).


STEP 1
The type of query is SELECT.

FROM TABLE
users
Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.

FROM TABLE
post
Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.


As you can see from the output we have a table scan on BOTH tables! YIKES! This will cause some problems as your tables start to fill up with information.

To fix this problem, create an index on users.userid like this:

1> CREATE INDEX userid ON users( userid )
2> GO

1> SELECT *
2> FROM post,
3> users
4> WHERE post.userid = users.userid
5> GO

QUERY PLAN FOR STATEMENT 1 (at line 1).

STEP 1
The type of query is SELECT.

FROM TABLE
post
Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.

FROM TABLE
users
Nested iteration.
Index : userid
Forward scan.
Positioning by key.
Keys are:
userid ASC
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.


As you can see, the users table is now using the index your created. The reason why post is a table scan is because you are selecting all rows so an index won’t help you at all. A more complex WHERE clause which uses more columns from post would require an index to avoid the table scan.

To turn off NOEXEC And SHOWPLAN simply reverse the first command:

1> SET NOEXEC OFF
2> SET SHOWPLAN OFF
3> GO

QUERY PLAN FOR STATEMENT 1 (at line 1).


STEP 1
The type of query is SET OPTION OFF.


QUERY PLAN FOR STATEMENT 2 (at line 2).


STEP 1
The type of query is SET OPTION OFF.

1>

MattR
06-22-02, 13:40
To enable stored procedure showplans:


DBCC TRACEON( 3604, 302 )
SET SHOWPLAN ON
SET FMTONLY ON
GO

EXEC sp_something
GO

mkalsi
04-12-04, 11:07
To check what exactly is executed at the server level when frontend user kicks of a report or any application module, use:

dbcc traceon(11201,11202,11203,11204,11205,11206)

It produces huge output in errorlog. Make sure to turn it off when the job is done.

vsnreddi
12-16-05, 02:52
Thanks a lot..It is very useful to sybase developers/DBA's

ponsenniah
03-17-06, 10:59
what aspects are used in AS/400 from sybase

jainabhaykumar
04-02-07, 08:32
How to identify which process is slow

LakshmiAlagappan
06-27-07, 07:25
Hi,
can anyone help me out in finding a purticular table size in a sybase db. and i'm using sqlanywhere10-interactive sql tool.
sp_spaceused is nomore supported. any alternative or any scripts that i can have to finf the table size?

suu
08-21-07, 22:51
hello frens..

i've problems to replicate database in 2 machines that already have sybase ASE 12.5.2. I try to configure ASE Replicator using this document
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/rl125ug.
but the following error appear when i run the aserep command.
ASE Replicator requesting Java Virtual Machine exit with message: ASE Replicator
initialization error in component <DDBAdmin>. Component message: Error encounte
red checking environement: S0022: Invalid column name 'network_name'.

ASE Replicator initialization error in component <DDBAdmin>. Component message:
Error encountered checking environement: S0022: Invalid column name 'network_nam
e'.
I didn't find any document on this topic that use GUI Sybase Central to configure replication.Can anyone help me on this topic?TQ:confused:

taimor2010
10-01-07, 11:09
really very useful

thx alot for your great help

TBOY7
08-18-08, 18:08
Hi,
l'm wondering if someone can help me, l'm a sqlserver person and just started dabbling into sybase, l decided to start with version 12.5 and purchased jeffery garbus book, it's dosen't explain much on the process of installation and l'm finding it increasing difficult to uninstall sybase ase 12.5 as it's not showing in add/remove programs and the uninstall option in the programs folder is giving me a "unable to launch application".Also, l can't see ase service in the service applet, l've spent the whole day on this and am not too happy, please help, no documentation on uninstalling ase 12.5 on windows 2000 server.