Wednesday, September 27, 2006

Dump File and Load File -- Sybase

We have a script to dump user created databases on daily basis via a cron job. However, you can dump and recover a user database on demand.

Here are the steps.

To dump a user database to file:
Ensure that you have permissions to write to the destination directory.
1>use master
2>go
1>dump database databasename to '/raid/sybdumps/dump.dat'
2>go

To recovered from a database dump file:
Ensure that you have permissions to read the dump file.
1>use master
2>go
1>load database databasename from '/raid/sybdumps/dump.dat'
2>go
1>online database databasename
2>go
1>quit
2>go

Exit Sybase interactive mode

No comments: