Packages [message #666787] |
Sat, 25 November 2017 20:44 |
|
rkapex
Messages: 10 Registered: November 2017
|
Junior Member |
|
|
I have a package with 50 procedure and 30 functions etc. In short I have a huge package. So I don't want to load the whole package in memory. I want to one function or procedure of package laodaed in the memory. How can I do that ?
[Updated on: Sat, 25 November 2017 20:47] Report message to a moderator
|
|
|
|
|
Re: Packages [message #666795 is a reply to message #666787] |
Sun, 26 November 2017 01:46 |
John Watson
Messages: 8951 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Invoking one function or procedure in a package forces Oracle to load the entire package into the library cache. How do you think you might re-structure the code to avoid this?
|
|
|
|
Re: Packages [message #666818 is a reply to message #666798] |
Mon, 27 November 2017 03:27 |
cookiemonster
Messages: 13943 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Though I'd say that the real correct answer is that if loading a single large package into memory is causing issues then you've got much bigger underlying problems that need fixing first.
|
|
|
Re: Packages [message #666831 is a reply to message #666787] |
Mon, 27 November 2017 08:04 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
rkapex wrote on Sat, 25 November 2017 21:44I have a package with 50 procedure and 30 functions etc. In short I have a huge package. So I don't want to load the whole package in memory. I want to one function or procedure of package loaded in the memory. How can I do that ?
That's not exactly a huge package. Who told you that a package that size would be a problem? You look at some of the standard oracle packages in SYS and they are as big or bigger. That being said when you reference a package and it is not already in memory it loads it. While the database will keep internal variables separate per session the database doesn't load each session that uses a package a fresh copy of the code.
If you want only the called procedure/function loaded you have to make them into standalone code. While totally do able you lose the many advantages you get with a package.
[Updated on: Mon, 27 November 2017 08:05] Report message to a moderator
|
|
|