It is not easy to find document to provide simple and complete steps on the internet about Sybase backup and restore(because Sybase is not actively developed now? ). Therefore I wrote my own below as a quick reference for backing up and restoring Sybase database. This reference should be working for ASE 12.5 to 15.x.
Backup database
1. Run isql to connect to the database instance wtih sa privilege
isql -Usa -P -S
2. Run the command
sp_helpdb
go
to check for the database list.
3. Force a checkpoint on the database to be backed up
use
go
checkpoint
go
4. Run the backup command
dump database to '/_.dmp'
go
Restore Master database
1. Shutdown the database and start the database again in single user mode
cd $SYBASE/ASE-12.5/install
startserver RUN_DBINSTANCE -m
2. Run isql to connect to the database instance wtih sa privilege
isql -Usa -SSYSBASE_INSTANCE
3. In the single User Mode, Load the database by
load database master from ''
4. After restoring the master database, shutdown the database by
shutdown SYB_BACKUP
go
shutdown with nowait
go
6. Start the sybase database in Multi-user mode by
cd /opt/sybase/ASE-12.5/install
startserver -f
startserver
Restore User databases
1. Run isql to connect to the database instance wtih sa privilege
isql -Usa -P -S
3. Restore the database
load database from ''
go
4. Put the database back online
online database
go
Note that if you do not start the server in single user mode during restoration, the database may be locked by other users and you may encounter the following error:
Msg 3101, Level 16, State 1:
Server 'local', Line 1:
Database in use. A user with System Administrator (SA) role must haveexclusive use of database to run load. To fix this problem, you need to find out who is locking the database using the following commands:
use master
go
sp_who
After find out who is locking the database, you can use kill command to terminate user sessions:
kill
go
Backup database
1. Run isql to connect to the database instance wtih sa privilege
isql -Usa -P
2. Run the command
sp_helpdb
go
to check for the database list.
3. Force a checkpoint on the database to be backed up
use
go
checkpoint
go
4. Run the backup command
dump database to '
go
Restore Master database
1. Shutdown the database and start the database again in single user mode
cd $SYBASE/ASE-12.5/install
startserver RUN_DBINSTANCE -m
2. Run isql to connect to the database instance wtih sa privilege
isql -Usa -SSYSBASE_INSTANCE
3. In the single User Mode, Load the database by
load database master from '
4. After restoring the master database, shutdown the database by
shutdown SYB_BACKUP
go
shutdown with nowait
go
6. Start the sybase database in Multi-user mode by
cd /opt/sybase/ASE-12.5/install
startserver -f
startserver
Restore User databases
1. Run isql to connect to the database instance wtih sa privilege
isql -Usa -P
3. Restore the database
load database from '
go
4. Put the database back online
online database
go
Note that if you do not start the server in single user mode during restoration, the database may be locked by other users and you may encounter the following error:
Msg 3101, Level 16, State 1:
Server 'local', Line 1:
Database in use. A user with System Administrator (SA) role must haveexclusive use of database to run load. To fix this problem, you need to find out who is locking the database using the following commands:
use master
go
sp_who
After find out who is locking the database, you can use kill command to terminate user sessions:
kill
go

Filed under:
Sybase