Oracle 11g - External Table Issue SQL - PL/SQL?
Oracle 11g - External Table Issue?
=====================
I hope this is the right forum for this issue, if not let me, where to go.
We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
We are trying to use oracle external table to load text files in .csv format. Here is our data look like.
======================
Date1,date2,Political party,Name, ROLE
20-Jan-66,22-Nov-69,Democratic,"John ", MMM
22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
9-Aug-72,20-Jan-75,Republican,Henry,MMM
ALL NULL -- record
20-Jan-80,20-Jan-89,Democratic,"Donald Smith",MMM
======================
Our Expernal table structures is as follows
CREATE TABLE P_LOAD
DATE1 VARCHAR2(10),
DATE2 VARCHAR2(10),
POL_PRTY VARCHAR2(30),
P_NAME VARCHAR2(30),
P_ROLE VARCHAR2(5)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY P_EXT_TAB_D
ACCESS PARAMETERS (
RECORDS DELIMITED by NEWLINE
SKIP 1
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
REJECT ROWS WITH ALL NULL FIELDS
MISSING FIELD VALUES ARE NULL
DATE1 CHAR (10) Terminated by "," ,
DATE2 CHAR (10) Terminated by "," ,
POL_PRTY CHAR (30) Terminated by "," ,
P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
P_ROLE CHAR (5) Terminated by ","
LOCATION ('Input.dat')
REJECT LIMIT UNLIMITED;
It created successfully using SQL Developer
Here is the issue.
It is not loading the records, where fields are enclosed in '"' (Rec # 2,3,4,7)
It is loading all NULL value record (Rec # 6)
*** If we remove the '"' from input data, it loads all records including all NULL records
Log file has
KUP-04021: field formatting error for field P_NAME
KUP-04036: second enclosing delimiter not found
KUP-04101: record 2 rejected in file ....
Our questions
Why did "REJECT ROWS WITH ALL NULL FIELDS" not working?
Why did Terminated by "," OPTIONALLY ENCLOSED BY '"' not working?
Any idea?
Thanks in helping.
Edited by: qwe16235 on Jun 11, 2011 11:31 AM
I'm not sure, but maybe you should get rid of the redundancy that you have in your CREATE TABLE statement.
This line covers all fields:
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
{code}
So I would change the field list to:
{code}
DATE1 CHAR (10),
DATE2 CHAR (10),
POL_PRTY CHAR (30),
P_NAME CHAR (30),
P_ROLE CHAR (5)
{code}
It worked on my installation.
Similar Messages
-
Oracle 11g - External Table Issue?
Oracle 11g - External Table Issue?
=====================
I hope this is the right forum for this issue, if not let me, where to go.
We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
We are trying to use oracle external table to load text files in .csv format. Here is our data look like.
======================
Date1,date2,Political party,Name, ROLE
20-Jan-66,22-Nov-69,Democratic,"John ", MMM
22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
9-Aug-72,20-Jan-75,Republican,Henry,MMM
------ ALL NULL -- record
20-Jan-80,20-Jan-89,Democratic,"Donald Smith",MMM
======================
Our Expernal table structures is as follows
CREATE TABLE P_LOAD
DATE1 VARCHAR2(10),
DATE2 VARCHAR2(10),
POL_PRTY VARCHAR2(30),
P_NAME VARCHAR2(30),
P_ROLE VARCHAR2(5)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY P_EXT_TAB_D
ACCESS PARAMETERS (
RECORDS DELIMITED by NEWLINE
SKIP 1
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
REJECT ROWS WITH ALL NULL FIELDS
MISSING FIELD VALUES ARE NULL
DATE1 CHAR (10) Terminated by "," ,
DATE2 CHAR (10) Terminated by "," ,
POL_PRTY CHAR (30) Terminated by "," ,
P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
P_ROLE CHAR (5) Terminated by ","
LOCATION ('Input.dat')
REJECT LIMIT UNLIMITED;
It created successfully using SQL Developer
Here is the issue.
It is not loading the records, where fields are enclosed in '"' (Rec # 2,3,4,7)
It is loading all NULL value record (Rec # 6)
*** If we remove the '"' from input data, it loads all records including all NULL records
Log file has
KUP-04021: field formatting error for field P_NAME
KUP-04036: second enclosing delimiter not found
KUP-04101: record 2 rejected in file ....
Our questions
Why did "REJECT ROWS WITH ALL NULL FIELDS" not working?
Why did Terminated by "," OPTIONALLY ENCLOSED BY '"' not working?
Any idea?
Thanks in helping.
Edited by: qwe16235 on Jun 10, 2011 2:16 PMThe following worked for me:
drop table p_load;
CREATE TABLE P_LOAD
DATE1 VARCHAR2(10),
DATE2 VARCHAR2(10),
POL_PRTY VARCHAR2(30),
P_NAME VARCHAR2(30),
P_ROLE VARCHAR2(5)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY scott_def_dir1
ACCESS PARAMETERS (
RECORDS DELIMITED by NEWLINE
badfile scott_def_dir2:'p_load_%a_%p.bad'
logfile scott_def_dir2:'p_load_%a_%p.log'
SKIP 1
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
DATE1 CHAR (10) Terminated by "," ,
DATE2 CHAR (10) Terminated by "," ,
POL_PRTY CHAR (30) Terminated by "," ,
P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
P_ROLE CHAR (5) Terminated by ","
LOCATION ('Input.dat')
REJECT LIMIT UNLIMITED;
Note that I had to interchange the two lines:
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
Just to get the access parameters to parse correctly.
I added two empty lines, one in the middle and one at the end - both were rejected.
In the log file, you will see the rejectiions:
$ cat p_load_000_9219.log
LOG file opened at 07/08/11 19:47:23
Field Definitions for table P_LOAD
Record format DELIMITED BY NEWLINE
Data in file has same endianness as the platform
Reject rows with all null fields
Fields in Data Source:
DATE1 CHAR (10)
Terminated by ","
Enclosed by """ and """
Trim whitespace same as SQL Loader
DATE2 CHAR (10)
Terminated by ","
Enclosed by """ and """
Trim whitespace same as SQL Loader
POL_PRTY CHAR (30)
Terminated by ","
Enclosed by """ and """
Trim whitespace same as SQL Loader
P_NAME CHAR (30)
Terminated by ","
Enclosed by """ and """
Trim whitespace same as SQL Loader
P_ROLE CHAR (5)
Terminated by ","
Enclosed by """ and """
Trim whitespace same as SQL Loader
KUP-04073: record ignored because all referenced fields are null for a record
KUP-04073: record ignored because all referenced fields are null for a record
Input Data:
Date1,date2,Political party,Name, ROLE
20-Jan-66,22-Nov-69,Democratic,"John ", MMM
22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
9-Aug-72,20-Jan-75,Republican,Henry,MMM
4-Aug-70,20-Jan-75,Independent
Result:
SQL> select * from p_load;
DATE1 DATE2 POL_PRTY P_NAME P_ROL
20-Jan-66 22-Nov-69 Democratic John MMM
22-Nov-70 20-Jan-71 Democratic John Jr. MMM
20-Jan-68 9-Aug-70 Republican Rick Ford Sr. MMM
9-Aug-72 20-Jan-75 Republican Henry MMM
Regards,
- Allen -
Oracle 11g - External Table/SQL Developer Issue?
Oracle 11g - External Table/SQL Developer Issue?
==============================
I hope this is the right forum for this issue, if not let me, where to go.
We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
We are trying to use oracle external table to load text files in .csv format. Here is our data look like.
======================
Date1,date2,Political party,Name, ROLE
20-Jan-66,22-Nov-69,Democratic,"John ", MMM
22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
9-Aug-72,20-Jan-75,Republican,Henry,MMM
------ ALL NULL -- record
20-Jan-80,20-Jan-89,Democratic,"Donald Smith",MMM
======================
Our Expernal table structures is as follows
CREATE TABLE P_LOAD
DATE1 VARCHAR2(10),
DATE2 VARCHAR2(10),
POL_PRTY VARCHAR2(30),
P_NAME VARCHAR2(30),
P_ROLE VARCHAR2(5)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY P_EXT_TAB_D
ACCESS PARAMETERS (
RECORDS DELIMITED by NEWLINE
SKIP 1
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
REJECT ROWS WITH ALL NULL FIELDS
MISSING FIELD VALUES ARE NULL
DATE1 CHAR (10) Terminated by "," ,
DATE2 CHAR (10) Terminated by "," ,
POL_PRTY CHAR (30) Terminated by "," ,
P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
P_ROLE CHAR (5) Terminated by ","
LOCATION ('Input.dat')
REJECT LIMIT UNLIMITED;
It created successfully using SQL Developer
Here is the issue.
It is not loading the records, where fields are enclosed in '"' (Rec # 2,3,4,7)
It is loading all NULL value record (Rec # 6)
*** If we remove the '"' from input data, it loads all records including all NULL records
Log file has
KUP-04021: field formatting error for field P_NAME
KUP-04036: second enclosing delimiter not found
KUP-04101: record 2 rejected in file ....
Our questions
Why did "REJECT ROWS WITH ALL NULL FIELDS" not working?
Why did Terminated by "," OPTIONALLY ENCLOSED BY '"' not working?
Any idea?
Thanks in helping.I don't think this is a SQLDeveloper issue. You will get better answers in the Database - General or perhaps SQL and PL/SQL forums.
-
Oracle 11g - External Table/Remote File Issue?
Oracle 11g - External Table/Remote File Issue?
=============================
I hope this is the right forum for this issue, if not let me, where to go.
We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
We are not allowed to put files on the CSV file system (Server A), where DB instance is running. We are able place CSV files on another server(Server B), where DB instance is not running.
We are trying to use oracle external table to load text files in .CSV format.
How do we create a Directory (Create Directory) on Server A DB to point to File system of Server B?
Is it feasible?
Any idea?
Thanks in helping.The Solaris DBA should be able to mount the filesystem for you. Either that or you have to get creative transferring the file like this;
http://www.linkedin.com/groups/Getting-creative-external-table-preprocessor-140609.S.50474382?qid=ba673ce4-c4bb-40c5-8367-52bd2a2dfc80&trk=group_search_item_list-0-b-ttl&goback=%2Egmp_140609
Cheers
David -
Hi..
I am using Oracle 11g in windows environment .. when i drop user the following issue occur..
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
but this user are not used and there is no session also. pls help me..
thanks and advance
karthikhi,
check this link
drop user fails with ORA-00604: error occurred at recursive SQL level 1 -
Helllo Everyone.
I am new to external tables concept and I have only used using flat files.
Is there a complete reference on on external tables somewhere?
Also, instead of .csv or text based datafiles, can I use XML as data source for these external tables? If so, how?
Thanks,
RThe link to the documentation has been already posted.
About the xml as a possible datasource, in Oracle9i only the ORACLE_LOADER driver is supported, it allows you to read data using SQL*Loader, that is to say only plain text files.
In Oracle10g a new driver has been added: ORACLE_DATAPUMP, it allows you to read with an external table a dump file created from other Oracle tables using the same ORACLE_DATAPUMP driver.
Unfortunately the ORACLE_DATAPUMP driver doesn't support the XMLTYPE datatype:
SQL> desc tbl_xml
Nome Nullo? Tipo
XML PUBLIC.XMLTYPE
SQL> CREATE TABLE xml_ext
2 ORGANIZATION EXTERNAL
3 (
4 TYPE ORACLE_DATAPUMP
5 DEFAULT DIRECTORY DATA_PUMP_DIR
6 LOCATION ('xml_ext.dmp')
7 )
8 AS SELECT * FROM tbl_xml;
CREATE TABLE xml_ext
ERRORE alla riga 1:
ORA-30656: tipo di colonna non supportato in una tabella organizzata esterna
SQL>Max
[My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/18/table-elimination-oppure-join-elimination-lottimizzatore-si-libera-della-zavorra/] -
Hi all,
After Oracle 11g migration, i have been facing issues in OEM scheduling. Twice the job did not run even after 11.2.0.7 upgrade. Hence i would like to explore the possibility of scheduling the same in DBMS jobs (we have not faced even a single failure since migration). However there is no mail alert available for successful completion of the job. In this regard i would like to have your views and help to create alerts to proceed further.
ThankxHi Ravi,
Really the link helps,eventhough i have been looking for the rootcause to overcome from the job failure(scheduled jobs)
Actually after completion/succeded of my scheduled job i may also get "INITIALIZATION ERROR" status message,so i need to be Re-schedule the particular job again
for next day.
Look up screenshot of the error
Job Name=OEM_FLEET_ICL_SEND_6_30_AM_DAILY
Job Owner=SYSMAN
Job Type=SQL Script
Target Type=Database Instance
Timestamp=Apr 19, 2011 6:30:44 AM
Status=Initialization Error
Step Output=
Command:Output Log
SQLPlus: Release 11.2.0.2.0 Production on Tue Apr 19 06:30:15 2011*
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> SQL> SQL> SQL> Connected.
SQL> SQL> SQL> SQL>
PL/SQL procedure successfully completed.
SQL> SP2-0103: Nothing in SQL buffer to run.
SQL>
Commit complete.
SQL> SQL> SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
*~~~End Step Output/Error Log~~~*
kindly advice me on this
Thanks -
Can not open database control in oracle 11g r2, listener issues
Hi,
I installed Oracle 11g r2 database on my laptop for testing. at beginning everything was fine and working. 2 days later i am unable to run oracle database control.. i get page not found!
I tried all the tricks and read almost 200 pages from oracle documentation, none of this was even close to help!
(by the way oracle documentation is a fail in my opinion, it really tend to complicate things so much and talk about things not related to what a developer want to read about, its even hard for professional programmer to keep up with this, I started to hate dealing with Oracle before even going deep!!)
I tried deleting database and creating new database i get the following warning:
- Enterprise manager configuration failed due to the following error:
listener is not up or database service is not registered with it. start listener and register database service.. etc.
Some how after few hours the control is working but the database is not there, and it shows that the listener is up, but database is down.
I tried creating a new database, but i get the error above (it seems its created but not linked to listener!!)
I guess what triggered this error is running xampp, i was also working in php project and ran xampp for test, since then oracle is corrupted!
any help would be appreciated (please don't send me links to oracle documentation because its useless and not straight to the point)
RegardsHi
thank you for the reply
I assume i should do this through SQL plus?
anyway, now am getting new error: ORA-00020: maximum number of processes (150) exceeded
I get this error when trying to login to SQL plus, or create/configure database.
I tried deleting oracle 11g via universal installer i get message saying run the command c:\...dbhome_1\deinstall\deinstall
I don't understand Oracle totally collapsed in my laptop with no reason -
Oracle 11g Migration performance issue
Hello,
There a performance issue with Migration from Oracle 10g(10.2.0.5) to Oracle 11g(11.2.0.2).
Its very simple statement hanging for more than a day and later found that query plan is very very bad. Example of the query is given below:
INSERT INTO TABLE_XYZ
SELECT F1,F2,F3
FROM TABLE_AB, TABLE_BC
WHERE F1=F4;
While looking at cost in Explain plan :
on 10g --> 62567
0n 11g --> 9879652356776
Strange thing is that
Scenario 1: if I issue just query as shown below, will display rows immediately :
SELECT F1,F2,F3
FROM TABLE_AB, TABLE_BC
WHERE F1=F4;
Scenario 2: If I create a table as shown below, will work correctly.
CREATE TABLE TABLE_XYZ AS
SELECT F1,F2,F3
FROM TABLE_AB, TABLE_BC
WHERE F1=F4;
What could be the issue here with INSERT INTO <TAB> SELECT <COL> FROM <TAB1>?Table:
CREATE TABLE AVN_WRK_F_RENEWAL_TRANS_T
"PKSRCSYSTEMID" NUMBER(4,0) NOT NULL ENABLE,
"PKCOMPANYCODE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
"PKBRANCHCODE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
"PKLINEOFBUSINESS" NUMBER(4,0) NOT NULL ENABLE,
"PKPRODUCINGOFFICELIST" VARCHAR2(2 CHAR) NOT NULL ENABLE,
"PKPRODUCINGOFFICE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
"PKEXPIRYYR" NUMBER(4,0) NOT NULL ENABLE,
"PKEXPIRYMTH" NUMBER(2,0) NOT NULL ENABLE,
"CURRENTEXPIRYCOUNT" NUMBER,
"CURRENTRENEWEDCOUNT" NUMBER,
"PREVIOUSEXPIRYCOUNT" NUMBER,
"PREVIOUSRENEWEDCOUNT" NUMBER
SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
TABLESPACE "XYZ" ;
Explain Plan(With Insert Statement and Query):_
INSERT STATEMENT, GOAL = ALL_ROWS Cost=9110025395866 Cardinality=78120 Bytes=11952360
LOAD TABLE CONVENTIONAL Object owner=ODS Object name=AVN_WRK_F_RENEWAL_TRANS
NESTED LOOPS OUTER Cost=9110025395866 Cardinality=78120 Bytes=11952360
TABLE ACCESS FULL Object owner=ODS Object name=AVN_WRK_F_RENEWAL_TRANS_1ST Cost=115 Cardinality=78120 Bytes=2499840
VIEW PUSHED PREDICATE Object owner=ODS Cost=116615788 Cardinality=1 Bytes=121
SORT GROUP BY Cost=116615788 Cardinality=3594 Bytes=406122
VIEW Object owner=SYS Object name=VW_DAG_1 Cost=116615787 Cardinality=20168 Bytes=2278984
SORT GROUP BY Cost=116615787 Cardinality=20168 Bytes=4073936
NESTED LOOPS OUTER Cost=116614896 Cardinality=20168 Bytes=4073936
VIEW Object owner=SYS Cost=5722 Cardinality=20168 Bytes=2157976
NESTED LOOPS Cost=5722 Cardinality=20168 Bytes=2097472
HASH JOIN Cost=924 Cardinality=1199 Bytes=100716
NESTED LOOPS
NESTED LOOPS Cost=181 Cardinality=1199 Bytes=80333
TABLE ACCESS BY INDEX ROWID Object owner=ODS Object name=INWARDSPOLICYDETAILS Cost=159 Cardinality=1199 Bytes=39567
INDEX RANGE SCAN Object owner=ODS Object name=IX_INWPOLDTLS_SYSCOMPANYBRANCH Cost=7 Cardinality=1199
INDEX UNIQUE SCAN Object owner=ODS Object name=PK_AVN_D_MASTERPOLICYDETAILS Cost=0 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=ODS Object name=AVN_D_MASTERPOLICYDETAILS Cost=1 Cardinality=1 Bytes=34
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYLOBMAPPING Cost=741 Cardinality=288498 Bytes=4904466
VIEW PUSHED PREDICATE Object owner=ODS Cost=4 Cardinality=1 Bytes=20
FILTER
SORT AGGREGATE Cardinality=1 Bytes=21
TABLE ACCESS BY GLOBAL INDEX ROWID Object owner=ODS Object name=AVN_F_TRANSACTIONS Cost=4 Cardinality=1 Bytes=21
INDEX RANGE SCAN Object owner=ODS Object name=PK_AVN_F_TRANSACTIONS Cost=3 Cardinality=1
VIEW PUSHED PREDICATE Object owner=ODS Cost=5782 Cardinality=1 Bytes=95
SORT GROUP BY Cost=5782 Cardinality=2485 Bytes=216195
VIEW Object owner=SYS Object name=VW_DAG_0 Cost=5781 Cardinality=2485 Bytes=216195
SORT GROUP BY Cost=5781 Cardinality=2485 Bytes=278320
HASH JOIN Cost=5780 Cardinality=2485 Bytes=278320
VIEW Object owner=SYS Object name=VW_GBC_15 Cost=925 Cardinality=1199 Bytes=73139
SORT GROUP BY Cost=925 Cardinality=1199 Bytes=100716
HASH JOIN Cost=924 Cardinality=1199 Bytes=100716
NESTED LOOPS
NESTED LOOPS Cost=181 Cardinality=1199 Bytes=80333
TABLE ACCESS BY INDEX ROWID Object owner=ODS Object name=INWARDSPOLICYDETAILS Cost=159 Cardinality=1199 Bytes=39567
INDEX RANGE SCAN Object owner=ODS Object name=IX_INWPOLDTLS_SYSCOMPANYBRANCH Cost=7 Cardinality=1199
INDEX UNIQUE SCAN Object owner=ODS Object name=PK_AVN_D_MASTERPOLICYDETAILS Cost=0 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=ODS Object name=AVN_D_MASTERPOLICYDETAILS Cost=1 Cardinality=1 Bytes=34
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYLOBMAPPING Cost=741 Cardinality=288498 Bytes=4904466
VIEW Object owner=SYS Object name=VW_GBF_16 Cost=4854 Cardinality=75507 Bytes=3850857
SORT GROUP BY Cost=4854 Cardinality=75507 Bytes=2340717
VIEW Object owner=ODS Cost=4207 Cardinality=75507 Bytes=2340717
SORT GROUP BY Cost=4207 Cardinality=75507 Bytes=1585647
PARTITION HASH ALL Cost=3713 Cardinality=75936 Bytes=1594656
TABLE ACCESS FULL Object owner=ODS Object name=AVN_F_TRANSACTIONS Cost=3713 Cardinality=75936 Bytes=1594656
Explain Plan(Only Query):_
SELECT STATEMENT, GOAL = ALL_ROWS Cost=62783 Cardinality=89964 Bytes=17632944
HASH JOIN OUTER Cost=62783 Cardinality=89964 Bytes=17632944
TABLE ACCESS FULL Object owner=ODS Object name=AVN_WRK_F_RENEWAL_TRANS_1ST Cost=138 Cardinality=89964 Bytes=2878848
VIEW Object owner=ODS Cost=60556 Cardinality=227882 Bytes=37372648
HASH GROUP BY Cost=60556 Cardinality=227882 Bytes=26434312
VIEW Object owner=SYS Object name=VW_DAG_1 Cost=54600 Cardinality=227882 Bytes=26434312
HASH GROUP BY Cost=54600 Cardinality=227882 Bytes=36005356
HASH JOIN OUTER Cost=46664 Cardinality=227882 Bytes=36005356
VIEW Object owner=SYS Cost=18270 Cardinality=227882 Bytes=16635386
HASH JOIN Cost=18270 Cardinality=227882 Bytes=32587126
HASH JOIN Cost=12147 Cardinality=34667 Bytes=2912028
HASH JOIN Cost=10076 Cardinality=34667 Bytes=2322689
TABLE ACCESS FULL Object owner=ODS Object name=AVN_D_MASTERPOLICYDETAILS Cost=137 Cardinality=34667 Bytes=1178678
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYDETAILS Cost=9934 Cardinality=820724 Bytes=27083892
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYLOBMAPPING Cost=741 Cardinality=866377 Bytes=14728409
VIEW Object owner=ODS Cost=5195 Cardinality=227882 Bytes=13445038
HASH GROUP BY Cost=5195 Cardinality=227882 Bytes=4785522
PARTITION HASH ALL Cost=3717 Cardinality=227882 Bytes=4785522
TABLE ACCESS FULL Object owner=ODS Object name=AVN_F_TRANSACTIONS Cost=3717 Cardinality=227882 Bytes=4785522
VIEW Object owner=ODS Cost=26427 Cardinality=227882 Bytes=19369970
HASH GROUP BY Cost=26427 Cardinality=227882 Bytes=18686324
VIEW Object owner=SYS Object name=VW_DAG_0 Cost=26427 Cardinality=227882 Bytes=18686324
HASH GROUP BY Cost=26427 Cardinality=227882 Bytes=25294902
HASH JOIN Cost=20687 Cardinality=227882 Bytes=25294902
VIEW Object owner=SYS Object name=VW_GBC_15 Cost=12826 Cardinality=34667 Bytes=2080020
HASH GROUP BY Cost=12826 Cardinality=34667 Bytes=2912028
HASH JOIN Cost=12147 Cardinality=34667 Bytes=2912028
HASH JOIN Cost=10076 Cardinality=34667 Bytes=2322689
TABLE ACCESS FULL Object owner=ODS Object name=AVN_D_MASTERPOLICYDETAILS Cost=137 Cardinality=34667 Bytes=1178678
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYDETAILS Cost=9934 Cardinality=820724 Bytes=27083892
TABLE ACCESS FULL Object owner=ODS Object name=INWARDSPOLICYLOBMAPPING Cost=741 Cardinality=866377 Bytes=14728409
VIEW Object owner=SYS Object name=VW_GBF_16 Cost=7059 Cardinality=227882 Bytes=11621982
HASH GROUP BY Cost=7059 Cardinality=227882 Bytes=6836460
VIEW Object owner=ODS Cost=5195 Cardinality=227882 Bytes=6836460
HASH GROUP BY Cost=5195 Cardinality=227882 Bytes=4785522
PARTITION HASH ALL Cost=3717 Cardinality=227882 Bytes=4785522
TABLE ACCESS FULL Object owner=ODS Object name=AVN_F_TRANSACTIONS Cost=3717 Cardinality=227882 Bytes=4785522 -
External Table - Issues With Special Character.
I have an external table that reads from a fixed length file. The file is expected to contain special characters. In my case the word containing special character is "Göteborg". Because "ö" is a special character, looks like Oracle is considering it as 2 bytes. That causes the trouble. The subsequent fields in the files get shifted by 1 byte thereby messing up the data. Has anyone faced the issue before. So far we have tried the following solution:
Changed the value of NLS_LANG to AMERICAN_AMERICA.WE8ISO8859P1
Tried Setting the Database Character set to UTF-8
Tried changing the NLS_LENGTH_SYMMANTIC to CHAR instead of BYTE using ALTER SYSTEM
Tried changing the External table characterset to: AL32UTF8
Tried changing the External table characterset to: UTF-8
Nothing works. Other details include:
• File is UTF-8 encoded
• Operating System : RHEL
• Database: Oracle 11gR2
Any thing else that I might be missing? Any help will be appreciated. Thanks in advance!
GaneshCREATE TABLE "APP_XXX_XX_XXXX"(
"KEY_NO" NUMBER,
"XXX_XXX_XXXXX" VARCHAR2(1 CHAR),
"XXX_XXX_XXXXX" NUMBER(9,0),
"XXX_XXX_XXXXX" NUMBER(4,0),
"XXX_XXX_XXXXX" NUMBER(2,0),
"XXX_XXX_XXXXX" NUMBER(3,0))
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY "DIR"
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
CHARACTERSET 'UTF8'
LOGFILE APP_XXX_XX_XXXX_%A_%P.LOG'
BADFILE 'APP_XXX_XX_XXXX_%A_%P.BAD'
DISCARDFILE 'APP_XXX_XX_XXXX_%A_%P.DSC'
FIELDS(
KEY_NO POSITION(1:9) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(10:10) CHAR,
XXX_XXX_XXXXX POSITION(11:19) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(11:14) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(15:16) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(17:19) INTEGER EXTERNAL)
LOCATION
( 'FILE1.TXT')
REJECT LIMIT UNLIMITED
PARALLEL 4;
The data forms part of a major driver table, which I may not be able to provide as per the NDA with my company.
The Script I have shared is standard template for creating external table as part of our applications.
We majorly cater for EU regions with this project.(European Characterset needed to be supported)
Thanks
Ganesh
Edited by: RGRAM on Feb 11, 2011 12:44 PM -
HI all,
--External table and bad table structures
CREATE TABLE EXT_APISEARCH_RESULT
LINENUMBER NUMBER(20,0),
USERID VARCHAR2(15 BYTE),
NAMESPACE CHAR(2 BYTE),
ACCTNUM VARCHAR2(10 BYTE),
APC VARCHAR2(50 BYTE),
SESSIONID VARCHAR2(65 BYTE),
REQUESTDATETIME VARCHAR2(19 BYTE),
RESPONSEDATETIME VARCHAR2(19 BYTE),
APITRANSNAME VARCHAR2(50 BYTE),
HDLNORGN VARCHAR2(20 BYTE),
ADDNLORGNDATA VARCHAR2(250 BYTE),
SRCHMODE VARCHAR2(30 BYTE),
SRCGENRE VARCHAR2(1000 BYTE),
PARTCODES VARCHAR2(1000 BYTE),
SEARCHLANGCODES VARCHAR2(250 BYTE),
SNIPPETTYPE VARCHAR2(20 BYTE),
BLACKLISTKEYWRDS VARCHAR2(1000 BYTE),
CONTIND VARCHAR2(5 BYTE),
DATERANGE VARCHAR2(10 BYTE),
DAYSRANGE VARCHAR2(50 BYTE),
DUPLICATIONMODE VARCHAR2(10 BYTE),
SORTBY VARCHAR2(50 BYTE),
HDLNDISPREQ VARCHAR2(50 BYTE),
RSLTSOFFSET VARCHAR2(10 BYTE),
SUCCESSIND VARCHAR2(2 BYTE),
ERRORCODE VARCHAR2(20 BYTE),
RESPONSEFORMAT VARCHAR2(50 BYTE),
EPVALUE VARCHAR2(3000 BYTE),
APCU VARCHAR2(20 BYTE),
TOTALHDLNS NUMBER(10,0),
UNIQUEHDLNS NUMBER(10,0),
DUPHDLNS NUMBER(10,0)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER DEFAULT DIRECTORY EXT_TAB_DIR ACCESS PARAMETERS ( RECORDS DELIMITED BY '\n' BADFILE 'EXT_TAB_DIR_LOG':'SEARCHRESULTAPI.BAD' LOGFILE 'EXT_TAB_DIR_LOG':'SEARCHRESULTAPI.LOG' DISCARDFILE 'EXT_TAB_DIR_LOG':'SEARCHRESULTAPI.DSC' FIELDS TERMINATED BY '#|#' OPTIONALLY ENCLOSED BY '#$'
AND '$#' MISSING FIELD VALUES ARE NULL( LINENUMBER, USERID, NAMESPACE, ACCTNUM, APC, SESSIONID, REQUESTDATETIME, RESPONSEDATETIME, APITRANSNAME, HDLNORGN, ADDNLORGNDATA, SRCHMODE, SRCGENRE CHAR(1000), PARTCODES CHAR(1000), SEARCHLANGCODES , SNIPPETTYPE, BLACKLISTKEYWRDS CHAR(1000), CONTIND, DATERANGE, DAYSRANGE, DUPLICATIONMODE, SORTBY, HDLNDISPREQ, RSLTSOFFSET, SUCCESSIND, ERRORCODE, RESPONSEFORMAT, EPVALUE CHAR(3000), APCU, TOTALHDLNS, UNIQUEHDLNS, DUPHDLNS ) ) LOCATION ( 'SEARCHRESULTAPI.dat' )
REJECT LIMIT UNLIMITED;
--DROP TABLE EXT_BAD_APISEARCH_RESULT;
CREATE TABLE EXT_BAD_APISEARCH_RESULT
BADRECORD VARCHAR2(1000 BYTE)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER DEFAULT DIRECTORY EXT_TAB_DIR_LOG ACCESS PARAMETERS ( RECORDS DELIMITED BY '\n' NOBADFILE NOLOGFILE NODISCARDFILE FIELDS TERMINATED BY '\n' MISSING FIELD VALUES ARE NULL( BADRECORD CHAR(1000) ) ) LOCATION ( 'SEARCHRESULTAPI.BAD' )
REJECT LIMIT UNLIMITED;Eventhough there is no space in the BAD file mentioned in the external table it is getting created with space. uDe to which BAD recorsd are not being moved to external bad table (2nd table) hence file processing is failing.
--Getting created with space.
'EXT_TAB_DIR_LOG':' SEARCHRESULTAPI.BAD'Please note that, external bad table is getting created without any space in the bad file mentioned.
Anything wrong with first table script ? Please let us know.
Thanks and Regards
Nagaraja akkivalli.
Edited by: Nagaraja Akkivalli on Jun 13, 2012 10:09 AMPlease do the following statements.
-- Execute the below statements.
create or replace directory EXT_TAB_DIR as '<Point to some location in server>';
create or replace directory EXT_TAB_DIR_LOG as '<Point to some location in server>';
Example:
create or replace directory EXT_TAB_DIR_LOG as '/var/factiva/ODS/log';
-- Perform the below steps.
1. Execute both create table statements mentioned above.
2. Once table's are created then click on the table from SqlDeveloper.
3. Next, click on SQl tab where we can see the create table statement.
Now, check the below part in the create table statement.
'EXT_TAB_DIR_LOG':' SEARCHRESULTAPI.BAD'There is space before SEARCHRESULTAPI.BAD.
My question is,
How did this space got inserted eventhogh there is no space in the create table statement ??
Please let me know if you are still not able to understand my question. I will re-phrase again. -
Oracle 11g Database Perfomance issue
HI
I test migration of our product from Oracle 9i to 11g and have some problems.
When I execute queries (not very complex: with several joins and sometimes inner selects) queries are executed very slow the first time (about 10-15 seconds without fetching). Next times it executes for a half of seconds. It seems that Oracle caches some data. But for 2 minutes the situation is the same - execution time takes more then 10 seconds.
Using Oracle 9i the same query executes first time for 4-5 seconds and next times for 1 second with not cache-time limitation
Something similar with PL/SQL Developer we use. When I try to get function or procedure or some other list first execution take a lot of time in average15-20 seconds, though analogical operations with 9i takes 1-2 seconds. But it seems that there are no difference between first and next executions.
Technical Info:
Oracle 11.1.0.6.0
PL/SQL Developer 7.1
Pentium IV 2.8
Ubuntu 7.04 (I know it is not certified, but I don't think that problem depends on that)
Windows Clients 9i and 10.2.0.2
Will appreciate any helpThe machines a differentThat's quite an understatement ;) The machines are different in almost every way -
1) The number/type of CPU's
2) The amount of memory
3) The type of disks used
4) The operating system itself.
I would suggest that comparing performance at the moment (and then pointing at 11g as the 'culprit') is a bit misleading. I think you need to test both systems on the same hardware before you jump to that conclusion (I'm not saying that you're wrong....perhaps you're right, but comparing timings on those two different setups isn't exactly 'conclusive' to me).
there is no bottlenecksThen congratulations, your 2 x Pentium III is actually a quantum supercomputer in disguise...;)
Seriously...there is always a bottleneck, something (in the current state of the Physical world) is always going to be the limiting factor. Sure, you can decrease that bottleneck or even remove it (but then something else becomes the primary bottleneck).
John. -
Oracle 11g clusterware installation issue.
In our test lab, we are facing the following issue.Kindly help us to resolve this issue.
Environment Details
O/S : Oracle Enterprise Linux
Database: Oracle 11g
Clusterware: Oracle 11g
The nodes are created using vmware.
All the pre installation checks using clufvy utility are successful.
During Installation of clusterware software, we need to run root.sh at the end on all the nodes. We have 2 node cluster. Root.sh runs successfully on node 1, but fails on node 2.
Root.sh on node 2 details are given below
# ./root.sh
WARNING: directory '/u01/app/oracle/product/11.1.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
WARNING: directory '/u01/app' is not owned by root
WARNING: directory '/u01' is not owned by root
Checking to see if Oracle CRS stack is already configured
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/app/oracle/product/11.1.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
WARNING: directory '/u01/app' is not owned by root
WARNING: directory '/u01' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 11G Release 1.
assigning default hostname tsa1-fdfolio for node 1.
assigning default hostname tsa2-fdfolio for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: tsa1-fdfolio tsa1-fdfolio-priv tsa1-fdfolio
node 2: tsa2-fdfolio tsa2-fdfolio-priv tsa2-fdfolio
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
Failure at final check of Oracle CRS stack.
10The trace files which **might** contain some useful error messages are :
a) The latest trace files under $CRS_Home/log/hostname/client directory
b) The OS Messages file ( /var/log/messages )
This information can then be used to google similar issues ..
Paste those messages here and I'll see if it rings a bell ..
Vishwa -
Oracle 11g Case Insensitive Issue
Hi,
For our .net framework 4.0 Application we need case insenstive search. So I have tried setting NLS_COMP=LINGUISTIC & NLS_SORT=BINARY_CI in environmental variable.. But this is not working. But when I tried firing trigger on each logon and setting NLS_COMP for each session.. It is working.. But because of performance reason we don't want to fire on trigger for each database logon.
Pls Let me know why it is not working setting environmental variable. We are using Oracle 11g client and 10g server and connecting from our .net application through ODP.NET.
Regards,
RaghuDo you see the same behavior when connecting via SQLPlus after setting the environment variables? Is this an ODP.NET specific issue? If it's not specific to ODP, you'll probably get better insight by posting in one of the generic database forums.
With respect to ODP specific solutions, have you already checked out the OracleGlobalization class?
http://docs.oracle.com/cd/B19306_01/win.102/b14307/OracleGlobalizationClass.htm#i1009565
Hope it helps,
Greg -
Accesing windows files using oracle unix external tables.
Hi, I'm trying to access files on windows2k using oracle external tables on unix:
Oracle server on unix: oracle ver. is 9.2.0.6 and OS is 5.8 Generic_117000-03 sun4u sparc SUNW,Sun-Fire
1. Created dir object on oracle unix pointing to windows path
2. created user
3. Assigned read and write privs on dir to user
4. created external table using dir step 1
5. select on external table
When I FTP the files into unix and recreate dir object, it works, but if I point dir object into windows path, it fails.
Is possible to do this?
Tks
GAPHi
The directory object must be accesible to your Database server, so if the Database is in unix you must create the directory in unix.
I don´t know software that allow unix systems to see a windows file system. Maybe windows can see unix from a samba server or NFS.
Maybe you are looking for
-
How to get rid of the residual value in my account
hi i have 1 kr in my itunes accout and i need to change my country but i cant , what i do to get rid of the remaining value . thank you
-
I have been having trouble using my new dynadock 3575 and the video - operating system is Vista home Premium 64 bit. Contact Toshiba about 6 weeks ago and today i received an email from yousendit with a file to solve the problem. I have a policy of
-
How to create Reports for the infopath form data
Hi All, I have a requirement to generate reports in SharePoint based on InfoPath form data which is submitted into form library. Do I need to store each InfoPath form data into SQL Database/MS Access Database. if yes, can any one help me on this how
-
Bridge preferences to open PSElements, not Photoshop
I have Photoshop CS4 and PS8 installed. I want Bridge to open PSE8 only. Is there a way to change these preferences?
-
How to change background in bulk
Hi All, I have made simulation type project in English version using Captivate 4. Now, I want to develop this project in multilingual. I can change the caption text easily using the export command. But I want to change the background for multilingual