بتاريخ: 31 أكتوبر 201114 سنة comment_217133 What is sql-loader SQL LOADER is an Oracle utility used to load data into table given a datafile which has the records that need to be loaded. SQL*Loader takes data file, as well as a control file, to insert data into the table. When a Control file is executed, it can create Three (3) files called a log file, bad file or reject file, discard file. Log file tells you the state of the tables and indexes and the number of logical records already read from the input datafile. This information can be used to resume the load where it left off. Bad file or reject file gives you the records that were rejected because of formatting errors or because they caused Oracle errors. Discard filespecifies the records that do not meet any of the loading criteria like when any of the WHEN clauses specified in the control file. These records differ from rejected records How Sql-Loader Works sql-loader depend on two files first one is Control_file.ctl and the other one is Data_file.txt/.dat. the following figure show us the whole process: The way of writing and understanding the Sql-loader Script Before starting there is something I want to mention it, the control_file.ctl and data_file.txt are depending on each others. Some time put them in command line and sometime data_file.dat include into the control_file.ctl by using infile = ‘datafile.dat’ the following script show this properties:data_file.txt/.dat1,Ibrahim,Jenin2,Mohammad,Nablus3,Ahmad,Ramallah-Control_file.ctlload datainfile ‘c:\data_file.txt/.dat’truncateinto table table_namefields terminated by “,” (id,name,city) To use the sqlldr.exe utility. You can found it by run cmd.exe and then write the following statement: c:\>sqlldr hr/hr@xe control = c:\control_file.ctlFor more information follow the following link:http://psoug.org/ref.../sqlloader.html تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.