简体   繁体   中英

select query using an invalid package reference in oracle

I have a package that contains a function which simply returns a description from a table given the product id.

now i have a procedure that has a select statement which makes the use of this function. this morning i noticed that, the package body has become invalid, and all the calls to this procedure results in running that select statement, which never completes because of invalid package reference.

I need to make changes to my package, but i cannot do so until all the processes have completed ( or rolled back).

What can i do..?

You can query active processes using the following query to obtain the sid & serial#.

SELECT ses.sid, ses.serial#, ses.username, ses.schemaname, sql.sql_text
FROM   v$session ses,
       v$sql     sql
WHERE  sql.sql_id(+) = ses.sql_id
AND    ses.type      = 'USER'
AND    ses.status    = 'ACTIVE'
AND    UPPER(sql.sql_text) LIKE '%MY_PKG.MY_FUNC%';

Then you can have a DBA terminate the sessions executing your function.

ALTER SYSTEM KILL SESSION '<sid, serial#>';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM