What is the Oracle Mount table?

Source: Internet
Author: User

The Oracle Mount table imports the data in a sqlloader way.
Oracle's Sql*loader can load external data into database tables. Here are the basic features of Sql*loader:
1) data that can be loaded into different data type files and multiple data files
2) can be loaded into fixed format, free bound and long-format data
3) can be loaded into binary, compressed decimal data
4) data can be loaded into multiple tables at once
5) Connect multiple physical records into one record
6) to a single record decomposition and then loaded into the table
7) A unique key can be generated using the number pair formulation column
8) can be loaded into a tab in a disk or tape data file
9) Provide loading error reporting
10) The integer string in the file can be automatically converted to a compressed decimal and loaded into the list.
1.2 Control files
A control file is a text file written in a language that can be sql*loader recognized by the text file. Sql*loader can find the data that needs to be loaded according to the control file. and analyze and interpret the data. The control file consists of three parts:
L Global options, rows, number of skipped records, etc.;
l The input data specified by the infile clause;
L Data characteristic description.
1.3 Input File
For Sql*loader, the input data is in addition to the control file. Sql*loader can read data from one or more specified files. If the data is specified in the control file, it should be written in the INFILE * format in the control file. Use infile "Fix n" when the format of the data is fixed (the same length) and is obtained in the file
Load data
InFile ' Example.dat ' "Fix 11"
into table example
Fields terminated by ', ' optionally enclosed by ' "'
(col1 char (5),
Col2 char (7))
Example.dat:
001, CD, 0002,fghi,
00003,LMN,
1, "PQRS",
0005,UVWX,
Use infile "var n" When the data is in a variable format (not the same length) and is obtained in a file. Such as:
Load data
InFile ' Example.dat ' "VAR 3"
into table example
Fields terminated by ', ' optionally enclosed by ' "'
(col1 char (5),
Col2 char (7))
Example.dat:
009hello,cd,010world,im,
012my,name is,
1.4 Bad files
Bad files contain records that are rejected by Sql*loader. Rejected records may be records that do not meet the requirements.
The name of the bad file is given by the Badfile parameter of the Sql*loader command.
1.5 log file and log information
When Sql*loader starts executing, it automatically establishes the log file. The log file contains a summary of the load, error messages in the load, and so on.
Control File Syntax
The format of the control file is as follows:
OPTIONS ({[Skip=integer] [LOAD = integer]
[ERRORS = integer] [Rows=integer]
[Bindsize=integer] [Silent= (all| feedback| error| DISCARD)])
Load[data]
[{INFILE | INDDN} {File | *}
[STREAM | RECORD | FIXED length [BLOCKSIZE size]|
VARIABLE [Length]]
[{badfile | BADDN} file]
{Discards | Discardmax} Integr]
[{INDDN | INFILE} ...]
[APPEND | REPLACE | INSERT]
[Reclent integer]
[{Concatenate integer |
Continueif {[This | NEXT] (start[: end]) Last}
Operator {' String ' | X ' Hex '}}]
into TABLE [user.] Table
[APPEND | replace| INSERT]
[When condition [and condition] ...]
[Fields [delimiter]]
(
column {
Recnum | CONSTANT value |
SEQUENCE ({integer | MAX | COUNT} [, increment]) |
[POSITION ({start [end] | * [+ integer]}
) ]
DataType
[TERMINATED [by] {whitespace| [X] ' character '}]
[[optionally] enclose[by] [X] ' charcter ']
[Nullif condition]
[Defaultif Condotion]
}
[ ,...]
)
[Into TABLE ...]
[Begindata]
1) The data file to load:
1. INFILE and Inddn are synonyms, and they are followed by data files to be loaded. If you use *, the data is within the control file. You can follow a few files after infile.
2. Stram represents one byte of data read at a time. The new row represents the new physical record (the logical record can consist of several physical records).
3. The record uses the host operating system files and records management system. This method is used if the data is in the control file.
3. The length of the record to be read by FIXED length is long byte,
4. VARIABLE the length of the first two bytes that are read in the record, and length records the possible lengths. The injury is 8k bytes.
5. Badfile and Baddn are synonymous. Oracle cannot load those records for data to the database.
6. Discardfile and DISCARDDN are synonyms. Record data that was not passed.
7. Discards and Discardmax are synonyms. Integer is the maximum number of files discarded.
2) How to load:
1. APPEND adds rows to the table.
2. INSERT adds rows to empty tables (exits if there are records in the table).
3. REPLACE clears the table before loading the data.
4. Reclen is used in both cases, 1) Sqlldr cannot automatically calculate the record length, 2) or when the user wants to see the full record of the bad file. For the latter, Oracle can only write the bad record part to the wrong place as usual. If you look at the entire record, you can write the entire record to a bad file.
3) Specify the maximum record length:
1. Concatenate allows the user to set an integer representing the number of logical records to be combined.
4) Establish logical records:
1. This checks the current record condition and, if true, connects to the next record.
2. Next checks the next record condition. If true, the next record is connected to the current record.
2. Start:end indicates whether to check for a continuation string in this or next string to determine if a connection is made. such as: Continueif next (1-3) = ' WAG ' or Continueif next (1-3) =x ' 0d03if '
5) Specify the table to load:
1. Table name to add to into table.
2. When and select where are similar. A condition used to check a record, such as when (3-5) = ' SSM ' and (22) = ' * '
6) Introduce and enclose the fields in the record:
1. Fields gives the delimiter for the field in the record, in the form:
fields [Termialed [by] {whitespace | [X] ' charcter '}]
[[Optionally] enclose [by] [X] ' charcter ']
TERMINATED read the previous field and start reading the next field until you are done.
Whitespace means that the Terminator is a space. Includes spaces, tabs, line feeds, page breaks, and carriage returns. If the character is to be judged, it can be enclosed in single quotes, such as x ' 1 B '.
Optionally enclosed indicates that the data should be surrounded by special characters. can also be enclosed in terminated word characters. Use the optionally to use terminlated at the same time.
Enclosed refers to data within two delimiters. If you use both enclosed and terminaed, their order determines the order in which they are calculated.
7) Define the columns:
column is the name of the table column. The value of the column can be:
Bechum represents the number of logical records. The first record is 1, and the 2nd record is 2.
The CONSTANT represents the given constant.
SEQUENCE indicates that the sequence can begin with any ordinal number in the form:
SEQUENCE ({integer | MAX | COUNT} [, Increment]
POSITION gives the position of the dequeue in the logical record. Can be absolute, or relative to the value of the previous column. The format is:
POSITION ({start[end] | * [+integer]})
Start position
* Indicates the previous field immediately after the start.
+ The number of positions of the backward bar starting at the top.
8) Define the data type:
You can define 14 types of data:
CHAR
DATE
DECIMAL EXTERNAL
DECIMAL
DOUBLE
FLOAT
FLOAT EXTERNAL
GRAPHIC EXTERNAL
INTEGER
INTEGER EXTERNAL
SMALLINT
VARCHAR
Vargraphic
1. Character type data
char[(length)] [delimiter]
The length defaults to 1.
2. Date type data
DATE [(length)] [' Date_format ' [delimiter]
Use the To_date function to limit.
3. Decimal in character format
DECIMAL EXTERNAL [(length)] [delimiter]
The decimal number used for the general format (not binary = = a bit equals a bit).
4. Compress decimal Format data
DECIMAL (digtial [, Divcision])
5. Double-precision character point binary
DOUBLE
6. Common character Point binary
FLOAT
7. Number of character format points
FLOAT EXTERNAL [(length)] [delimiter]
8. Double-byte string data
GRAPHIC [(Legth)]
9. Double-byte string data
GRAPHIC external[(legth)]
10. Regular whole word binary integer
INTEGER
11. Character Format integer
INTEGER EXTERNAL
12. General Whole Word binary data
SMALLINT
13. Variable-length strings
VARCHAR
14. Variable double-byte string data
Vargraphic
2.2 Write Control File ctl
1. The file name of each data file;
2. Each data file format;
3. The properties of each data record field in each data file;
4. The attributes of an Oracle table column that accepts data;
5. data definition;
6. Other
Requirements for data files:
Specifying the data type
char character type
Integer EXTERNAL integral type
DECIMAL EXTERNAL floating point type
3.1 Contents of the data file
Can be in a file under the OS, or follow the specific data under the control file. The data file can be:
1, binary and character format: Loader can read the binary file (as a character read) in the list
2, fixed format: Record data, data type, data length fixed.
3, variable format: Each record has at least one variable Long data field, and a record can be a sequential string.
The demarcation of the data segment (e.g., name, age) as "," as a field;
Brackets, etc.
4. Loader can use the physical records of multiple contiguous fields to compose a logical record that records file run status files: including the following:
1. Running Date: Software version number
2, all input, the output file name, the command line display information, supplementary information,
3, for each loading information report: such as table name, loading situation; For initial loading, adding or more
In the choice of case, column information
4. Data error Report: error code; discard Record Report
5, each loading x report: Loaded into the line, the number of lines may be skipped, the number of rows may be rejected;
Number of discarded rows, etc.
6, Statistical Summary: the use of space (packet size, length), read the number of records, loading records, skip
Number of records rejected, number of records discarded, running time, etc.
Turn from: What is the Oracle Mount table?

What is the Oracle Mount table?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.