query SQL loader
HelloI load a CSV for emp table data using sql loader.
I wrote the control as file below. How to run so that the data can be inserted into the emp table.
Control file:
DOWNLOAD THE DATA
INFILE ' C:\VINOD\EMP_DATA. CSV'
INSERT INTO THE TABLE EMP
FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
TRAILING NULLCOLS
(ENO, ENAME, SAL);
Thank you
910575 wrote:
HelloI load a CSV for emp table data using sql loader.
I wrote the control as file below. How to run so that the data can be inserted into the emp table.Control file:
DOWNLOAD THE DATA
INFILE ' C:\VINOD\EMP_DATA. CSV'
INSERT INTO THE TABLE EMP
FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
TRAILING NULLCOLS
(ENO, ENAME, SAL);Thank you
bcm@bcm-laptop:~$ sqlldr
SQL*Loader: Release 11.2.0.1.0 - Production on Sun Jun 24 11:28:59 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Usage: SQLLDR keyword=value [,keyword=value,...]
Valid Keywords:
userid -- ORACLE username/password
control -- control file name
log -- log file name
bad -- bad file name
data -- data file name
discard -- discard file name
discardmax -- number of discards to allow (Default all)
skip -- number of logical records to skip (Default 0)
load -- number of logical records to load (Default all)
errors -- number of errors to allow (Default 50)
rows -- number of rows in conventional path bind array or between direct path data saves
(Default: Conventional path 64, Direct path all)
bindsize -- size of conventional path bind array in bytes (Default 256000)
silent -- suppress messages during run (header,feedback,errors,discards,partitions)
direct -- use direct path (Default FALSE)
parfile -- parameter file: name of file that contains parameter specifications
parallel -- do parallel load (Default FALSE)
file -- file to allocate extents from
skip_unusable_indexes -- disallow/allow unusable indexes or index partitions (Default FALSE)
skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable (Default FALSE)
commit_discontinued -- commit loaded rows when load is discontinued (Default FALSE)
readsize -- size of read buffer (Default 1048576)
external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE (Default NOT_USED)
columnarrayrows -- number of rows for direct path column array (Default 5000)
streamsize -- size of direct path stream buffer in bytes (Default 256000)
multithreading -- use multithreading in direct path
resumable -- enable or disable resumable for current session (Default FALSE)
resumable_name -- text string to help identify resumable statement
resumable_timeout -- wait time (in seconds) for RESUMABLE (Default 7200)
date_cache -- size (in entries) of date conversion cache (Default 1000)
no_index_errors -- abort load on any index errors (Default FALSE)
PLEASE NOTE: Command-line parameters may be specified either by
position or by keywords. An example of the former case is 'sqlldr
scott/tiger foo'; an example of the latter is 'sqlldr control=foo
userid=scott/tiger'. One may specify parameters by position before
but not after parameters specified by keywords. For example,
'sqlldr scott/tiger control=foo logfile=log' is allowed, but
'sqlldr scott/tiger control=foo log' is not, even though the
position of the parameter 'log' is correct.
alternative, you could always Read The Fine Manual
http://docs.Oracle.com/CD/E11882_01/server.112/e22490/part_ldr.htm#i436326
Tags: Database
Similar Questions
-
Can I use function defined by the user in the control file Sql Loader?
Hi Master,
Can I use fuction user-defined in the sql loader control file? Please advise... !!
If you can provide an example... It's very kind of you.
Concerning
AR
Here are a few examples that should give you clues: Sql loader
I seriously wonder if why you use the century previous SQL * Loader instead of a external table:
ORACLE-BASE - external Tables: querying data from flat files in Oracle
-
Trouble with the adapter SQL Loader
Hi all
I'm trying to sue the adapter SQL Loader to collect my SQL server instance performance statistics. I followed the instructions in Appendix A of this document: https://www.vmware.com/files/pdf/solutions/Monitoring-Business-Critical-Applications-VMware-vCenter-Operations-Manager-white-paper.pdf
Our environment is one vCOps 5.8 vCloud Suite Enterprise license licensed. SQL server SQL 2008 R2 and is reasonably up-to-date on patches, etc. (CUA8, I think)
I've gotten to the point where the database is logged in and my query is running, but it seems that the values returned by the query correspond to default values (0). I don't know why this is happening, but because the newspapers seem to show the actual values from the database:
2014-02-10 17:29:50, 438 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - #SELECT "SQL LOADER" ADAPTERKIND, query
"SQL Server PERFMON STATS" RESOURCEKIND,.
GETUTCDATE() TIMESTAMP,
'Agent' RESOURCEKIND,
"SVC-mgmt-sql SQL Server" RESOURCENAME,.
(LTRIM (RTRIM (replace ([parameter], ':', '-'))) + "|" + counter_name) METRICNAME1,
Sum (cntr_value) VALUE1
FROM sys.dm_os_performance_counters
WHERE
(GETUTCDATE() > = (CONVERT (datetime, ' 02/10/2014 17:9:0 ', 101))) AND
(' 01 / 01/2000 ' < (CONVERT (datetime, ' 02/10/2014-17:29:50 ', 101))) AND
counter_name in)
"User connections"
"Compilations SQL/s."
"SQL Recompilations/sec."
"Server memory target (KB)"
"Total server memory (KB)"
"Scriptures delayed/s."
"Checkpoint pages/sec.
"Page life expectancy."
'Memory waiting requests',
"IO Page lock expects."
"Wait worker."
"Writing waiting to connect."
"IO expects network")
GROUP BY (LTRIM (RTRIM (replace ([parameter], ':', '-'))) + "|" + counter_name)
ORDER OF TIMESTAMP
2014-02-10 17:29:50, 467 com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB DEBUG [Collector worker thread 8] (20583) - try to connect...
2014-02-10 17:29:50, 478 com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB DEBUG [Collector worker thread 8] (20583) - connected...
2014-02-10 17:29:50, 490 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - QueryExecutionTime = 12
2014-02-10 17:29:50, 509 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - strMetricCount = 0
2014-02-10 17:29:50, 533 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 538 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 571 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 12921
2014-02-10 17:29:50, 612 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 624 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 624 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 10
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 72869
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 626 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 17
2014-02-10 17:29:50, 627 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 627 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 627 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 72869
2014-02-10 17:29:50, 627 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 628 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 628 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 10644
2014-02-10 17:29:50, 628 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 628 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 628 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 77
2014-02-10 17:29:50, 629 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 629 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 629 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 0
2014-02-10 17:29:50, 629 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 629 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 630 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 425692
2014-02-10 17:29:50, 630 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 630 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 630 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 11747062
2014-02-10 17:29:50, 630 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 631 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 631 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 29360128
2014-02-10 17:29:50, 631 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 631 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 631 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 29360128
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getResourceKeyFromResultSet (20583) - work on resource: SVC - mgmt - sql SQL Server
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.isResourceRenameAllowed - rename audit allowed for resource key {resourceName = SVC - mgmt - sql SQL Server & adapterKindKey = SQL LOADER & resourceKindKey = SQL Server PERFORMANCE Monitor STATS}
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - resource of treatment: SVC-mgmt-sql SQL Server extract the metric values are 0
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB (20583) - number of records processed 13 - used memory (MB): free Mem in 1757 (Mo): 1104
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.getDataFromDB - for request #= "SQL LOADER' SELECT ADAPTERKIND,.
"SQL Server PERFMON STATS" RESOURCEKIND,.
GETUTCDATE() TIMESTAMP,
'Agent' RESOURCEKIND,
"SVC-mgmt-sql SQL Server" RESOURCENAME,.
(LTRIM (RTRIM (replace ([parameter], ':', '-'))) + "|" + counter_name) METRICNAME1,
Sum (cntr_value) VALUE1
FROM sys.dm_os_performance_counters
WHERE
(GETUTCDATE() > = %f)) AND
(' 01 / 01/2000 ' < %t)) AND
counter_name in)
"User connections"
"Compilations SQL/s."
"SQL Recompilations/sec."
"Server memory target (KB)"
"Total server memory (KB)"
"Scriptures delayed/s."
"Checkpoint pages/sec.
"Page life expectancy."
'Memory waiting requests',
"IO Page lock expects."
"Wait worker."
"Writing waiting to connect."
"IO expects network")
GROUP BY (LTRIM (RTRIM (replace ([parameter], ':', '-'))) + "|" + counter_name)
ORDER OF TIMESTAMP
RecordCount = 13 FilteredRecordCount = 0
2014-02-10 17:29:50, 632 DEBUG [Collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.addDefaultData - Default Metrics size after a data loop = 13
2014-02-10 17:29:50, 633 INFO [collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.addDefaultData - number of default values for this piece of data = 13
2014-02-10 17:29:50, 633 INFO [collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.DataReader.read - 26 returned query parameters
2014-02-10 17:29:50, 634 INFO [collector worker thread 8] com.integrien.adapter3.generalsqldataloader.DataReader.updateResourceTimeMapAndRemoveDuplicates (20583) - 26 data 0 resource comments who have been sent the last time.
2014-02-10 17:29:50, 634 INFO [collector worker thread 8] (20583) com.integrien.adapter3.generalsqldataloader.GeneralSQLDataLoaderAdapter.groupByResource - grouping of resources
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 634 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 635 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2014-02-10 17:29:50, 636 DEBUG [Collector worker thread 8] (20583) com.integrien.alive.common.adapter3.AdapterBase.addMetricData - 1 added metrics to collect the result for the "SVC - mgmt - sql SQL Server" resource, resId = 20584, adapter "GeneralSQLDataLoaderAdapter".
2
Has anyone out there dealt with this or found a way around this kind of problem? There only seems to be a lot of information regarding the use of this (or of the) adapters.
Thank you
Jason
IS to use the option you gave.
Looks like that time is not the same timezone between solutions if he just started working after 5 to 6 hours. Make sure you that you don't need to use a different zone such as GMT.
-
Error loading data using SQL loader
I get an error message like "SQL * Loader - 350 combination illegal syntax of non-alphanumeriques characters error during loading of a file using SQL loader in RHEL." The command used to run SQL * Loader is:
Sqlldr userid = < user name > / < password > control = data.ctl
The control file is data.ctl:
DOWNLOAD the data
INFILE ' / home/oraprod/data.txt'
Add in the table test
{
EmpID completed by «,»,
fname completed by «,»,
lname completed by «,»,
treatment is completed with a white space
}
The data.txt file is:
1, Kaushal, Hamad, 5000
2, Chetan, Hamad, 1000
Hopefully, my question is clear.
Please get back with the answer to my query.
Concerning
Replace "{" by "("dans votre fichier de contrôle) "
DOWNLOAD the data
INFILE 'c:\data.txt.
Add the emp_t table
(
EmpID completed by «,»,
fname completed by «,»,
lname completed by «,»,
treatment is completed with a white space
)
C:\>sqlldr user/pwd@database control = c.ctl
SQL * Loader: release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit the point reached - the number of logical records 1
Commit the point reached - the number of logical records 2
SQL > select * from emp_t;
EMPID, FNAME LNAME SALARY
---------- -------------------- -------------------- ----------
1 kone hamadi 5000
2 Chetan Hamad 1000
Best regards
Mohamed Houri
-
SQL loader file path control...
Hi all
I run the query through sql loader client machine below...
saved query in the file loader.ctl, which I kept it in the path "D:\loader.ctl" below...
options (skip = 1)
load data
INFILE 'D:\flat.txt '.
in the GL_INTERFACE table
fields ended by ',' optionally surrounded "" "
* (STATUS, LEDGER_ID, USER_JE_SOURCE_NAME, USER_JE_CATEGORY_NAME, ACCOUNTING_DATE, CURRENCY_CODE, DATE_CREATED, CREATED_BY, *)
SEGMENT1, SEGMENT2 SEGMENT3, SEGMENT4, SEGMENT5, ACTUAL_FLAG, ENTERED_DR, ENTERED_CR, GROUP_ID)
Now my doubt is, to run the above, I need to run the command in sql loader below...
sqlldr USERID = apps/apps CONTROL = loader.ctl
In the control file, we have given the path to the data file, but * how the command (SQLLDR) identifies the path of the control file. ? *
What I have to give or...?
Is it possible to run the loader program above in the customer's computer? or we have to run only one server...
Please clarify my doubt.
Thank you and best regards,
MuthuHello
The preferred method is, if you use oracle apps, then a simultaneous recording of type sql * loader
the ctl yor file in $/bin. Run the program at the same time to load the data. I'm just givng you advice, you search on google, that you will get several ways to do the same things.
There are many ways such as the use of the external table, UTL_FILE or Shell Script to do the same thing.
Thank you
Lenora -
Hi all
I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.
For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.
I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.
Thanks and greetings
El MI created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.
For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.
I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.
You can provide information on the data file in the control file, or switch the full directory path and the name of your file as an argument. Concurrent Manager passes the "data = (full path of the data file)" token at query execution time. Without a data file name, the concurrent manager ignores this token and SQL * Loader uses the data file name specified in the control file.
http://docs.Oracle.com/CD/E18727_01/doc.121/e12897/T302934T458254.htm#4163833
The control file must be placed in the directory XX_TOP/bin $.
http://oracleapplications99.blogspot.ca/2011/12/sqlloader-examples.html
http://imdjkoch.WordPress.com/2010/08/12/registering-SQL-Loader-as-a-concurrent-program/
http://erpschools.com/articles/SQL-LoaderThank you
Hussein -
Conditions in SQL Loader Control file
Hello
I am trying to find a way to set up a sql loader control file that will have the data to a CSV (as shown below):
ACCOUNT DESCRIPTION 9-Apr 9-May 9-June 9 - Jul 9-Aug 9-Sep
3573000 H - 75 68 75 75 75 30 CLRICL
3123000 10 10 6 12 10 7 HRS-OTHER
3151000 HRS - BISHOP 150 143 150 143 120 143
3153000 HRS - BISHOP 22 22 14 29 22 22
3571000 H-TEACHER 135 143 150 218 143 143
and import it into an Oracle table as below:
ACCOUNT YR_MNTH TOTAL DESCRIPTION
3573000 h-CLRICL April 9, 70
3123000 HRS-OTHER 9-Apr 5
3151000 HRS - MGR 9 - APR 129
HRS - MGR 3153000 9-April 20
3571000 HRS - TEACHER 9 - APR 145
3573000 h-CLRICL 9 may 73
3123000 HRS - OTHER 9 - May 12
3151000 HRS - MGR 9 - may 135
HRS - MGR 3153000 9-10 may
3571000 HRS - TEACHER 9 - may 150
3573000 h-CLRICL June 9, 75
3123000 HRS-OTHER 9 - Jun 10
3151000 HRS - 9 - Jun 150 MGR
HRS - MGR 3153000 9-June 22
3571000 HRS-TEACHER 9 - Jun 135
3573000 h-CLRICL July 9, 68
3123000 HRS - OTHER 9-Jul 10
3151000 HRS - MGR 9 - Jul 143
HRS - MGR 3153000 9 - Jul 22
3571000 HRS - TEACHER 9 - Jul 143
3573000 h-CLRICL August 9, 75
3123000 HRS - OTHER 9-August 6
3151000 HRS - MGR 9 - August 150
HRS - MGR 3153000 9-August 14
3571000 HRS - TEACHER 9 - August 150
3573000 h-CLRICL 9 - Sep 75
3123000 9 HRS-OTHER-Sep 12
HRS - MGR 3151000 9-Sep 143
9 HRS - MGR 3153000 - Sept. 29
3571000 HRS-TEACHER 9 - Sep 218
Has anyone done anything like this? Any light anyone can throw is greatly appreciated.
Thank you.
Edited by: user11293056 January 6, 2010 09:19Hello
I think you'll be better off using external pointing to csv data, and then by running the query on the external table to insert rows in the target table table.
Concerning
-
Import data... Wizard creates the file SQL Loader ctl with columns out of order
4.1.1.19 SQL Developer version. Connected to Oracle XE to test this.
I'm trying to understand what the problem with the data in my import file when finally, I realize that the Import Wizard of data did not care how I traced the columns at all. The ctl SQL Loader file generated by the Wizard expects that the columns of data in my file to match the order that they appear in the definition of the table and not how they have been mapped in the wizard. Manually edit the ctl file is a workaround. Has anyone else seen elsewhere?
I see that this is a bug.
-
Hi all
I am load flat file in custom intermediate table using sql loader, but I'm betting that the error
Record 2720: Rejected - error on the table XXPLL_SALES_FCST_BGA_TMPL, column MKTG_ASP.
ORA-01722: invalid number
XXPLL_SALES_FCST_BGA_TMPL - Custom intermediate Table
MKTG_ASP - contains decimal values
I created this column as a number data type.
I've seen much after and it was proposed to use 'Decimal external' but it still does not work. All suggestions will be useful.
Thank you
Sharath Chander M
Hi Barbara Boehmer
Now, I changed in the file ctl under 'EXTERNAL DECIMAL Mktg_ASP DONE BY a SPACE' and now all data are allowed in / load. Is - this way?
I will also try as you say. Also if the data file has a line any, as a null value for this column will be it's causing any problem for the amendment that I have performed in ctl file?
Thank you
Sharath Chander M
-
SQL Loader - ignore the lines with "rejected - all null columns."
Hello
Please see the attached log file. Also joined the table creation script, data file and the bad and throw the files after execution.
Sqlldr customer in the version of Windows-
SQL * Loader: release 11.2.0.1.0 - Production
The CTL file has two clauses INTO TABLE due to the nature of the data. The data presented are a subset of data in the real world file. We are only interested in the lines with the word "Index" in the first column.
The problem we need to do face is, according to paragraph INTO TABLE appears first in the corresponding CTL lines file to the WHEN CLAUSE it would insert and the rest get discarded.
1. statement of Create table : create table dummy_load (varchar2 (30) name, number, date of effdate);
2. data file to simulate this issue contains the lines below 10. Save this as name.dat. The intention is to load all of the rows in a CTL file. The actual file would have additional lines before and after these lines that can be discarded.
H15T1Y Index | 2. 19/01/2016 |
H15T2Y Index | 2. 19/01/2016 |
H15T3Y Index | 2. 19/01/2016 |
H15T5Y Index | 2. 19/01/2016 |
H15T7Y Index | 2. 19/01/2016 |
H15T10Y Index | 2. 19/01/2016 |
CPDR9AAC Index | 2. 15/01/2016 |
MOODCAVG Index | 2. 15/01/2016 |
H15TXXX Index | 2. 15/01/2016 |
H15TXXX Index | 2. 15/01/2016 |
3. the CTL file - name.ctl
DOWNLOAD THE DATA
ADD
IN THE TABLE dummy_load
WHEN (09:13) = "Index".
TRAILING NULLCOLS
(
COMPLETED name BY ' | ',.
rate TERMINATED BY ' | '.
COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").
)
IN THE TABLE dummy_load
WHEN (08:12) = "Index".
TRAILING NULLCOLS
(
COMPLETED name BY ' | ',.
rate TERMINATED BY ' | '.
COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").
)
invoke SQL loader in a file-> beats
C:\Oracle\product\11.2.0\client\bin\sqlldr USERID = myid/[email protected] CONTROL=C:\temp\t\name.ctl BAD=C:\temp\t\name_bad.dat LOG=C:\temp\t\name_log.dat DISCARD=C:\temp\t\name_disc.dat DATA=C:\temp\t\name.dat
Once this is run, the following text appears in the log file (excerpt):
Table DUMMY_LOAD, charged when 09:13 = 0X496e646578 ('Index' character)
Insert the option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
NAME FIRST * | CHARACTER
RATE NEXT * | CHARACTER
EFFDATE NEXT * | CHARACTER
SQL string for the column: ' TO_DATE (: effdate, "MM/DD/YYYY").
Table DUMMY_LOAD, charged when 08:12 = 0X496e646578 ('Index' character)
Insert the option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
NAME NEXT * | CHARACTER
RATE NEXT * | CHARACTER
EFFDATE NEXT * | CHARACTER
SQL string for the column: ' TO_DATE (: effdate, "MM/DD/YYYY").
Record 1: Ignored - all null columns.
Sheet 2: Cast - all null columns.
Record 3: Ignored - all null columns.
Record 4: Ignored - all null columns.
Sheet 5: Cast - all null columns.
Sheet 7: Discarded - failed all WHEN clauses.
Sheet 8: Discarded - failed all WHEN clauses.
File 9: Discarded - failed all WHEN clauses.
Case 10: Discarded - failed all WHEN clauses.
Table DUMMY_LOAD:
1 row loaded successfully.
0 rows not loaded due to data errors.
9 lines not loading because all WHEN clauses were failed.
0 rows not populated because all fields are null.
Table DUMMY_LOAD:
0 rows successfully loaded.
0 rows not loaded due to data errors.
5 rows not loading because all WHEN clauses were failed.
5 rows not populated because all fields are null.
The bad file is empty. The discard file has the following
H15T1Y Index | 2. 19/01/2016 |
H15T2Y Index | 2. 19/01/2016 |
H15T3Y Index | 2. 19/01/2016 |
H15T5Y Index | 2. 19/01/2016 |
H15T7Y Index | 2. 19/01/2016 |
CPDR9AAC Index | 2. 15/01/2016 |
MOODCAVG Index | 2. 15/01/2016 |
H15TXXX Index | 2. 15/01/2016 |
H15TXXX Index | 2. 15/01/2016 |
Based on the understanding of the instructions in the CTL file, ideally the first 6 rows will have been inserted into the table. Instead the table comes from the line 6' th.
NAME RATE EFFDATE H15T10Y Index 2 January 19, 2016 If the INTO TABLE clauses were put in the CTL file, then the first 5 rows are inserted and the rest are in the discard file. The line 6' th would have a ""rejected - all columns null. "in the log file. "
Could someone please take a look and advise? My apologies that the files cannot be attached.
Unless you tell it otherwise, SQL * Loader assumes that each later in the table and what clause after the first back in the position where the previous left off. If you want to start at the beginning of the line every time, then you need to reset the position using position (1) with the first column, as shown below. Position on the first using is optional.
DOWNLOAD THE DATA
ADD
IN THE TABLE dummy_load
WHEN (09:13) = "Index".
TRAILING NULLCOLS
(
name POSITION (1) TERMINATED BY ' | '.
rate TERMINATED BY ' | '.
COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").
)
IN THE TABLE dummy_load
WHEN (08:12) = "Index".
TRAILING NULLCOLS
(
name POSITION (1) TERMINATED BY ' | '.
rate TERMINATED BY ' | '.
COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").
)
-
Condition of licence for SQL Loader?
Hello
I have an installing the oracle client that allows me to use SQLPLUS to connect to our Oracle 11g databases. SQL Loader is optional for installation. I would like to make use of this utility. Can anyone confirm if there is a condition of additional license to install SQL Loader?
TIA
Oracle allows the tools that usually used to interact with the database. SQL * Plus, SQL Developer, SQL * Loader are all free. If you use a feature optionally licensed in the database that makes the difference. For example, Oracle Partitioning is an extra cost feature. You can use SQL * Loader to load data into an Oracle database without that it costs you nothing more. But if you use SQL * Loader to load into a partitioned table, you will have to pay for the partitioning, but not SQL * Loader.
See you soon,.
Brian -
Hi people,
Please find the table with the records below
CREATE TABLE EMPLOYEE_LOAD (ID NUMBER, NAME VARCHAR2 (100), UNIVERSITY_NAME VARCHAR2 (100));
File to load: employee.txt
ID | NAME | UNIVERSITY_NAME
1. JAMES | UNIVERSITY OF MIT
2. LISA | UNIVERSITY OF CAMBRIDGE
3. MINDY | "THIS UNIVERSITY
4. ' ALLEN J |' IT UNIVERSITY
5. ' MIKE'ALLEN | "THIS UNIVERSITY
I've written SQL Loader control as file below
OPTIONS(SKIP=1,DIRECT=TRUE)
DOWNLOAD THE DATA
INFILE ' mnt/employee.txt.
BADFILE "mnt/employee.bad.
DISCARDFILE ' mnt/employee.dsc.
ADD THE EMPLOYEE_LOAD TABLE
FIELDS TERMINATED BY ' | '. SURROUNDED OF POSSIBLY ' ' ' TRAILING NULLCOLS
(
ID,
NAME,
UNIVERSITY_NAME
)
sqlldr userid = < username > @database/password control=/mnt/employee.ctl log=/mnt/employee.log
Only 2 first recordings are loading (excluding the header) and face below errors
(1) no terminator found after CLOSE and CLOSED field
(2) second string for the attachment does not exist
These 3 recordings are in the wrong files and how do I force sql loader to load subfolders too?
3. MINDY | "THIS UNIVERSITY
4. ' ALLEN J |' IT UNIVERSITY
5. ' MIKE'ALLEN | "THIS UNIVERSITY
Try to remove the ENCLOSED BY ' ' ' clause. It is not true, according to your sample data.
These quotes seem to be interspersed randomly.
-
On the use of SQL * loader program pl/sql command
Is it possible to develop a PL/SQL program that calls SQL * Loader (sqlldr userid =...) command?
We want to package a process that loads data from a text file into a table, and we research it is possible to use SQL * Loader to the data loading process.
You can launch sqlldr like all other orders of operation. There are several methods of cooking OS command, as
1. external procedure PL/SQL: CHMOD FROM A PLSQL?
Johan's blog: how to call PL/SQL kernel32.dll.
2 Java Stored Procedure: Blog of Johan: using JAVA in PL/SQL - PART - I list files with timestamp , Blog of Johan: using JAVA in PL/SQL - PART - II operating system information obtaining
3. external PREPROCESSOR Table function: no response on java not call windows in oracle command
4. using DBMS_SCHEDULER,
job_type => 'executable' and
job_action => '/bin/sh' (may be)
-
Question to load data using sql loader in staging table, and then in the main tables!
Hello
I'm trying to load data into our main database table using SQL LOADER. data will be provided in separate pipes csv files.
I have develop a shell script to load the data and it works fine except one thing.
Here are the details of a data to re-create the problem.
Staging of the structure of the table in which data will be filled using sql loader
create table stg_cmts_data (cmts_token varchar2 (30), CMTS_IP varchar2 (20));
create table stg_link_data (dhcp_token varchar2 (30), cmts_to_add varchar2 (200));
create table stg_dhcp_data (dhcp_token varchar2 (30), DHCP_IP varchar2 (20));
DATA in the csv file-
for stg_cmts_data-
cmts_map_03092015_1.csv
WNLB-CMTS-01-1. 10.15.0.1
WNLB-CMTS-02-2 | 10.15.16.1
WNLB-CMTS-03-3. 10.15.48.1
WNLB-CMTS-04-4. 10.15.80.1
WNLB-CMTS-05-5. 10.15.96.1
for stg_dhcp_data-
dhcp_map_03092015_1.csv
DHCP-1-1-1. 10.25.23.10, 25.26.14.01
DHCP-1-1-2. 56.25.111.25, 100.25.2.01
DHCP-1-1-3. 25.255.3.01, 89.20.147.258
DHCP-1-1-4. 10.25.26.36, 200.32.58.69
DHCP-1-1-5 | 80.25.47.369, 60.258.14.10
for stg_link_data
cmts_dhcp_link_map_0309151623_1.csv
DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2
DHCP-1-1-2. WNLB-CMTS-03-3,WNLB-CMTS-04-4,WNLB-CMTS-05-5
DHCP-1-1-3. WNLB-CMTS-01-1
DHCP-1-1-4. WNLB-CMTS-05-8,WNLB-CMTS-05-6,WNLB-CMTS-05-0,WNLB-CMTS-03-3
DHCP-1-1-5 | WNLB-CMTS-02-2,WNLB-CMTS-04-4,WNLB-CMTS-05-7
WNLB-DHCP-1-13 | WNLB-CMTS-02-2
Now, after loading these data in the staging of table I have to fill the main database table
create table subntwk (subntwk_nm varchar2 (20), subntwk_ip varchar2 (30));
create table link (link_nm varchar2 (50));
SQL scripts that I created to load data is like.
coil load_cmts.log
Set serveroutput on
DECLARE
CURSOR c_stg_cmts IS SELECT *.
OF stg_cmts_data;
TYPE t_stg_cmts IS TABLE OF stg_cmts_data % ROWTYPE INDEX BY pls_integer;
l_stg_cmts t_stg_cmts;
l_cmts_cnt NUMBER;
l_cnt NUMBER;
NUMBER of l_cnt_1;
BEGIN
OPEN c_stg_cmts.
Get the c_stg_cmts COLLECT in BULK IN l_stg_cmts;
BECAUSE me IN l_stg_cmts. FIRST... l_stg_cmts. LAST
LOOP
SELECT COUNT (1)
IN l_cmts_cnt
OF subntwk
WHERE subntwk_nm = l_stg_cmts (i) .cmts_token;
IF l_cmts_cnt < 1 THEN
INSERT
IN SUBNTWK
(
subntwk_nm
)
VALUES
(
l_stg_cmts (i) .cmts_token
);
DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_cmts (i) .cmts_token);
ON THE OTHER
DBMS_OUTPUT. Put_line ("token is already present'");
END IF;
WHEN l_stg_cmts EXIT. COUNT = 0;
END LOOP;
commit;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
for dhcp
coil load_dhcp.log
Set serveroutput on
DECLARE
CURSOR c_stg_dhcp IS SELECT *.
OF stg_dhcp_data;
TYPE t_stg_dhcp IS TABLE OF stg_dhcp_data % ROWTYPE INDEX BY pls_integer;
l_stg_dhcp t_stg_dhcp;
l_dhcp_cnt NUMBER;
l_cnt NUMBER;
NUMBER of l_cnt_1;
BEGIN
OPEN c_stg_dhcp.
Get the c_stg_dhcp COLLECT in BULK IN l_stg_dhcp;
BECAUSE me IN l_stg_dhcp. FIRST... l_stg_dhcp. LAST
LOOP
SELECT COUNT (1)
IN l_dhcp_cnt
OF subntwk
WHERE subntwk_nm = l_stg_dhcp (i) .dhcp_token;
IF l_dhcp_cnt < 1 THEN
INSERT
IN SUBNTWK
(
subntwk_nm
)
VALUES
(
l_stg_dhcp (i) .dhcp_token
);
DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_dhcp (i) .dhcp_token);
ON THE OTHER
DBMS_OUTPUT. Put_line ("token is already present'");
END IF;
WHEN l_stg_dhcp EXIT. COUNT = 0;
END LOOP;
commit;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
for link -.
coil load_link.log
Set serveroutput on
DECLARE
l_cmts_1 VARCHAR2 (4000 CHAR);
l_cmts_add VARCHAR2 (200 CHAR);
l_dhcp_cnt NUMBER;
l_cmts_cnt NUMBER;
l_link_cnt NUMBER;
l_add_link_nm VARCHAR2 (200 CHAR);
BEGIN
FOR (IN) r
SELECT dhcp_token, cmts_to_add | ',' cmts_add
OF stg_link_data
)
LOOP
l_cmts_1: = r.cmts_add;
l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));
SELECT COUNT (1)
IN l_dhcp_cnt
OF subntwk
WHERE subntwk_nm = r.dhcp_token;
IF l_dhcp_cnt = 0 THEN
DBMS_OUTPUT. Put_line ("device not found: ' |") r.dhcp_token);
ON THE OTHER
While l_cmts_add IS NOT NULL
LOOP
l_add_link_nm: = r.dhcp_token |' _TO_' | l_cmts_add;
SELECT COUNT (1)
IN l_cmts_cnt
OF subntwk
WHERE subntwk_nm = TRIM (l_cmts_add);
SELECT COUNT (1)
IN l_link_cnt
LINK
WHERE link_nm = l_add_link_nm;
IF l_cmts_cnt > 0 AND l_link_cnt = 0 THEN
INSERT INTO link (link_nm)
VALUES (l_add_link_nm);
DBMS_OUTPUT. Put_line (l_add_link_nm |) » '||' Has been added. ") ;
ELSIF l_link_cnt > 0 THEN
DBMS_OUTPUT. Put_line (' link is already present: ' | l_add_link_nm);
ELSIF l_cmts_cnt = 0 then
DBMS_OUTPUT. Put_line (' no. CMTS FOUND for device to create the link: ' | l_cmts_add);
END IF;
l_cmts_1: = TRIM (SUBSTR (l_cmts_1, INSTR (l_cmts_1, ',') + 1));
l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));
END LOOP;
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
control files -
DOWNLOAD THE DATA
INFILE 'cmts_data.csv '.
ADD
IN THE STG_CMTS_DATA TABLE
When (cmts_token! = ") AND (cmts_token! = 'NULL') AND (cmts_token! = 'null')
and (cmts_ip! = ") AND (cmts_ip! = 'NULL') AND (cmts_ip! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:cmts_token))' cmts_token,
cmts_ip ' RTRIM (LTRIM(:cmts_ip)) ")". "
for dhcp.
DOWNLOAD THE DATA
INFILE 'dhcp_data.csv '.
ADD
IN THE STG_DHCP_DATA TABLE
When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')
and (dhcp_ip! = ") AND (dhcp_ip! = 'NULL') AND (dhcp_ip! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:dhcp_token))' dhcp_token,
dhcp_ip ' RTRIM (LTRIM(:dhcp_ip)) ")". "
for link -.
DOWNLOAD THE DATA
INFILE 'link_data.csv '.
ADD
IN THE STG_LINK_DATA TABLE
When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')
and (cmts_to_add! = ") AND (cmts_to_add! = 'NULL') AND (cmts_to_add! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:dhcp_token))' dhcp_token,
cmts_to_add TANK (4000) RTRIM (LTRIM(:cmts_to_add)) ")" ""
SHELL SCRIPT-
If [!-d / log]
then
Mkdir log
FI
If [!-d / finished]
then
mkdir makes
FI
If [!-d / bad]
then
bad mkdir
FI
nohup time sqlldr username/password@SID CONTROL = load_cmts_data.ctl LOG = log/ldr_cmts_data.log = log/ldr_cmts_data.bad DISCARD log/ldr_cmts_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
nohup time username/password@SID @load_cmts.sql
nohup time sqlldr username/password@SID CONTROL = load_dhcp_data.ctl LOG = log/ldr_dhcp_data.log = log/ldr_dhcp_data.bad DISCARD log/ldr_dhcp_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
time nohup sqlplus username/password@SID @load_dhcp.sql
nohup time sqlldr username/password@SID CONTROL = load_link_data.ctl LOG = log/ldr_link_data.log = log/ldr_link_data.bad DISCARD log/ldr_link_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
time nohup sqlplus username/password@SID @load_link.sql
MV *.log. / log
If the problem I encounter is here for loading data in the link table that I check if DHCP is present in the subntwk table, then continue to another mistake of the newspaper. If CMTS then left create link to another error in the newspaper.
Now that we can here multiple CMTS are associated with unique DHCP.
So here in the table links to create the link, but for the last iteration of the loop, where I get separated by commas separate CMTS table stg_link_data it gives me log as not found CMTS.
for example
DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2
Here, I guess to link the dhcp-1-1-1 with balancing-CMTS-01-1 and wnlb-CMTS-02-2
Theses all the data present in the subntwk table, but still it gives me journal wnlb-CMTS-02-2 could not be FOUND, but we have already loaded into the subntwk table.
same thing is happening with all the CMTS table stg_link_data who are in the last (I think here you got what I'm trying to explain).
But when I run the SQL scripts in the SQL Developer separately then it inserts all valid links in the table of links.
Here, she should create 9 lines in the table of links, whereas now he creates only 5 rows.
I use COMMIT in my script also but it only does not help me.
Run these scripts in your machine let me know if you also get the same behavior I get.
and please give me a solution I tried many thing from yesterday, but it's always the same.
It is the table of link log
link is already present: dhcp-1-1-1_TO_wnlb-cmts-01-1 NOT FOUND CMTS for device to create the link: wnlb-CMTS-02-2
link is already present: dhcp-1-1-2_TO_wnlb-cmts-03-3 link is already present: dhcp-1-1-2_TO_wnlb-cmts-04-4 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-5
NOT FOUND CMTS for device to create the link: wnlb-CMTS-01-1
NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-8 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-6 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-0 NOT FOUND CMTS for device to create the link: wnlb-CMTS-03-3
link is already present: dhcp-1-1-5_TO_wnlb-cmts-02-2 link is already present: dhcp-1-1-5_TO_wnlb-cmts-04-4 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-7
Device not found: wnlb-dhcp-1-13 IF NEED MORE INFORMATION PLEASE LET ME KNOW
Thank you
I felt later in the night that during the loading in the staging table using UNIX machine he created the new line for each line. That is why the last CMTS is not found, for this I use the UNIX 2 BACK conversion and it starts to work perfectly.
It was the dos2unix error!
Thank you all for your interest and I may learn new things, as I have almost 10 months of experience in (PLSQL, SQL)
-
SQL * Loader does not import data
Hi all -
I have a very basic package which should load data from a file delimited by tabs. My problem is that when I run my package, no data is loaded. Although the correct number of records is created (based on relaxation of the table). All records contain no data.
OPTIONS (skip = 1, errors = 10, lines = 10000, direct = True)
DOWNLOAD THE DATA
INFILE "C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackKeywords.csv" "str"\n"
BADFILE "C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.bad."
DISCARDFILE 'C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.dsc '.
IN THE TABLE "ETL_STAGE". "" MARIN_KEYWORD ".
ADD
EVALUATE CHECK_CONSTRAINTS
"FIELDS TERMINATED BY ' 09 X."
TRAILING NULLCOLS
(
MARIN_KEYWORD_ID,
KEYWORD,
BUSINESS_DATE,
EDITOR,
ACCOUNT,
CAMPAIGN,
AD_GROUP,
TYPE CHAR (100000),
DESTINATION_URL,
UNIQUE_ID,
PUB_ID,
PRINT,
CLICKS,
PUB_COST,
ATTRIBUTED_CONVERSIONS_CONV,
CLICK_PATH_CONV,
LAST_CLICK_CONV,
EMAIL_SIGNUPS_CONV,
SCORECARD_SIGNUPS_CONV,
STORE_LOCATOR_PAGE_CONV
)
My table creation script is:
CREATE THE TABLE ETL_STAGE. MARIN_KEYWORD
(
MARIN_KEYWORD_ID VARCHAR2 (1000 BYTE),
KEYWORD VARCHAR2 (1000 BYTE).
BUSINESS_DATE VARCHAR2 (200 BYTE),
EDITOR VARCHAR2 (1000 BYTE),
ACCOUNT VARCHAR2 (1000 BYTE),
CAMPAIGN VARCHAR2 (1000 BYTE),
AD_GROUP VARCHAR2 (1000 BYTE),
TYPE VARCHAR2 (1000 BYTE),
DESTINATION_URL VARCHAR2 (1000 BYTE),
UNIQUE_ID VARCHAR2 (1000 BYTE),
PUB_ID VARCHAR2 (1000 BYTE),
VARCHAR2 (1000 BYTE) PRINT,
VARCHAR2 (1000 BYTE) CLICKS,
PUB_COST VARCHAR2 (1000 BYTE),
ATTRIBUTED_CONVERSIONS_CONV VARCHAR2 (1000 BYTE),
CLICK_PATH_CONV VARCHAR2 (1000 BYTE),
LAST_CLICK_CONV VARCHAR2 (1000 BYTE),
EMAIL_SIGNUPS_CONV VARCHAR2 (1000 BYTE),
SCORECARD_SIGNUPS_CONV VARCHAR2 (1000 BYTE),
STORE_LOCATOR_PAGE_CONV VARCHAR2 (1000 BYTE),
IMEX_LOG_REFERENCE_ID VARCHAR2 (1000 BYTE),
DATE_ADDED DATE DEFAULT SYSDATE NOT NULL,.
ADDED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.
DATE_LAST_MODIFIED DATE DEFAULT SYSDATE NOT NULL,.
MODIFIED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.
RECORD_STATUS VARCHAR2 (1 BYTE) DEFAULT 'A' NOT NULL
)
TABLESPACE ECOM_DATA
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE)
64K INITIALS
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
The log displays the following text:
SQL * Loader: release 11.2.0.2.0 - Production on Thu Jun 25 14:31:35 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Control file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\SQLLoaderScripts\MARIN_DSG_CREATIVES.ctl
Data file: C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackCreatives.csv
Bad leadership: C:\\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.bad
Delete the file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.dsc
(Allow all releases)
Number of loading: ALL
Number of jump: 10
Authorized errors: 50
Link table: 64 lines, maximum of 256000 bytes
Continuation of the debate: none is specified
Path used: classics
Table 'ETL_STAGE '. "" MARIN_CREATIVE ", loaded from every logical record.
Insert the option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
CREATIVE_ID PRIME * WHT O(") CHARACTER
The maximum field length is 100,000
HEADLINE THEN * CHARACTER O(") WHT
BUSINESS_DATE NEXT * CHARACTER O(") WHT
The SQL string for the column: 'TRIM(:BUSINESS_DATE) '.
DESCRIPTION_LINE_1 NEXT * CHARACTER O(") WHT
DESCRIPTION_LINE_2 NEXT * CHARACTER O(") WHT
DISPLAY_URL NEXT * CHARACTER O(") WHT
DESTINATION_URL NEXT * WHT O(") CHARACTER
The maximum field length is 100,000
EDITOR NEXT * CHARACTER O(") WHT
THEN THE CAMPAIGN * CHARACTER O(") WHT
AD_GROUP NEXT * CHARACTER O(") WHT
UNIQUE_ID NEXT * CHARACTER O(") WHT
PUB_ID NEXT * CHARACTER O(") WHT
PRINT NEXT * CHARACTER O(") WHT
The SQL string for the column: "replace (: print, ',',") "."
CLICK ON NEXT * CHARACTER O(") WHT
The SQL string for the column: "replace (: CLICKS, ',',") "."
ATTRIBUTED_CONVERSIONS_CONV NEXT * CHARACTER O(") WHT
CLICK_PATH_CONV NEXT * CHARACTER O(") WHT
LAST_CLICK_CONV NEXT * CHARACTER O(") WHT
EMAIL_SIGNUPS_CONV NEXT * CHARACTER O(") WHT
SCORECARD_SIGNUPS_CONV NEXT * CHARACTER O(") WHT
STORE_LOCATOR_PAGE_HITS_CONV NEXT * CHARACTER O(") WHT
IMEX_LOG_REFERENCE_ID NEXT * CHARACTER O(") WHT
Why WHT, showing when I use tabs?
In addition, why is not display all the data in the files?
NLS_CHARACTERSET WE8ISO8859P1
Maybe you are looking for
-
Key broken on Satellite A300-13i
Hello world! Shortly after I received my laptop Toshiba Satellite A300-13i, the CTRL (control) key is detached from the keyboard.I inspected the key and I saw that some of the plastic hinges were broken.I suppose that this is covered by the warranty,
-
Satellite Pro L10 does not go on standby mode
After a virus and reinstall all my programs and drivers etc, my computer won't now, go in standby mode.When you go to "turn off computer" option ensures their but is grayed out and you can not click on it.Power options in my Control Panel on them is
-
SuperFetch will stop runing I get this when you click on more details: _
Problem event name: APPCRASHApplication name: svchost.exe_SysMainApplication version: 6.0.6001.18000Application timestamp: 47918b 89Fault Module name: sysmain.dllFault Module Version: 6.0.6002.18005Timestamp of Module error: 49e03808Exception code: c
-
Foglight of Tomcat alert and monitoring services
Hi all We want to follow normal Tomcat7 services and create an alert if the service stops... We have configured the Windows agent and added Tomcat services in the properties the agent and creating the rule under the type of topology "Host Service", w
-
Installed Windows 7 - Second monitor not detected
So I just installed Windows 7 Ultimate (x 64) and everything that happened very well, but my second monitor is not detected. I am running Windows Vista and it worked but since I updated it stopped working, I tried 3 different monitors and have failed