Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
sqlloader error

HI Experts,
We are getting below error:-. we need to modify the script so that,
If the script has ora error then it should load the same .csv file again and then come out of the script
SQL*Loader: Release 12.1.0.2.0 - Production on Wed May 19 09:35:04 2021
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Control File: las_agt2.ctl
Data File: /opt/app/t1c32/ora01/t1c32/dba/agt2.csv
Bad File: ag3.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 1
Errors allowed: 500
Continuation: none specified
Path used: Direct
Table report.agt_prod_stag, loaded from every logical record.
Insert option in effect for this table: TRUNCATE TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
ID FIRST * , O(") CHARACTER
EVENTID NEXT 4000 , O(") CHARACTER
EVENTNAME NEXT 4000 , O(") CHARACTER
TIMESTAMP NEXT * , O(") DATETIME YYYY-MM-DD"T"HH24:MI:SS.ff3"Z"
EVENTMETHOD NEXT 4000 , O(") CHARACTER
RESOURCENAME NEXT 4000 , O(") CHARACTER
TARGETTYPE NEXT 4000 , O(") CHARACTER
OPERATIONNAME NEXT 4000 , O(") CHARACTER
FUNCTIONSTATUS NEXT 4000 , O(") CHARACTER
PAGEID NEXT 4000 , O(") CHARACTER
BN NEXT 4000 , O(") CHARACTER
JOBID NEXT 4000 , O(") CHARACTER
RID NEXT 4000 , O(") CHARACTER
JOBTYPE NEXT 4000 , O(") CHARACTER
UID NEXT 4000 , O(") CHARACTER
TECHREGION NEXT 4000 , O(") CHARACTER
MGMTREPORTINGFUNCTION NEXT 4000 , O(") CHARACTER
RECORDPUBLISHINDICATOR NEXT 4000 , O(") CHARACTER
VERSION NEXT 4000 , O(") CHARACTER
SQL*Loader-926: OCI error while executing delete/truncate (due to REPLACE/TRUNCATE keyword) for table report.agt_prod_stag
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
Answers
-
The script doesn't have an error, it looks like someone has issued a "select ... for update nowait" to lock record(s) in the table or issued a "lock table... in exclusive mode nowait" on the table to lock the whole table, so SQL Loader can't nuke records.
I doubt you'll be able to change your SQL loader script to solve this, it isn't a problem with the script. You may be able to try to lock the table yourself before you try the load.
-
Thanks experts.
If we get above error, so :-
If the script has ora error then it should load the same .csv file again and then come out of the script
like here ag2.csv file should load again, how can we acheive it.
Data File: /opt/app/t1c32/ora01/t1c32/dba/agt2.csv
-
Maybe you can set ddl_lock_timeout to a bigger value. This has to be done at database level since sql loader does not have an option to include "alter session".
-
Do you ever read what people say to you?
-
Thanks experts,
I checked the value for current DDL_LOCK_TIMEOUT it's not set to any value:-
NAME TYPE VALUE
-------------------------------------------------- ----------- ----------------------------------------------------------------------------------------------------
ddl_lock_timeout integer 0
what values we can set here.
-
you can try 60 first, meaning it will wait for one minute before the truncate if table is locked by other sessions.