SQL*Loader error ORA-00604 and ORA-02248 - oracle

I've a Problem with Oracle's SQL*Loader.
SQL*Loader: Release 11.2.0.3.0 - Production on Tue Feb 11 14:32:00 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
SQL*Loader-128: unable to begin a session
ORA-00604: Fehler auf rekursiver SQL-Ebene 1
ORA-02248: Ungültige Option für ALTER SESSION
This Errormessage occurs in the Errorlog after execute sqlldr with the following control and data file:
sqlldr statement:
sqlldr userid=%PW%/%Name%#%DBname% control=ABGRENZUNG_control.dat log=loader.log
ABGRENZUG control file
load data
INFILE 'ABGRENZUNG.dat'
INTO TABLE ABGRENZUNG
APPEND
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(AVG_RESTSCHULD,DATUM,DISAGIO,GEBUEHR,NOMZINS,REF_KEY,RESTSCHULD,STEUER_TYP,TYP,ZINSBETRAG,ZINSTAGE)
ABGRENZUNG.dat:
,20040630,0,0,,7514,3091209.0914799999,"S","T",11147.31048,
,20040731,0,0,,7514,3105526.7633799999,"S","T",17645.6519,
,20040831,0,0,,7514,3119926.1653200001,"S","T",17727.38194,
,20040930,0,0,,7514,3134407.7638500002,"S","T",17809.57853,
,20041031,0,0,,7514,3148972.0281699998,"S","T",17892.24432,
,20041130,0,0,,7514,3163619.43016,"S","T",17975.38199,
,20041231,0,0,,7514,3178350.44441,"S","T",18058.99425,
,20050131,0,0,,7514,3193165.5482000001,"S","T",18143.08379,
,20050228,0,0,,7514,3208065.2215300002,"S","T",18227.65334,
,20050331,0,0,,7514,3223049.9471700001,"S","T",18312.70564,
,20050430,0,0,,7514,3238120.21062,"S","T",18398.24345,
,20050531,0,0,,7514,3253276.5001599998,"S","T",18484.26954,
,20050630,0,0,,7514,3268519.3068400002,"S","T",18570.78669,
,20050731,0,0,,7514,3283849.1245499998,"S","T",18657.79771,
,20050831,0,0,,7514,3299266.44997,"S","T",18745.30542,
,20050930,0,0,,7514,3314771.7826299998,"S","T",18833.31265,
,20051031,0,0,,7514,3330365.6248900001,"S","T",18921.82226,
,20051130,0,0,,7514,3346048.4819899998,"S","T",19010.83711,
,20051231,0,0,,7514,3361820.8620799999,"S","T",19100.36008,
,20060131,0,0,,7514,3377683.27617,"S","T",19190.39409,
,20060228,0,0,,7514,3393636.2382,"S","T",19280.94203,
,20060331,0,0,,7514,3409680.2650600001,"S","T",19372.00686,
,20060430,0,0,,7514,3425815.8765699998,"S","T",19463.59151,
,20060531,0,0,,7514,3442043.5955400001,"S","T",19555.69896,
,20060630,0,0,,7514,3458363.9477300001,"S","T",19648.33219,
before executing the sqlldr statement I set these options.
set nls_lang=AMERICAN_AMERICA.WE8MSWIN1252
set nls_date_format='YYYYMMDD'

It seems that the problem occurs because of the NLS parameters. There must be a conflict with the nls_session(or database)_parameters.

Related

Concat two values using sqlldr throws error

I have a table to which i want to load data using sqlldr,
The DDL of the table is as below,
create table abc.AccountDataDump (
CIF_ID varchar2(20),
ACCOUNT_NO varchar2(30),
TURNOVER number(15,2),
CASH_WITHDRAWAL number(15,2),
CASH_DEPOSIT number(15,2),
MONTH number(2),
YEAR number(4) );
I have the ctl file as below,
LOAD DATA
INFILE '/home/sijo/Downloads/testcash/CXPS_CASHDATA_MONTHLY_APR21.TXT'
badfile '/home/sijo/Downloads/testcash/cash.bad'
discardfile '/home/sijo/Downloads/testcash/cash.rej'
TRUNCATE INTO TABLE CXPSADM_sijo_47z50.AccountDataDump
FIELDS TERMINATED BY '~|'
TRAILING NULLCOLS
(
"CIF_ID",
"ACCOUNT_NO" "A_F_||:ACCOUNT_NO",
"TURNOVER",
"CASH_WITHDRAWAL",
"CASH_DEPOSIT" ,
"MONTH" ,
"YEAR"
)
Basically i am trying to prepend 'A_F_' to the "ACCOUNT_NO" but it is throwing the error as below. The account number in the in file is proper
"Record 1: Rejected - Error on table CXPSADM_SIJO_47Z50.ACCOUNTDATADUMP, column "ACCOUNT_NO".
ORA-00984: column not allowed here"
If i replace "ACCOUNT_NO" "A_F_||:ACCOUNT_NO", with just "ACCOUNT_NO", then it is working fine. Please help
Replace
"ACCOUNT_NO" "A_F_||:ACCOUNT_NO",
by
ACCOUNT_NO "'A_F_'||:ACCOUNT_NO",
Let me show you how it works
Demo
[ftpfdm#scglvdoracd0006 ~]$ cat t.ctl
LOAD DATA
INFILE '/home/ftpfdm/t.dat'
badfile '/home/ftpfdm/t.bad'
discardfile '/home/ftpfdm/t.dsc'
TRUNCATE INTO TABLE TEST1.LOADER_EXAMPLE
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
(
CIF_ID,
ACCOUNT_NO "'A_F_'||:ACCOUNT_NO"
)
[ftpfdm#scglvdoracd0006 ~]$ cat t.dat
1;A2
2;B2
[ftpfdm#scglvdoracd0006 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 1 11:37:12 2021
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0
SQL> truncate table test1.loader_Example ;
Table truncated.
SQL> desc test1.loader_example
Name Null? Type
----------------------------------------- -------- ----------------------------
CIF_ID NUMBER
ACCOUNT_NO VARCHAR2(50)
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0
[ftpfdm#scglvdoracd0006 ~]$ sqlldr control=t.ctl
Username:/ as sysdba
SQL*Loader: Release 19.0.0.0.0 - Production on Wed Sep 1 11:37:32 2021
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Path used: Conventional
Commit point reached - logical record count 2
Table TEST1.LOADER_EXAMPLE:
2 Rows successfully loaded.
Check the log file:
t.log
for more information about the load.
[ftpfdm#scglvdoracd0006 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 1 11:37:40 2021
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0
SQL> select * from test1.loader_example ;
CIF_ID ACCOUNT_NO
---------- --------------------------------------------------
1 A_F_A2
2 A_F_B2
SQL>

My question is about exportdump with a query on oracle 9i

I am getting the following error and i need help.
hcp7 (spar)/tmp $ exp system/puppy parfile=rr.prm
Export: Release 9.2.0.8.0 - Production on Thu Oct 31 13:27:11 2019
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
Current user changed to AHS
. . exporting table HB_CONTROL_OUT_DATA
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
hcp7 (spar)/tmp $
hcp7 (spar)/tmp $ vi rr.prm
"rr.prm" 6 lines, 258 characters
file=raj.dmp
log=raj.log
STATISTICS=none
compress=y
tables=AHS.HB_CONTROL_OUT_DATA
query="[select * from hb_control_out_data where exists (select '1' from hb_control_out where hbod_tran_num = hbo_tran_num and ADD_MO
NTHS(HBO_TO_MIS_DATE,24) >SYSDATE)]"
You need to escape your quotes in the query. See the documentation at https://docs.oracle.com/cd/B10501_01/server.920/a96652/ch01.htm#1005843.
BTW, version 9i belongs in a software museum. It was released 17 years ago and the final patch set was released over 12 years ago.
The error message is
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
What SQL are you executing? Well, your parameter file includes a QUERY parameter. It may be a trick of the cut'n'paste into the StackOverflow question box but this looks odd:
ADD_MO NTHS(HBO_TO_MIS_DATE,24)
^
If that space or newline is not an artefact remove and re-run the export.

VARCHAR2 field and NVARCHAR2 exsit in the same table,the former is correct,the latter was garbled

the database A field Type is:
select column_name,data_type From all_tab_columns ;
COLUMN_NAME DATA_TYPE
------------------------------------
NAME VARCHAR2
ID_ISSUE_PLACE VARCHAR2
NATIONALITY NVARCHAR2
I want to export a table with expdp:
expdp abc/123 tables=A.CUST:PARTNUM_0 exclude=grant,index,contraint,statistics,trigger DIRECTORY=DATATMP filesize=100M dumpfile=expdp_%U.dmp parallel=4 cluster=N COMPRESSION=DATA_ONLY
Then,I import the dmp file to my local oracle,the field 'NATIONALITY' is correct , but the other field is garbled.
impdp abc/123 DIRECTORY=DATATMP DUMPFILE=expdp_01.dmp
[oracle#db01 tmp]$ impdp bi71/bi71 DIRECTORY=datatmp
DUMPFILE=expdp_01.dmp
Import: Release 11.2.0.1.0 - Production on Tue Sep 6 11:18:05 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights
reserved.
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table
"A"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting
"A"."SYS_IMPORT_FULL_01": abc/******** DIRECTORY=datatmp
DUMPFILE=expdp_01.dmp Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported
"A"."CUST":"PARTNUM_0" 5.990 MB 78037 rows
Statement:Not a windows client problems,because the vietnamese charecter has been displayed properly.Here with reason screenshot windows client, is to make the results better clarity.
screenshot
I found a rule,once vietnamese nationality in this line appears,the field NAME,ID_ISSUE_PLACE are garbled.
How to resolve? thanks(^_^).

gives many errors when using expdp command

expdp is giving the following errors.
C:\db>expdp SYSTEM/xxx#orcl directory=dump_dir dumpfile=anew.dmp log=export.log schemas=anew
Export: Release 11.2.0.4.0 - Production on Qua Fev 17 17:09:00 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31637: cannot create job SYS_EXPORT_SCHEMA_01 for user SYSTEM
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT_INT", line 798
ORA-39244: Event to disable dropping null bit image header during relational select
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPC$QUE_INT", line 1840
ORA-00955: name is already used by an existing object
There is no orphan jobs in my system:
select * from dba_datapump_jobs;
no rows selected
Any ideas about this error?
The temporary table created every time a datapump is started has not been automatically dropped.
Solution 1: drop table sys.job_name with sys rights
Solution 2: use a .par file and put entries like below (change to suit your job):
DIRECTORY=dump_dir
DUMPFILE=anew.dmp
LOGFILE=export.log
PARALLEL=16
SCHEMAS=anew
JOB_NAME=new_expdp <----- this has to change

write command log to file in window

I want to write log of following command to file in window:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;
(This command use to import data in to oracle).
I try to use this command:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;>log.txt
But it not write log to file. The output in command line is:
Import: Release 11.2.0.1.0 - Production on Thu Jan 14 16:32:47 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
IMP-00058: ORACLE error 1017 encountered ORA-01017: invalid
username/password; logon deniedUsername:
I've found solution for this problem. use below command:
IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billuser.dmp
FULL=Y IGNORE=Y logfile=log.txt

Resources