Oracle 8 Triggers vs. Procedures

We're trying to decide if we should convert existing, and frequently fired, trigger bodies to procedures. A lot of the documentation suggests that procedures are the best way to go. I'm trying to understand the difference in how triggers and procedures are stored, specifically in the shared pool. One set of documentation says that both procedures and triggers are cached the same way in the shared pool and remain there based on the LRU list. Another set of doc says that the source code for a trigger is flushed from the shared pool after firing. Is this the difference? Is there a definite recommendation for keeping the triggers as is or converting the trigger bodies to procedures?
Thanks!

Stored Procedure is compiled and converted into P-code(Pseudo code) it will not take much time execute, but the trigger body is compiled each time trigger fires,it will reduce the performance of the transaction.
each time trigger body need to be compiled &kept into SGA, but procedure or function or package will be directly loaded into the SGA.
any more or other reason post it.
thanks

Similar Messages

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • Oracle lite and Stored Procedures

    Hi, I have just installed Oracle lite, connected to Polite and created dropped tables etc. I notice that in Navigator there is no folder for stored procedures or triggers. I tried to compile a syntacally correct proc in SQL plus and it generated this error: Create or Replace Procedure SCORECARD.Gen_Fiscal_Year_Data AS
    ERROR at line 1:
    OCA-30021: error preparing/executing SQL statement
    [POL-5228] syntax error.
    Does this mean that stored procs are not supported in Oracle lite?
    Thanks, Paul
    null

    Oracle Lite database does not support the usual stored procedures/triggers like an Oracle database. You have to use java classes to create triggers/stored procedures to run them in Oracle Lite database. You can refer the documentation on Oracle 8i Lite for samples/detailed information.

  • Oracle text related internal procedure taking a lot of time in our Production database

    Hi,
    I am on Oracle 11.2.0.2 on Linux. I have Oracle Text implemented in all my databases for fuzzy search. I am seeing the following Oracle TExt specific internal procedure to be among the Top SQL in my AWR in production. This is during business time.
    SQL ordered by Elapsed Time
    Resources reported for PL/SQL code includes the resources used by
    all SQL statements called by the code.
    % Total DB Time is the Elapsed Time of the SQL statement divided
    into the Total Database Time multiplied by 100
    %Total - Elapsed Time as a percentage of Total DB time
    %CPU - CPU Time as a percentage of Elapsed Time
    %IO - User I/O Time as a percentage of Elapsed Time
    Captured SQL account for 59.3% of Total DB Time (s): 120,379
    Captured PL/SQL account for 33.8% of Total DB Time (s): 120,379
    Elapsed Time (s)
    Executions
    Elapsed Time per Exec (s)
    %Total
    %CPU
    %IO
    SQL Id
    SQL Module
    SQL Text
    23,476.22
    205,095
    0.11
    19.50
    16.21
    7.88
    ddr8uck5s5kp3
    begin ctxsys.drvdml.com_sync_i...
    Note that the sql id ddr8uck5s5kp3 has this sql:
    begin ctxsys.drvdml.com_sync_index(:idxname, :idxmem, :partname); end;
    Also note that I have the procedure to optimize the indexes (ctx_ddl.optimize_index in FULL mode) set up every night to run at 3 am for all our Oracle Text indexes.  Is there anything else needed. I don't know why the procedure I showed above in the AWR report takes so much time and why it is among our Top sql.
    I will be very thankful for guidance in this regard.
    Thanks,
    OrauserN

    This is the internal call which drives the SYNC call for a text index. Effectively all the indexing of new and updated data in your text-indexed table is contained within this call.
    If you're using parallel SYNC you will see this call contained with a SELECT query - that select is executed as a parallel query on a table function, which is the way we divide up the work between parallel slaves.

  • Help Required :Excel Upload Into Oracle Table Using PLSQL Procedure/Package

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    I also Tried to Use This
    But How can i Use SQLLDR Command In Stored Procedure.
    Well IN SQL*PlUS it is successfull but in Stored Procedure /Package ,PL/SQL does not recognise the OS commands.
    So now my Question How can I recognise the SQLLDR Commnad in Stored Procedure.

  • Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
    If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
    If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
    Justin

  • Does Oracle have Extended Stored Procedure like SQL Server and Sybase?

    Hi, i am new to Oracle. I want to know if...
    Does Oracle have Extended Stored Procedure like SQL Server and Sybase?
    If it does not have, then how can i call outside program written in C or JAVA from the Database stored procedure or trigger?

    refer to this link on external procedures
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76956/manproc.htm#11064

  • How i can load excel sheet into a table in oracle through pl/sql procedure

    Hi,
    How i can load excel sheet into a table in oracle through pl/sql procedure or a pl/sql block. Excel sheet is saved on my c or d drive on my machine. In xls format.

    Depending on how big your spreadsheet is and how frequently you want to do this you might want to contruct insert statements in excel, then run these. I have done this to load a few hundred rows for a one off test on dev.
    e.g. if you have values 1 and 'a' in you spread sheet and want to insert them in to table xxx col1 & 2:
    | /|   A   |   B   |    C
    |1 |col1   |col2   |
    |2 |      1|a      |="insert into xxx ("&$A$1&","&B1&") values ("&A2&",'"&B2&"');"then paste the contents of colum C
    insert into xxx (col1,col2) values (1,'a');into sqlplus or a script.

  • Assign Hotkeys with Oracle Form6i Triggers

    i have one problem in form6i.
    How to assign assign Hotkeys with Oracle Forms Triggers?
    hot to assign to assign F12 key with form trigger and what is the process?
    can you explain brifly?

    Hi User,
    Kindly follow the following link where I have summarized the usage of Oracle terminal.
    [Usage of Oracle terminal|http://gskaushik.blogspot.com/2009/05/oracle-terminal-reference-forms-6i.html|Click to follow link]
    Kindly revert for any clarifications
    regards
    Kaushik
    Kindly click Helpful if it helps or correct if the issue is solved

  • Oracle Error Executing Stored Procedure

    Hi
    I'm invoking a stored procedure from Oracle Database. The procedure is running Ok in oracle, but when i run the procedure from .NET, failed. The code when stop is :
    Reader = cmdReader.ExecuteReader()
    The error is:
    A first chance exception of type 'System.Data.OracleClient.OracleException' occurred in System.Data.OracleClient.dll
    A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
    In the Catch Exception:
    Catch ex As OracleException
    MsgBox(ex.Code.ToString)
    The result is: 6550
    Do you can help me?

    Since you are using Microsoft's ADO.NET Provider for Oracle, I suggest that you post your question with a short sample on "ADO.NET Data Providers" forum here - http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1

  • Call Oracle function from Stored Procedure

    Hi,
    I have function Which returning one number. I want to use that number in a procedure. How to call the Oracle Function from the Procedure
    Create procedure
    AS
    Begin
    Check number;
    Select Function1 into check from dual;
    It is giving error.
    Can anyone provide me example for this.
    Thanks in advance

    Put the Check Number; before begin
    SQL> create or replace procedure abc as
      2 begin
    3 val number;
      4  select abcd into val from dual;
      5  dbms_output.put_line(val);
      6  end;
      7  /
    Warning: Procedure created with compilation errors.
    Elapsed: 00:00:00.00
    SQL> show error
    Errors for PROCEDURE ABC:
    LINE/COL ERROR
    3/5      PLS-00103: Encountered the symbol "NUMBER" when expecting one of
             the following:
             := . ( @ % ;
             The symbol ":=" was substituted for "NUMBER" to continue.
    SQL> create or replace procedure abc as
      2 val number;
    3 begin
      4  select abcd into val from dual;
      5  dbms_output.put_line(val);
      6  end;
      7  /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec abc;
    100.22
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL>

  • Sybase - Oracle: Editing triggers/procedures clears them

    Migrating from Sybase 11.0 to Oracle 8.1 I get of course
    parsing errors. If I want to fix them by editing the text
    of the stored procedures/views/triggers in the repository
    (i.e. clicking on the window and entering text, commenting
    out etc.) leads to
    parsing errors ... EOF
    Looking at the repository, the captured source text is now
    empty. Since I have no chance to capture single procs, I have
    to capture all 400+ procs, triggers, views again, which takes
    long time.
    Please fix this behaviour or at least allow to capture single
    objects.
    Regards,
    Jwrg Thwnnes
    null

    Hi Jorg,
    This is a bug and it has been fixed.You can get the fix in the
    next beta release.Pls check with the Product manager on the next
    release.
    Thanks,
    Hari
    Jwrg Thwnnes (guest) wrote:
    : Migrating from Sybase 11.0 to Oracle 8.1 I get of course
    : parsing errors. If I want to fix them by editing the text
    : of the stored procedures/views/triggers in the repository
    : (i.e. clicking on the window and entering text, commenting
    : out etc.) leads to
    : parsing errors ... EOF
    : Looking at the repository, the captured source text is now
    : empty. Since I have no chance to capture single procs, I have
    : to capture all 400+ procs, triggers, views again, which takes
    : long time.
    : Please fix this behaviour or at least allow to capture single
    : objects.
    : Regards,
    : Jwrg Thwnnes
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Converting Oracle Forms to J2ee - (Focus on Form triggers/ Form Procedures)

    Hi,
    We are in the process of exploring the option of migrating forms to J2EE using JheadStart tool. After migration of forms using Jheadstart tool, what will happen to my Form triggers, Procedures? Does the GUI look and feel - canvases and tabbed pages etc will be exactly same?
    Ex: I have created a sample master detail form with few buttons and triggers. After migrating the form using jheadstart evaluation copy, I am not finding the buttons and as well as any logic enforced on buttons. On top of that the GUI is not same as in FORM, it comes with one find window and then navigates to master detail block. Does that mean, I need to customize the pages also for each form to be migrated?
    Would be very much thankful to you for your early response on the same.
    Thanks and Regards,
    Venkateswar NDT

    Venkateswar,
    JHeadstart Designer Generator does not transform all functionality of your Forms into J2EE. JHeadstart focuses on providing the same data reporting and manipulation capabilities.
    The reason for this is that we want to produce an application that can easily and productively be maintained and extended. The migration is not the final stage of the trip, it is only the beginning of the journey. The migration result should be (close to) what you would have developed from scratch.
    What is not migrated:
    * Business logic coded in Forms
    * Fancy layouts that cannot be built using HTML
    * Complex, cross-forms navigation
    We think this is preferrable over line by line translations of PL/SQL into Java, because the Forms architecture is so different from J2EE architecture. It would lead to a badly structured J2EE application that would be very hard to maintain. Instead, we want to give you a head start in creating a well structured, maintainable J2EE application.
    You get a migrated application with:
    * Professional and powerful HTML user interface
    * Most common layout styles are fully generated
    * Compliant with the Model-View-Controller Paradigm
    * Component based architecture that enables you to wire different business component together
    In the JHeadstart Developer's Guide (which is shipped with the evaluation copy), chapter 5, you can find more about the JHeadstart Designer Generator. Look for example at page 5-19 and onwards, for details about what parts of Designer Modules are transformed. You can also take a look at the JHeadstart Designer Generator Reference, to which a link is included in the JHeadstart Documentation Index ([JHeadstart Home]\jheadstart\doc\index.html)
    Hope this helps,
    Sandra Muller
    JHeadstart Team

  • Oracle Form functions and procedures in APEX, how?

    I am working to recreate in APEX, already existing Read Only Forms in Oracle Forms. APEX Interactive Report functionality among other things, makes it worth while as well as targetting a different audience than the one that utilizies the Oracle Form versions. Oracle Forms versions use lots of pre and post query triggers, PLSQL Functions.
    In Oracle Forms one of the places those functions can be located is in the "Program Units" section of the Form. A typical function of this sort, based on a specific Mission ID Itinerary, collects scheduled passengers last names, formats them with a comma and space after each one, into a single string that is returned and displayed as the passenger list of one row.
    I have all this code written so I can move most of the main query of the Oracle Form into an Interactive Report. These functions and triggers called from within the Form, from the "Program Units" section of the Oracle Form rather than being stored in the Database schema in a package, where would they go inside APEX? Can I create a "Shortcut" in APEX and call it from the Interactive Report "Region Source"? Can I create the PLSQL function at the page level or region level of the Interactive Report? Or, is my best bet creating a package stored in the database, of all these functions and/or proecedures I may need from the original Oracle Form?
    Some advice would be greatly appriciated.

    RLBickham wrote:
    I don't think I have been clear enough in describing the specific thing I want to do, it simply does not reach the level of forms to APEX conversion. It is basically a PLSQL Function problem.
    I have an Interactive Report that is currently getting 90 percent of what I want however, each row, representing a Mission may have multiple legs. Each Leg has two locations or ICAO codes attached to it. Based on the Mission number, I want to loop through the leg table, collect all the ICAO codes for that Mission, put them all into 1 variable separated by a coma and add that variable to the column display of that Interactive Report as the last column.
    In Oracle Forms I have a function saved to the database that is called within the main query. Maybe I am asking a question that does not need to be asked but in any case my question is can I put that function currently in the database somewhere in the confines of the Interactive Report and reference it via Http somehow or should I just stick with putting functions and procedures in packages stored in the database and called the conventional way?You could move the function to the database and call it from the report query, but it sounds as if it's superfluous. In the report query use whatever form of Re: 4. How do I convert rows to columns? is appropriate to your (unspecified) database version.
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Oracle Lite Triggers

    Hi,
    What is the best way to handle triggers in Oracle Lite?
    The application table on my live server (oracle 9i) has many triggers and most of them are not required on oracle Lite. So, i don't include triggers will packaging. But I get error while publishing the application.
    Pls advice.
    Regards,
    Deepak

    Hi,
    I am qouting below from the oracle 8i Lite documentation which says it supports triggers . Please clarify.
    Oracle Lite DBMS
    Oracle Lite DBMS is a lightweight (50KB - 750KB), Java enabled database designed from the ground up for laptops, handheld computers, PDAs and smartphones. It supports industry standard ODBC, JDBC, SQLJ, and Java Stored Procedures and Triggers. It provides a streaming fast "C" interface, OKAPI, to its object kernel. It also supports Java Access Classes, JAC, a fast and easy way to make Java Objects persistent. Oracle Lite DBMS now supports all popular mobile platforms, including Palm OS, EPOC, and Windows CE, letting you deploy enterprise applications on virtually any mobile device.
    Regards
    null

Maybe you are looking for

  • How to hide a table row in pdf  using javascript?

    How to hide a table row in pdf  using javascript?

  • No longer able to drag icons to other pages?

    Before syncing my iPhone to desktop computer, I USED to be able to select and drag app icons from one page to another. Although iTunes says that I should be able to do this, nothing happens when I click-and-hold an App icon, other than the entire PAG

  • Pointing an existing domain name to business catalyst.

    Hi there, I have an existing site called www.design180.co.nz. But I have designed a new site. I want to replace the old site with the new one Ive redesigned Adobe in muse. The hosting company has the domain name, I will need them to point the domain

  • Can you convert a ppc to an intel

    I have a Power Mac G5 (late 2004) Model   M9555LL/A G5 Processor Single 1.8GHz PowerPC G5 is there a way to convert it to an intel pc so I can upgrade everything to current levels, or do I look at a new intel power pc?

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,       I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created thi