Re: Database restore
Posted in 1998
John
1) Make sure all users are logged out of aurprod
2) At the command prompt, type
dbexport aurprod
It will create a directory called aurprod.exp which will contain the
ascii unload files for all tables and schema objects in aurprod. Make
sure you have sufficient space in this directory. You can check to see
if you have sufficient space by finding the size of aurprod like so:
oncheck -pe | grep aurprod: | awk '{space+=$3} END {printf "%d
kBytes\\n", space*2}'
3) Copy the directory aurprod.exp to the second machine using tar or
crossmount the directory to the second machine.
4) Rename the .exp directory and the .sql file under it, like so:
mv aurprod.exp aurtest.exp
cd aurtest.exp
mv aurprod.sql aurtest.sql
cd ..
5) Set the environment to the new instance where aurtest needs to
reside.
6) dbimport aurtest -d dbspacename
Also, if the instances are identical then you can take a level 0
backup from the first one, restore into the second and rename the
database using the following SQL:
RENAME DATABASE aurprod TO aurtest
HTH
Sujit Pal
______________________________ Reply Separator _________________________________
Subject: Database restore
Author: John Harman <harmanj@agric.nsw.gov.au> at Internet
Date: 5/6/98 2:52 PM
I'm a 'thrown to the wolves' DBA owing to the sudden illness of a
co-worker. Need some fundamental type advice. I need to copy a database
from one machine to another, but I want to restore it as a different name.
i.e. The source database is called 'aurprod'. I want create this
database on another machine, call it 'aurtest', and load the data from
'aurprod'. Should be routine ?? There just doesn't seem to be a [source
database name] [destination database name] type option.
John