oracle database external table population with datapump utility.
We can load data from non oracle file to oracle database using oracle loader utility.
- First Create Datapump Directories.
Sql > Create Directory data as '/u01/data/';
Sql > Desc Dba_Directories
Sql > set line 120 pages 150
Sql > col owner format a12
Sql > col Directory_path for a75
Sql > Select * form dba_directories;
- Create Text file in Directory Folder.
File Name T2.txt gedit /u01/data/T2.txt
10,Allen
20,Ram 30,Shyam
Save This File
| Sqlplus / as sysdba Show user |
Create Table Ext(Id Number, Name varchar2(20))
organisation external
(type oracle_loader default directory dump access parameters
(records delimited by newline
fields terminated by ','
)
location('T2.txt'));
Table Created.
|
Sql > Select * from Ext;
Id Name
--- ----------------
10 Allen
20 Ram
30 Shyam
|
- In this way we can easily use sql loader utility for load data from non Oracle file to Oracle database.
- I will show you another thing.
Goto T2.txt text file and open it. |
|
Id Name
--- ---------------
10 Allen
20 Ram
30 Shyam
40 Parag
50 Piyush
- Add New Records in this file.
- Goto SQl Prompt and Run Command.
Sql > Select * from Ext;
Id Name
--- ------------------
10 Allen
20 Ram
30 Shyam
40 Parag
50 Piyush
- Using Oracle Loader we can add record in Text file and Record will reflect to Oracle Table.
- Using Oracle Loader If we Modify Text file these modification is reflect on oracle database.
No comments:
Post a Comment