Reputation:
I need to take dump of a user (including tables, procedures ,etc.) as FILENAME.dmp
.
If I create a new user and import that FILENAME.dmp
, then everything should be created.
How can I create this dump file?
Don't tel me to use the Run > EXP
or Run > IMP
functions because, due to some problem, that feature is not working for me.
Upvotes: 12
Views: 137083
Reputation: 36
There are some easy steps to make Dump file of your Tables,Users and Procedures:
Goto sqlplus or any sql*plus
connect by your username or password
Upvotes: 0
Reputation: 774
Just as an update this can be done by using Toad 9 also.Goto Database>Export>Data Pump Export wizard.At the desitination directory window if you dont find any directory in the dropdown,then you probably have to create a directory object.
CREATE OR REPLACE DIRECTORY data_pmp_dir_test AS '/u01/app/oracle/oradata/pmp_dir_test';
See this for an example.
Upvotes: 1
Reputation: 9816
EXP (export) and IMP (import) are the two tools you need. It's is better to try to run these on the command line and on the same machine.
It can be run from remote, you just need to setup you TNSNAMES.ORA
correctly and install all the developer tools with the same version as the database. Without knowing the error message you are experiencing then I can't help you to get exp/imp to work.
The command to export a single user:
exp userid=dba/dbapassword OWNER=username DIRECT=Y FILE=filename.dmp
This will create the export dump file.
To import the dump file into a different user schema, first create the newuser in SQLPLUS:
SQL> create user newuser identified by 'password' quota unlimited users;
Then import the data:
imp userid=dba/dbapassword FILE=filename.dmp FROMUSER=username TOUSER=newusername
If there is a lot of data then investigate increasing the BUFFERS
or look into expdp/impdp
Most common errors for exp and imp are setup. Check your PATH
includes $ORACLE_HOME/bin
, check $ORACLE_HOME
is set correctly and check $ORACLE_SID
is set
Upvotes: 23
Reputation: 14253
Export (or datapump if you have 10g/11g) is the way to do it. Why not ask how to fix your problems with that rather than trying to find another way to do it?
Upvotes: -1
Reputation: 2008
Just to keep this up to date:
The current version of SQLDeveloper has an export tool (Tools > Database Export
) that will allow you to dump a schema to a file, with filters for object types, object names, table data etc.
It's a fair amount easier to set-up and use than exp
and imp
if you're used to working in a GUI environment, but not as versatile if you need to use it for scripting anything.
Upvotes: 9