Note: Census data is used in the following example.
- Download the product delivery file.
- Extract the delivery file to find the text data file.
- Create the table structure in the database using the Create Table script. Be sure to change the table name in the template to the dataset you are loading. If, for example, you are loading the Census dataset, the table should be named census.
- Once the table structure has been created, copy the Oracle CTL template to the directory in which the product delivery file is located.
- Open the CTL file in a text editor. Add the path to the extracted data text file
to the
infile
statement and replaceOracle destination table name
with the name of the table created in Step 3.Note: TheTRAILING NULLCOLS
clause used in the CTL file instructs SQL Loader to treat any relatively positioned columns that are not present in the record as null columns. - Open a Windows command prompt and enter the
following:
Examplesqlldr userid=<username>/<password>@<database_connection> control=<path>/<ctl_file_name> log=<path>/<log_file_name>
sqlldr userid=username/password@hostname/service control='D:\census\ Census_Data\oracle_census_ctl_template.ctl' log='D:\census\census.log'
- Data will begin loading into the database.