Home » RDBMS Server » Server Administration » Re: Refreshing the
Re: Refreshing the [message #53020] Fri, 23 August 2002 14:20
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I would do it something like this:
1.) export (unix):
export ORACLE_SID=orcl
DT=`date +%Y%m%d%H%M`
echo "The date is : $DT"
echo "The ORACLE SID is : $ORACLE_SID"
exp system/pass
consistent=y
rows=y
owner=SCOTT
file=scott_${ORACLE_SID}_$DT.dmp
log=exp_scott_${ORACLE_SID}_$DT.log

2.)import:
imp system/pass fromuser=scott touser=scott file=scott_orcl_????.dmp log=imp_scott_dev_???.log ignore=y

Before doing the import, you need to either drop the existing tables, views, sequences - or disable all the Primary and FK constraints; truncate the tables and then import. Of course you then need to re-sync the sequences; re-enable any disabled constraints and recompile any packages or other code which has been broken in the process. Keeping the original tables has the benefit of retaining the original table sizing, grants etc.

If you are going to do it on a regular basis or if the database is large, it's faster to CLONE the database by copying the datafiles. Not something you want to start playing with unless you are really familiar with it.
If you clone the databse remember to modify the global_name else it will be the same as the one you copied from.
Previous Topic: Re: Oracle Instance
Next Topic: Oracle Instance
Goto Forum:
  


Current Time: Thu Sep 19 16:53:24 CDT 2024