Monday, January 19, 2009

Dumping and loading a database

Now you know how to create a database maybe you have a DR server you wish to copy the database too.
Or maybe you just wish to back the database up as this is good practise just in case you loose data or your database become corrupt.

dump database database to '/dump/dbname.dmp
go

or if your database is compressed also you might want to strip the database over a number of volumes.

Dump database database to `compress::/fox/dump/dbname/:database.dmp
Strip /dbdump/proj/dump/dbname/:database.dmp 1,
Strip /dbdump/proj/dump/dbname/:databasedmp 2,
Strip /dbdump/proj/dump/dbname/:database.dmp 3,
Strip /dbdump/proj/dump/dbname/:database.dmp 4


This goes for loading too

if you are copying this to a dr site then
scp database hostname:/dump/proj/dbname/

load database dbname from '/dump/dbname.dump
or if you have a compressed database with strips

load database database from `compress::/fox/dump/dbname/:database.dmp
Strip /dbdump/proj/dump/dbname/:database.dmp 1,
Strip /dbdump/proj/dump/dbname/:databasedmp 2,
Strip /dbdump/proj/dump/dbname/:database.dmp 3,
Strip /dbdump/proj/dump/dbname/:database.dmp 4
go
online database database
remember to online the database

No comments:

Post a Comment