ORA-02045: too many local sessions participating in global transaction
Hi,
this is related with the solution that I got from my previous post in
modify LONG column using trigger
that solution work in my local schema. But when test this in the real application,
I got above error.
can I know what is the reason?
thanks
Hi Michael,
below is my code
I created the loopback db link as follows
CREATE PUBLIC DATABASE LINK "DEV_LOOPBACK.MYDOMAIN.COM"
CONNECT TO "DBLINK_USER"
IDENTIFIED BY "********"
USING 'DEV' trigger as follow
CREATE OR REPLACE TRIGGER TEST_TABLE_MEMO_AFT_UPD
AFTER UPDATE
ON TABLE_MEMO
FOR EACH ROW
DECLARE
myCOLNAME VARCHAR2(20);
BEGIN
IF :NEW.COL_NAME = 'FC_NOTE' THEN
myCOLNAME := :NEW.COL_NAME;
EXECUTE IMMEDIATE
DECLARE
Original_Char VARCHAR2(32767);
Fixed_Char VARCHAR2(32767);
BEGIN
SELECT MEMO INTO Original_Char FROM TABLE_MEMO@DEV_LOOPBACK WHERE RECNO = :1 AND COL_NAME = :2;
UPDATE MBS_OWNER.TABLE_MEMO@DEV_LOOPBACK SET MEMO = REPLACE(Original_Char,chr(141),CHR(13)) WHERE RECNO = :1 AND COL_NAME = :2;
END;
' USING :NEW.RECNO,myCOLNAME;
ELSE
NULL;
END IF;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20005,SQLCODE||' TRIGGER ERROR AFTER UPDATE '||SQLERRM);
END;Note:
with adding a loopback dblink, now I have 5 dblink active in the DB.
My Open_Links parameter set to 4 and I don't have INIT.ORA
thanks
Lie
Similar Messages
-
ORA-02042: too many distributed transactions
1. I have been working on a portal application for several weeks.
2. Portal is installed in 1 instance and my data is in another instance.
3. I've had no ora-02042 problems in the devt environment set up that way.
4. I've recently migrated the application/pages to a test environment set up that way.
5. I've been working in the test environment for several days with no problems.
6. For some portlets on some pages I'm now getting:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
Failed to parse query
Error:ORA-02042: too many distributed transactions
Error:ORA-02042: too many distributed transactions
ORA-02063: preceding line from
LINK_TO_TEST (WWV-11230) Failed to parse as PACID_SCHEMA -
select user_action.userid, action.name,
user_action.created_date,
user_action.created_by, action.action_id,
'del' del_link from user_action , action
where user_action.action_id =
action.action_id and user_action.userid
LIKE UPPER(:userid) order by USERID
ASC, NAME ASC, CREATED_DATE
ASC (WWV-08300)
<HR></BLOCKQUOTE>
7. I cannot find anything about this error in the db log files for either instance.
8. I've increased distributed transactions to 200 in the portal db and bounced
it. Still get the error.
9. No records in dba_2pc_pending or dba_2pc_neighbors in the portal instance.
10. I get the error in various reports and form LOVs at different times. Pages with a lot of portlets seem to be more prone to the error.
Here is a typical LOV error:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
COMBOBOX LOV ERROR:
LOV: "ASIMM_1022.TITLE_LOV"
Parse Message: Parse as pre-set global: "PACID_SCHEMA".
Find Message: LOV is of type DYNAMIC (LOV based on SQL query).
Query: "select code display_column, code return_column from codes where table_id = 'OFFICER_TITLE' order by code"
wwv_parse.parse_as_user: ORA-02042: too many distributed transactions ORA-02063: preceding line from LINK_TO_TEST wwv_parse.parse_as_user: Failed to parse as PACID_SCHEMA - select code display_column, code return_column from codes where table_id = 'OFFICER_TITLE' order by code wwv_security.check_comp_privilege: Insufficient privileges. wwpre_utl.get_path_id: The preference path does not exist: ORACLE.WEBVIEW.PARAMETERS.217_USER_INPUT_ASIMM_5423428
<HR></BLOCKQUOTE>
Why are these select statements being interpreted as distributed transactions? Note:1032658.6 suggests I "USE SET TRANSACTION READ ONLY". Is this necessary? If so how?
What puzzles me is that this set up has been working fine for several days. I don't know of any changes to my environment apart from me increasing distributed transactions.
nullHi,
this is information from metalink:
The ORA-2042 indicates that you should increase the parameter
distributed_transactions.
The ORA-2063 indicates that this must be done at the remote
database.
Explanation
If the distributed transaction table is full on either side of
the database link you get the error ORA-2042:
ORA-02042: "too many distributed transactions"
Cause: the distributed transaction table is full,
because too many distributed transactions are active.
Action: increase the INIT.ORA "distributed_transactions" or
run fewer transactions.
If you are sure you don't have too many concurrent
distributed transactions, this indicates an internal
error and support should be notified.
Instance shutdown/restart would be a workaround.
When the error is generated at the remote database it is
accompanied with an ORA-2063. In this case the parameter
distributed_transactions must be increased at the remote
database.
If there is no ORA-2063 the parameter distributed_transactions
must be increased at the local database. -
ORA-02020 too many database links
Hello,
I'm getting the ORA-02020 too many database links error in my Apex application. This error occurs when I run an interactive report in a page. There are 21 pages and 7 database links in the application. Each page has one interactive report that references one database link in the region source.
The database links are referenced in each page as follows: database link1 (page 1); database link2 (pages 2 and 3); database link3 (pages 4-7), database link4 (pages 8-15); database link5 (pages 16-18); database link6 (pages 19); and database link7 (pages 20-21). Each database link is referenced to separate schemas in one remote Oracle database.
I tried to eliminate the error by setting the open_links and open_links_per_instance parameters in the init.ora file of the remote and XE databases to 100 then restarted the both databases. This solution did not work. I created separate Application Processes from the Shared Components to close each database link by implementing the following:
Click on Shared Components> Logic > Application Processes > Create >
Name: CLOSE_LINK1
Sequence: 1
Point: On Load: Before Header (page template header)
Type: PL/SQL Anonymous Block
Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
Error Message: Database Link Error
When I run the application now, the ORA-02081: database link is not open error appears.
Please help anyone! I know someone has experienced these same errors.
Thanks,
Ms. HJoel,
Thank you for your quick response. For clarification purposes, could you provide samples for 1) issuing the CLOSE DATABASE LINK and catching the exception; and 2) querying from V$DBLINK prior to issuing the CLOSE DATABASE LINK from the Shared Components > Logic > Application Processes?
Lets assume the following query with a database link in the region source is referenced for Page 1.
Page 1 - Employee Listing
Region Source:
select ename, job, hiredate
from scott.emp@link1
Lets assume the following Application Processes from the Shared Components is referenced to close the database link:
Click on Shared Components> Logic > Application Processes > Create >
Name: CLOSE_LINK1
Sequence: 1
Point: On Load: Before Header (page template header)
Type: PL/SQL Anonymous Block
Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
Error Message: Database Link Error
My thoughts are to do the following:
1. Log in SQL*Plus as SYS
SQL> grant select to v_$dblink to scott;
2. In Apex, goto Shared Components> Logic > Application Processes and add the following queries in the Process Text:
Name: CLOSE_LINK1
Sequence: 1
Process Text:
select db_link from v$dblink;
execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
3. Catch the exception???
Your assistance is greatly appreciated. :8}
Ms. H -
ORA-00939: too many arguments for function using Timezones in xquery
Running on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
CREATE TABLE "ORT"."SAMPLE"
( "THEDATE" DATE,
"THETIMESTAMP" TIMESTAMP (6),
"STARTTIMESTAMP" TIMESTAMP (6) WITH LOCAL TIME ZONE,
"ENDTIMESTAMP" TIMESTAMP (6) WITH LOCAL TIME ZONE
REM INSERTING into SAMPLE
SET DEFINE OFF;
Insert into SAMPLE (THEDATE,THETIMESTAMP,STARTTIMESTAMP,ENDTIMESTAMP) values (to_date('13-06-10 14:07:52','RR-MM-DD HH24:MI:SS'),to_timestamp('13-06-19 14:27:52.000000000','RR-MM-DD HH24:MI:SS.FF'),to_timestamp('13-06-19 10:34:04.586000000','RR-MM-DD HH24:MI:SS.FF'),to_timestamp('13-06-19 15:05:38.805000000','RR-MM-DD HH24:MI:SS.FF'));
following query raises ora-00939
SELECT XMLQUERY('for $v in fn:collection("oradb:/ORT/SAMPLE")
let $date1 := $v/ROW/STARTTIMESTAMP/text()
let $date2 := $v/ROW/ENDTIMESTAMP/text()
return if ($date1 < $date2) then (concat($date1," date is less than ", $date2)) else (concat($date1," date is greater than ", $date2)) ' returning content) from dual;
ORA-00939: too many arguments for function
00939. 00000 - "too many arguments for function"
*Cause:
*Action:
any ideas?Hi Odie,
Not too familiar with XQuery rewrite, but i suspect by providing this hint, Oracle cannot optimize the query whatsoever.... tried this hint in my actual query and basically hangs.... I will attempt at opening an SR with Oracle...
the other option i'm looking at is checking the date ranges outside of xquery, and using a mix of xmltable, xmlexists and the SQL XML functions to reconstruct my xml. -
PL/SQL: ORA-00913: too many values
I don't find out why i'mg getting an "ORA-00913: too many values" Error
This Example works fine:
DECLARE
TYPE session_type IS TABLE OF v$session%ROWTYPE ;
blocking_sessions session_type;
BEGIN
select * bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
But in this Example i'm getting an ORA-00913. Can anybody tell me what i'm doing wrong?
DECLARE
TYPE session_type IS TABLE OF v$session%ROWTYPE ;
blocking_sessions session_type;
BEGIN
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
ERROR at line 7:
ORA-06550: line 7, column 70:
PL/SQL: ORA-00913: too many values
ORA-06550: line 7, column 1:
PL/SQL: SQL Statement ignoredOK this one works also:
DECLARE
TYPE session_type IS TABLE OF NUMBER ;
blocking_sessions session_type;
BEGIN
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
But when i'm selecting for about 20 columns of a table with 30 columns. Do I have to declare every single column? -
hi
I am getting the following error while calling the procedure in the batch process
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-29270: too many open HTTP requests
Could you please help me on this? As this is getting affected in the live databases.
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-29270: too many open HTTP requests
CREATE OR REPLACE PROCEDURE Send_To_Spg(
PTRANSACTION_ID IN VARCHAR2,
PCHANNEL_TYPE IN VARCHAR2 DEFAULT NULL,
PCSS_ORDER_NUMBER IN VARCHAR2 DEFAULT NULL,
PTELEPHONE_NUMBER IN VARCHAR2 DEFAULT NULL,
PSCENARIO_TYPE IN VARCHAR2 DEFAULT NULL,
PCUSTOMER_REQUIRED_DATE IN VARCHAR2 DEFAULT NULL,
PCUSTOMER_REQUIRED_TIME IN VARCHAR2 DEFAULT NULL,
PCANCELLATION_REASON IN VARCHAR2 DEFAULT NULL,
PCANCELLATION_NOTES IN VARCHAR2 DEFAULT NULL,
PSMPF_RETENTION IN VARCHAR2 DEFAULT NULL,
PEMERGENCY_WINBACK IN VARCHAR2 DEFAULT NULL,
PCSS_PROJECT_ID IN VARCHAR2 DEFAULT NULL,
PCSS_ORDER_NOTES IN VARCHAR2 DEFAULT NULL,
PREASON_FOR_CESSATION IN VARCHAR2 DEFAULT NULL,
P_RESPONSE OUT VARCHAR2,
PSMART_USER_ID IN VARCHAR2 DEFAULT NULL,
PORACLE_ERROR OUT VARCHAR2,
PORACLE_ERROR_MESSAGE OUT VARCHAR2,
PRESPONSE_TIME OUT NUMBER,
PDATA_TRANSFER_STATUS OUT VARCHAR2)
IS
v_scenario_type VARCHAR2(20); -- Varialble to Hold Time Out of every request to SPG
v_transaction_time NUMBER; -- Total time in which Request to SPG was processed
v_record_inserted_at DATE; -- Date/Time about the record insertion to the Error Handler
v_start_time NUMBER; -- Variable to hold Start Time for calculationg Transaction Time
v_url VARCHAR2(32767);-- URL to use when sending data to SPG
vtransaction_id VARCHAR2(18); -- Variable to hold Transaction ID for the request
v_buffer VARCHAR2(32760);-- Variable to read response from the SPG interface
v_timeout PLS_INTEGER; -- Time Out for each Transaction
v_oracle_err_msg VARCHAR2(600); -- Variable to hold Oracle Error Message
v_resp UTL_HTTP.RESP; -- Response Object
v_req UTL_HTTP.REQ; -- Request Object
v_userid_pwd SMT_ORACLE_PARAMETERS%ROWTYPE; --Variable declared to contain User ID & Password
vl_RetCode VARCHAR2(5000);
vl_std_returnCode VARCHAR2(3000);
--PDATA_TRANSFER_STATUS Holds the Data Transfer Status which can have possible values as
-- N => Data Has not been sent to SPG
-- Y => Received Successful response from SPG
-- F => On the First try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
-- S => On the Second try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
-- T => Data Has been transferred to the Error Log Table
-- X => Data need not be transfered to Error Log Table.
--Location of the timeout, URL & User Id & Password in Standing Data.
c_url_stopwlr SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_WLR';-- Stop WLR URL
c_url_cancelown SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OWN';-- Cancel own URL
c_url_cancelother SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OTH';-- Cancel other URL
c_url_amendcrd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_CRD';--Amend CRD URL
c_spg_useridpwd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPGIDPWD'; --Contains user id and pwd
ctimeout smt_parameters.parameter_code%TYPE:='SPGTO'; --This holds the timeout parameter
BEGIN
--In case the calling batch process can pass this value this SQL read will not be required & can be deleted
--Read data transfer status for the transaction Id
SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS FROM SPG_INTERFACE_TABLE
WHERE transaction_id = PTRANSACTION_ID;
--Record the start time
v_start_time:=DBMS_UTILITY.GET_TIME;
--If Data transfer status is S then send the record to error handler
IF PDATA_TRANSFER_STATUS = 'S' THEN
Error_Handler(PTRANSACTION_ID,PSMART_USER_ID,PORACLE_ERROR,PORACLE_ERROR_MESSAGE,v_record_inserted_at,PDATA_TRANSFER_STATUS);
ELSE
--In case Data Tranfer Status is something other than S then send the request to SPG
--Initialise other variables which will be populated during the journey
P_RESPONSE := '';
PORACLE_ERROR := NULL;
PORACLE_ERROR_MESSAGE := NULL;
PRESPONSE_TIME := 0;
--Read timeout parameter from standing data.
BEGIN
SELECT VALUE INTO v_timeout FROM smt_parameters WHERE parameter_code=ctimeout;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_timeout:=30;
WHEN OTHERS THEN
v_timeout:=30;
END;
-- Construct the URL for Stop WLR Scenario
IF PSCENARIO_TYPE = 'STOP_WLR' THEN
BEGIN
-- Read the Initial URL from Standing Data
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_stopwlr
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL depending on the parameters to be passed to the url
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' || Smart_Urlencode('xmloverhttp') || '&';
v_url := v_url || 'p_channel_type=' || Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' || Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' || Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_crd=' || Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
v_url := v_url || 'p_take_over_time=' || Smart_Urlencode(PCUSTOMER_REQUIRED_TIME)|| '&';
v_url := v_url || 'p_retainsmpf=' || Smart_Urlencode(PSMPF_RETENTION)|| '&';
--v_url := v_url || 'p_emergency_winback=' || Smart_Urlencode(PEMERGENCY_WINBACK)|| '&';
v_url := v_url || 'p_projectno=' || Smart_Urlencode(PCSS_PROJECT_ID)|| '&';
v_url := v_url || 'p_ordernotes=' || Smart_Urlencode(PCSS_ORDER_NOTES)|| '&';
v_url := v_url || 'p_reason_cessation=' || Smart_Urlencode(PREASON_FOR_CESSATION);
ELSIF PSCENARIO_TYPE='CANCEL_OWN' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_cancelown
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON)|| '&';
v_url:= v_url || 'p_cancel_notes=' ||Smart_Urlencode(PCANCELLATION_NOTES);
ELSIF PSCENARIO_TYPE='CANCEL_OTHER' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_cancelother
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_stop_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON);
ELSIF Pscenario_type='AMEND_CRD' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_amendcrd
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_crd=' ||Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
v_url := v_url || 'p_css_change_order_numbers='||Smart_Urlencode(PCANCELLATION_REASON);
END IF;
--this is start of setting parameters for utl http object. the show begins...
utl_http.set_transfer_timeout(v_timeout);
--Set the wallet
--XXXXX e.g.UTL_HTTP.SET_WALLET(?file:DirectoryPath?,'put password here?);
--Set proxy
--YYYYY e.g. utl_http.set_proxy(p_proxy_in, p_no_proxy_domains_in);
v_url := REPLACE(v_url,'%27%27','%27'); -- Fix to ensure Double Quotes are converted to Single Quotes
--set the required URL to utl http.
v_req := utl_http.begin_request(v_url);
--Authentication setting
--Fetch the user id and password from stnding data.
BEGIN
SELECT *
INTO v_userid_pwd
FROM SMT_ORACLE_PARAMETERS
WHERE PARAMETER_CODE=c_spg_useridpwd
AND HOST_ID = ( SELECT HOST_ID
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS B
WHERE A.HOSTNAME = B.HOSTNAME
AND A.DATABASE_ID = B.DATABASE_ID));
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
WHEN OTHERS THEN
P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
END;
--utl_http.set_authentication(v_req, p_username_in, p_password_in);
utl_http.set_authentication(v_req, v_userid_pwd.description, v_userid_pwd.VALUE);
v_resp := utl_http.get_response(v_req);
--Fill in the the response time
PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
IF v_resp.reason_phrase = 'OK' THEN
-- Fetch the response
BEGIN
LOOP
utl_http.read_line(v_resp, v_buffer);
P_RESPONSE := P_RESPONSE || v_buffer;
END LOOP;
utl_http.end_response(v_resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(v_resp);
P_RESPONSE := P_RESPONSE || v_buffer;
END;
ELSIF v_resp.reason_phrase <> 'OK' OR P_RESPONSE = '' THEN
--error handling starts
--If the HTTP Status is not OK then store the error information
PORACLE_ERROR_MESSAGE := 'Status Code: '|| v_resp.STATUS_CODE||'. Reason Phrase ' ||v_resp.reason_phrase;
P_RESPONSE := 'ORACLE_ERROR: '|| ' Reason Phrase ' || v_resp.reason_phrase;
PORACLE_ERROR := v_resp.STATUS_CODE;
END IF;
--In case we got successful response from SPG
IF P_RESPONSE LIKE '%<RetCde>0</RetCde>%' THEN
PDATA_TRANSFER_STATUS := 'Y';
ELSE
BEGIN
SELECT message
INTO vl_std_returnCode
FROM SMT_MESSAGES
WHERE MESSAGE_CODE='SPGANTIDTS';
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '-12545,-29273,-1,401,';
WHEN OTHERS THEN
vl_std_returnCode := '-12545,-29273,-1,401,';
END;
--In case there was an error do not update Data Transfer Status
IF PORACLE_ERROR <> NULL AND INSTR(vl_std_returnCode, PORACLE_ERROR || ',', 1, 1) <> 0 THEN
PDATA_TRANSFER_STATUS:=PDATA_TRANSFER_STATUS;
ELSE
vl_RetCode := SUBSTR(P_RESPONSE, INSTR(P_RESPONSE,'<RetCde>', 1, 1),
INSTR(P_RESPONSE,'</RetCde>',1,1)+9 - INSTR(P_RESPONSE,'<RetCde>', 1, 1));
BEGIN
SELECT VALUE
INTO vl_std_returnCode
FROM SMT_ORACLE_PARAMETERS
WHERE PARAMETER_CODE='SPGRCS'
AND HOST_ID = ( SELECT HOST_ID
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS B
WHERE A.HOSTNAME = B.HOSTNAME
AND A.DATABASE_ID = B.DATABASE_ID));
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
WHEN OTHERS THEN
vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
END;
IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
--needs not to re attempted.
PDATA_TRANSFER_STATUS:='X';
ELSE
--In case we did'nt got SUCCESSFUL response FROM SPG THEN UPDATE the Data Transfer Status so that the failed requests can be picked up BY the NEXT batch job RUN
IF PDATA_TRANSFER_STATUS='N' THEN
--initially if data transfer status was N then update it now to F
PDATA_TRANSFER_STATUS := 'F';
ELSIF PDATA_TRANSFER_STATUS='F' THEN
--initially if data transfer status was N then update it now to S
PDATA_TRANSFER_STATUS := 'S';
END IF;
END IF;
END IF;
END IF;
--Now Update all the modified Values
UPDATE SPG_INTERFACE_TABLE
SET response = P_RESPONSE,
data_transfer_status = PDATA_TRANSFER_STATUS,
oracle_error = PORACLE_ERROR,
oracle_error_message = PORACLE_ERROR_MESSAGE,
response_time = PRESPONSE_TIME
WHERE transaction_id = PTRANSACTION_ID;
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
--Handling the unhandled exception
PORACLE_ERROR := SQLCODE;
PORACLE_ERROR_MESSAGE := SQLERRM;
P_RESPONSE := 'ORACLE_ERROR: '|| PORACLE_ERROR_MESSAGE;
PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS
FROM SPG_INTERFACE_TABLE
WHERE transaction_id=PTRANSACTION_ID;
--New functionality to update the oracle error and oracle error message and not the Data Transfer Status
BEGIN
SELECT message
INTO vl_std_returnCode
FROM SMT_MESSAGES
WHERE MESSAGE_CODE='SPGANTIDTS';
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '-12545,-29273,-1,';
WHEN OTHERS THEN
vl_std_returnCode := '-12545,-29273,-1,';
END;
vl_RetCode := PORACLE_ERROR || ',';
IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
--If the error is found in above maintained standing data do not change the Data Transfer Status
pdata_transfer_status:=pdata_transfer_status;
ELSE
IF pdata_transfer_status='N' THEN
PDATA_TRANSFER_STATUS := 'F';
DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
ELSIF pdata_transfer_status='F' THEN
PDATA_TRANSFER_STATUS := 'S';
DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
ELSE
DBMS_OUTPUT.PUT_LINE('Failure WHEN sending data TO Error LOG. Data Transfer Status IS ' || PDATA_TRANSFER_STATUS || '. TRANSACTION ID '|| PTRANSACTION_ID);
END IF;
END IF;
--Now update all the information gathered above to the table
UPDATE SPG_INTERFACE_TABLE
SET response = P_RESPONSE,
data_transfer_status = PDATA_TRANSFER_STATUS,
oracle_error = PORACLE_ERROR,
oracle_error_message = PORACLE_ERROR_MESSAGE,
response_time = PRESPONSE_TIME
WHERE transaction_id = PTRANSACTION_ID;
COMMIT;
END;
/I have fixed the problem by own.
Seems there are some while space in the endpoint url.
Fix
http_req:= utl_http.begin_request
trim(l_endpoint_url)
,'POST'
,'HTTP/1.1'
It works...
Regards
BS -
JDBC receiver error - ORA-00913: too many values
Hi all,
Facing a strange issue with proxy-jdbc issue.
Message fails with error - ORA-00913: too many values
Handling the missing fields from the source with - Empty String in the comm. Channel
Empty string handling works fine - whenever there is no value coming form souce, null is inserted into the field value on the DB.
Trying to insert the same data manually, it works fine. But gives this error END2END.
When testing END2END, if the field values are made couple of chars less in length, that works fine....fails with the actual data.....seems to be the issue with the field lenghts on the DB.
Increased all the lengths by 10 chars..still does not work.
Except the key fields of the DB table, all others are nullable.
Is there anything else, I am missing...
Note: Generally, ORA-00913: too many values comes when the number of fields and the number of values donot match in an INSERT/UPDATE statement.
regHi
When testing END2END, if the field values are made couple of chars less in length, that works fine....fails with the actual data.....seems to be the issue with the field lenghts on the DB.
Increased all the lengths by 10 chars..still does not work
Well the error you mention generally occurs when the insert statement has more fields mention than in the table .ie you are mentioning extra field .aur this error is due to the field lenght of any of the filed you had to check in the oracle itself by using the command DESCRIBE there you ll be able to see the field lenght of each and every field .
hope your problem got resolved :
Regard's
Chetan Ahuja -
UTL_MAIL --- ORA-30678: too many open connections
Hello,
I have a pl/sql package that sends out emails using UTL_MAIL pkg pointing to an Exchange server, an APEX app calls this pkg.. This package used to work fine for months but I recently noticed that some emails are not being sent as expected. The package loops through a set of action items satisfying some conditions and send emails based on that ( this number is expected to grow every day ). I checked the errors log and I found this error:
ORA-30678: too many open connections
I think this means that I have to close the connection everytime I send en email, but UTL_MAIL does NOT have a function or a proc to close connections, right ?
I don't know what causes this error to happen, but I suspect that this started happening right after we re-pointed the UTL_MAIL pkg from a Lotus Notes server to an Exchange server.
I am also seeing this error:
ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
I know where this error comes from (usually a null email id in the FROM or TO field ), but can this be causing the first error to happen ?
Please advise if you got this error before, is it a bug in oracle 10g as I read in some blog ? or is the second error happening make the Exchange server refuse SMTP connections ???
Thanks,
SamHi Sam,
seems to be a bug in UTL_MAIL if you ask me, as you are right - there is only /send/, no option to close, so I'd expect this to be done automatically.
Anyway, though UTL_MAIL is usable for basic mailing, I prefer using a custom mail implementation based on UTL_SMTP. The most important reason is that most mail servers don't work without authentication. And if you have done this once, you can reuse the function/procedure/package as simple as UTL_MAIL. The good news is, that there are several examples published that provide you with the functionality you have in UTL_MAIL at once - with the difference, that you definetly get your connection closed when you expect it to be closed.
You'll also be able to handle empty addresses. Perhaps this error actually causes UTL_MAIL to "forget" to close the connection, if this exception isn't caught before in order to close an open connection before raising it to the outside.
One example implementation for using UTL_SMTP can be found [url http://www.morganslibrary.com/reference/pkgs/utl_smtp.html]here
-Udo -
Hello all,
I have a view called V_MEDGEN_LISTRADIO but I can't run
SELECT * FROM V_MEDGEN_LISTRADIO
ORA-02020: too many database links in useThe cause is that we call in the view 5 tables over dblink and the open_links parameter is set to 4.
What is strange is that when I run this select by adding a where clause then it works!
SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;Can someone explain me ? (use of index so all tables are not called ???)
ThanksExplain plan for SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 1 | 244 | 19 (6)| 00:00:01 | | | | |
| 1 | SORT ORDER BY | | 1 | 244 | 19 (6)| 00:00:01 | | | | |
| 2 | NESTED LOOPS | | 1 | 244 | 18 (0)| 00:00:01 | | | | |
| 3 | NESTED LOOPS | | 1 | 218 | 17 (0)| 00:00:01 | | | | |
| 4 | NESTED LOOPS | | 1 | 188 | 15 (0)| 00:00:01 | | | | |
| 5 | NESTED LOOPS | | 3 | 384 | 10 (0)| 00:00:01 | | | | |
| 6 | NESTED LOOPS | | 3 | 186 | 4 (0)| 00:00:01 | | | | |
| 7 | REMOTE | SPRR | 1 | 20 | 2 (0)| 00:00:01 | | | DEV10~ | R->S |
| 8 | REMOTE | MPAT_MF | 3 | 126 | 2 (0)| 00:00:01 | | | DEV10~ | R->S |
| 9 | REMOTE | SPER_P | 1 | 66 | 2 (0)| 00:00:01 | | | ORAP_~ | R->S |
|* 10 | TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL | 1 | 60 | 3 (0)| 00:00:01 | ROWID | ROWID | | |
|* 11 | INDEX RANGE SCAN | DOSMED_MPR_IDX2 | 2 | | 1 (0)| 00:00:01 | | | | |
| 12 | REMOTE | MEP | 1 | 30 | 2 (0)| 00:00:01 | | | ORAP_~ | R->S |
| 13 | REMOTE | SSV | 1 | 26 | 1 (0)| 00:00:01 | | | ORAP_~ | R->S |
Predicate Information (identified by operation id):
10 - filter("DM"."EXAM_TYPE"='TELEM')
11 - access("DM"."MPR"="P"."SPER")
Remote SQL Information (identified by operation id):
7 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE "SPRR"=3645 (accessing 'DEV10_DBLK' )
8 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE "SPRR_MF"=3645 AND NVL("AU",:1+1)>=:2 AND
"RMPB"='PRINC' AND "DU"<=:3 (accessing 'DEV10_DBLK' )
9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE "SPER"=:1 (accessing 'ORAP_DBLK' )
12 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
13 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO
Plan hash value: 3820716840
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 7 | 1708 | 771 (1)| 00:00:10 | | | | |
| 1 | SORT ORDER BY | | 7 | 1708 | 771 (1)| 00:00:10 | | | | |
| 2 | NESTED LOOPS | | 7 | 1708 | 770 (1)| 00:00:10 | | | | |
| 3 | NESTED LOOPS | | 7 | 1568 | 763 (1)| 00:00:10 | | | | |
| 4 | NESTED LOOPS | | 7 | 1386 | 756 (1)| 00:00:10 | | | | |
| 5 | NESTED LOOPS | | 7 | 1176 | 742 (1)| 00:00:09 | | | | |
| 6 | NESTED LOOPS | | 194 | 24444 | 414 (1)| 00:00:05 | | | | |
| 7 | TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL | 194 | 11640 | 23 (0)| 00:00:01 | ROWID | ROWID | | |
|* 8 | INDEX RANGE SCAN | DOSMED_EXAM_TYPE_IDX2 | 194 | | 1 (0)| 00:00:01 | | | | |
| 9 | REMOTE | SPER_P | 1 | 66 | 2 (0)| 00:00:01 | | | ORAP_~ | R->S |
| 10 | REMOTE | MPAT_MF | 1 | 42 | 2 (0)| 00:00:01 | | | DEV10~ | R->S |
| 11 | REMOTE | MEP | 1 | 30 | 2 (0)| 00:00:01 | | | ORAP_~ | R->S |
| 12 | REMOTE | SSV | 1 | 26 | 1 (0)| 00:00:01 | | | ORAP_~ | R->S |
| 13 | REMOTE | SPRR | 1 | 20 | 1 (0)| 00:00:01 | | | DEV10~ | R->S |
Predicate Information (identified by operation id):
8 - access("DM"."EXAM_TYPE"='TELEM')
Remote SQL Information (identified by operation id):
9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE :1="SPER" (accessing 'ORAP_DBLK' )
10 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE NVL("AU",:1+1)>=:2 AND "RMPB"='PRINC' AND "DU"<=:3 AND
:4="SPAT" (accessing 'DEV10_DBLK' )
11 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
12 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )
13 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE :1="SPRR" (accessing 'DEV10_DBLK' ) -
VISACOM - Alloc Error using 488.2 USB-B Interface - too many open sessions
I have been having the following issue in my VB .NET RF-ATE application.... It usually happens when my program enters a measurement loop (I.E. searching for P1dB). It begins to solve for P1dB and performs about 15 cycles (sets power level on SigGen and takes SpecAn meas) and then crashes due to the following error :
As Logged in the Event Viewer :
VISA: May 13 09:45:22: Error=bfff003c,"VI_ERROR_ALLOC: Insufficient system resources/memory": ViTable::add - too many open sessions
As Logged in VB .NET :
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in RFATE.exe
Additional information: HRESULT = 8004003c
VI_ERROR_ALLOC
Not sure why its happening my code is pretty solid (or so I thought) and I believe it closes the VISA session properly after each R/W operation? (See attached). I call the same procedure to talk to the GPIB instruments over and over.
Is it possible that I am not freeing and disposing of resources properly? I have read a little about destructors in .NET etc. but I was under the impression that as soon as "Sub End" is executed that the resources were free'd up? But that doesn't explain why I would get a "too many open sessions" error occour if I am closing the session after I am finished?
Another odd thing to note is that I have created testplan scripts and loaded them into my application with literally hundreds of measurement commands and my program didn't crash then???
I am very new to VB and .NET (3 months) so I have a lot to learn but I can't understand why this is occouring. Any help is appreciated.
Attachments:
GPIB.txt 3 KBJust posting a followup... Turns out I found a way to make it work! (I have been fighting this for almost 3 days!).
If you look at the variable declarations of my procedure.....
Sub GPIB(ByVal Addr As Object, ByRef Data As Object, ByVal IO As String)
Dim ioMgr As Ivi.Visa.Interop.ResourceManager
Dim instrument As Ivi.Visa.Interop.FormattedIO488
Dim session As Ivi.Visa.Interop.IMessage
I use the "IMessage" interface for the variable session.
Just before the "Sub End" is executed I use the following line to close the session :
session.Close
Which it would appear doesn't close the session properly when you use the "IMessage" interface.
So I changed the line to use the "IVisaSession" interface instead :
Dim session As Ivi.Visa.Interop.IVisaSession
Now when the Close method is executed aparently it closes the session properly because my program isn't crashing at all!
I was using VISA COM 3.0 Reference object (GlobMgr.dll).
If anyone has any insight on this please do share. -
ORA-30678: too many open connections
Hi,
I executed this procedure..
CREATE OR REPLACE procedure
TRY.e_mail_message
from_name in varchar2,
to_name in varchar2,
subject in varchar2,
message in varchar2
is
l_mailhost VARCHAR2(64);
l_from VARCHAR2(64);
l_to VARCHAR2(64);
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
l_mail_conn UTL_SMTP.connection;
mesg VARCHAR2( 4000 );
BEGIN
select a.SERVER into l_mailhost from email_setting a where a.SERVER is not null;
select a.USERNAME into l_from from email_setting a where a.SERVER is not null;
l_from := from_name;
--UTL_SMTP.open_data(l_mail_conn);
dbms_output.put_line('email test ');
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: <'||l_from||'>' || crlf ||
'Subject: ' ||subject|| crlf ||
'To: '||to_name || crlf || '' || crlf ;
mesg:=mesg||message;
dbms_output.put_line(mesg);
l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
UTL_SMTP.helo(l_mail_conn, l_mailhost);
UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn, to_name);
UTL_SMTP.data(l_mail_conn, mesg);
UTL_SMTP.quit(l_mail_conn);
exception
when others then dbms_output.put_line(sqlerrm);
END;
However, email could not be sent to recipient. Below is the error message.
Sending email to subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
call email_mssg cmd 3
email test
Date: 23 June 10 15:11:50
From: <>
Subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
To: [email protected]
Please Settle Outstanding Bil for your Invoice No: CA/01062010/555. Thank you
ORA-30678: too many open connections
Below is the username I keyed in the email_setting table, with reference to the select username statement from the procedure as above.
username in email_setting => [email protected]
I also tried key in as '[email protected]' but still not working.
Could someone suggest any solution? Thanks..Mr. Saubhik,
Yes, no data passed for the From: as shown from the dbms output error message shown below:
Sending email to subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
call email_mssg cmd 3
email test
Date: 23 June 10 16:15:04
From:
Subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
To: [email protected]
Please Settle Outstanding Bil for your Invoice No: CA/01062010/555. Thank you
ORA-29279: SMTP permanent error: 501 5.1.7 Invalid address
I am clueless how to settle this. I don't want to hard code the sender's email address. Please help. Thank you. -
Insert ORA-00913: too many values -- urgent help
Hi there
Its pretty urgent, got stuck up....
To avoid the undo snapshot error, I am using this procedure to migrate the smaller chunks of huge volume of table data into new tables. This below code works well if the columns are very less. And this procedure is not working if the tables columns are morethan 30 columns and throwing the error PL/SQL: ORA-00913: too many values
CREATE OR REPLACE PROCEDURE migration AS
TYPE array_tp IS TABLE OF tranproc%ROWTYPE;
l_array array_tp;
CURSOR c IS
select * from tranproc p where trunc(date)<=trunc(sysdate)-180;
l_cnt1 NUMBER :=0;
l_cnt2 NUMBER :=0;
l_cnt3 NUMBER :=0;
BEGIN
OPEN c;
LOOP
FETCH c BULK COLLECT INTO l_array LIMIT 10000;
EXIT WHEN l_array.COUNT = 0;
l_cnt1 := c%ROWCOUNT;
FORALL i IN 1 .. l_array.COUNT
INSERT INTO TMP_Transpoc VALUES l_array(i);
l_cnt2 := l_cnt2 + SQL%rowcount;
END LOOP;
l_cnt3 := c%ROWCOUNT;
CLOSE c;
END;
16 22 PL/SQL: ORA-00913: too many values
its falling
line 16: INSERT INTO TMP_Transpoc VALUES l_array(i);
Above table i.e tranproc has around 80 columns .
i am not pl/sql expert, kindly advise how to resolve it.. i am fine with alternative approach, just i need a smaller chunk commit.Actually, Direct Path does not necessarily require NOLOGGING. If you successfully invoke Direct Path (look for LOAD AS SELECT or DIRECT LOAD INTO in the execution plan) then you are inserting into blocks above the high-water mark (HWM) and there is virtually no UNDO generated for the changes in the table segment.
However, the index maintenance (if any) will require UNDO, and it may be a lot. If this is going into a new table, then you should be able to create the index after the table is populated.
Also beware of the NOLOGGING advice. In many cases, an individual SQL statement can not disable logging. And yet, if you do bypass REDO logging, be very sure you understand the consequences for your ability to recover. -
ORA-29270: too many open HTTP requests
Hi,
We have a requirement like, we will get bulk data (2 GB) data file with different languages(Russian, chinese, Japanese, German) etc. and we need to load these data into our databse also we have to translate the same.
We are using Oracle 11g.
We had used Oracle httpuritype - And the below mentioned procedure PROCEDURE TEST.PRC_TRANS_GERMAN will call the function - trans_jef
Input parameter for PRC_TRANS_GERMAN - > To_language and from Language. and this procedure will store the translated word in the seperate table.
Input parameter for the function trans_jef - > Word to be translated , from languae, to_language. And this function will return the translated word.
The issue I am facing is when I am passing the table of around 10000 records, around 4000 rows are not getting translated. So when i try to capture the error in exception- the error is
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1819
ORA-29270: too many open HTTP requests
When I try to re execute the missed words, they were translated. But they are not getting translated in one go because of the too many http open request.
So could you please let me know how to resolve this ORA-29270 errror. I know we have to end the request and start again. But not sure how to do. Can some one help with this~!!!!
Translator
CREATE OR REPLACE FUNCTION trans_jef (v_RawText IN VARCHAR2,
v_SrcLang IN VARCHAR2,
v_DestLang IN VARCHAR2)
RETURN CLOB
IS
v_EscRawText VARCHAR2 (3000);
v_XlateUrl VARCHAR (3000);
--v_SrcLang Varchar(10) ;-- := 'de';
--v_DestLang Varchar(10) ; -- := 'en';
v_XlateResult CLOB;
l_result CLOB;
BEGIN
DBMS_OUTPUT.ENABLE (10000000);
v_EscRawText := UTL_URL.escape (v_RawText, TRUE, 'UTF-8');
v_XlateUrl :=
'http://translate.google.com/translate_a/t?client=t&text='
|| v_EscRawText
|| '&hl='
|| v_DestLang
|| '&sl='
|| v_SrcLang
|| '&tl='
|| v_DestLang
|| '&ie=UTF-8&oe=UTF-8&multires=1&oc=1&prev=btn&ssel=0&tsel=0&sc=1';
v_XlateResult := httpuritype (v_XlateUrl).getclob ();
-- dbms_output.put_line (v_XlateResult);
l_result := TRIM (BOTH '"' FROM REGEXP_SUBSTR (v_XlateResult, '"[^"]+"'));
RETURN l_result;
END;
/* Formatted on 07-09-2012 09:21:05 (QP5 v5.215.12089.38647) */
CREATE OR REPLACE PROCEDURE TEST.PRC_TRANS_GERMAN (TO_LANG1 IN VARCHAR2,
FROM_LANG1 IN VARCHAR2)
IS
P_CHINESE VARCHAR2 (3000);
FROM_LANG VARCHAR2 (3000);
FROM_LANG_CODE VARCHAR2 (3000);
TO_LANG_CODE VARCHAR2 (3000);
FROM_LANG_CODE1 VARCHAR2 (3000);
TO_LANG_CODE1 VARCHAR2 (3000);
cnt NUMBER := 1;
counter NUMBER;
CURSOR C1
IS
SELECT RAW_VAL_TXT FROM T_TRANS_VAL;
VC1 C1%ROWTYPE;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO VC1;
EXIT WHEN C1%NOTFOUND;
BEGIN
TO_LANG_CODE :=
CASE TO_LANG1
WHEN 'English' THEN 'en'
WHEN 'Chinese Simplified' THEN 'zh-CN'
WHEN 'Chinese Tradational' THEN 'zh-TW'
WHEN 'German' THEN 'de'
WHEN 'Japanese' THEN 'ja'
--other languages
END;
FROM_LANG_CODE :=
CASE FROM_LANG1
WHEN 'English' THEN 'en'
WHEN 'Chinese Simplified' THEN 'zh-CN'
WHEN 'Chinese Tradational' THEN 'zh-TW'
WHEN 'German' THEN 'de'
WHEN 'Japanese' THEN 'ja'
other languages
-- else 'auto'
END;
SELECT trans_jef (VC1.RAW_VAL_TXT, FROM_LANG_CODE, TO_LANG_CODE)
INTO P_CHINESE
FROM DUAL;
-- same translator function is used. Language used is simplied chinese.
-- We can use traditional Chinese as well ('zh-TW'), which works perfectly.
FROM_LANG_CODE1 := --decode(from_lang,'en','English','ar','Arabic', from_lang);
CASE FROM_LANG_CODE
WHEN 'en' THEN 'English'
WHEN 'zh-CN' THEN 'Chinese Simplified'
WHEN 'zh-TW' THEN 'Chinese Tradational'
WHEN 'de' THEN 'German'
WHEN 'ja' THEN 'Japanese'
--other languages
END;
TO_LANG_CODE1 := --decode(from_lang,'en','English','ar','Arabic', from_lang);
CASE TO_LANG_CODE
WHEN 'en' THEN 'English'
WHEN 'zh-CN' THEN 'Chinese Simplified'
WHEN 'zh-TW' THEN 'Chinese Tradational'
WHEN 'de' THEN 'German'
WHEN 'ja' THEN 'Japanese'
-- other languages
END;
INSERT INTO t_trans
VALUES (FROM_LANG_CODE1,
VC1.RAW_VAL_TXT,
TO_LANG_CODE1,
P_CHINESE);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
INSERT INTO excep_trans (P_WORD_EXP, UPDATE_TIME, COUNTER)
VALUES (VC1.RAW_VAL_TXT, SYSDATE, cnt);
INSERT INTO error_message
VALUES (DBMS_UTILITY.FORMAT_ERROR_STACK);
COMMIT;
END;
END LOOP;
CLOSE C1;
END;
/Edited by: 950814 on 6 Sep, 2012 11:16 PMSimply add the call to your exception hander. E.g.
EXCEPTION
WHEN OTHERS
THEN
UTL_TCP.Close_All_Connections;
INSERT INTO excep_trans (P_WORD_EXP, UPDATE_TIME, COUNTER)
VALUES (VC1.RAW_VAL_TXT, SYSDATE, cnt);
..etc..
END;Also consider using proper coding standards. There is NO modern day programming language standard that says to write (selective) reserved words in uppercase. Write in lowercase. Use camelcase and pascalcase for variable names and procedures/functions/methods. Restrict the use of uppercase to defining identifiers such as compiler macros or constants.
Do yourself a favour and read, understand and apply the basic naming standards as detailed in .Net Guidelines for Names and Code Conventions for the Java Programming Language. -
ORA-30678: too many open connections with UTL_MAIL.send
I'm have just recently started getting the ORA-30678: too many open connections error while calling the UTL_MAIL.send procedure to send emails via a pl/sql package. The call is made within a loop and there can be a significant number of calls made to this procedure. In fact, I received this error over 1400 times within the last three days. This was previously working until I made a change to the processing which now results in a larger number of emails/calls to this procedure. I don't see any documentation on how (or if) I can close the connection with UTL_MAIL.
I'm using Oracle 11g. Any insight would be much appreciated.
Thanks,
TeriLooks like a bug possibly, check out this MOS Note:
Ora-30678: Too Many Open Connections From UTL_MAIL [ID 788442.1]
The bug note says it was fixed in 11.2. Not sure which version of 11 you are running.
Edited by: Centinul on Apr 26, 2010 2:07 PM -
ORA-00913: too many values when running a Delete
Hi When I run the both the select statements inlcuding the minus it works,
but when I run the Delete statement it gives me error ORA-00913: too many values
Can someone tell me if there is anything I am missing
DELETE FROM tablename where rowid in
select rowid,
to_number(lndr_spcl_allow_int_rate_pct),
tablename.lndr_spcl_end_prin_bal_amt,
tablename.lndr_spcl_avg_dly_prin_bal_amt,
tablename.lndr_spcl_adj_avg_dly_prin_amt,
tablename.calculated_amt,
tablename.paid_amt,
tablename.reported_amt,
--tablename.processing_date_id, this date changes
tablename.date_paid_id,
tablename.lndr_spcl_allwnc_ctgry_id,
tablename.affected_period_qtr_date_id,
tablename.loan_type_id,
tablename.lndr_id,
tablename.report_fiscal_qtr_date_id,
tablename.report_qtr_date_id,
tablename.lndr_geography_id,
tablename.lndr_billing_code_id,
tablename.orig_billing_code,
tablename.orig_allowance_category,
tablename.form_id,
tablename.srvcr_id,
tablename.document_long_desc,
tablename.document_date_id,
tablename.affected_period_qtr_date_desc,
tablename.document_type
from tablename
where lndr_spcl_allow_int_rate_pct not like ('%V%')
and lndr_spcl_allow_int_rate_pct not like ('N%')
minus
select min(rowid),
to_number(lndr_spcl_allow_int_rate_pct),
tablename.lndr_spcl_end_prin_bal_amt,
tablename.lndr_spcl_avg_dly_prin_bal_amt,
tablename.lndr_spcl_adj_avg_dly_prin_amt,
tablename.calculated_amt,
tablename.paid_amt,
tablename.reported_amt,
--tablename.processing_date_id, this date changes
tablename.date_paid_id,
tablename.lndr_spcl_allwnc_ctgry_id,
tablename.affected_period_qtr_date_id,
tablename.loan_type_id,
tablename.lndr_id,
tablename.report_fiscal_qtr_date_id,
tablename.report_qtr_date_id,
tablename.lndr_geography_id,
tablename.lndr_billing_code_id,
tablename.orig_billing_code,
tablename.orig_allowance_category,
tablename.form_id,
tablename.srvcr_id,
tablename.document_long_desc,
tablename.document_date_id,
tablename.affected_period_qtr_date_desc,
tablename.document_type
from tablename
where lndr_spcl_allow_int_rate_pct not like ('%V%')
and lndr_spcl_allow_int_rate_pct not like ('N%')
group by to_number(lndr_spcl_allow_int_rate_pct),
tablename.lndr_spcl_end_prin_bal_amt,
tablename.lndr_spcl_avg_dly_prin_bal_amt,
tablename.lndr_spcl_adj_avg_dly_prin_amt,
tablename.calculated_amt,
tablename.paid_amt,
tablename.reported_amt,
--tablename.processing_date_id, this date changes
tablename.date_paid_id,
tablename.lndr_spcl_allwnc_ctgry_id,
tablename.affected_period_qtr_date_id,
tablename.loan_type_id,
tablename.lndr_id,
tablename.report_fiscal_qtr_date_id,
tablename.report_qtr_date_id,
tablename.lndr_geography_id,
tablename.lndr_billing_code_id,
tablename.orig_billing_code,
tablename.orig_allowance_category,
tablename.form_id,
tablename.srvcr_id,
tablename.document_long_desc,
tablename.document_date_id,
tablename.affected_period_qtr_date_desc,
tablename.document_type)Perhaps this should be your final query ->
DELETE FROM tablename
where rowid in (
select rowid
from tablename
where lndr_spcl_allow_int_rate_pct not like ('%V%')
and lndr_spcl_allow_int_rate_pct not like ('N%')
minus
select min(rowid)
from tablename
where lndr_spcl_allow_int_rate_pct not like ('%V%')
and lndr_spcl_allow_int_rate_pct not like ('N%')
group by to_number(lndr_spcl_allow_int_rate_pct),
tablename.lndr_spcl_end_prin_bal_amt,
tablename.lndr_spcl_avg_dly_prin_bal_amt,
tablename.lndr_spcl_adj_avg_dly_prin_amt,
tablename.calculated_amt,
tablename.paid_amt,
tablename.reported_amt,
--tablename.processing_date_id, this date changes
tablename.date_paid_id,
tablename.lndr_spcl_allwnc_ctgry_id,
tablename.affected_period_qtr_date_id,
tablename.loan_type_id,
tablename.lndr_id,
tablename.report_fiscal_qtr_date_id,
tablename.report_qtr_date_id,
tablename.lndr_geography_id,
tablename.lndr_billing_code_id,
tablename.orig_billing_code,
tablename.orig_allowance_category,
tablename.form_id,
tablename.srvcr_id,
tablename.document_long_desc,
tablename.document_date_id,
tablename.affected_period_qtr_date_desc,
tablename.document_type
);N.B.: Not Tested...
Regards.
Satyaki De.
Maybe you are looking for
-
I need help with Compressor 4 settings to convert .mp4 files to .m4v for iBooks Author
I'm a curriculum design guy with no video background. I have Compressor 4, but don't really know much about how to best use it. I'd appreciate some help with getting the right setting for my project. Screen shots of settings would be much appreciate
-
Why is the French Siri version so unaccomplished....?
and moreover, when I call the customer's service for some news or information that we as clients are entitled to have, the salesman barely understands french,obviously has no Apple culture, ( has propably never manipulated any Apple product in his li
-
Why can't I get my 122min movie on a DVD-DL
Hi everyone. I am new to FCPX, but I was a quite confortable user to iMovie. As I have to get a 122min movie on a DVD, I am obviously using dual layers. First, I tried to do it with FCPX itself, using the Share > DVD... menu. Setting it to Double lay
-
Hello, I am having problems using an dvorak keyboard layout with Xorg in Solaris 10. I added the following entries to /etc/X11/xorg.conf: <div class="pre"><pre> Section "InputDevice" Identifier "Keyboard0" Driver "keyboard" Option "XkbRules" "xorg" O
-
John Burkey ?. (lead architect of JavaFX ? )
I came across this on the "JavaFX Blog" this morning. http://blogs.sun.com/javafx/entry/going_to_ctia To quote "On the agenda we have John Burkey, lead architect for JavaFX, who will be showing off latest and greatest developments in JavaFX and Hinkm