At times it might be necessary to drop and recreate a Sybase ASE database. For example when you want to do a system copy from scratch and you need the current database to be cleaned up or when your DB is in inconsistent state and you want to created new DB and restore it.
Following command can be used to drop a database:
drop database <dbname>
But if the DB is in inconsistent state you might get below error:
In such case use the below steps to drop the DB and create it again:
Note: DBCC DROPDB will only work if the database is marked as suspect:
First check if the DB is marked as suspect:
If the DB is not marked as suspect, this should be marked explicitly:
- Allow updatesNote: At this stage you need to restart your database services for the changes to take effect.
- Set the status of DB to suspect (320)
- Drop database using DBCC:
4. Dont forget to disable the updates by setting “Allow Updates” to Zero and restart the database.
If you want to shutdown backup server also, make sure too shut it down first, as you will not be able to login to isql if you shutdown main server first.
Login to isql to shudown the ASE database and issue command “shutdown”
Then you can shutdown the ASE database instance.
You can opt to kill the processes (For example: If you dont have password to login to isql). But this is not the most safer way. Please use this option only if you are not able to login to isql.
Dont use -9 option. This might not allow uncommited DB transactions to rool back in a proper way.
Use the below commands to delete users form Sybase ASE database (For example when activating super admin user SAP*)
Make sure you are logged in with user syb<sid> while connecting to isql.
User correct schema for SAP (SAPSR3 in this case).
Make sure you are logged in with user syb<sid>.
From the environment variables find you Sybase ASE install Directory:
Travesrse to the install path:
Here you see the configuration files (Runserver) RUN_<SID> (Database server) and RUN_<SID>_BS (Backup server).
Use command startserver to start each server process.
You can either start them individually or together.
- -f runserverfile – specifies the relative path name of a runserver file, which is used as a reference each time you start an SAP ASE server or Backup Server. By default, the runserver file is in the current directory and is named RUN_servername. If you start a second SAP ASE server on the same machine, startserver creates a new runserver file named RUN_servername.
- -m – starts an SAP ASE server in single-user mode, allowing only one system administrator to log in, and turns the allow updates to system tables configuration parameter on. Use this mode to restore the master database. The system administrator can use thedbo use only parameter of sp_dboption for system administration activities that require more than one process, such as bulk copying or using the data dictionary. startserver normally starts up only one server per node.The -m parameter creates an m_RUNSERVER file and overwrites any existing m_RUNSERVER file.
After both the processes are started the control is not returned back until you hit a key.
Now you can check the status of server using command showserver.
2570084 – How to start Backup Server manually – SAP ASE
2307016 – How to manually configure and start ASE Cockpit for an existing ASE server – ASE 16.0 SP02 PL02
2581558 – Starting SAP ASE Backup Server as windows service reporting error “The service did not respond to the start or control request in a timely fashion”support-grace , support grace, Application version, License version, lic, Sysam, grace period, ASEServer, SAPASE, .lic, FLEXnet Licensing error, key, old license file, datestamp, support renewal date, sybase license , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Problem