ORA-3113 Error in pl/sql
Hi,
I am working in oracle9i and solaris 8.If i execute a package in Pl/sql it shows error as
ora-03113 end-of-file on communication channel...
but the same package if i executed in TOAD means it's working fine ....
Please explain me...
If i execute a package in Pl/sql Do you mean in SQL*Plus (as opposed to TOAD)?
ORA-3113 is a generic error, usually meaning the client did something the server didn't like. This can often be caused by incompatibilities between the versions of the client and the database server.
Unfortunately the generic nature of teh error makes it hard for us to give you a specific answer, Is there anything in the alert log file?
Cheers, APC
Similar Messages
-
ORA 3113 error when dropping user
I have an instance of oracle 9.2 that when I drop a user I get the ORA-3113 error.
I have no other problems with this database, It can be started and stopped with out error, users can connect...etc.
I tried the following oracle solution without success
Subject: ORA-03113 While Dropping a User
Doc ID: Note:291186.1 Type: PROBLEM
Last Revision Date: 21-JUL-2005 Status: MODERATED
The information in this document applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.5
This problem can occur on any platform.
Errors
ORA-03113 "end-of-file on communication channel"
Symptoms
ORA-03113 is thrown, while dropping a User
SQL> drop user test9 cascade;
ORA-03113 end-of-file on communication channel
Cause
Corrupted password file
Check whether REMOTE_LOGIN_PASSWORDFILE is set to { SHARED | EXCLUSIVE}
Fix
-- Recreate the password file.
++ $ orapwd file=orapw<sid> password=<sys's password> entries=<max # user's>
NOTE:
-- Set the REMOTE_LOGIN_PASSWORDFILE=NONE
-- Drop the user
-- If it is successful, You are hitting this problem.Are u getting this error sometimes while connecting to DB.
If not check the trace file generated on the server at failure time.
Regards
Raman -
ORA-00604: error at recursive sql level 1ORA-01882: timezone region not fou
hello eveyone i have installed SQL developer and try to create a connexion but it shows the following error:
" : ORA-00604: error at recursive sql level 1ORA-01882: timezone region not found"
(i choosed TNS as connexion type , default as rol )
plz help
thanksHi Raccio,
Using the forum search functionality, I came across the following threads with some tips that might help you:
ORA-00604 & ORA-01804 when connecting to Oracle 11 database 11.1.0.6.0
ora-01882 "timezone region not found" with 3.0.03.97 but not with 3.0.03.45
Regards,
Gary Graham
SQL Developer Team
Edited by: gggraham on Jul 20, 2011 1:03 PM -
Ora -3113 error in the alert log
Hi ,
We are getting ORA-3113 error in the alertlog and i pasted below alert log entry.
VERSION INFORMATION:
TNS for Linux: Version 11.1.0.7.0 - Production
Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 11.1.0.7.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.1.0.7.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.1.0.7.0 - Production
Time: 27-JAN-2011 16:11:25
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNSperation timed out
ns secondary err code: 12560
nt main err code: 505
TNS-00505: Operation timed out
nt secondary err code: 110
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.100.72.127)(PORT=2844))
Thu Jan 27 16:13:55 2011
opidcl aborting process unknown ospid (18585_47319544949952) due to error ORA-3113
Thu Jan 27 16:14:03 2011
Thread 2 advanced to log sequence 2022 (LGWR switch)
Current log# 4 seq# 2022 mem# 0: +DATA/systemprod/onlinelog/group_4.269.736019283
Current log# 4 seq# 2022 mem# 1: +FLASH1/systemprod/onlinelog/group_4.262.736019285
Thu Jan 27 16:14:13 2011
opidcl aborting process unknown ospid (14096_47207734746304) due to error ORA-3113
Thu Jan 27 16:16:34 2011
Thread 2 advanced to log sequence 2023 (LGWR switch)
Current log# 8 seq# 2023 mem# 0: +DATA/systemprod/onlinelog/group_8.319.736018999
Current log# 8 seq# 2023 mem# 1: +FLASH1/systemprod/onlinelog/group_8.3138.736018999
Thu Jan 27 16:19:33 2011
Thread 2 advanced to log sequence 2024 (LGWR switch)
Current log# 3 seq# 2024 mem# 0: +DATA/systemprod/onlinelog/group_3.268.736019049
Current log# 3 seq# 2024 mem# 1: +FLASH1/systemprod/onlinelog/group_3.261.736019051
Thu Jan 27 16:22:17 2011
What could be the workaround to resove this issue
Regards
PremORA-00600/ORA-07445/ORA-03113 = Oracle bug => search on Metalink and/or call Oracle support
-
ORA-06528: Error executing PL/SQL profiler
Hai
I would like to see the outcome of package (to view the report on the package).In order to get that
I installed the below package connect as internal
sql>d:\oracle\orq81\rdbms\admin\profload.sql
In order to use dbms_profiler,after that i need to have installed profilling tables ,in order to get i ran proftab.sql ,and its created three tables are
plsql_profiler_data,plsql_profiler_units,plsql+profiler_runs
after that i ran the below procedure
create or replace procedure do_mod as
cnt number := 0;
begin
dbms_profiler.start_profiler( 'mod' );
for i in 1 .. 500000
loop
cnt := cnt + 1;
if ( mod(cnt,1000) = 0 )
then
commit;
end if;
end loop;
dbms_profiler.stop_profiler;
end;/
PL/SQL procedure successfully completed.
exec no_mod
PL/SQL procedure successfully completed.
In order to see the report on packge ,i had query the table , RUN_TOTAL_TIME IS 3.5190E+11(this is seconds)
my qusetion is
1)
Please explain me that is total amount time in seconds or minutes,i donnot understand what is 3.5190e+11
SQL> select RUNID,RUN_COMMENT,RUN_TOTAL_TIME FROM PLSQL_PROFILER_RUNS;
RUNID
RUN_COMMENT
RUN_TOTAL_TIME
1
mod
7.0975E+11
2
mod
6.9767E+11
RUNID
RUN_COMMENT
RUN_TOTAL_TIME
3
no mod
3.5190E+11
2)
I had ran the above script one of the schema ,and successfully created above procedure.When i execte,it retuns below error message
SQL> exec do_mod;
BEGIN do_mod; END;
ERROR at line 1:
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 123
ORA-06512: at "SYS.DBMS_PROFILER", line 132
ORA-06512: at "MOHAN1.DO_MOD", line 4
ORA-06512: at line 1
Any one any idea about that
Regards
mohan1) Run_total_time is the elapsed total time in nanoseconds.
A nanosecond is one billionth of a second.
It is displayed in scientific notation
where E stands for "times ten to the power of".
So, 3.5190E+11 nanoseconds
= 3.5190 * 100000000000 nanoseconds
= 351900000000 nanoseconds
= 351900000000 billionths of a second
= 351900000000 / 1000000000 seconds
= 351.9 seconds
If you want to display it in seconds, use:
SELECT runid,
run_comment,
run_total_time / 1000000000 AS seconds
FROM plsql_profiler_runs;
2) The only thing that looks wrong about your do_mod procedure
is the last line:
end;/
The / should be on the next line.
Other than that, I don't see any possible cause for
the error. -
Export meet ora-3113 error!
In my database there are two scheama t1 ,t2.
When I use the command 'export' to export the
data in 'USER' mode,one of the scheama t1 meet the oracle error ORA-3113,but the other t2 is ok!
the error occured when t1's tables are exported and would be exported its synonyms!
I will be appricated if anyone can help me!
nullORA-00600/ORA-07445/ORA-03113 = Oracle bug => search on Metalink and/or call Oracle support
-
Version 3.1 fault - ORA-06502 error when creating SQL Report Region/Page
I usually perfect my query in SQL*PLUS before I create a new report region.
Consequently, I copy the code into the region wizard to create the new page. However, since we have upgraded to Version 3.1, virtually every report I have tried to create has created the following error:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
It would appear that a maximum of 960 characters can be used to create the region/page. Perversely, once the page/region has been created, I can then edit the source and include as much code as I want (so far I've not run up against a limit)
As it's just annoying, but not stopping me doing what I wanted to do, I've not got around to mentioning this error previously, but it occurred to me that I should (so I am!)
DavidHi David,
Thank you for reporting this. Unfortunately, this was a regression introduced in Application Express 3.1. The workaround is to edit the region, as you suggested. This has been filed as Bug 6956070 and will be corrected in the forthcoming Application Express 3.1.1 patch set.
Joel -
ORA-00933 - Error in PL/SQL for Form with report.
Hello,
I am getting this error :
failed to parse SQL query:
ORA-00933: SQL command not properly ended
and my PL/SQL function body returning SQL is as follows:
Declare
q varchar2(32767);
w varchar2(4000);
v_total varchar2(10);
Begin
v_total:='TOTAL' ;
q:=' SELECT ASR_DB_CLIENT.CLIENT_NAME, ';
q:=q||' ASR_DB_OIS.ACCT_NAME, ';
q:=q||' ASR_DB_OIS.ACCT_NBR, ';
q:=q||' ASR_DB_OIS.INCEPT_DT, ';
q:=q||' asr_db_prod.MKT_CODE, ';
q:=q||' asr_db_prod.asst_clss, ';
q:=q||' ASR_DB_OIS.PROD_CODE, ';
q:=q||' ASR_DB_OIS.GROUP_CODE, ';
q:=q||' ASR_DB_PLAN.TAX_STAT, ';
q:=q||' asr_db_clnt_type.clnt_type_name, ';
q:=q||' asr_db_plan_type.plan_type_name, ';
q:=q||' ASR_DB_OIS.ACCT_type, ';
q:=q||' ASR_DB_PLAN.CNTRY_CODE, ';
q:=q||' ASR_DB_OIS.DISCRET_FLAG, ';
q:=q||' ASR_DB_OIS.ASST_BAL ';
q:=q||' FROM ASR_DB_OIS, ASR_DB_PLAN, ASR_DB_CLIENT, ASR_DB_PROD, ';
q:=q||' asr_db_plan_type, ';
q:=q||' asr_db_Clnt_type ';
q:=q||' WHERE';
q:=q||' ASR_DB_OIS.PLAN_ID = ASR_DB_PLAN.PLAN_ID and ';
q:=q||' ASR_DB_OIS.as_of_dt = ASR_DB_PLAN.as_of_dt and ';
q:=q||' ASR_DB_PLAN.CLIENT_ID = ASR_DB_CLIENT.CLIENT_ID and ';
q:=q||' ASR_DB_OIS.as_of_dt = ASR_DB_CLIENT.as_of_dt and ';
q:=q||' asr_db_ois.prod_code = asr_db_prod.prod_code and ';
q:=q||' ASR_DB_PLAN.plan_type_code = ASR_DB_PLAN_type.plan_type_code and ';
q:=q||' ASR_DB_Client.clnt_type_code = ASR_DB_clnt_type.clnt_type_code and ';
q:=q||' ASR_DB_OIS.AS_OF_DT = :p99_asofdate ';
IF :P2_ROLLUPSLEEVE = 'RU'
THEN
q :=q||' and ASR_DB_OIS.PARENT_OIS_ID is null ';
Else
q :=q||' and ASR_DB_OIS.ACCT_TYPE like "%"'||v_total||'"%" ';
q :=q||' and ASR_DB_OIS.PARENT_OIS_ID is not null ';
END IF;
return q;
end;
Why this is failing ?
Is "%"'||v_total||'"%" '; incorrect ?
P2_ROLLUPSLEEVE is a radio button.
Please advise....
Thanks,
HMAnd
Also, I get the following error when I try few other things like
q :=q||' and ASR_DB_OIS.ACCT_TYPE = '||v_total||' ';
or
q :=q||' and ASR_DB_OIS.ACCT_TYPE = "||v_total||" ';
failed to parse SQL query:
ORA-00904: "TOTAL": invalid identifier
And
ORA-06550: line 43, column 41: PLS-00103: Encountered the symbol "TOTAL" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || member SUBMULTISET_ The symbol "* was inserted before "TOTAL" to continue.
When I try
q :=q||' and ASR_DB_OIS.ACCT_TYPE = "'TOTAL'" ';
Any helpful tips will be much appreciated.
Thanks,
HM -
Unix Shell Script -- ORA-00905 error in pl/sql
Below is my unix shell script .... in which i am trying to caluclate difference between time stamps ..... i am getting a severe error when i run --- ORA-00905: missing keyword ( included it bottom of this post )
please look into this and let me know where to correct ....
much appreciated in adv
~~~~~~~~~~~~~~~~~~~~~START of Script~~~~~~~~~~~~~~~~~~~~
#!/bin/ksh
export readTime checkTime timeDiff
# Get initial Time
readTime=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select SYSTIMESTAMP from dual;
EOF
`
echo "readTime value is : $readTime"
# Get end of time
checkTime=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select SYSTIMESTAMP from dual;
EOF
`
echo "value of checkTime : $checkTime"
# calculate time diff
timeDiff=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select CAST(TO_DATE('$time2','''YYYY\/MM\/DD:HH24:MI:SS'''))-CAST(TO_DATE('$VAR1','YYYY-MM-DD:HH24:MI:SS')) from dual;
EOF
`
echo "value of timeDiff : $timeDiff"
~~~~~~~~~~~~~~~~~OUTPUT here ~~~~~~~~~~~~~~~~~~~~~~~
readTime value is :
02-DEC-05 12.07.53.779328 AM -06:00
value of checkTime :
02-DEC-05 12.07.54.013613 AM -06:00
value of timeDiff : 02-DEC-05 12.07.54.013613 AM -06:00','''YYYY\/MM\/DD:HH24:MI:SS'''))-CAST(TO_DATE('
ERROR at line 2:
ORA-00905: missing keywordYou didn't specify if you want a total time for a portion of a shell script, or the whole script in general. If you only want to know the time of the whole shell script, just reference the linux/unix built-in variable ${SECONDS}. This variable is reset for each PID.
I usually add these lines to the bottom of long running shell scripts (just before an exit code):
~~~~~~~~~~~~~~~~~~~~~~~~~
((TIME = ${SECONDS} / 60))
echo "Script ran for ${TIME} minutes. (${SECONDS} seconds total.)
~~~~~~~~~~~~~~~~~~~~~~~~~
Like I said, ${SECONDS} starts ticking from 0 when you start the script, so no need to export the variable, just reference it. The nice part is that you don't have to bother getting into sqlplus and hit the database. -
Import failing with ORA 3113 end of file on communication channel error
While doing a schema level import on oracle 9.2.0.6 enterprise edition db, i get IMP 00003 with ORA 3113 error.
The import job fails particularly at one point where it tries to create a view with around 7000 lines.
Now I tried to create this view manually by executing the sql statement and get the same error.
As an another exercise when i pick up just a few lines say first 10 or 15 of the view definition, the view gets created in no time.
So, is there any limitation with Oracle as to how many lines a view can hold or buffer space or something.
Here is the sample code:
create or replace view uix_kana_kanji_c_evw as
select 'EFBC90' as kana_kanji_char from dual
union select 'EFBC91' as kana_kanji_char from dual
union select 'EFBC92' as kana_kanji_char from dual
union select 'EFBC93' as kana_kanji_char from dual
union select 'EFBC94' as kana_kanji_char from dual
union select 'EFBC95' as kana_kanji_char from dual
union select 'EFBC96' as kana_kanji_char from dual
union select 'EFBC97' as kana_kanji_char from dual
union select 'EFBC98' as kana_kanji_char from dual
union select 'EFBC99' as kana_kanji_char from dual
union select 'EFBCA1' as kana_kanji_char from dual
union select 'EFBCA2' as kana_kanji_char from dual
union select 'EFBCA3' as kana_kanji_char from dual
union select 'EFBCA4' as kana_kanji_char from dual
union select 'EFBCA5' as kana_kanji_char from dual
union select 'EFBCA6' as kana_kanji_char from dual
union select 'EFBCA7' as kana_kanji_char from dualORA-3113 is a generic error. The bad news is there are slightly less than a million combination of OS, platform, versions and events that might cause it to happen.
The good news is there should be a message in the alert log whenever this occurs. If you're lucky there may be .TRC file as well (check udump directory as well as bdump). The contents of the file(s) should give you some guidance about what causes it to happen. If you still need help from us you'll need to post some concrete details for us to ponder.
Good luck, APC -
ORA-29516 when runing initjvm.sql on Windwos 2k
When I run initjvm.sql on oracle 8.1.7 with Windows 2000 there is some errors like:
create or replace java system;
ORA-29516: Aurora assertion failure: Assertion failure at eox.c:217
Uncaught exception Root of all Java exceptions: X0
ORA-06550: line 6, column 21:
PLS-00201: identifier 'DBA_JAVA_POLICY' must be declared
ORA-06550: line 6, column 5:
PL/SQL: SQL Statement ignored
ORA-06550: line 6, column 12:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 11, column 5:
PL/SQL: SQL Statement ignored
nullActually I have found that I get a ora-3113 error when I try to run the initjvm.sql script. I am trying to run it as SYS, however it hangs after a 20 or so statements and then after a long time, I get the ora-3113 error (i am guessing that oracle is terminating its session).
-
ORA-6571 ERROR (PACKAGE PRAGMA의 사용)
제품 : SQL*PLUS
작성날짜 : 1997-06-03
* ORA-6571 Error ( Package Pragma 의 사용 )
=============================================
SQL문 안에서 Stored function을 call하여 사용하는 경우 ORA-6571 error가
발생할 수 있습니다. 기본적으로 stored function이나 procedure, package에서의
DML 문장의 사용은 보장이 되는 기능이나, sql list에서의 stored function의
사용은 몇 가지 제약 조건을 가지고 수행이 가능합니다.
아래의 자료는 ORA-6571 error가 발생하는 원인에 대하여 기술한 자료이며,
stored function을 SQL EXPRESSION에서 사용하는 경우에 대해서만 적용이 되는
사항입니다.
Calling Stored Functions from SQL Expressions
Stored function은 data dictionary에 저장이 되는 user defined pl/sql
function을 의미하며, 하나의 database object로서 해당 database에 connect하는
application에 의해서도 reference될 수 있습니다.
Function에는 2가지 유형이 제공되고 있는데, package 형태(pl/sql package 내
에서 defined된 function)와, standalone function(독립적인 function)이 있
습니다.
pl/sql version 2.0까지는 stored function을 call하는 부분이 procedural
statement에서만 사용이 가능하였으나, pl/sql version 2.1부터는 sql 문 안에서
도 stored function을 call하여 사용이 가능하게 되었습니다.
2.1 version 이상의 pl/sql engine에서는 select 문이나 values, set, where,
start with, group by, having, order by 등과 같은 sql expression에서
function을 call하여 사용하실 수 있습니다.
즉, user-defined function을 built-in sql function(round, length,
months_between ...)과 같은 형태로 사용이 가능하도록 지원이 됩니다.
이러한 sql 문의 확장 지원은 oracle server 내에서 보다 복잡한 data에 대한
분석 작업을 용이하게 하며 data independency를 증가시킵니다.
Sql expression의 내부에서 사용이 되는 function과는 다르게 stored procedure는
statement로서만 call되며 sql expression에서 direct로 call될 수 없습니다.
Calling Syntax
stored function을 sql expression에서 call하고자 하는 경우에는 다음의 syntax
를 사용하시면 됩니다.
[schema.][package.]function[@dblink][(arg[, arg] ...)]
argument를 넘기는 경우에는 positional notation을 사용하여 작업을 수행하셔야
합니다.
Remote oracle database에 있는 standalone function gross_pay를 call하는
경우를 예로 들어보면 아래와 같이 기술할수 있습니다.
SELECT gross_pay@newyork(eenum, stime, otime) INTO pay FROM dual;
Using Default Values
Stored function gross_pay가 DEFAULT 절을 사용하여 2개의 formal parameter를
넘기는 경우의 function creation은 아래와 같이 기술됩니다.
CREATE FUNCTION gross_pay
(emp_id IN NUMBER,
st_hrs IN NUMBER DEFAULT 40,
ot_hrs IN NUMBER DEFAULT 0) RETURN
NUMBER AS
Procedural statement에서 gross_pay function을 call하는 경우에는 항상
st_hrs의 default 값을 accept할 수 있으며, 이는 named notation을 사용하기
때문에 가능합니다.
그러나, sql expression에서는 ot_hrs의 default값을 accept하지 않는다면,
st_hrs의 default값을 accept할 수 없으며, 이는 named notation을 sql
expression에서는 사용할 수 없기 때문입니다.
/* Named Notation */
IF gross_pay(eenum, ot_hrs => otime) > pay_limit THEN . . .
Meeting Basic Requirements
sql expression에서 call 할 수 있는 user-defined pl/sql function은
아래의 기본 조건을 만족하여야 합니다.
1. Stored function이여야 합니다.
pl/sql block이나 subprogram 내에 define된 function은 사용할 수 없습니다.
2. Row function이여야 하며, column (group) function이여서는 안됩니다.
이는 argument로 전체 column의 data를 사용할 수 없기 때문입니다.
3. Function의 모든 formal parameter는 반드시 IN parameter이여야 합니다.
OUT이나 IN OUT parameter는 사용될 수 없습니다.
4. Formal parameter의 datatype은 oracle server internal type (CHAR,
DATE, NUMBER)이어야 합니다.
pl/sql type(BOOLEAN, RECORD, TABLE)은 사용할 수 없습니다.
5. Return type도 반드시 oracle server internal type이여야 합니다.
아래의 stored function은 상기의 조건을 모두 만족하는 function입니다.
CREATE FUNCTION gross_pay
(emp_id IN NUMBER,
st_hrs IN NUMBER DEFAULT 40,
ot_hrs IN NUMBER DEFAULT 0) RETURN NUMBER
AS
st_rate NUMBER;
ot_rate NUMBER;
BEGIN
SELECT srate, orate INTO st_rate, ot_rate
FROM payroll
WHERE acctno = emp_id;
RETURN st_hrs * st_rate + ot_hrs * ot_rate;
END gross_pay;
Controlling Side Effects
Sql 문에서 call되는 stored function을 실행하기 위하여, oracle server는
해당 function의 purity level(function이 side effect로 부터 free한 영역)을
알고 있어야만 합니다.
Side effect는 database table이나 packaged variable에 대한 reference를
의미합니다.
Side effect는 query의 parallelization을 제한할 수 있는데, 이유는
order-dependent한 결과(indeterminate result)나 user session간에 지속적인
값을 유지(not allowed)하는 package state가 요구되는 경우가 발생하기 때문입
니다.
그러므로, 아래에 기술되는 사항은 sql expression에서 call되는 stored
function에 적용되어야 합니다.
1. Function은 database table을 modify해서는 안된다.
(insert, update, delete statement를 사용할 수 없다.)
2. Remote나 parallelized function은 packaged variable의 값을 읽거나
쓸 수(read or write) 없다.
3. Select, values, set 절에서 call되는 function만이 packaged variable의
값을 write할 수 있다.
4. Function은 앞에 기술된 rules를 어기는 또 다른 subprogram을 call할 수 없다.
마찬가지로 앞에 기술된 rule을 어기는 view를 reference할 수 없습니다.
(Oracle은 view에 대한 reference를 function call을 포함하는 stored SELECT
operation 으로 대체합니다.)
Standalone function에 대하여 oracle은 function body를 checking함으로써,
이러한 rule이 적용되도록 합니다.
그러나, package에 대해서는 packaged function body는 hidden이 되며,
package specification만이 visible하기 때문에, specification 부분에
pragma(compiler directive) RESTRICT_REFERENCES를 기술하여야 합니다.
Pragma는 pl/sql compiler에게 database table이나 packaged variable에
대하여 read/write access를 하지 않는다는 것을 기술합니다.
Function body를 compile하는 도중 pragma에 위반되는 내용이 있다면,
compilation error가 발생합니다.
Calling Packaged Functions
Sql expression에서 packaged function을 call하기 위해서는, package
specification에서 pragma RESTRICT_REFERENCES를 기술함으로써 purity level을
선언하여야 합니다.
Pragma는 function declaration 이후에 기술되어야 하는 사항이며, 주어진
function에 대하여 단지 한 pragma만이 기술될 수 있습니다.
Pragma RESTRICT_REFERENCES를 기술하는 syntax는 아래와 같습니다.
PRAGMA RESTRICT_REFERENCES
(function_name, WNDS [, WNPS] [, RNDS] [,RNPS]);
WNDS means "writes no database state" (does not modify db tables)
WNPS means "writes no package state" (does not change the values of
packaged variables)
RNDS means "reads no database state" (does not query database tables)
RNPS means "reads no package state" (does not reference the values of
packaged variables)
어떤 순서로든 기술된 argument를 passing할 수 있으며, WNDS는 반드시
pass되어야 합니다.
아래의 예는 maximum purity level을 선언한 packaged function이며,
database나 package state에 대하여 read나 write를 전혀 수행하지 않는
function입니다.
CREATE PACKAGE finance AS -- package specification
FUNCTION compound
(years IN NUMBER,
amount IN NUMBER,
rate IN NUMBER )
RETURN NUMBER;
PRAGMA RESTRICT_REFERENCES(compound, WNDS, WNPS, RNDS, RNPS);
END finance;
CREATE PACKAGE BODY finance AS -- package body
FUNCTION compound
(years IN NUMBER,
amount IN NUMBER,
rate IN NUMBER)
RETURN NUMBER IS
BEGIN
RETURN amount * POWER((rate/100) + 1, years);
END compound;
-- no pragma in package body
END finance;
이후에 pl/sql block에서 compound function을 call하는 경우에는 아래와
같이 기술될 수 있습니다.
BEGIN
SELECT finance.compound(yrs, amt, rte) -- function call
INTO interest FROM accounts WHERE acctno = acct_id;
Package는 initialization part를 가질 수 있으며, 이는 package body에는
hidden됩니다.
일반적으로 initialization part는 public variable에 대한 initialize
statement를 기술하게 되며, 아래의 예에서는 prime_rate 이라는 public
variable에 대한 예가 기술되어 있습니다.
CREATE PACKAGE loans AS
prime_rate REAL; -- public packaged variable
END loans;
CREATE PACKAGE BODY loans AS
BEGIN -- initialization part
SELECT prime INTO prime_rate FROM rates;
END loans;
Initialization code는 package가 처음 reference되는 경우에 단지 한번만
수행이 되며, 자신의 것이 아닌 database state나 package state를 read나
write를 하게 되면, side effect의 원인이 될 수 있습니다. 더 나아가
package를 reference하는 stored function은 indirect하게 side effect를
발생시킬 수 있습니다. 그러므로, pragma RESTRICT_REFERENCES를 사용하여
initialization code에 대한 purity level을 명시적으로 선언을 하거나
암시해줄 수 있어야 합니다.
Initialization code에 대한 Purity level을 선언하기 위하여, pragma를
사용하여 작업을 하실 수 있으며, function name을 package name으로
대체하여 기술하시면 됩니다.
Package specification 부분에 기술되는 pragma는 다른 user들에게도
open되어 있는 것이기 때문에, package를 reference 하는 user들은
restriction에 대한 사항을 보게 되며, 해당하는 제약 사항을 따르게 됩니다.
사용되는 syntax는 다음과 같습니다.
PRAGMA RESTRICT_REFERENCES (
package_name, WNDS [, WNPS] [, RNDS] [, RNPS]);
Argument의 의미는 앞에서 기술된 사항과 동일합니다.
아래의 예에서 보면, initialization code는 database state에 대한 read와
package state에 대한 write를 수행합니다. 그러나 WNPS를 선언할 수 있는데
이는 자기 자신의 package state만을 write하는 code이기 때문에 선언이 될
수 있습니다.
만약 public variable prime_rate이 다른 package에 포함되어 있는
것이라면, WNPS는 선언될 수 없습니다.
CREATE PACKAGE loans AS
PRAGMA RESTRICT_REFERENCES (loans, WNDS, WNPS, RNPS);
prime_rate REAL;
END loans;
CREATE PACKAGE BODY loans AS
BEGIN
SELECT prime INTO prime_rate FROM rates;
END loans;
Pragma를 인식함으로 해서 oracle은 initialization code의 purity level을
알 수 있습니다.
( pragma에 의하여 선언된 rule을 위배하여 생성될 수 없기 때문 )
Avoiding Problems
Sql expression에서 packaged function을 call하기 위해서는 pragma
RESTRICT_REFERENCES를 사용하여 function의 purity level을 선언하여야
합니다.
그러나 package가 initialization part를 가지고 있다면, pl/sql
compiler는 function에 허용되는 가장 높은 purity level을 선언하도록
허용하지 않습니다. 결과적으로 function을 remote에서 수행하거나,
parallel하게 또는 sql 절에서 사용할 수 없도록 제한됩니다.
이러한 사항은 packaged function이 package initialization code보다
purity level이 더 높은 경우에 발생하며, 기억하여야 할 것은,
package가 처음 reference되는 때에 initialization code가 실행된다는
사항입니다. 처음 reference하는 것이 function call인 경우,
initialization code에 의하여 부가적인 side effect가 발생하는
원인이 됩니다.
이러한 사항은 initialization code가 function의 purity level보다
낮은 경우에 발생하는 사항입니다.
이러한 문제를 해결하기 위해서는 package initialization code를
subprogram으로 옮겨
주어야 합니다. 이러한 방식으로 변경하는 경우에는 package가 reference
되는 중에 implicitly하게 code를 run하지 않고 explicitly하게 code를
run하게 되며, 이는 packaged function에 영향을 주지 않습니다.
Name Precedence
database column과 argument를 가지지 않는 function이 동일한 이름을
가진다면, sql문안에서 database column이 우선순위를 가지게 됩니다.
CREATE TABLE stats (rand_num NUMBER, . . .);
CREATE FUNCTION rand_num
RETURN NUMBER AS . . . .
위와 같은 상황에서 아래의 sql문을 사용하는 경우 column rand_num을
참조하게 됩니다.
SELECT rand_num INTO start_val FROM stats WHERE . . .
이 경우 stored function rand_num을 사용하기 위해서는 schema를
기술해주어야 합니다.
SELECT scott.rand_num INTO start_val FROM stats WHERE . . .
Overloading
Pl/sql에서는 packaged function에 대해서 overload를 허용합니다.
(standalone은 허용되지 않음) 다시 말하면 넘겨주는 argument가 갯수나,
순서, datatype등이 다르다면, 서로 다른 function에 대해서도 동일한
이름을 사용할 수 있습니다.
그러나 RESTRICT_REFERENCES pragma는 단지 한 function에 대해서만
적용이 되며, 가장 가까운 곳에 선언된 function에 대하여 적용이 됩니다.
아래의 예에서는 두번째 function에 pragma 선언이 적용됩니다.
CREATE PACKAGE tests AS
FUNCTION valid ( x NUMBER)
RETURN CHAR;
FUNCTION valid ( x DATE)
RETURN CHAR;
PRAGMA RESTRICT_REFERENCES (valid, WNDS);You will need to investigate/resolve these errors first before making a decision
2 . ORA-00406: COMPATIBLE parameter needs to be 11.0.0.0.0 or greater ORA-00722:
1 . ORA-00722: Feature "Virtual columns" ORA-06512: at line 31
1 . ORA-00722: Feature "Virtual columns" ORA-06512: at line 43
1 . ORA-06512: at line 31
1 . ORA-06512: at line 43 -
06528. 00000 - "Error executing PL/SQL profiler"
HI.
i am getting an error -
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 258
ORA-06512: at line 3
06528. 00000 - "Error executing PL/SQL profiler"
*Cause: An error occurred in during execution of a PL/SQL profiler
procedure.
when i try to run the following block
BEGIN
DBMS_PROFILER.START_PROFILER( sysdate,'');
DBMS_PROFILER.FLUSH_DATA;
END;
plz helpRun proftab.sql first. look st the test case. Hopefully you have installed dbms_profiler package. The first anonymous block is to test that, second block is your block which is failing.
SQL> ed
Wrote file afiedt.buf
1 declare
2 var1 binary_integer;
3 var2 binary_integer;
4 begin
5 DBMS_PROFILER.GET_VERSION(Var1,var2);
6 dbms_output.put_line('Var1 '||Var1);
7* end;
8 /
Var1 2
PL/SQL procedure successfully completed.
SQL> BEGIN
2 DBMS_PROFILER.START_PROFILER( sysdate,'');
3 DBMS_PROFILER.FLUSH_DATA;
4 END;
5 /
BEGIN
ERROR at line 1:
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 123
ORA-06512: at "SYS.DBMS_PROFILER", line 132
ORA-06512: at line 2
SQL> @C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN\proftab.sql
SQL> BEGIN
2 DBMS_PROFILER.START_PROFILER( sysdate,'');
3 DBMS_PROFILER.FLUSH_DATA;
4 END;
5 /
PL/SQL procedure successfully completed. -
Deleting application results in ORA-03113 error
I'm having trouble deleting applications from my workspace. Every time I attempt to delete an application, I get an ORA-03113 error.
It doesn't seem to matter whether or not I choose to include the Application Definition or Supporting Objects when deleting.
If I cancel and keep trying to delete the application, the db crashes. When this happens the .trc file shows multiple memory errors and the alert log shows multiple core dumps.
db version = *10.2.0.1*
apex version = *3.2*
If anyone has experience with similar issues, any suggestions would appreciated. This problem has been a real pain.
Keith Malay
www.sds-cg.comKeith,
There are quite a few hits on Metalink for this error. You may want to go there and see if you can find a patch (of which there seems to be several) or some other method of troubleshooting this problem.
Here is what Doc ID: 1020463.6 has to say in the introduction:
The ORA-3113 error is a general error reported by Oracle client tools,
which signifies that they cannot communicate with the oracle shadow
process. As it is such a general error more information must be collected
to help determine what has happened.
Than note's title is "Diagnosing ORA-3113 Errors".
Good luck,
Don. -
We have a process that executes weekly for analyzing tables with the option estimate statistics.
In only one database it occurs the error ORA-03113, end of comunication channel.
Is there solution for this problem?
Thanks
AngieThe ORA-3113 error occurs when your session lose connetion ith the database for some reason. There is no single cause for this error, or at least none I was ever able to find in several attempts to solve different problems. Your only hope is intensive problem solving. A couple of possibilites to help you get started.
If you are getting this on an analyze, the most likely reason is a corrupt data block in the datafile. This could be either at the Oracle level or at the OS level. Try to determine if it always occurs for the same object. If so, then try to analyze it manually using validate structure. If this fails then try exporting the object, re-create it and then import the data into the newly created object.
Another possibility is that some other process is doing something that analyze cannot cope with. Check if the error occurs at the same time every time. If so, check if there are other jobs running against the database at the same time. Try rescheduling the other jobs, or the analyze to see if that solves the problem. It is also possible that an OS job could cause this even if it is not using the database (We had a backup job that would occasionally eat our server. This sometimes caused Oracle connections to time out and raise 3113 when the backup job finished.).
Check any OS error logs available to see if anything shows up around the time of the 3113 error.
You should also check the Oracle alert logs, and look for trace files in udump, bdump and cdump directories.
Good Luck.
null
Maybe you are looking for
-
TS3297 How can I get new iTunes store to load on my XP?
I have tried to re-instal iTunes on my XP laptop. The software installs and loads but it simply won't connect to the Apple store. It hangs until it finally stops trying. I have no issues with internet connection. It's specific to iTunes. Help!
-
How to log in standard sap way in a jsp/servlet project
Hi expert, To log and trace in sap standard mechanism always confuse me a lot. Is there any how-to document for j2ee project? I know for wdj you can add log configuration by select 'create log configuration file' in context menu, but I can not find t
-
Hi guys, How to upload a XML file into sap? is there any function module? can anybody give me an example program for converting or uploading XML data into sap. regards, vinoth.
-
Data and Dashboard Security using ROLES Variable in OBIEE 11g
Hi all, I'm currently using OBIEE 11g. I'm wondering how to implement the security for data and dashboard in the 11g. Below is the sample of how the security matrix requirement when I use the 10g version. In 10g, we usually use GROUP (for the data fi
-
Can I load different songs from CD into Ipod Nano?
Paying 99 cents for a song . . in an ipod that can hold 1000 tunes. You'll have a 1000 dollar walkman before you know it SO, I was wondering could I load the existing CDs that I already own in the Ipod Nano library? New mac user, former windows user,