Tuesday, March 11

Exporting data table in Oracle database.


This tutorial is one way of exporting our data table in Oracle database.
This is for Windows XP Operating System. First create a Folder in My Documents,
this folder is where we save the table file (.dmp).
Make sure you created the folder in My Documents. Then open word editor
and type following syntax or script:

ECHO ON
SET ORACLE_SID= DatabaseName
EXP USERNAME/PASSWORD TABLES='TableName' file=FolderYouCreated\NameOfTable.dmp


Then save the file with .bat (export.bat). Make sure that you also save it in My Documents.
Once done double click the .bat file.


For more than one tables the syntax is:

ECHO ON
SET ORACLE_SID= DatabaseName
EXP USERNAME/PASSWORD TABLES='TableName1' file=FolderYouCreated\NameOfTable1.dmp
EXP USERNAME/PASSWORD TABLES='TableName2' file=FolderYouCreated\NameOfTable2.dmp
EXP USERNAME/PASSWORD TABLES='TableName3' file=FolderYouCreated\NameOfTable3.dmp


In some point we dont want others to see our database log-in parameters, we can use the
syntax below:


ECHO ON
SET ORACLE_SID= DatabaseName
EXP  TABLES='TableName1' file=FolderYouCreated\NameOfTable1.dmp
EXP  TABLES='TableName2' file=FolderYouCreated\NameOfTable2.dmp
EXP  TABLES='TableName3' file=FolderYouCreated\NameOfTable3.dmp




this systax will promp you to enter you username and password. Once we exported the tables
we need to import it. The following syntax is for importing the exported tables:

ECHO ON
SET ORACLE_SID= DatabaseName
IMP USERNAME/PASSWORD TABLES='TableName1' file=FolderYouCreated\NameOfTable1.dmp
IMP USERNAME/PASSWORD TABLES='TableName2' file=FolderYouCreated\NameOfTable2.dmp
IMP USERNAME/PASSWORD TABLES='TableName3' file=FolderYouCreated\NameOfTable3.dmp


We just simply change the EXP to IMP, then save it again with .bat (import.bat) once save
double click the file and  check it to your database. Thats it I hope it helped you!
Thank you for reading and God bless you!




22 Because of the Lord’s great love we are not consumed,  for his compassions never fail.
23 They are new every morning; great is your faithfulness.
24 I say to myself, “The Lord is my portion;
    therefore I will wait for him.”

Lamentation 3:22-24




To GOD all the Glory.

No comments:

Post a Comment