Use the sqlldr tool of Oracle to import data from the SDSS. CSV file to the database.
The content of SDSS. CSV placed on E: \ is as follows:
2.3757292136910399e-4,-8.9490277843631194, 20.302597,
December 0.00023851549291556,-0.88450365314434698, 20.098101,
2.5168890447969299e-4, 7.7169029946908094e-2, 18.762859,
2.9486118387225802e-4,-9.8447540892170409, 19.943598,
2.94865362739442e-4,-9.8447540642891909, 19.944597,
Procedure:
1. Create an empty table in Oracle according to the imported data format
Decimal type
RA number 23 20
Dec number 23 20
Mag number 8 6
2. Compile a loader. CTL file with the following content:
Load data
Infile 'e: \ sdss.csv'
Into Table sdss_stars
Fields terminated ","
(RA, Dec, MAG)
3. Execute the following statement in cmd:
Sqlldr Scott/tiger control = loader. CTL
4. Two files are automatically generated in the current directory.
Default Log File Name: loader. Log
The default bad record file is SDSS. Bad.
Note:
1. operations must be performed on the local server and cannot be performed on machines that only install the Oracle client.
2. The contents of the CSV file are separated by commas (,). If the data is not imported with commas (,) At the end, an error occurs.
You can use the ultraedit and other text editors to replace ^ P with ^ P. Then, you can add a comma at the end of each line.
3. Data Import takes a long time.