Oracle 9.2i - Log Errors in a Merge Statement
Hi all,
I want to log errors in a merge statement in way to allow the statement to finish without rollback. I see that in Oracle 10g2 it is possible with "LOG ERRORS INTO err$_dest ('MERGE') REJECT LIMIT UNLIMITED;" instruction but, apparently, it's not possible in Oracle 9.2i.
Is there another way to solve this problem?
Depending on what type of errors you expect, you may be helped by deferring your constraints: unique, foreign key and check constraints can be deferred; that means they are only enforced when you commit.
You could defer all constraints, perform the bulk insert and then instead of committing you first try to set all constraints to immediate. If this fails, there are errors. If it does not, you can commit.
To find the exact errors, you can try to switch all deferred constraints back to immediate one by one. The ones that succeed are not violated by your transaction, oinly the ones that fail to switch to immediate are not met by your transaction.
For the violated constraints, you can find the offending records by simply selecting them. For example if the check constraint states Col X + Col Y < 10000 you will find the offending records by selecting all records where not (Col X + Col Y < 10000 ). Unfortunately we have no better mechanism than this for finding the records that are in violation of the rules.
best regards
Lucas
Similar Messages
-
Indivual error recording in Merge Statement !!!!
Is it possible to record indivudual error in MERGE statement (Update / Insert).
I am unable to record those error. instead of MERGE if I update table in the cursor loop then I am able to record individual error but the process is time consuming.
Thanks in advance.
DebaHi Deba,
DML Error Logging:
SQL> create table tab1 (x number(1));
Table created.
SQL> exec dbms_errlog.create_error_log('tab1')
PL/SQL procedure successfully completed.
SQL>
SQL> merge into tab1 t
2 using (select 1 x from dual union all
3 select 112 x from dual) s
4 on (t.x = s.x)
5 when not matched
6 then insert (x) values (s.x)
7 log errors into err$_tab1 reject limit unlimited;
1 row merged.
SQL>
SQL> COL x for 9999
SQL> select * from tab1;
X
1
SQL> COL x for a4
SQL> select ora_err_number$, X from err$_tab1;
ORA_ERR_NUMBER$ X
1438 112
SQL>Regards
Peter -
Error while using Merge statement
Hi,
Can any one please look at the merge statement and help me understand the error.Thanks in advance.
MERGE /*+ APPEND */
INTO intf_lpa_master m
USING (SELECT std_district_student_id,
std_grade_code,
sub_test,
test_date,
performance_lvl_code,
test_lang_code,
v_student_id,
v_test_id,
v_lang_cd,
v_plc,
valid_test_date,
-- school_year,
-- school_id,
valid_src_stu_id,
test_code
FROM intf_lpa_master_vw
MINUS
SELECT std_district_student_id,
std_grade_code,
sub_test,
test_date,
performance_lvl_code,
test_lang_code,
v_student_id,
v_test_id,
v_lang_cd,
v_plc,
valid_test_date,
-- school_yr,
-- school_id,
valid_src_stu_id,
test_code
FROM intf_lpa_master
WHERE active_flag = 'Y') v
ON ( m.std_district_student_id = v.std_district_student_id
AND m.sub_test = v.sub_test
AND m.test_date = v.test_date)
WHEN MATCHED
THEN
UPDATE SET m.std_grade_code = v.std_grade_code,
m.performance_lvl_code = v.performance_lvl_code,
m.test_lang_code = v.test_lang_code,
m.active_flag = 'Y', -- if we are touching this record, it is to be active.
m.error_message = NULL, -- refresh these, to properly reconsider records.
m.create_date = SYSDATE,
m.record_id = intf_lpa_master_seq.NEXTVAL,
m.process_row = 'U',
m.last_update_date = SYSDATE,
m.last_update_user = 'PRE_PROCESS_LPA - UPDATE',
-- m.job_id = c_run_id ,
m.validation_step = NULL, -- refresh these, to properly reconsider records.
m.v_student_id = v.v_student_id,
m.v_test_id = v.v_test_id,
m.v_lang_cd = v.v_lang_cd,
m.v_plc = v.v_plc,
m.valid_test_date = v.valid_test_date,
-- m.school_year = v.schloo_year,
-- m.school_id = v.school_id,
m.valid_src_stu_id = v.valid_src_stu_id,
m.test_code = v.test_code
WHEN NOT MATCHED
THEN
INSERT (
m.std_district_student_id,
m.std_grade_code,
m.sub_test,
m.test_date,
m.performance_lvl_code,
m.test_lang_code,
m.active_flag,
m.error_message,
m.create_date,
m.record_id,
m.process_row,
m.last_update_date,
m.last_update_user,
-- m.job_id,
m.validation_step,
m.v_student_id,
m.v_test_id,
m.v_lang_cd,
m.v_plc,
m.valid_test_date,
-- m. school_year,
-- m. school_id,
m.valid_src_stu_id,
m.test_code)
VALUES (
v.std_district_student_id,
v.std_grade_code,
v.sub_test,
v.test_date,
v.performance_lvl_code,
v.test_lang_code,
'Y',
NULL,
SYSDATE,
intf_lpa_master_seq.NEXTVAL,
'I',
SYSDATE,
'PRE_PROCESS_LPA - INSERT',
-- c_run_id,
NULL,
v.v_student_id,
v.v_test_id,
v.v_lang_cd,
v.v_plc,
v.valid_test_date,
-- v. school_year,
-- v. school_id,
v.valid_src_stut_id,
v.test_code);
Error Message :
ORA-06553 : PLS-306:wrong number or types of arguments in call to 'V'There are a couple of thngs wrong here. In the when matched insert column list, you cannot qualify the field name with the table alias. It should be just:
insert (std_district_student_id, std_grade_code, sub_test ...)Are v_student_id, v_test_id, v_lang_cd, and v_plc really columns in the intf_lpa_master table? I am more used to seeing v_name as a variable naming convention than a column name, but I could be wrong.
John -
Can you explain this error message with MERGE statement
Here is the code that gives me headache.
I give you the description of the two tables involved and the error message I get when I run a simple MERGE statement
SQL> desc employees
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
SQL> desc emp2
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(25)
1 MERGE INTO emp2 e2
2 USING employees e
3 ON (e2.employee_id = e.employee_id)
4 WHEN MATCHED THEN
5 UPDATE SET
6 e2.employee_id = e.employee_id,
7 e2.last_name = e.last_name,
8 e2.first_name = e.first_name
9 WHEN NOT MATCHED THEN
10 INSERT VALUES
11 (e.employee_id,
12 e.last_name,
13* e.first_name)
14 /
ON (e2.employee_id = e.employee_id)
ERROR at line 3:
ORA-00904: "E2"."EMPLOYEE_ID": invalid identifier
Any responce much appreciatedHi,
Columns going to be updated should not be in 'ON clause' , try to delete the line 6 of your query. By the way, there isno sense to update e2.employee_id = e.employee_id when matched, the equality is already verified.
Nicolas. -
ORA 900 error while executing MERGE statement
Hi All,
I am using Oracle 11 Rg1.
I have a summarization process running daily where the process of execution is as follows:-
1. Data loads every 10 min into a transaction table from external dat files
2. I have a package with 13 stored procedures - each procedure has a MERGE logic to summarize data from the above table into a summarization table. Each procedure select data depending on the business requirement
3. A wrapper file is invoked by a crontab daily to execute each procedue in the above package sequentially
4. Each of the 13 procs is executed and data summarized daily into the summarization tables
From a few days, I have been getting a strange error - where 5 of the stored procs are failing with the error code and description as ORA 900 - invalid sql statement. The structure of all the 13 procs is the same. The only difference is in the MERGE logic WHERE clauses.
Due to some data loss occurence I introduced conditions the WHERE clause that take into account pl/sql variables.
I shall paste one procedure here and provide additional details as the discussion progress to avoid making this first post very lengthy.
This logic is failing with ORA 900 when invoked from the wrapper in unix as :-
exec PKG_ODS_AV_SUMMARY.SP_LOAD_ODS_AV_SUMMARY_BYSRCCD(sysdate-1,'');
create or replace PACKAGE PKG_AV_SUMMARY AS
PROCEDURE SP_LOAD_SUMMARY_BYSRCCD (pv_sum_enddate IN DATE, pv_summm_type_indicator IN VARCHAR2);
END PKG_AV_SUMMARY;
create or replace
PACKAGE BODY PKG_AV_SUMMARY AS
--Girish:07June2011 global variables
-- Declaring package variables to hold common constant values
c_status_inprogress VARCHAR2(50) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSSTATUS_INPROGRESS');
c_status_success VARCHAR2(50) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSSTATUS_SUCCESS');
c_status_failure VARCHAR2(50) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSSTATUS_FAILURE');
c_summaryType_fullLoad VARCHAR2(50) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSSUMMTYPE_FULL');
c_summaryType_incrementLoad VARCHAR2(50) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSSUMMTYPE_INCR');
c_errordesc_summparamisN VARCHAR2(100) := PKG_SUMMARY_COMMON.FN_GET_CONSTANTVALUE('SUMMARIZATION','ODSSUMMARYPARAMETERSERRORDESC_SUMMPARAMISN');
PROCEDURE SP_LOAD_SUMMARY_BYSRCCD (pv_sum_enddate IN DATE, pv_summm_type_indicator IN VARCHAR2)
AS
lv_table_name VARCHAR2(30) := 'AV_SUMMARY_BYSRCCD';
ln_count NUMBER;
lv_summarizationrequired VARCHAR2(2);
lv_summm_type_indicator VARCHAR2(5);
lv_sum_startdate DATE;
lv_sum_enddate DATE;
lv_partitioned_start_date DATE;
lv_partitioned_end_date DATE;
ln_errorcode NUMBER;
lv_errormsg VARCHAR2(200);
e_exception exception;
BEGIN
-- lv_summm_type_indicator is used as IN OUT parameter for SP_INS_SUMMARY_PARAMETERS procedure.
lv_summm_type_indicator := pv_summm_type_indicator;
PKG_SUMMARY_COMMON.SP_INS_SUMMARY_PARAMETERS(lv_table_name, pv_sum_enddate, lv_summm_type_indicator,
lv_sum_startdate, lv_sum_enddate, ln_errorcode, lv_errormsg);
--raise e_exception;
IF ( lv_errormsg IS NOT NULL or LENGTH(lv_errormsg) <> 0 ) THEN
raise e_exception;
END IF;
lv_summarizationrequired := PKG_SUMMARY_COMMON.FN_fetch_summarizationRequired(lv_table_name);
IF( lv_summarizationrequired = 'Y' ) THEN
BEGIN
IF( lv_summm_type_indicator = c_summaryType_fullLoad) THEN
PKG_SUMMARY_COMMON.SP_FETCH_PARTITION_DATE('ARTICLE_VIEWS',lv_sum_startdate,lv_sum_enddate,lv_partitioned_start_date,lv_partitioned_end_date);
ELSE
lv_partitioned_start_date := lv_sum_startdate;
lv_partitioned_end_date := lv_sum_enddate;
END IF;
MERGE INTO av_summary_bysrccd
USING
(SELECT LAST_DAY(TRUNC(to_timestamp(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))) AS SUMMARY_DATE,
os.acctnum,
ol.sourcecode AS sourcecode,
ol.sourcename AS sourcename,
count(1) cnt_articleview
FROM article_views os , master_sourcecode ol
where os.sourcecode = ol.sourcecode
AND os.acctnum IS NOT NULL
AND ol.sourcecode IS NOT NULL
AND os.requestdatetime IS NOT NULL
AND UPPER(os.success_ind) = 'S'
AND (
(lv_summm_type_indicator = c_summaryType_fullLoad
AND (get_date_timestamp(os.requestdatetime) BETWEEN lv_sum_startdate AND lv_sum_enddate
AND os.entry_CreatedDate BETWEEN lv_partitioned_start_date AND lv_partitioned_end_date
OR (lv_summm_type_indicator = c_summaryType_incrementLoad
AND os.entry_createddate BETWEEN lv_sum_startdate AND lv_sum_enddate )
group by LAST_DAY(TRUNC(to_timestamp(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))),
os.acctnum,ol.sourcecode,ol.sourcename) mrg_query
ON (av_summary_bysrccd.acctnum = mrg_query.acctnum AND
av_summary_bysrccd.summary_date=mrg_query.summary_date AND
av_summary_bysrccd.sourcecode=mrg_query.sourcecode)
WHEN NOT MATCHED THEN
INSERT (SUMMARY_date,ACCTNUM,SOURCECODE,SOURCENAME,CNT_ARTICLEVIEW,ENTRY_LASTUPDATEDDATE)
VALUES(mrg_query.summary_date,mrg_query.acctnum,mrg_query.sourcecode,mrg_query.sourcename,
mrg_query.cnt_articleview,sysdate)
WHEN MATCHED THEN
UPDATE SET ods_av_summary_bysrccd.cnt_articleview=
CASE WHEN NVL(lv_summm_type_indicator,c_summaryType_incrementLoad) = c_summaryType_fullLoad THEN mrg_query.cnt_articleview
ELSE av_summary_bysrccd.cnt_articleview+mrg_query.cnt_articleview
END,
av_summary_bysrccd.entry_lastupdateddate=sysdate;
PKG_SUMMARY_COMMON.SP_UPD_SUMMARY_PARAMETERS(lv_table_name,c_status_inprogress,c_status_success,'');
END;
ELSE
PKG_SUMMARY_COMMON.SP_UPD_SUMMARY_PARAMETERS(lv_table_name,c_status_inprogress,c_status_failure,c_errordesc_summparamisN);
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
BEGIN
ROLLBACK;
lv_errormsg := SQLERRM;
ln_errorcode := SQLCODE;
ln_count := PKG_SUMMARY_COMMON.FN_GET_COUNTOFTABLEINSUMMPARAM(lv_table_name,c_status_inprogress);
IF ( ln_count <> 0 ) THEN
PKG_SUMMARY_COMMON.SP_UPD_SUMMARY_PARAMETERS(lv_table_name,c_status_inprogress,c_status_failure,lv_errormsg);
END IF;
COMMIT;
raise_application_error(-20004,lv_errormsg);
END;
END SP_LOAD_SUMMARY_BYSRCCD;
END PKG_AV_SUMMARY;Edited by: Chaitanya on Aug 29, 2011 1:56 AM
Edited by: Chaitanya on Aug 29, 2011 2:06 AMHi Sven,
Unfortunately, requestdatetime is a varchar2 column. The source table which has this column had been created a long back and recently we have started to take care of this issue by loading data after converting it into date format.
We have managed to locate the place in the logic where the error is occuring, but not why it might be occuring. Its due to the logic:-
AND (
(lv_summm_type_indicator = c_summaryType_fullLoad
AND (get_date_timestamp(os.requestdatetime) BETWEEN lv_sum_startdate AND lv_sum_enddate
AND os.entry_CreatedDate BETWEEN lv_partitioned_start_date AND lv_partitioned_end_date
OR (lv_summm_type_indicator = c_summaryType_incrementLoad
AND os.entry_createddate BETWEEN lv_sum_startdate AND lv_sum_enddate )
)When I hardcoded the values for lv_summm_type_indicator, c_summaryType_fullLoad and c_summaryType_incrementLoad, the logic worked fine:
AND (
('INCR' = 'FULL'
AND (get_date_timestamp(os.requestdatetime) BETWEEN lv_sum_startdate AND lv_sum_enddate
AND os.entry_CreatedDate BETWEEN lv_partitioned_start_date AND lv_partitioned_end_date
OR ('INCR' = 'INCR'
AND os.entry_createddate BETWEEN lv_sum_startdate AND lv_sum_enddate )
)But, the data for the pl sql variables is coming properly as I used dbms_output statements to check. So not sure what exactly is happening. -
Is this possible with LOG ERRORS?
I have a procedure which does a bulk insert/update operation using MERGE (running on Oracle 10gR2). We want to silently log any failed inserts/updates but not rollback the entire batch no matter how many inserts fail. So I am logging the exceptions via LOG ERRORS REJECT LIMIT UNLIMITED. This works fine actually.
The one other aspect is the procedure is being called from Java and although we want any and all good data to be committed, regardless of how many rows have bad data, we still want to notify the Java front end that not all records were inserted properly. Even something such as '150 rows were not processed.' So I am wondering if there is anyway to still run the entire batch, log the errors, but still raise an error from the stored procedure.
Here is the working code:
CREATE TABLE merge_table
t_id NUMBER(9,0),
t_desc VARCHAR2(100) NOT NULL
CREATE OR REPLACE TYPE merge_type IS OBJECT
type_id NUMBER(9,0),
type_desc VARCHAR2(100)
CREATE OR REPLACE TYPE merge_list IS TABLE OF merge_type;
-- Create Error Log.
BEGIN
DBMS_ERRLOG.CREATE_ERROR_LOG(
dml_table_name => 'MERGE_TABLE',
err_log_table_name => 'MERGE_TABLE_ERROR_LOG',
END;
CREATE OR REPLACE PROCEDURE my_merge_proc_bulk(p_records IN merge_list)
AS
BEGIN
MERGE INTO merge_table MT
USING
SELECT
type_id,
type_desc
FROM TABLE(p_records)
) R
ON
MT.t_id = R.type_id
WHEN MATCHED THEN UPDATE
SET
MT.t_desc = R.type_desc
WHEN NOT MATCHED THEN INSERT
MT.t_id,
MT.t_desc
VALUES
R.type_id,
R.type_desc
LOG ERRORS INTO MERGE_TABLE_ERROR_LOG ('MERGE') REJECT LIMIT UNLIMITED;
COMMIT;
END;
-- test script to execute procedure
DECLARE
l_list merge_list := merge_list();
l_size NUMBER;
l_start_time NUMBER;
l_end_time NUMBER;
BEGIN
l_size := 10000;
DBMS_OUTPUT.PUT_LINE('Row size: ' || l_size || CHR(10));
l_list.EXTEND(l_size);
-- Create some test data.
FOR i IN 1 .. l_size
LOOP
l_list(i) := merge_type(i,'desc ' || TO_CHAR(i));
END LOOP;
EXECUTE IMMEDIATE 'TRUNCATE TABLE MERGE_TABLE';
EXECUTE IMMEDIATE 'TRUNCATE TABLE MERGE_TABLE_ERROR_LOG';
-- Modify some records to simulate bad data/nulls not allowed for desc field
l_list(10).type_desc := NULL;
l_list(11).type_desc := NULL;
l_list(12).type_desc := NULL;
l_list(13).type_desc := NULL;
l_list(14).type_desc := NULL;
l_start_time := DBMS_UTILITY.GET_TIME;
my_merge_proc_bulk(p_records => l_list);
l_end_time := DBMS_UTILITY.GET_TIME;
DBMS_OUTPUT.PUT_LINE('Bulk time: ' || TO_CHAR((l_end_time - l_start_time)/100) || ' sec. ' || CHR(10));
END;
/I tried this at the end of the procedure, but it does not work, probably because I am not using SAVE EXCEPTIONS:
IF (SQL%BULK_EXCEPTIONS.COUNT > 0) THEN
RAISE_APPLICATION_ERROR(-20105, SQL%BULK_EXCEPTIONS.COUNT || ' rows failed for the batch.' );
END IF;Also the one thing we would like to have is the datetime logged for each failure in the ERROR_LOG table. We may be running several different batches over night. Is this possible to manipulate the table to add this?
Name Null? Type
ORA_ERR_NUMBER$ NUMBER
ORA_ERR_MESG$ VARCHAR2(2000)
ORA_ERR_ROWID$ ROWID
ORA_ERR_OPTYP$ VARCHAR2(2)
ORA_ERR_TAG$ VARCHAR2(2000)
CHANNEL_ID VARCHAR2(4000)
CHANNEL_DESC VARCHAR2(4000)
CHANNEL_CLASS VARCHAR2(4000)Edited by: donovan7800 on Feb 16, 2012 1:14 PM
Edited by: donovan7800 on Feb 16, 2012 1:17 PMAh yes I remember. The guy needing the TABLE(p_records).
Re: Merge possible from nested table?
>
I tried this at the end of the procedure, but it does not work, probably because I am not using SAVE EXCEPTIONS:
IF (SQL%BULK_EXCEPTIONS.COUNT > 0) THEN
RAISE_APPLICATION_ERROR(-20105, SQL%BULK_EXCEPTIONS.COUNT || ' rows failed for the batch.' );
END IF;
>
Correct - you need to use SAVE EXCEPTIONS.
I know there is the FORALL command, but I figured there was a way to do this with MERGE since the procedure does an update if a match is found instead
But you can use MERGE with FORALL and add the SAVE EXCEPTIONS to handle your problem.
I still have a question as to what the source of the PL/SQL table provided by the parameter Is this table being prepared in another PL/SQL procedure, in Java, or how? Are you confident that the number of rows in the table will be small enough to avoid a memory issue?
If in PL/SQL you could pass a ref cursor and then in this proc use a LOOP with a 'BULK COLLECT into' with a LIMIT clause to do the processing. -
S7 Event Log Error...SYNCERR_FILE_NOT_OPEN
I keep getting an error after hotsync that reads:
Failed to backup 1 file
-S7 Event Log
--Protocol Error: Handheld file could not be opened (4004)
---SYNCERR_FILE_NOT_OPEN
I was instructed by Palm Chat help to download the Fix PM Trace file onto my palm and told that would fix my issue. Unfortunatley it has not, the same error still exists. I have looked at others who have posted about an S7 Event Log error, and all instruction states is to download FileZ, which I have already on my Palm and to uncheck in Attributes the box that says backup. I go into FileZ,click on Internal, click on S7 Event Log, click on attrs, uncheck the backup box, click save, and then I get another error which states: Error: dm: Cant Open in updateFile() i (S7 Event Log), and then the only option I am given is to hit ok. Are there any other options that I am able to try regarding this error?I see that almost 1000 people have viewed this person's posting, but there are no solutions listed! Obviously, a lot of us are having this annoying problem. Help!
-
Converting MERGE Statements into Mappings
Hello All,
I am an Oracle DBA. New to Oracle Warehouse Builder.
Now working in Oracle Warehouse Builder 10G R2.
We have merge statements which needs to be converted into Oracle Warehouse Builder Mappings.
I created mappings and process flows and deployed the same.
When i start the process flow it inserted say 150 records to the target table. But when i start the process flow again the number of records becames double.
How can i use the functionality of merge statement in this case.
Thanks,
Salih KMHi,
When you click on the target table, on the left side panel you will have the option to choose whether to use one of the available constraints on the target table to match on while merging.
If you do not hav any constraint defined, then choose "No Constraints". Then you have to click on each of the attribute you need to match on, and then from the left panel, select Yes for "Match while updating".
That should do it.
HTH
Mahesh -
Error logging in merge statement
how to handle error logging in merge statement??
thanks in advance!!!Welcome to the forum!
Whenever you post please provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
>
how to handle error logging in merge statement??
>
Do it the way the documentation tells you to.
See the error_logging_clause of the MERGE statement in the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
It contains an example of using error logging with MERGE
>
error_logging_clause
The error_logging_clause has the same behavior in a MERGE statement as in an INSERT statement. Refer to the INSERT statement error_logging_clause for more information.
See Also:
"Inserting Into a Table with Error Logging: Example" -
ORACLE LOG ERRORS - Bug in oracle??
Hi,
we are using oracle log errors to capture oversized err records for varchar2 type fields. Sql is something like:
INSERT INTO abc (col1,col2) VALUES ('asdsass','weqwewqee') LOG ERRORS INTO abc_err('1') REJECT LIMIT UNLIMITED;
But, data captured in abc table is trimmed data. Right spaces present in source are being trimmed by oracle while capturing this error table. I have the following queries:
-Has anyone else experienced this type of behavior?
-Is it a bug in oracle log errors functionallity??
-Is there any workaround to use oracle log errors functionality to catch untrimmed data?
thanks,
Edited by: user7036480 on Dec 11, 2008 4:22 PMuser7036480 wrote:
-Has anyone else experienced this type of behavior? Yes, described in that issue while "log errors into g_logtest_err(1) reject limit 1" (is it you?)
-Is it a bug in oracle log errors functionallity?? Raise a SR to know.
-Is there any workaround to use oracle log errors functionality to catch untrimmed data?No.
Nicolas. -
Logging into Oracle Apps R12 throws error - unable to authenticate session
Hi All,
Working on R12 OS:AIX
Logging into Oracle Apps R12 throws error - "unable to authenticate session".
Earlier Guest user was end-dated which has now been removed and autoconfig was run.but still the same issue..(services were bounced too)
Guest user password is:ORACLE(uppercase) in xml file,dbc file,GUEST profile options..
could anyone please share such an experience encountered before and suggest resolution...
Would appreciate an early response!
Thanks for your time!
Regards,Pl see ML Note 342332.1 on steps needed to troubleshooot login. Although this doc is for 11i, it should also apply to R12
Srini Chavali -
Hi,
I installed weblogic 12.1.2.0.0 with RHEL5.6. After the installation, I tried to post the following class path in setDomainEnv.sh file under the domain home directory,
POST_CLASSPATH="/prosun/jasper/jasperreports-3.6.0.jar:/prosun/jasper/commons-digester-1.7.jar:/prosun/jasper/log4j-1.2.15.jar:/prosun/jasper/org.apache.commons.beanutils_1.6.jar:/prosun/jasper/org.apache.commons.collections_3.1.jar:/prosun/jasper/org.apache.commons.logging_1.0.4.jar:/prosun/jasper/iText-2.1.0.jar:/prosun/jasper/groovy-all-1.5.5.jar"
While i am trying to start the Admin server, the server didn't started and following exception is reported in nohup.out file. Please help me to resolve this issue.
The above library jars are required for our applications.
Could not load Logmanager "oracle.core.ojdl.logging.ODLLogManager"
java.lang.ClassNotFoundException: oracle.core.ojdl.logging.ODLLogManager
java.lang.ClassNotFoundException: oracle.core.ojdl.logging.ODLLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager$1.run(LogManager.java:186)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.util.logging.LogManager.<clinit>(LogManager.java:176)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:483)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:452)
at java.util.logging.LogManager$1.run(LogManager.java:186)
at weblogic.kernel.KernelLogManager.createClientLogger(KernelLogManager.java:44)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.kernel.KernelLogManager.access$000(KernelLogManager.java:17)
at java.util.logging.LogManager.<clinit>(LogManager.java:176)
at weblogic.kernel.KernelLogManager$LoggerMaker.<clinit>(KernelLogManager.java:20)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:483)
at weblogic.kernel.KernelLogManager.getLogger(KernelLogManager.java:26)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:452)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at weblogic.kernel.KernelLogManager.createClientLogger(KernelLogManager.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at weblogic.kernel.KernelLogManager.access$000(KernelLogManager.java:17)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at weblogic.kernel.KernelLogManager$LoggerMaker.<clinit>(KernelLogManager.java:20)
at java.lang.reflect.Method.invoke(Method.java:601)
at weblogic.kernel.KernelLogManager.getLogger(KernelLogManager.java:26)
at weblogic.logging.MessageLogger.log(MessageLogger.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at weblogic.logging.MessageLogger.log(MessageLogger.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at weblogic.logging.WLMessageLogger.log(WLMessageLogger.java:52)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at weblogic.security.SecurityLogger.logDisallowingCryptoJDefaultJCEVerification(SecurityLogger.java:13444)
at java.lang.reflect.Method.invoke(Method.java:601)
at weblogic.security.utils.SecurityUtils.turnOffCryptoJDefaultJCEVerification(SecurityUtils.java:81)
at weblogic.logging.MessageLogger.log(MessageLogger.java:96)
at weblogic.Server.main(Server.java:70)at weblogic.logging.MessageLogger.log(MessageLogger.java:111)
at weblogic.logging.WLMessageLogger.log(WLMessageLogger.java:52)
Could not load Logmanager "oracle.core.ojdl.logging.ODLLogManager"
java.lang.ClassNotFoundException: oracle.core.ojdl.logging.ODLLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.util.logging.LogManager$1.run(LogManager.java:186)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:176)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:483)
at java.util.logging.Logger.getAnonymousLogger(Logger.java:452)
at weblogic.kernel.KernelLogManager.createClientLogger(KernelLogManager.java:44)
at weblogic.kernel.KernelLogManager.access$000(KernelLogManager.java:17)
at weblogic.kernel.KernelLogManager$LoggerMaker.<clinit>(KernelLogManager.java:20)
at weblogic.kernel.KernelLogManager.getLogger(KernelLogManager.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Regards,
Anand Krishnanhi, you should not do nothing with user root.
please, don't use root again for weblogic administration.
list all files with root permissions:
move to Middleware Home, example: cd /u01/app/oracle/Middleware
find . -user root
if there are files with root permissions, change it to oracle:oinstall
I saw this:
Could not load Logmanager "oracle.core.ojdl.logging.ODLLogManager"
java.lang.ClassNotFoundException: oracle.core.ojdl.logging.ODLLogManager
Please check in DOMAIN_HOME/bin/setDomainEnv.sh file if exist this:
JAVA_OPTIONS="-Djava.util.logging.manager=oracle.core.ojdl.logging.ODLLogManager ${JAVA_OPTIONS}"
export JAVA_OPTIONS
MWCONFIG_CLASSPATH=${FMWCONFIG_CLASSPATH}${CLASSPATHSEP}${COMMON_COMPONENTS_HOME}/modules/oracle.odl_11.1.1/ojdl.jar
export FMWCONFIG_CLASSPATH
if exist, replace for:
JAVA_OPTIONS="${JAVA_OPTIONS}"
export JAVA_OPTIONS
if not existe, its necesary for you to use /prosun/jasper/org.apache.commons.logging_1.0.4.jar in your classpath?. If it isn't necesary delete it, and restart the AdminServer. -
Hi all,
I am learning this new feature. I am having two tables
CREATE TABLE source_tab (col1 number, col2 varchar2(5))
CREATE TABLE taget_tab(col1 number, col2 varchar2(4))
taget_tab.col2 length is one character less compared with source_tab.col2
INSERT INTO source_tab VALUES (1,'AAA');
INSERT INTO source_tab VALUES (2,'BBB');
INSERT INTO source_tab VALUES (3,'CCCCC');
INSERT INTO source_tab VALUES (4,'ddd');
Now, I want to insert data from source table to target table. As data shows, source_tab.col1 with col1=3 will throw error, as its col2
size is more than the target table, but i want to continue with the execution and log the this value(3) in log table(logtmp) by using LOG ERRORS
feature of 10Gr2.
I have created log table like this manually
create table logtmp
ORA_ERR_NUMBER$ NUMBER ,
ORA_ERR_MESG$ VARCHAR2(2000),
ORA_ERR_ROWID$ ROWID,
ORA_ERR_OPTYP$ VARCHAR2(2),
ORA_ERR_TAG$ VARCHAR2(2000),
col1 number
Is this possible, if so, please give me the idea.
Thanks in advance.
Thanks,
PalSee the following example.
/* Table creation */
CREATE TABLE source_tab (col1 number, col2 varchar2(5));
CREATE TABLE target_tab(col1 number, col2 varchar2(4));
execute DBMS_ERRLOG.create_error_log (dml_table_name => 'TARGET_TAB', err_log_table_name => 'LOGTMP');
desc logtmp;
INSERT INTO source_tab VALUES (1,'AAA');
INSERT INTO source_tab VALUES (2,'BBB');
INSERT INTO source_tab VALUES (3,'CCCCC');
INSERT INTO source_tab VALUES (4,'ddd');
commit;
/* Insert that runs into errors */
insert into target_tab
select * from source_tab
log errors into LOGTMP reject limit unlimited;
select * from logtmp;
/* cleanup */
drop table source_tab;
drop table target_tab;
drop table logtmp;Consider to run this step by step.
And here is the relevant output from it.
desc logtmp
Name Null Typ
ORA_ERR_NUMBER$ NUMBER
ORA_ERR_MESG$ VARCHAR2(2000)
ORA_ERR_ROWID$ UROWID()
ORA_ERR_OPTYP$ VARCHAR2(2)
ORA_ERR_TAG$ VARCHAR2(2000)
COL1 VARCHAR2(4000)
COL2 VARCHAR2(4000)
ORA_ERR_NUMBER$ ORA_ERR_MESG$ COL1 COL2
12899 ORA-12899: Wert zu groß für Spalte "SCHEMA"."TARGET_TAB"."COL2" (aktuell: 5, maximal: 4) 3 CCCCCEdited by: Sven W. on Sep 27, 2012 1:32 PM -
Error in Merge statement for Oracle 10gR2
Hi,
When I use the MERGE statement to copy data across a database link (from 10gR2 to 10gR2 database), if I have both an update and insert clause it works fine, but if I omit the insert clause and have just update on its own, I get error "ORA-02064: distributed operation not supported".
Can anyone help on thisThis came up in a thread last week, the 10g versions of MERGE (without INSERT or with DELETE) did not appear to work over DB links.
-
I am getting an error while submitting the XML publisher report in Betsy N0 instance.
Issue
Log :- Beginning post-processing of request 145458120 on node BETSYN0DB1 at 22-DEC-2011 05:28:26.
Post-processing of request 145458120 failed at 22-DEC-2011 05:28:28 with the error message: One or more post-processing actions failed. Consult the OPP service log for details
Output :- Blank Report
XML file :- XML file generated without any error
Output process:-
[12/23/11 4:28:10 AM] [1213640:RT145480622] Completed post-processing actions for request 145480622.
[12/23/11 5:16:01 AM] [OPPServiceThread1] Post-processing request 145481427.
[12/23/11 5:49:30 AM] [OPPServiceThread1] Post-processing request 145481923.
[12/23/11 5:49:30 AM] [1213640:RT145481923] Executing post-processing actions for request 145481923.
[12/23/11 5:49:30 AM] [1213640:RT145481923] Starting XML Publisher post-processing action.
[12/23/11 5:49:30 AM] [1213640:RT145481923]
Template code: XXWIP_WO_VLVS
Template app: XXWIP
Language: en
Territory: US
Output type: PDF
oracle.apps.xdo.XDOException: Error creating lock file
at oracle.apps.xdo.oa.util.FontCacheManager.getFontFromDB(FontCacheManager.java:320)
at oracle.apps.xdo.oa.util.FontCacheManager.getFontFilePath(FontCacheManager.java:198)
at oracle.apps.xdo.oa.util.FontHelper.createFontProperties(FontHelper.java:432)
at oracle.apps.xdo.oa.util.ConfigHelper.getFontProperties(ConfigHelper.java:166)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5824)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
[12/23/11 5:49:31 AM] [UNEXPECTED] [1213640:RT145481923] oracle.apps.xdo.XDOException: Error creating lock file
at oracle.apps.xdo.oa.util.FontCacheManager.getFontFromDB(FontCacheManager.java:320)
at oracle.apps.xdo.oa.util.FontCacheManager.getFontFilePath(FontCacheManager.java:198)
at oracle.apps.xdo.oa.util.FontHelper.createFontProperties(FontHelper.java:432)
at oracle.apps.xdo.oa.util.ConfigHelper.getFontProperties(ConfigHelper.java:166)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5824)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
[12/23/11 5:49:31 AM] [1213640:RT145481923] Completed post-processing actions for request 145481923.The issue is fixed.
Our XML Publisher TMP is not defined, so it uses the APPLTMP used by concurrent manager. There is a folder xdofonts/<SID> in $APPLTMP. It contains the fonts used by XML publisher and on the of font file (.ttf) was 0 byte. We copied the ttf file from QA. And it started working.
Best practice is to define diffent TMP for concurrent managers and XML Publisher.
Cherrish Vaidiyan
Maybe you are looking for
-
How to fix a page in a multiple resolutiojn
Hi I am designing a page in the portal 3.0.9.8.0 for a standard resolution of 800*600. The page is divided into 3 regions (150px,325px,325px)and I publish portlets within these regions. The page is displaying perfectly, but when i change my resolutio
-
HT204023 How can i see who are those connected to my hotspot?
Sometimes my hotspot go 4-7 connections and I want to know who they are by not asking people around me. Is there any other way?
-
All I'm trying to implement Web Security Authorization using JRUN 4. When I start the server, I'm getting an error. Your help is much appreciated 06/03 15:46:24 error An exception was thrown when initializing the security filters. java.lang.NullPoint
-
o.k., here i am, trying to record a dj mix. Normaly i would use my minidisc recorder and audio cd recorder to do so. Now i want to use my mac for it. But how do you do it? I've read all the other topics about recording a dj mix but i must say, it doe
-
I'm looking for the soft LabView 5.0 for Windows 95 Is anybody could help me to get thise very usefull software ? Thanx K