Presentation is loading. Please wait.

Presentation is loading. Please wait.

Oracle Bulk Loader1 Loading data from a file Based on: Ullman et al. Using the Oracle Bulk Loader, www-db.stanford.edu/~ullman/fcdb/oracle/or-load.html.

Similar presentations


Presentation on theme: "Oracle Bulk Loader1 Loading data from a file Based on: Ullman et al. Using the Oracle Bulk Loader, www-db.stanford.edu/~ullman/fcdb/oracle/or-load.html."— Presentation transcript:

1 Oracle Bulk Loader1 Loading data from a file Based on: Ullman et al. Using the Oracle Bulk Loader, www-db.stanford.edu/~ullman/fcdb/oracle/or-load.html

2 Oracle Bulk Loader2 Purpose of the bulk loader Data comes from many sources –other databases –spread sheets –simple text files Most DBMS's and spread sheets can save data in a simple text file. The Oracle bulk loader reads data from a text file inserting the data into an Oracle table.

3 Oracle Bulk Loader3 How the bulk reader works 2 input files –the data file someThing.dat –the control file someName.ctl tells the bulk loader how to read the data file –examples constants.ctl –data in the control file - that's exceptional! externalData.ctl + externalData.dat

4 Oracle Bulk Loader4 Execution The receiving Oracle table must exist prior to execution! sqlldr username control=someName.ctl –sqlldrthe loader (a simple.exe file) –usernamethe owner of the receiving table you'll be prompted for password Result –data inserted into the Oracle table –status files someName.log –a log file telling everything about the execution someName.bad –a file with the data that couldn't be inserted in the table due to constraints, etc.

5 Oracle Bulk Loader5 Tabs Sometimes the data in the data files are separated by tabs. No problem: Just use tab in the control file Example –tab.ctl

6 Oracle Bulk Loader6 Dates Problem –Dates can have many formats Solution –Specify the date format in the control file Example –data.ctl

7 Oracle Bulk Loader7 Nulls Missing data in the data file is interpreted as nulls Example –null.ctl ',' a separator - put more spaces in the missing field.

8 Oracle Bulk Loader8 Further examples Oracle comes with some examples showing data and control files. On my machine the examples are in –C:\oracle\ora82\RDBMS\demo –Name: ulcaseN.ctlcontrol file ulcaseN.datdata file

9 Oracle Bulk Loader9 Loading by position Data in data file is structured by position Examples –ulcase2.dat –ulcase2.ctl


Download ppt "Oracle Bulk Loader1 Loading data from a file Based on: Ullman et al. Using the Oracle Bulk Loader, www-db.stanford.edu/~ullman/fcdb/oracle/or-load.html."

Similar presentations


Ads by Google