SQL Plus session - "schema.package" has been invalidated on making any chng

Hi
I am in the process of testing a stored procedure. Whenever I make changes to the procedure I am executing it from the SQL Plus session. But whenever I make a change to the procedure - i have to close that particular SQL Plus session and open another one. I get the message:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-04061: existing state of has been invalidated
ORA-04061: existing state of package body
"schema.package" has been invalidated
ORA-04065: not executed, altered or dropped package body
Is there a way that I do not have to open a new SQL Plus session everytime I make change to the package?

It does not help :(. I get this problem in a SQL+ session only when I make a change in a JDev session. I have to log off the SQL+ session and log back in and it is OK again without re-compling anything. I don't have a problem with two SQL+ session. Isn't that strange?
ben

Similar Messages

  • Existing state of packages has been discarded...

    Hi all,
    I know this is a long shot and probably you need more details to help, but please take a look in case you've encountered something similar before... It is a pretty interesting problem.
    Ok, I have two packages, say, A and B. Package A is composed of utility functions, and package B makes use of those functions. These packages are compiled as part of the schema installation, where package A is always compiled first. I also have unit test scripts for each procedure in each package.
    Now, after schema installation, when I run the unit test for some procedures in package B, I get the following error:
    ORA-04068: existing state of packages has been discarded
    ORA-04065: not executed, altered or dropped stored procedure "my_schema.pkg_A"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "my_schema.pkg_B", line 18
    ORA-06512: at line 5
    Some interesting notes:
    - I can run the unit test of all pkg A procedures. I can also describe the package. Which seems to me that pkg A has been compiled successfully.
    - If I log into a sqlplus session, run the unit test for a pkg B procedure, which then fails with the above message. Then I run a unit test of a pkg A proceudre, which succeeds. Then I run the same pkg B unit test, it will work then. And all the other pkg B procedures will work from this point on.
    - But if I log out from sqlplus session, and log in again, and run the pkg B procedure unit test again, it will fail as before.
    - Certain procedures in pkg B have no problem running. They also call pkg A procedures. However, the pkg A procedures are always invoked in the where or order by clauses in these cases. The pkg B procedures that call pkg A procedure in a standalone statement will always fail.
    - The fact above made me suspect that function-based indexes (which were created using pkg A procedures) were used in cases where pkg B procedures work. And that in those cases pkg A hasn't really been invoked. However, when I monitor those indexes using v$object_usage, it shows they are not used. (I have a very small set of data.)
    - After schema installation, if I compile pkg B again, the problem will disappear.
    Does this ring a bell to anyone? Any help will be appreciated.
    Thanks,
    Gloria Chung

    Thanks for reading and responding.
    I'm compiling both header and body for both packages.
    I ran the following query after schema installation, which returned 0:
    select count(*) from user_objects where status='INVALID';
    The schema installation involved putting new copies of both package A and B.
    If I only recompile the package body after installation, it will still 'cure' the problem. I.e. if I run any of the affected pkg B unit test, it will run successfully.
    It is assumed there is no schema before 'schema installation'.
    Thanks,
    Gloria

  • Existing state of package has been discarded...

    If application is running and it uses cursors/prepared statements for procedures and functions in packages and
    new version of package is inserted into database, then an error message 'existing state of package has
    been discarded' is raised.
    However, there are packages where there is no 'existing state of package'. And for application purposes
    new version of this package should be used without this error message.
    Enhancement: There should be a pragma stating that package is 'stateless' and new version ot it is used if it
    exists without an error situation.
    This feature would be beneficial e.g. in 3-tier architecture where servers are running constantly.
    Or can this be accomplished with any other way (without parsing statement with every call ) ?

    When session references a package for the first time package is instantiated in session memory. If package is recompiled since, Oracle assumes it possibly changed and package instance in session memory is no longer valid. That's why any reference to that package made by such session will raise an error.
    Session 1:
    SQL> create or replace
      2  package pkg1
      3  is
      4  g_n number;
      5  procedure p1;
      6  end;
      7  /
    Package created.
    SQL> create or replace
      2  package body pkg1
      3  is
      4  procedure p1
      5  is
      6  begin
      7  for rc in (select * from emp) loop
      8  dbms_output.put_line(rc.empno);
      9  end loop;
    10  end;
    11  end;
    12  /
    Package body created.
    SQL> exec pkg1.p1;
    PL/SQL procedure successfully completed.
    SQL>This instantiated package PKG1 is session1. Then session 2:
    SQL> alter package pkg1 compile body;
    Package body altered.
    SQL> Back to session 1:
    SQL> exec pkg1.p1;
    BEGIN pkg1.p1; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.PKG1" has been invalidated
    ORA-04065: not executed, altered or dropped package body "SCOTT.PKG1"
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.PKG1"
    ORA-06512: at line 1
    SQL>SY.

  • ORA-04061: existing state of  has been invalidated

    Hi,
    In Development Database Information
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Solution required for this oracle error
    I am getting this Error - ORA-04061: existing state of has been invalidated
    package pkg1 -> Main pkg
    pkg1 calling another package pkg2
    i am modified and recompiled the package pkg2.
    After executing the package PKG1 it throwing this Error ORA-04061.
    i am checking user_objects and it status are VALID.
    In both package doesnt have the any variables.
    Please suggest the above issue.
    Thanks in advance.
    Regards,
    Sudhakar P

    BluShadow wrote:
    Karthick_Arp wrote:
    Sudhakar P wrote:
    Hi,
    how to reload it into memory - SGA ?.Please suggest me.
    Regards
    Sudhakar P.I guess you dint get my point. So may be read this {message:id=3488533}:) Saves me re-posting it.Still remember reading it way back then :). I much appreciate the time you spend on explaining it in detail.

  • ORA-04068: existing state of packages has been discarded

    I work on an order entry system that is up 24x7 running Oracle version 8.0.5. I want to compile a fix to a procedure contained in a package body. I only will be recompiling the package body. Since the package body has no dependent objects, I should not invalidate any stored procedures that call this procedure in my package. However, should I worry about causing an "ORA-04068: existing state of packages has been discarded" error? What causes this error and when does it occur?

    Please ensure that DBMS_ROWID is created in SYS schema and not in any ordinary user's schema. If it exists in any user's schema drop it from there.
    If the problem persists, drop the package from sys schema as well and run two script files in the following order:
    1) ORACLE_HOME\rdbms\admin\dbmsutil.sql
    2) ORACLE_HOME\rdbms\admin\prvtutil.plb

  • Setting security context in sql*plus session

    Hi,
    For a SQL*Plus session under an account that doesn't have execute privileges on fnd_global, is there any way to set the application security context similar to the way fnd_global.apps_initialize does?
    For example, as APPS one can do this:
    <br>
    sqlplus apps/...
    SQL>  select SYS_CONTEXT('FND','USER_ID' ) as fnd_user_id from dual;
    FND_USER_ID
    1 row selected.
    SQL> execute fnd_global.apps_initialize( ... );
    SQL> select SYS_CONTEXT('FND','USER_ID' ) as fnd_user_id from dual;
    FND_USER_ID
    123456
    1 row selected.What I'd like to do is something like this ...
    <br>
    sqlplus scott/...
    SQL> ... call some EBizSuite procedure where I can supply or
    be prompted for an EBizSuite user name, password, and responsibility ...
    SQL> select SYS_CONTEXT('FND','USER_ID' ) as fnd_user_id from dual;
    FND_USER_ID
    123456
    1 row selected.

    Hi
    Is there any method to initialize the environment using Java API.
    how to call the function fnd_global.apps_initialize
    Can you explain the required parameters.
    Asheesh

  • How to check the last time a package has been compiled?

    How to check the last time a package has been compiled from sqlplus?

    LAST_DDL_TIME column in DBA_OBJECTS.

  • My broadband package has been downgraded without m...

    I wrote on here a couple of days ago as I was really annoyed at BT for cancelling my order for the Home Hub 4 which they ordered on my behalf - the order has disappeared off the MY BT page and I've no idea what happened, can only speculate. However, I've now logged back into My BT and found my broadband package has been downgraded from Unlimited Broadband to More Broadband!!! As far as I can tell, this means I've now got a limit of 40GB per month - I use that in a week!!
    What the hell are BT playing at? Has anyone got these problems or have I been landed with the idiots??
    Seriously considering cancelling the contract even though we are only weeks into it.
    Sort it out BT

    Hi
    I am sorry to see you are having problems
    I suggest you contact live chat at this link they should be able to help you
    http://bt.custhelp.com/app/contact/c/2902/?s_intcid=con_intban_sanda_contact_us_chat_from_forums
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Certificate with PSE type SystemPSE has been invalid

    Hi,
    I got the following error in the log. Please advise.
    Certificate with PSE type >SystemPSE< has been invalid for 733561 days
    Regards,
    Tony

    Tony,
    If you are not currently using SSO, you may want to clean up the System PSE at any time, to eliminate those log errors.
    If you are actively using SSO, youu2019ll want to wait for off-peak hours or a maintenance window.
    The following is based on having the system certificate and the portal SSO certificate.  If you have more for other reasons, youu2019ll need to take more care and planning.
    To do this, you will need to:
    -     go to strustsso2
    -     right click on System PSE (left panel)
    -     select Delete
    -     green arrow back all the way out of strustsso2 to the main screen
    - Go back into strustsso2
    - right click on create
    - accept the default entries for u2018create PSEu2019
    - click Save
    - If you expand the System PSE on left, you should see your server name.
    - Double click the server to show the system certificate. 
    - Then double click the certificate to see the details.
    -     Finally, youu2019ll want to import your SSO certificate, add it to the Certificate List and add it to the ACL, and save.
    Of course, all of this is if you want to have a cleaner system log.  If you have any doubts before attempting, feel free to post as there are a lot of helpful people in the forums, and in this thread alone!
    If everything is working as expected and you donu2019t mind ignoring the system log messages, then you can take no action.
    Hope this helps!
    PJ

  • How to block Sql Plus sessions in Oracle 10g

    Hi,
    I want to block all sql plus sessions in oracle 10g, as we have a application and we need each and every one to use this application not the sql plus session.
    Kindly update us as soon as possible. and also thanks in advanced.

    Understand the concept Karl, but a layered defense seldom works in the IP world. If I manage to get through the firewall, then how can you prevent me access, at IP level, at any other ISO stack layer? If you manage to get through, then your firewall policies could just be too weak :) at least you must have some kind of an IDS infrastructure in place..
    what I mean is, you can have infinite number of threats.. and this will be part of your Risk Analysis. Determining all possible threats to the assets, what are being protected and their associated value, and predicting the rate of occurrence.... with all of these you could probably come up with contingency plans and incident response.. And most of all, you should not ignore the fact that people are creative, ingenious, and curious, and they'll prove this to you by testing your security implementations. So you'll have to periodically evaluate your security.. that's why there are audits.. Also, you must balance Security, Performance, Usability, and your Budget.
    Yes, you can argue that if the entire firewall goes down (thus no IP defense), then something like DBV (or even denying IPs in sqlnet) can provide some defense. But is that not then a case of too little too late? It's better too little too late, than no protection at all... Imagine if there's no DBV, or if you have not implemented the concept of "Least Privilege"? or if the backups and exports are not encrypted? That would be more devastating.. that's the importance of database security options and features in providing "defense in depth"
    I question just what purpose and how effective IP packet security is at higher layers. It can never substitute doing this instead at firewall level. Well, it's not all about network security. All facets must be considered and the inter-relationships should be understand. Like the core information security and access management, physical and personnel security, training them, etc... And all of these are equally important in providing a secure ecosystem
    As for security that relies on the client to pass secure data (like executable name or o/s user name)... all this can easily be spoofed. Even if the app and Oracle driver are somehow digitally signed and these signatures can be verified on the server side, we only need to look at Vista to see how secure this really would be. Microsoft attempted to encrypt every single h/w and s/w layer from the physical DVD track to the pixel on the monitor.. and this was defeated. And this was done as o/s kernel level. It is less complex to hack at driver level and even trivial to do it at application level.Security is about risk management. Blocking SQL*Plus does not negate the risk of SQL from the wild being run on a production server. For example, the client is a VB client using ODBC. It is easy to create a proxy that accepts the ODBC connection from the VB client and proxy the OCI packets to the real Oracle server. Now you have a man-in-the-middle than can inspect every single SQL call made to Oracle, and inject any PL/SQL or SQL code it wants.
    Security is far beyond writing a login trigger to deny SQL*Plus sessions and calling that a defense. >
    Yes I agree with you. That's why there are independent organizations and regulating bodies that provides security best practices, to give us a headstart on comming up of strong security policies.
    And one of my favorites is the one provided by IASE (sponsored by Defense Information Systems Agency) where there's lot of content regarding hardening and policies
    http://iase.disa.mil/stigs/stig/index.html
    http://iase.disa.mil/stigs/checklist/index.html
    http://iase.disa.mil/stigs/SRR/index.html
    - Karl Arao
    http://karlarao.wordpress.com

  • I have bought a new Iphone 4S and also own a Mac pro, also IPad.        I did not install find my phone on the IPad, my IPad has either been misplaced (have tore the house up looking for it) or it has been stolen is there any way I can find where it is at

    I resently purchased the New IPhone 4S, and I have a mac Pro, plus a IPad.  I have misplaced my IPad or it has been stolen is there any way by using Find My phone it can be located Thanks Look for My IPad

    Unless you set up MobileMe / Find My iPad on it before it was lost/stolen, then no, there isn't any way to locate it. If you did set up MobileMe on it then you could try locating it either via me.com on a computer or Find My iPhone / Find My iPad on a another device - but that will only work if it's connected to a network and the device hasn't already been wiped and/or MobileMe disabled on it.
    If you think that it was stolen then you should report it to the police. As a safety precaution you should also change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.

  • HT5622 I never set up icloud and my ipad has been stolen is there any way i can find it still?

    I never set up icloud on my ipad and it has been stolen is there any way i can still track it without it being turned on the device?

    Nope.
    What To Do If Your iDevice or Computer Is Lost Or Stolen
    iPhone, iPod Touch, and iPad
    If you activated Find My Phone before it was lost or stolen, you can track it only if Wi-Fi is enabled on the device. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. iCloud- Use Lost Mode
      6. What to do if your iOS device is lost or stolen
      7. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      8. Find My iPhone
      9. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)
    Mac Computer
           Find My Mac can be used from Find My Phone at iCloud.com and via Find
           My Phone on your iDevice.
          The following is third-party anti-theft software:
               1.  STEM 2.1
               2.  MacPhoneHome 3.5
               3.  MacTrack 7.5.0
               4.  VUWER 1.7
               5.  Sneaky Bastar* 0.2.0
               6.  Undercover 5.1.1
               7.  LoJack for Laptops
               8. Hidden 2.0
               9. Prey 0.6.2

  • My Droid 2 has been malfunctioning lately making the phone completely uncontrollable. I have done a hard factory reset and the problem still persists. What else can i try?

    My Droid 2 has been malfunctioning lately making the phone completely uncontrollable. I have done a hard factory reset and the problem still persists. What else can i try?

        We want you to enjoy the best reliability with your Droid 2 Jaxie! What specific problems are you having with the device? Is your software up to date? The latest version available is: 4.5.621.A955.Verizon.en.US. If the software is up to date, we recommend running the device in safe mode to determine if third party apps may be causing the issues. I hope this information is helpful.
    http://bit.ly/IPw5jE
    http://bit.ly/o5McAQ
    Sincerely,
    JonathanK_VZW
    VZW Support
    Follow Us on Twitter@VZWSupport

  • Since the recent upgrade my mac has been freezing up.  Any suggestions

    Since the last IOS update my laptop has been freezing up.  Any suggestions.

    Do you mean OS X? iOS is for iDevices, not computers.
    What, exactly, is happening? Do you have any error messages?
    Clinton

  • HT3275 My Time Capsule has been backing up without any problems and all of a sudden it stops reading on my computer. The external hard drive beeps three times and the motter wont run within. What happened?

    My Time Capsule has been backing up without any problems and all of a sudden it stops reading on my computer. The external hard drive beeps three times and the motter wont run within. The light that usually blinks while in use is no longer blinking and is on constant. What happened?

    abailey46 wrote:
    My Time Capsule has been backing up without any problems and all of a sudden it stops reading on my computer. The external hard drive beeps three times and the motter wont run within. The light that usually blinks while in use is no longer blinking and is on constant. What happened?
    Sorry we are unclear as to the external hard drive and its connection to the TC..
    For instance the light that blinks.. is that the TC or external hard disk or what.
    Did you try just rebooting / restart the whole network in correct order.. modem.. router / TC.. external drive.. clients with 2min gap between each.
    Are you actually running Snow Leopard as the profile states?
    How old is the TC?

Maybe you are looking for

  • Service Desk - Create Message from Satellite System

    Hi Guru, I'm learning SAP Solution manager service desk tools (on EHP1 SP22). I've managed to activate it and I can create the message from satellite system (with SLFN as default transaction type). Is it possible to change default of transaction type

  • Problem publishing Photo page with iWeb 08

    Hello, I have a problem when publishing photo pages with iWeb 08. Upload starts and then I get the error message that iWeb encountered a problem while publishing. The funny thing is that I can see the photo page in Safari. The only problem is that wh

  • Substituting a still image for FLV

    I have FMS2, profile 1, limited to 150 concurrent license connections. Question: if user number 151 hits the web page, my video box will not display the FLV because of concurrent connection limits. Is there a way to substitute a still image to replac

  • Updates for 2 MACs

    Hi, We have 2 MACS and use a satellite for our internet have a limited amount of download capacity. Downloading every update twice is killing us as the file size has been pretty large of late. Is there a way that we can download on one machine then c

  • Action Required: Error in Workflow ,  ORA-20002: [WFMLR_DOCUMENT_ERROR]'

    Hi, While executing custom workflow on oracle EBS version : R 12.0.6 i am getting the error like An Error occurred in the following Workflow. Item Type = ATLCUSMS Item Key = ATLCUSMS-795 User Key =USERKEY: 525 Error Name = WF_ERROR Error Message = [W