There are two command tools to export database exp and expdp.
Open the console and give the exp command on the command prompt. It will prompt for information like username, password, export filename and path etc as below.
And also it will show few options like below. You can export entire database or only users/schemas or only the tables. You can also mention, whether you want to export permission and data inside the tables also.
After providing all these information, it will start exporting the database. After finishing it you can observe a statement like “Export terminated successfully”
Instead of following the above step by step procedure, we can give all this in a single command which will do the same. Below is the example of the command.
Ex: Exp userid=mytestings/welcome1@xe file=d:mydump.dmp
Another tool to export database is expdp command. Which works like exp command but it is more powerful. Below is the example to use this command.
There are two command tools to import database from the .dmp files are imp and impdp.
These two works like the above export commands.
Below are the syntax and example to use imp command.
imp userid/password@Connect_identifier fromuser=user_name_you_have_data_unloaded_from touser=new_user_name file=Path_to_*.dmp file
Ex: imp testuser/welcome1@xe fromuser=mytestings touser=testuser file=D:DataMYDUMP.dmp
Below is the example to use impdp command.
impdp mytestings/welcome1@orcl TABLE_EXISTS_ACTION=REPLACE dumpfile=MYDUMP.dmp
Instead of passing options to the command line, we can create a .par file and give all these properties in that file and pass that file to the command as below. This .par file option is available for both impdp and expdp commands but not imp and exp commands.
impdp sccinternal/welcome1@orcl parfile=impdata.par
Sample .par file look like as below.