Error updating CLOB in oracle : ORA-00600: [kcfrbd_2] - oracle

I get this error when I want to update clob field.If the updated text is short, there is no problem, but when I want to enter a long data, I get an error. I try to update one column with clob data but
When try to run this code block
DECLARE
large_txt CLOB;
BEGIN
large_txt:='/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCADEAZMDASIAAhEBAxEB/8QAGwAAAwEBAQEBQWWVQFllkAXKupcpELUZyULgcHWl03N96ao1xcHNhSZ2vW9NVccZE5Kp4VzXTJBulgjMEJsbt58URUfnmBwRPhqY6pkZpTTvYgp8U0yVFIt0bo3LYHbkASNUQ8g5onxZoIaAssLgFZZbfWAUQkBTAqMmWJ/fyCErTdEc1b378/rkuqn7pvIcvuuOt752XoLrpn8NvILXiGec9+u/wCyVt/Xr4rOPVjwQbEfFQODOvf6+ic58AptMlMM1Q05lbI8h69WSg7kZ3IDNkZAJHGUtuV1swqGkgXyQ0OaxkIEnhCAkgrTadM0viVtRJQHIIfl5IF0oB0IDnO9Ym83HEes0CRwshMWkoMeB8EuQi/LgiTv8ISnggBM68ErngCbb7/FLVuwxqR4Sovc+W4cI6wxFxIga96lrNuhqVKTdoosc4YnB2Aam3kvM9rCkdq2MPLAzpCX2gaEz61XouaDWp3EtJIFt2eXHhn3LyfbbXPZsbA1+M4hDs9M1qL48n21/LjaCNlaAyBMGRPBeS5du30qlB7adVmF0TC4XK72kTckKdyQqKpS7J5rt2X3VXkuKl2Su7ZfcVfWi55O2CItKk7NVdanPHyUjmpFLKCKCqMsssgBUS9rj2JKq7slc7SWODovmtRnKqMwTYQVOp7wp2kFzY0zMZrPaQ4nDiB+CJ4zWA0icPWnPw80jjBc0ExOSHWaZuCgqyp/ZFTVWiacKZY4aFItOW9Qkg2H6YU1uayI6G9kclkRkssuj6oEQssoyKKyyDkre+PHyXVS90zw5LLLV4gu7J4FRo1HPzjsMd3mfJZZZRdl8X9UJm3JnfCyyqhMgcViTI4lZZUZzixsi+ZugB+PnYBtvG6yyIaTKYiADvPkssgU5TwQORKyyow+o+aUHLvWWQHTun4pSTDotCyyAHsg6wlOcc1lkE6l7cVImAB+oXWWWazkLJxi9sJsvJ9u1HUqmyPZm3FHwWWWo1PH572jVdWrBzzeI7lwuWWWnPDiRSlZZRtSl2V3bL/y9Tv+Syy55O2CVT3A/q8lA5rLKRaVZZZVGWKyyBX9l3Jc7jJHALLLUZyGl2kXvcHG6yyvqeBjcOKowB4kgLLKVYz7MJFlIPdvWWSJR6Q8CqgCJgSsslWDCyyyjT//2Q==';
update test set resim=large_txt where ID=1;
END;
then i get an error
Error report -
ORA-00600: internal error code, arguments: [kcfrbd_2], [6], [0], [1], [19491072], [19491072], [], [], [], [], [], []
ORA-06512: at line 5
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause: This is the generic internal error number for Oracle program
exceptions. This indicates that a process has encountered an
exceptional condition.
*Action: Report as a bug - the first argument is the internal error number

ORA-00600 is a general error code for basically "An internal Oracle error occurred". This is a catch-all error code meaning something outside normal database operations happened. It's probably not a problem with your code. It is something you will have to take up with Oracle Support.
Since you said this started happening after an abnormal database shutdown, I'd say something internal is in an inconsistent state the database cannot understand, but that's just a guess.

Related

RSpec and expecting PG:RaiseException

I am trying to write the test. The database should raise the exception and I want to check, that exception is raised.
expect { save_to_db(#params)}.to raise_exception(PG::Exception)
But
RSpec::Expectations::ExpectationNotMetError: expected {:PG=>Exception} but nothing was raised
Even when I get
ERROR - 27/Feb/2020 10:52:19 PG::RaiseException: ERROR: Message ...
Any tips, please? :)
Edit:
Fix typo, now result is
RSpec::Expectations::ExpectationNotMetError: expected PG::RaiseException but nothing was raised
I tried different combinations, using raise_error and PG::Error but still unable to catch and handle.
This is first try
expect { save_to_db(#params)}.to raise_exception(PG::RaiseException)
and returns:
RSpec::Expectations::ExpectationNotMetError: expected PG::Error but nothing was raised
If I try to override our method save_to_db() and paste the post url:
expect { page.driver.post("send/?records=#{records_id}")}.to raise_exception(PG::RaiseException)
I get the same error
You have a typo in raise_exception(PG:Exception) - it must be raise_exception(PG::Exception) (note the double colon instead of single one).
As the result, it is parsed as a hash value {:PG => Exception} (:PG is a valid symbol, Exception constant is defined, so no complaints from the Ruby parser) that is passed to a raise_exception matcher. So, in fact you expect any error with the particular message (equal to the hash you provided) - and for sure actual PG::Exception's error message is different...
Try fixing this typo first - it might solve the problem.

Prolog: ERROR: Undefined procedure: getval/2 How to use getval?

I set the values of two variables in the first two lines of my code. However when I want to retrieve the values of them later using getval, I got the error ERROR: Undefined procedure: getval/2. What's wrong?

error while executing select query(ORA-00600: internal error code, arguments: [xtydty2ldi], [], [], [], [], [], [], [], [], [], [], [])

I am facing the following error while running this simple select query
select * from ERICSSON_EUTRAN.NB_EUCELLFDD_5
ORA-00600: internal error code, arguments: [xtydty2ldi], [], [], [],
[], [], [], [], [], [], [], []
If I run the same query with an additional condition, query runs fine.
The first step to resolving an ORA-600 bug is to go to support.oracle.com, search for "ora-600 tool", enter the first argument ("xtydty2ldi"), then click "Look-up Error".
In this case the website has two possible causes for this error. Read through the related documents and try the workarounds. (I'd post some of the content here but the data on the website is not meant to be shared.)
If you don't have access to that site then talk to a DBA or someone at your organization that has access. They should be able to add you easily.
Don't worry too much about solving the problem. As long as you can avoid it or work around it consider yourself lucky. Some people will tell you to always submit a service request for every ORA-0600 but that will usually just waste a lot of time.
If you receive an ORA-00600 it indicates a bug in Oracle itself, and not in your code. You should contact Oracle support.
You might be able to work around the bug by changing your query, but without knowing the exact details of the internals it is difficult to know if you have really avoided the bug or it might occur again.
You may also have a hardware problem.

Is it best practice for functions to return after raising an error in PL/SQL

I have a bunch of functions in packages that first check the validity of the work being requested and throw exceptions if not.
Example:
package body foo as
function implode (
i_foo_id number
) return implode_id as
not_implodable exception;
implode_id number;
begin
if not is_implodable(i_foo_id) then
raise not_implodable;
end if;
//Implode logic here.
return implode_id;
exception
when not_implodable then
raise_application_error(-20005, 'Imploding is not possible on this foo.');
end implode;
end foo;
I have turned on warning reporting and get something like this when I compile.
Warning(67,3): PLW-05005: subprogram IMPLODE returns without value at line 14.
If I put a return statement after the raise_application_error then the warning goes away. Since raising the error exits the call stack, is there any good reason to return null anyways?
No. It is not a best practice for functions to return after raising and error in PL/SQL.
It is possible and sometimes even recommended to add code just to shut up the compiler, like:
exception
when fooex then
raise_application_error(-20100, 'invalid number');
return null; -- silence PLW-05005
end;
Be sure to document such a peculiar code !
Generally I don't like a code that is just there to satisfy compiler warning, but there is always exceptions to this rule. In this particular case I'd say the problem is more the compiler than the code. In my opinion code like below is perfectly valid and compiler should not complain about it. In fact I think compiler should warn if a block has statements after raise as it's effectively a dead-code (unreachable code).
Let's consider the following function:
$ cat foo.sql
create or replace function foo(p_in in number)
return number is
fooex exception;
begin
if p_in < 1 then
raise fooex;
end if;
return p_in;
exception
when fooex then
raise_application_error(-20100, 'invalid number');
end;
/
show errors
Running this in Oracle 11g XE:
-- By default the warnings are disabled
SQL> #foo
Function created.
No errors.
Usually I want all warnings:
SQL> alter session set plsql_warnings = 'ENABLE:ALL';
Session altered.
SQL> #foo
SP2-0806: Function created with compilation warnings
Errors for FUNCTION FOO:
LINE/COL ERROR
-------- -----------------------------------------------------------------
1/1 PLW-05005: subprogram FOO returns without value at line 13
1/1 PLW-05018: unit FOO omitted optional AUTHID clause; default
value DEFINER used
After reviewing the code I found out the warnings above are incorrect, so I disable them for this compilation unit only:
SQL> alter session set plsql_warnings = 'ENABLE:ALL, DISABLE:(5005,5018)';
Session altered.
SQL> #foo
Function created.
No errors.
SQL>
Now all is good and great.
My recommendation is to turn on all warnings by default and then turn off wrong positives per compilation unit (alter session set plsql_warnings = 'ENABLE:ALL, DISABLE:(5005,5018)';). If possible: alter system plsql_warnings = 'ENABLE:ALL'; but in practice this might be a bit too harsh ...
And oh, it is a recommended practice to turn on all compiler error checks. We as a programmers need all the help the compilers can give to us ! Unfortunately with Oracle PL/SQL compiler this needs to be compromised.
Best practice is to always raise any exceptions that your function (or procedure, as the case may be) doesn't know how to handle.
For example, if your function queries a table, and the logic is "if no rows are found, return 0" or something, then I'd expect your function to handle the exception and return a sane value.
If your function gets an unexpected exception, e.g. VALUE_ERROR (e.g. due to bad data in the table caused by some bug in a data load procedure, or a missing constraint), that's arguably not the responsibility of the function; I'd expect your function to propagate the exception to the caller (although I might write the function to at least log the error before re-raising the exception).
This is why you should always have a RAISE; in any WHEN OTHERS exception handler.
The only time I'd make an exception to this rule is if I'm coding an API for some legacy system which can't handle exceptions, and expects an "error flag" (e.g. as an out parameter). In that case, I might use a WHEN OTHERS THEN exception handler to log the unexpected error, and return the error flag to the caller. It's not good coding style though, because it puts a lot of trust in the calling code to check the "error flag" before assuming the function did its work without error.
It doesn't matter one way or the other. Adding a return will make the whatever code validator your using happy. The statement will never get reached as raising the application error puts control in caller's exception handler if exists or execution ends.
Personally, I code according the syntax of the language and hope the validators eventually correct their mistakes.

Type Mismatch error on WAIT?

This one is making me a little crazy and I hope someone can help.
I added a wait(45) line to my QTP script and when it runs I get a type mismatch error.
I know this will occur if a function can't be called or I misspell something to be called or etc.
But, this is a simple WAIT statement. Nothing else on the line.
Line: 152
Char: 6
Error: Type mismatch: 'Wait'
Code 800A000D
Any ideas? Did I miss something? How can there be a type mismatch on Wait?
There definitely is no Wait() sub or function in VBScript; as this question indicates, this holds for QTP too.
As to the error: a missing sub/function throws a type mismatch:
>> nosuchsub
>>
Error Number: 13
Error Description: Type mismatch
(If this consoles you, I don't like it neither.)
Actual error is not in Wait function. QTP shows type mismatch error due to compilation error in previous lines. Check all your library files are properly added. Best method to find the root cause of problems like this is to divide your code into smaller functions / procedures and test each function.

Resources