> Use sqlloader to import data < |
|
Environment Description: Database: oracle8.1.6oem; System: Windows2000 Server. **************************************** **************************************** *********** Use NotePad to create the control file input. CTL. The content is as follows: Load data Infile 'test.txt '-- Data File Append into Table Test Fields terminated by '|' -- or '09', that is, the field termination and Tab (-- Field name Cp_bh char (30 ), MC char (50 ), Cp_ljmc char (100 ), Zyh char (20 ), DJ ) **************************************** **************************************** *********** The content format in test.txt of the example file, for example: 10300108200 | XPB65-113S | pp 34kg | 0030200525 | 3.42000008 10300108200 | XPB65-113S | wash bucket cover light blue Transparent ABS | 0030200877 | 15.52000046 Generally, the data is exported to each other. For example, you can save the data exported from Excel as: separated by tabs, named test ,......, And so on. **************************************** **************************************** *********** Use SQL * loader to import data (sqlldr -? View help) Run the following command in "run: Sqlldr username/PW control = path/input. ctl data = path/test.txt log = path bad = path |
Use sqlloader to import inputs in batches:
You can use sqlloader to import data in batches from files.
1. Insert: the data in the import table should be empty.
2. append method: equivalent to append. Data is inserted based on the previous method.
3. truncate: truncate the data in the table before importing.
4. Replace: delete all the data in the table before importing the data.
There is no obvious difference between the truncate and replace methods, but one is truncate and the other is Delete.
In this view, it should be a recovery that can be restored through flash, and a recovery failure.
Sqlldr userid = username/pwd @ servicename control =./CTL
Create Table position (col1 char (5), col2 char (5 ))
Control file ):
-- Specify the file method -------
Load data
Infile 'd:/*. CSV'
Append/insert/replace/truncate
Into Table table_name
(Col1, col2)
----------------------
-- Specify the column width:
Load data
Infile *
Append/insert/replace/truncate
Into Table table_name
(
Col1 position (0:05) Char (5 ),
Col2 position (06:10) Char (5)
)
Begindata
1234567890
Abcdefghij
Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 826053