Can anyone tell me what is the difference between the INLINE Pragma and pinned objects in oracle .
As per my understanding pinning objects means Keeping database packages in the Oracle database'sSystem Global Area (SGA) shared pool`
Inline Pragma specifys that a subprogram call is, or is not, to be inlined. Inlining replaces a subprogram call (to a subprogram in the same program unit) with a copy of the called subprogram at compile time.
Is oracle also stores the compiled code in SGA ?,what if a user do Pinning as well Inline Pragma for the same object in database.
Oracle has to load the code into the shared pool in the SGA in order to run it, yes. Generally, there is no need to pin objects in memory because Oracle ages them out of the shared pool based on a least recently used algorithm. So if a piece of code is called frequently, it will be kept in the shared pool. If it is called infrequently, it may be aged out and you may have to re-read it from disk on the next call. But that’s generally exactly what you want to happen– you want to optimize things that happen frequently and you want to incur the cost of a few disk I/O’s when you read infrequently accessed code from disk.
Inlining determines whether the compiler chooses to copy the code for a subprogram inline which generally makes the compiled product slightly bigger, and thus require slightly more space in the shared pool in return for not having to jump to the subprogram at runtime. Generally, inlining is not something that you’d manually specify with a
PRAGMA, it’s something that would be taken care of automatically by the compiler by settingPLSQL_OPTIMIZE_LEVELto 3. From the PL/SQL Language Reference