Thursday, January 19, 2012

ASE Error messages on Android mobile

Yes,today i found this interesting application DBA Sidekick(sybase) on android market.But not tried.I think it is useful to DBAs.
If any one used this application ,post a comment on this.

Here is the link for the android application

https://market.android.com/details?id=com.businesscompassllc.dbasidekicksybase&hl=en



Yes,today i found this interesting application DBA Sidekick(sybase) on android market.But not tried.I think it is useful to DBAs.
If any one used this application ,post a comment on this.

Here is the link for the android application

https://market.android.com/details?id=com.businesscompassllc.dbasidekicksybase&hl=en



Wednesday, January 11, 2012

List all stored procedures in ASE

use sybsystemprocs
select name from sysobjects where type='P' 
use sybsystemprocs
select name from sysobjects where type='P' 

sp_dbremap

A special procedure to be run only when instructed by ASE error message number 946. The procedure synchronizes the definition of a database in sysusages and memory.

sp_dbremap


  • If an alter database  statement issued on a database that is in the process of being dumped is interrupted, Adaptive Server prints a message instructing the user to execute sp_dbremap.
  • Any changes to sysusages during a database or transaction dump are not copied into active memory until the dump completes, to ensure that database mapping does not change during the dump. Running alter database  while doing database dump  makes changes to system tables on the disk immediately. In-memory allocations cannot be changed until a dump completes. so alter database operation pauses.
    When you execute sp_dbremap, it must wait until the dump process completes.
  • If you are instructed to run sp_dbremap, but do not do it, the space you have allocated with alter database does not become available to Adaptive Server until the next restart.
A special procedure to be run only when instructed by ASE error message number 946. The procedure synchronizes the definition of a database in sysusages and memory.

sp_dbremap


  • If an alter database  statement issued on a database that is in the process of being dumped is interrupted, Adaptive Server prints a message instructing the user to execute sp_dbremap.
  • Any changes to sysusages during a database or transaction dump are not copied into active memory until the dump completes, to ensure that database mapping does not change during the dump. Running alter database  while doing database dump  makes changes to system tables on the disk immediately. In-memory allocations cannot be changed until a dump completes. so alter database operation pauses.
    When you execute sp_dbremap, it must wait until the dump process completes.
  • If you are instructed to run sp_dbremap, but do not do it, the space you have allocated with alter database does not become available to Adaptive Server until the next restart.

Monday, January 9, 2012

Troubleshoot if tempdb gets filled


 Try to find out the Active process that is filling up the temp db space.

1)  If the transaction log of tempdb is full then you can login through sa and type following command.

1> dump tran tempdb with truncate_only
2> go


2) If the database is full then you can increase the size of the database on a free device.

1> alter database tempdb on device_name = size
2> go



3) use following command It will abort all open transactions.

    But be sure the task by confirming with the concern users.

1>select lct_admin(0,2)
2>go


Restarting the server is not recommanded.
lct_admin (0,2) would abort all open transactions, or you can go for altering the tempdb space. Multiple tempdb's is a feature which can be implemented to minimize such issues of tempdb getting full.

Previously posted article on same topic refer that also.
http://sybaseadmin.blogspot.com/2011/12/temp-db-full.html


 

 Try to find out the Active process that is filling up the temp db space.

1)  If the transaction log of tempdb is full then you can login through sa and type following command.

1> dump tran tempdb with truncate_only
2> go


2) If the database is full then you can increase the size of the database on a free device.

1> alter database tempdb on device_name = size
2> go



3) use following command It will abort all open transactions.

    But be sure the task by confirming with the concern users.

1>select lct_admin(0,2)
2>go


Restarting the server is not recommanded.
lct_admin (0,2) would abort all open transactions, or you can go for altering the tempdb space. Multiple tempdb's is a feature which can be implemented to minimize such issues of tempdb getting full.

Previously posted article on same topic refer that also.
http://sybaseadmin.blogspot.com/2011/12/temp-db-full.html


 

Wednesday, December 28, 2011

List Server Reserved Words

Run this simple query in isql to find all the reserved words for Adaptive Server Enterprise .
 To list all reserved words for Adaptive Server Enterprise, log in to isql and run this query:

     select name from spt_values where type = "W"


The spt_values table is a look-up table in the master database that stores system values used by other server processes.


Run this simple query in isql to find all the reserved words for Adaptive Server Enterprise .
 To list all reserved words for Adaptive Server Enterprise, log in to isql and run this query:

     select name from spt_values where type = "W"


The spt_values table is a look-up table in the master database that stores system values used by other server processes.


Monday, December 26, 2011

Installing sybase on ubuntu

Just  installed ASE15.0.3 ESD#1  on ubuntu 7.04 inside virtual box.

Download the ASE Developer’s Edition.

1)Install the following package(Need to put  ubuntu 7.04 CD /DVD in Drive).

apt-get install libaio1 



2)Sybase requires at lea Ist 300 MB shared memory,so increase.

/sbin/sysctl -w kernerl.shmmax=300000000


3)Unzip sybase installation file

tar -xvf ase_1503_linuxx86.tgz


4)Now run the setup

chmod +x ./setup



Choose Express Edition install while installing.

5)Append  the contents of the SYBASE.sh to /etc/bash.bashrc.

6)We need to add sybase shared libraries to the library path.

gedit /etc/ld.so.conf.d/sybase.conf


7)Add these lines to the above file

/opt/sybase/OCS-15_0/lib3p
/opt/sybase/ASE-15_0/lib


8)Afterwards, update the paths

/sbin/ldconfig


9)In /opt/sybase/locales/locales.dat

Find the section:
[linux]

 Add the line:
locale = en_IN, us_english, iso_1
Just  installed ASE15.0.3 ESD#1  on ubuntu 7.04 inside virtual box.

Download the ASE Developer’s Edition.

1)Install the following package(Need to put  ubuntu 7.04 CD /DVD in Drive).

apt-get install libaio1 



2)Sybase requires at lea Ist 300 MB shared memory,so increase.

/sbin/sysctl -w kernerl.shmmax=300000000


3)Unzip sybase installation file

tar -xvf ase_1503_linuxx86.tgz


4)Now run the setup

chmod +x ./setup



Choose Express Edition install while installing.

5)Append  the contents of the SYBASE.sh to /etc/bash.bashrc.

6)We need to add sybase shared libraries to the library path.

gedit /etc/ld.so.conf.d/sybase.conf


7)Add these lines to the above file

/opt/sybase/OCS-15_0/lib3p
/opt/sybase/ASE-15_0/lib


8)Afterwards, update the paths

/sbin/ldconfig


9)In /opt/sybase/locales/locales.dat

Find the section:
[linux]

 Add the line:
locale = en_IN, us_english, iso_1

Temp db full

Since ASE 12.5 we can create a user defined tempdb (using sp_tempdb) and bind an admin login
 to this new tempdb. This admin account can then run sp_who to find out who filled tempdb and kill the process.

Sometimes the kill won't work The new 'multiple tempdb' feature in 12.5.0.3 allows you to avoid the problem that tempdb is full and  cannot access the fake tables in master.
In pre-12.5.0.3, we can get some information from different sources, like dbcc pss, dbcc lock and dbcc log

Follow these steps to solve tempdb full

 (i) use 'tempdb_space' resource limits (in 12.5+) and

 (ii) if your tempdb gets full anyway,use lct_admin to abort the transactions causing this.
 Instead of this  it's a good idea to

 (iii) enable the 'abort tran on log full' option for tempdb so that LOG SUSPEND statuses will not remain until the DBA takes action.


Since ASE 12.5 we can create a user defined tempdb (using sp_tempdb) and bind an admin login
 to this new tempdb. This admin account can then run sp_who to find out who filled tempdb and kill the process.

Sometimes the kill won't work The new 'multiple tempdb' feature in 12.5.0.3 allows you to avoid the problem that tempdb is full and  cannot access the fake tables in master.
In pre-12.5.0.3, we can get some information from different sources, like dbcc pss, dbcc lock and dbcc log

Follow these steps to solve tempdb full

 (i) use 'tempdb_space' resource limits (in 12.5+) and

 (ii) if your tempdb gets full anyway,use lct_admin to abort the transactions causing this.
 Instead of this  it's a good idea to

 (iii) enable the 'abort tran on log full' option for tempdb so that LOG SUSPEND statuses will not remain until the DBA takes action.


Sunday, December 25, 2011

orphan tables in tempdb

If an spid that owns the table no longer exists in sysprocesses.
This happens sometimes when a killed spid isn't cleaned up properly,
leaving temp tables behind.  These are called "orphaned" temp tables.

Running

    dbcc orphantables


will list orphaned tables in tempdb .

    dbcc orphantables ("drop")


will try to clean them up.
If an spid that owns the table no longer exists in sysprocesses.
This happens sometimes when a killed spid isn't cleaned up properly,
leaving temp tables behind.  These are called "orphaned" temp tables.

Running

    dbcc orphantables


will list orphaned tables in tempdb .

    dbcc orphantables ("drop")


will try to clean them up.

Friday, December 23, 2011

Top 10 large tables in database

Top 10 largest tables in a database by rowcount:
select

top 10

    name,

    row_count(db_id(), id)

from

    sysobjects

order by

    row_count(db_id(),id) desc

Top 10 largest tables in a database by allocated space:

select

top 10

    name,

    reserved_pages(db_id(),id)

/(1024.0 / (@@maxpagesize/1024.0) ) as "Allocated MB"

from

    sysobjects

order by

    reserved_pages(db_id(),id) desc

go

Top 10 largest tables in a database by used allocated space:

select

top 10

    name,

    used_pages(db_id(),id)

/(1024.0 / (@@maxpagesize/1024.0) ) as "Used MB"

from

    sysobjects

order by

    used_pages(db_id(),id)(db_id(),id) desc

go 
**These are not my own queries..Credit goes to Bret Halford on sybase forums.
Top 10 largest tables in a database by rowcount:
select

top 10

    name,

    row_count(db_id(), id)

from

    sysobjects

order by

    row_count(db_id(),id) desc

Top 10 largest tables in a database by allocated space:

select

top 10

    name,

    reserved_pages(db_id(),id)

/(1024.0 / (@@maxpagesize/1024.0) ) as "Allocated MB"

from

    sysobjects

order by

    reserved_pages(db_id(),id) desc

go

Top 10 largest tables in a database by used allocated space:

select

top 10

    name,

    used_pages(db_id(),id)

/(1024.0 / (@@maxpagesize/1024.0) ) as "Used MB"

from

    sysobjects

order by

    used_pages(db_id(),id)(db_id(),id) desc

go 
**These are not my own queries..Credit goes to Bret Halford on sybase forums.

Thursday, December 22, 2011

sa Login locked?

Add "-T4044" to the command line in the RUN_server file.
This will  allow you to log in as 'sa'.



Add "-T4044" to the command line in the RUN_server file.
This will  allow you to log in as 'sa'.



Tuesday, December 20, 2011

Hi to All

Hi, All will get timely updates on this blog!!!
Hi, All will get timely updates on this blog!!!

Wednesday, January 26, 2011

Maximum device size for ASE 12.5 and ASE 15.0

Up to ASE 12.5.x the maximum device size is 32GB (provided
that the OS knows how to handle large [>2GB] files) because
of the way the device number is encoded in the sysdevices
table (i.e. only 24 bits are available to describe the file
itself).

In ASE 15 this limit has been lifted.


ASE-15 device and database limits per server are as follow:

- device size limit: 4 terabytes per device
- server limit: 2 billion logical devices per server
- database size limit: 32 terabytes per database
- server limit: 32767 databases per server

So, maximum storage per ASE server is over one million terabytes (32TB x
32767).
Up to ASE 12.5.x the maximum device size is 32GB (provided
that the OS knows how to handle large [>2GB] files) because
of the way the device number is encoded in the sysdevices
table (i.e. only 24 bits are available to describe the file
itself).

In ASE 15 this limit has been lifted.


ASE-15 device and database limits per server are as follow:

- device size limit: 4 terabytes per device
- server limit: 2 billion logical devices per server
- database size limit: 32 terabytes per database
- server limit: 32767 databases per server

So, maximum storage per ASE server is over one million terabytes (32TB x
32767).

Monday, January 24, 2011

dump database three phases

The dump database command makes a copy of the entire
database, including both the data and the transaction log.
dump database does not truncate the log.
dump database allows dynamic dumps. Users can continue to
make changes to the database while the dump takes place.
This makes it convenient to back up databases on a regular
basis.
dump database executes in three phases. A progress message
informs you when each phase completes. When the dump is
finished, it reflects all changes that were made during its
execution, except for those initiated during phase 3."

Phase 1
* Phase 1 is the DBPAGES phase
* The Backup Server scans and dumps all the allocated
pages (both data and log pages) for the given database,
without checking to see whether any of the pages were
updated while this phase is going on.

Phase 2
* Phase 2 is the FLUSHPAGES phase:
* All the data pages that were modified during but not
logged in phase 1 (for example, a fast bcp) are dumped.
* The dump instant is the end of this phase. Recovery
restores the database to the state after phase 2.

Phase 3
* Phase 3 is the SCANLOGPAGES phase:
* The log pages are dumped again to capture
up-to-the-minute changes.
* dump transaction has only one phase: the SCANLOGPAGES
phase.
The dump database command makes a copy of the entire
database, including both the data and the transaction log.
dump database does not truncate the log.
dump database allows dynamic dumps. Users can continue to
make changes to the database while the dump takes place.
This makes it convenient to back up databases on a regular
basis.
dump database executes in three phases. A progress message
informs you when each phase completes. When the dump is
finished, it reflects all changes that were made during its
execution, except for those initiated during phase 3."

Phase 1
* Phase 1 is the DBPAGES phase
* The Backup Server scans and dumps all the allocated
pages (both data and log pages) for the given database,
without checking to see whether any of the pages were
updated while this phase is going on.

Phase 2
* Phase 2 is the FLUSHPAGES phase:
* All the data pages that were modified during but not
logged in phase 1 (for example, a fast bcp) are dumped.
* The dump instant is the end of this phase. Recovery
restores the database to the state after phase 2.

Phase 3
* Phase 3 is the SCANLOGPAGES phase:
* The log pages are dumped again to capture
up-to-the-minute changes.
* dump transaction has only one phase: the SCANLOGPAGES
phase.

how to get host/port,host name,server name,and db name in syabse

select address_info as "host/port"
      ,host_name() as "hostname"
      ,@@servername as "servername"
      ,db_name() "current_dbname"
from master..syslisteners
select address_info as "host/port"
      ,host_name() as "hostname"
      ,@@servername as "servername"
      ,db_name() "current_dbname"
from master..syslisteners

Use of "with overrride" option in database creation


Suppose we have a device, test_dev and you wish to create a database
with data and log on it.

create database testdb1
 on test_dev = 100
 log on test_dev = 20
 with override

You now have distinct data and log segments on the same device.
You can dump this log as usual with dump tran.

The log is always on it's own segment (the "log" segment).
The problem with dumping the tran log comes when the log segment is mixed with any other
kind of segment on the same fragment
(yielding a sysusages segmap that is something other than "4")

Suppose we have a device, test_dev and you wish to create a database
with data and log on it.

create database testdb1
 on test_dev = 100
 log on test_dev = 20
 with override

You now have distinct data and log segments on the same device.
You can dump this log as usual with dump tran.

The log is always on it's own segment (the "log" segment).
The problem with dumping the tran log comes when the log segment is mixed with any other
kind of segment on the same fragment
(yielding a sysusages segmap that is something other than "4")

Wednesday, January 19, 2011

dsync,direct io

The directio and dsync parameters are mutually exclusive. If a device has dsync set to “true,” you cannot set
directio to “true” for this device. To enable directio for a device, you must first reset dsync to “false.”
Direct I/O is always the preferred way.
dsync only applies to operating system files (meaning that it has no effect on "raw" devices used as Sybase disk devices)
The directio and dsync parameters are mutually exclusive. If a device has dsync set to “true,” you cannot set
directio to “true” for this device. To enable directio for a device, you must first reset dsync to “false.”
Direct I/O is always the preferred way.
dsync only applies to operating system files (meaning that it has no effect on "raw" devices used as Sybase disk devices)

Sunday, August 29, 2010

Get a free copy of "Replication For Dummies"

Click the following link ..to get a free copy of  "Replication For Dummies"


http://goo.gl/8oEF


Click the following link ..to get a free copy of  "Replication For Dummies"


http://goo.gl/8oEF


Monday, August 17, 2009

Clustered,Non-clustered Indexes

Heap = the data in a table, rows in chronological (insert) order

Index = B-Tree structure of keys, used to speed up the access to data rows.
Except for APL/CI, it is detached (separate allocation) from the heap.

Clustered = A special type of Index for APL tables only; where the Index is 'clustered' with the data; the leaf-level of the Index is the row (and therefore every access to data is one less than with a Nonclustered index).____Not available for DPL/DRL

Nonclustered = the ordinary Index, any index other than Clustered, detached from the Heap.
For performnce reasons, these should be placed on a different segment to the Heap or CI.

Placement : A special form of Nonclustered, the attempt to provide a semblance of 'clustering' for DPL/DRL tables only. Lives on the same segment as the Heap. The physical order of rows is attempted (it exists after a fresh create_index or reorg_rebuild, but it is lost after a few insert/deletes)

**The term Clustered when used with DPL/DRL, is incorrect**.
**Unfortunately the manuals use the incorrect term**

Unique = the indexed column(s) uniquely identify a single row. Prevents another row with the same values as the indexed column(s) being inserted.

Nonunique = the indexed column(s) identify more than one row.

Composite Key (not composite index) = The Key has more than one column.

APL/DPL/DRL are lockschems for the tables.

Credit goes to Derek Asirvadem for his clear explanation about indexes on sybase forums...
Heap = the data in a table, rows in chronological (insert) order

Index = B-Tree structure of keys, used to speed up the access to data rows.
Except for APL/CI, it is detached (separate allocation) from the heap.

Clustered = A special type of Index for APL tables only; where the Index is 'clustered' with the data; the leaf-level of the Index is the row (and therefore every access to data is one less than with a Nonclustered index).____Not available for DPL/DRL

Nonclustered = the ordinary Index, any index other than Clustered, detached from the Heap.
For performnce reasons, these should be placed on a different segment to the Heap or CI.

Placement : A special form of Nonclustered, the attempt to provide a semblance of 'clustering' for DPL/DRL tables only. Lives on the same segment as the Heap. The physical order of rows is attempted (it exists after a fresh create_index or reorg_rebuild, but it is lost after a few insert/deletes)

**The term Clustered when used with DPL/DRL, is incorrect**.
**Unfortunately the manuals use the incorrect term**

Unique = the indexed column(s) uniquely identify a single row. Prevents another row with the same values as the indexed column(s) being inserted.

Nonunique = the indexed column(s) identify more than one row.

Composite Key (not composite index) = The Key has more than one column.

APL/DPL/DRL are lockschems for the tables.

Credit goes to Derek Asirvadem for his clear explanation about indexes on sybase forums...

Thursday, August 13, 2009

ASE 15.0 Release Schedule and CR list Information

In the following link you will CR list information and Release terminology
Have a look at this link
In the following link you will CR list information and Release terminology
Have a look at this link

Monday, July 27, 2009

Zombie processes in ASE

When you do not have the row in sysprocesses but you do have in
syslocks that is zombie  lock ( i.e. phantom lock )
You will need to either recycle ASE server or use  dbcc . If you are
using  ASE 12.5.4 or later version , you can try using 'dbcc
lock_release'

A phantom [lock] is when there is an entry in syslocks for
a spid,  but the spid does not exist in sysobjects (phantoms
have no body, just cast a shadow).  Phantom locks are usually
due to bugs in process cleanup in the ASE. 

When you do not have the row in sysprocesses but you do have in
syslocks that is zombie  lock ( i.e. phantom lock )
You will need to either recycle ASE server or use  dbcc . If you are
using  ASE 12.5.4 or later version , you can try using 'dbcc
lock_release'

A phantom [lock] is when there is an entry in syslocks for
a spid,  but the spid does not exist in sysobjects (phantoms
have no body, just cast a shadow).  Phantom locks are usually
due to bugs in process cleanup in the ASE.