CS,
I sense that your use of the term,
database may be ambiguous here. When you say
database, do you mean the entire Oracle installation's collection of all users and the objects that they own (i.e., Oracle's definition for
database) [in which case, Ken's suggestion is right on and the one you want to use] or do you mean a single user's/schema's own objects (i.e., all other db vendors' definition for
database)?
If your meaning is the latter one (i.e, you wish to clone the "
live" schema within Oracle database instance "X" to the "
training" schema, also residing in the Oracle database instance "X"), then here are the steps (and commands) that I would use:
1. Create the "
training" schema:
Code:
create user training identified by <password>
default tablespace <app-ts-name>
temporary tablespace <temp-ts-name>
quota unlimited on <app-ts-name>;
grant connect, resource to <training>;
2. Export the
live schema:
Code:
exp buffer=15000000 compress=n grants=y feedback=1000 consistent=y file=<dump-file-name> log=<log-file-name> statistics=none owner=live userid=live/<password>@<TNS alias for 'X' instance>
3. Import the dump file of the
live schema into the newly created, empty
training schema:
Code:
imp buffer=15000000 grants=y feedback=1000 fromuser=LIVE touser=TRAINING file=<dump-file-name> log=<log-file-name> userid=live/<password>@<TNS alias for 'X' instance>
The "imp" command, above, presumes that "live" has DBA priviliges to write to the "training" schema. If "live" hasn't those privileges, then just replace "userid=live/<password>@..." with some DBA user.
Also, in both the "exp" and "imp" commands, above, they should appear on a single command line from your o/s prompt.
Let us know if this is what you wanted.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[
Providing low-cost remote Database Admin services]
Click here to join
Utah Oracle Users Group on Tek-Tips if you use
Oracle in
Utah USA.