MYSYSAD.COM

Dump Sybase Database to File

· Databases · Solaris & Sun · Files & disks

I had a reader ask me offline how to transfer a legacy database to another instance of a database management system (DBMS) on a separate server/workstation. The reader was trying to extract historical statistics via a test database (on a test server) without affecting the production database. I recommended dumping the entire database to a flat file and then writing (tar) the file to tape. I was uncertain if my response answered the reader's initial question but this is one way I dealt with a relatively small database (less than 50 megabytes) a few years ago. By the way, the sequence below assumes the receiving Sybase database was appropriately named and sized when it was created.

Login into production DBMS
1> use master
2> go
1> dump database yourdb to "/tmp/mydatabase.dat"
2> go
1> quit
2> go

Archive flat file to tape (assumes a tape drive is attached)
# cd /tmp
# tar cvfp /dev/rmt/0 mydatabase.dat

Move tape media to receiving server/workstation (assumes a tape drive is attached)
# cd /tmp
--This should extract mydatabase.dat to the /tmp directory
# tar xvfp /dev/rmt/0
# chmod 777 mydatabase.dat

Login into your test server DBMS
1> use master
2> go
1> load database yourdb from "/tmp/mydatabase.dat"
2> go
1> online database yourdb
2> go
1> quit
2> go

Other Sybase posts