In this tutorial we will see how we can export and import the content of one Oracle Schema using Oracle tools called EXPDP and IMPDP.
The syntax for this task is :
The options for this command are as follows bellow:
We are not going to use many of them here because is not the case, we will simply create a Schema dump and import the dump into a development database carrying the same
schema name.
1- Start by verifying if you have an available directory, to do so you need to run the query bellow:
For our example we will chhode the EXPDP - DIRECTORY that is fold in "/export/oradata/PCORP1/datapump"
2- In case you don't have one create one as follows:
Make sure the directory path exists and oracle user has rights on it.
3- Let's create the command now:
The process will create a dump file called GVC.dmp that will be located in our /export/oradata/db/datapump location. Depending on your schema size it can take some time.
4- Copy the dump archive to the host where the Oracle instance is running.
Make sure you find the DIRECTORY as we did on Step 1 on the development environment and copy the dump into it.
5- This step is very important(more or less!), We need to remove all the objects that are in the receiving Schema.
This is to avoid invalid objects and error messages when importing the dump.
Just place the name of your schema into the script.
Drop the tables:
Drop the rest of the objects:
You need to run the output of the scripts in order to remove the objects.
6- Import your dump into your development environment.
The syntax
7- Run the command now.
8- Last step is to recompile all your objects using the utlrp.sql script.
Tips:
Make sure you have your eyes on the instance alert log all the time to see any possible errors.