How to automatically compile a procedure

Often our users of the application to call us because some web applications do not work for a stored procedure called by the application is uncopiled, as usually, some of our developers have modified a table without recompiles the stored procedure. Even if the best thing would be to remember self-supply of recopile the stored procedure whenever you change one of the objects of the stored procedure, is there someone advise me how could be possible to plan a sort of batch that is able to "trigger" when a stored procedure gets no compiled or al least that periodically checks to see if there is something uncopiled and can automatically recompile? How would you?
Thank you!

Published by: Mark1970 on November 25, 2010 0.26

You have a lot of critics of the guys here... hope that those who are constructive to your developers.

To answer your question... There might be a shortcut or a small program that you can write to watch on your status as an object not valid. I think that guy DBA monitor this somehow.

I wrote a small program, some time to monitor the objects in the database to track the State of the database.

(1) write a piece of code to find invalid objects, something like that.
SELECT * FROM USER_OBJECTS WHERE TYPE_OBJET = 'PROCEDURE' AND STATUS = 'INVALID '.
(2) create a table like 'MONITOR_INVALID_PROC '.
(3) INSERT the result set of the SELECT query in the "MONITOR_INVALID_PROC" table
(4) you can have a mailing program simple to search this table frequently and mail it to you.
(5) have a JOB call this function/procedure every five minutes (to you).

You must have one handy mailing program, other animals is possible fast enough.

An approach more big but it has worked and works for me. I have developed a huge alert with this as a base program, it works for me.

Published by: user3044242 on November 25, 2010 16:38

Tags: Database

Similar Questions

  • Why I get an ORA-04052 error when I try to compile a procedure?

    Hello
    The following procedure I get an ORA-04052 error when I try to compile the following procedure.
    CREATE OR REPLACE PROCEDURE APPS.Find_String (
     pin_referenced_name IN dba_dependencies.referenced_name%TYPE) 
    
    IS
    
    cursor cur_get_dependancy
    is
    SELECT distinct owner, name, type 
      FROM [email protected]        -- prod.world 
     WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d' 
       AND referenced_type <> 'SYNONYM'
       AND owner <> 'SYS'
     order by name;
     
    v_owner  varchar2(40);
    v_name   varchar2(50);
    v_type   varchar2(40);
     
     
        BEGIN
    
           dbms_output.put_line(upper(pin_referenced_name)||' is found in the following objects.');
           dbms_output.put_line(' ');
           dbms_output.put_line(RPAD('OWNER', 30, ' ')||RPAD('NAME', 60, ' ')||RPAD('OBJECT TYPE', 30, ' '));
           dbms_output.put_line('-------------------------------------------------------------------------------------------------------------------');
    
            FOR i IN cur_get_dependancy
            LOOP
                v_owner := RPAD(i.owner, 30, ' ');
                v_name  := RPAD(i.name, 45, ' ');
                v_type  := RPAD(i.type, 30, ' ');
                
               
                dbms_output.put_line(v_owner ||v_name|| v_type);
    
            END LOOP;
    
    END find_string;
    I use the [email protected] link. Commented compiles it procedure for other links of database used in the cursor, including the one to the right of the code 'prod.world '.

    What is even more strange is that I took the SELECT statement
    SELECT distinct owner, name, type 
      FROM [email protected]        -- prod.world 
     WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d' 
       AND referenced_type <> 'SYNONYM'
       AND owner <> 'SYS'
     order by name;
    the procedure and he ran on the command line by using the link to @pinp.world, the SQL statement is fine. But when I tried to compile the procedure above to this exact same SQL query with the same exact link I get the following string of errors.
    ORA-04052: error occurred when looking up remote object [email protected]
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02068: following severe error from PINP
    ORA-03113: end-of-file on communication channel
    How the link can work very well in a regular SQL but then cause an error when its code compiled in that otherwise compile correctly when you use any link, or even just a simple database. Does anyone have any suggestions?

    Hello

    Good thounght, but no, there is no privilege SELECT ANY VIEW; SELECT ANY TABLE includes views and materilaized.

    I suspect that the problem is something specific to the data dictionary. I have just connected as SYS and granted SELECT ANY TABLE to another user with minimum privileges, X. X, ALL_VIEWS included so all views dba_, including the dba_dependencies. However, X was still unable to dba_dependencies the query either in SQL * more or PL/SQL.

  • How to automate the cutting through a visual basic 6.0 application tool?

    Original title: Visual basic 6.0

    How to automate the tool to cut through a visual basic 6.0 application. Or my visual basic 6.0 application is to take screenshots and save them as gif images, but the files are too big and take a long time to be sent by e-mail in real time. Please if someone could help, need a code in visual basic 6.0 to make these small files.

    Hello

    You can get support for development on the MSDN Forums tools.

    MSDN forums: Index

    http://social.msdn.Microsoft.com/forums/en-us/categories

    Concerning

  • How to automate ScanDisk using Task Scheduler tool?

    There is no file c:\windows\scandskw.exe on my XP, does anyone have any suggestions on how to automate using Task Scheduler tool in XP ScanDisk?

    Thanks for all the suggestions

    Saturday, August 14, 2010, 02:18:45 + 0000, SC Tom wrote:

    There is no program Scandisk in Windows XP.

    In order to specify that the person you are you answer to the. There is no program
    called the Scandisk, but there is a program with this feature; There
    Called Chkdsk.

    Ken Blake

  • Compilation of procedure error

    I'm trying to compile a procedure which is supposed to fill the tables with data, but I get errors ignored multiple statements. I'm running out of ideas what could be wrong, because the syntax seems very well. I downloaded the full code here: http://pastebin.com/gTnpj0Jm . Could someone please take a look?

    0566fdce-4035-4cdd-b2da-37d1e2b97e42 wrote:

    I'm sorry, but I searched in my code for a good 10 minutes and I can't find any case to appoint a pl/sql variable same as column name.

    You are right. Question is different.

    DECLARE
    DATE OF BORN_DATE_VALUE;
    BEGIN
    BORN_DATE_VALUE: = Trunc)
    TO_DATE ('2000 ', 'yyyy')
    +
    DBMS_RANDOM. VALUE)
    0,
    TO_DATE ('2015 ","yyyy")
    -
    TO_DATE ('2000 ', 'yyyy')
    ));
    END;

    INSERT INTO STUDENT (ID_STUDENT, F_NAME, L_NAME, BORN_DATE)
    VALUES (S_STUD. NEXTVAL, F_NAME_VALUE, L_NAME_VALUE, BORN_DATE_VALUE);

    BORN_DATE_VALUE range block, in which it is declared. If being outside the block INSERT statement in that born_date_value is declared, INSERT does not know what BORN_DATE_VALUE and assume it is the column name.

    SY.

  • How to automate the unique fusion of multiple JPEG to PDF files.

    I'm looking for an answer that does not purchase a license, or by downloading a shaded part of software.

    I have a batch of a software suite that creates multiple JPEG files every morning. The final product must be a single PDF, prefer it to order a certain way, but not completely necessary. I tried to do it thanks to Excel, but it was very awkward. I'm trying to implement through Adobe Action Wizard and can create the file I'm looking for, but I can't find how to automate in a batch file that I can task in Task Scheduler.

    Currently, I run a file backup all export to PDF and JPG. I then insert page for each PDF in the order I want to insert Pages using the. I can't understand how to automate the Action once it is implemented.

    These are designed to run early in the morning and the PDF picked up by different software and sent to before the start of the day.

    Any assistance in the automation of an action would help enormously.

    Thank you.

    I think you should forget Acrobat. Batch jobs need under license for this software. Acrobat is not. Software Adobe for the server might cost 100 times more.

  • How to execute a stored procedure on Sybase with SQL Developer

    We have accessed Sybase 15 with SQL developer.

    We can see the data in the table, if we do not, run the stored procedure (for instance sp_who) developed on Sybase.

    Could you tell me how we execute the stored procedure on Sybase with SQL Developer Sybase?

    Thank you

    Shige

    We will not intended to be a Sybase ASE customer.

    But

    A SQL Developer... @dermotoneill: Workheet advice

  • How you automatically send a client a copy of a form online that they met?

    How you automatically send a client a copy of a form online that they met?

    Hello

    At this point in time this feature is not available in the form of Contact of Muse. I would ask you yo visit our idea page Muse create an idea for the same. More votes as he gets the chance, should it be implemented in future releases of Muse.

    Ideas for features in Adobe Muse

    Click on Actions > create idea to submit your idea.

    To work around the problem, you can use any builders of form online third-party to create this kind of shape and if they allow you to generate code incorporated for the same then you can add this Muse of object > insert HTML code

    Kind regards

    Vivek

  • I'm a dictionary in InDesign, how to automatically repeat the entries at the top?

    I'm a dictionary in InDesign, how to automatically repeat the entries at the top?

    You mean, like in a running header? InDesign help | Numbering pages, chapters, and sections

    (If you have a subscription to Lynda: 027 common titles created using variables of the InDesign Secrets course)

  • How to call a stored procedure in ADF

    How to call a stored procedure in the ADF (Jdev 11.1.1.6)?

    Code sample stored procedure:

    CREATE or REPLACE PROCEDURE SP_HELLOWORLD

    (

    NAME IN VARCHAR2

    OUT VARCHAR2 DESIRES

    ) AS

    BEGIN

    WISHES: = 'Hello'. name | ', Welcome to MS.';

    END SP_HELLOWORLD;

    Your Code of ADF is:

    try {}

    System.out.println ("* beginning of the code *");

    String sql = "start SP_HELLOWORLD(:NAME,:WISHES); end; ";

    CallableStatement st = getDBTransaction () .createCallableStatement (sql, getDBTransaction(). DEFAULT VALUE);

    st.setObject ("NAME", "ABC"); Replace with required param

    st.registerOutParameter ("WISHES", Types.VARCHAR); import java.sql.Types;

    St.Execute ();

    System.out.println ("the output of the function DB is:" + st.getObject ("WISHES"));

    System.out.println ("* end of code *");

    } catch (Exception e) {e.printStackTrace () ;}

  • Error (34.2): PLS-00103: encountered the symbol "END" when you try to compile the procedure.

    Hello

    I get the following error when I try to compile the procedure. I call a package inside this simple procedure. Not sure where I do worng. Here is the error I get.

    Error (34.2): PLS-00103: encountered the symbol "END"?

    Here is my code

    create or replace PROCEDURE BATCH_JOB_CAC_SP

    (

    vstatus OUT NUMBER)

    AS

    vloadserver global_name.global_name%TYPE: = get_dbservername;

    vuseridmod CONSTANT VARCHAR2 (15): = 'SYSTEM '.

    vloadname CONSTANT VARCHAR2 (30): = "BATCH_JOB_CAC_SP";

    v_cnt_upd NUMBER: = 0;

    vrunid NUMBER;

    v_spoutput VARCHAR2 (150);

    CURSOR job_cac

    IS

    SELECT NumCli, job_cac FROM batch_job_cac, batch_recid, jobnum;

    BEGIN

    I'm in job_cac LOOP

    job_cac_pkg.job_cac_valid_sp (i.custnum, i.jobnum, v_spoutput);

    CASE v_spoutput

    WHEN "1" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN "2" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN '3' THEN DBMS_OUTPUT. Put_line ('can not update working ACC');

    OF ANOTHER DBMS_OUTPUT. Put_line (v_spoutput);

    END CASE;

    END LOOP;

    EXCEPTION

    WHILE OTHERS THEN

    IF job_cac % isopen THEN

    CLOSE Job_cac;

    END IF;

    ROLLBACK;

    vStatus: = 1;

    LOG_ERROR_SP_NM (vLoadServer, vLoadName, SQLCODE, SQLERRM, vUserIdMod);

    END;

    END BATCH_JOB_CAC_SP;

    Thanks for your help.

    Hello

    You have 2 statements END at the bottom of your code, but only 1 BEGIN statement earlier.

    Losing one of these END States.

  • How to pick up the procedure and the slider for oracle procedure

    How to pick up the procedure and the slider for that?

    SELECT aktualne_notowania.aspolka_id,
    aktualne_notowania.Notowanie * spolki.ilosc_akcji as total
    To aktualne_notowania, spolki
    WHERE aktualne_notowania.aspolka_id = spolki.spolka_id;
    something like

    create or replcae procedure test_proc() is
    v_es_id polski_table.id%type;
    number of v_mult_val;

    cursor c1 is
    Select q.id, (q.quantity * p.price) as total_amount
    the quantity q
    price p
    where q.itemId = p.itemId

    Start

    Open c1
    loop
    Fetch c1 into v_es_id, v_mult_val;
    When exit c1% notfound;

    Update table_target
    total value: = v_mult_val
    where id: = v_es_id;

    end

    Something like this:

    merge into table_target t
    using (select select q.id, (q.quantity*p.price) as total_amount
           from   quantity q
                , price p
           where q.itemId = p.itemId
          ) s
    on    (t.id = s.id)
    when  matched then update
          set t.total = s.total_amount;
    
  • How to automate the process of loading data using load file &amp; Task Scheduler

    Hello

    I do the automated processes to load the data into Hyperion Planning application using the file data_Load.bat & Scheduler of tasks.

    I created Data_Load.bat file, but the rest of the process, I cannot complete.

    Could help you me, how to automate the process of loading data using the file Data_load.bat & task Scheduler or what are the rest of the file is require it to achieve.

    Thank you

    In response to your question using the maxl for loading scripts?

    If Yes, I've seen and deliver in the batch (ex: load_data.bat) that is you do not have the path of the maxl script complete with a batch when passing through the event the task scheduler will work, but the log file and / or error will not be created. Which means lots claims it linked task scheduler, although he did not do what you need to.

    If you use maxl use this as the batch

    "essmsh C:\data\DataLoad.mxl" or you can also use the full path for the maxl or work elsewhere. The only reason why I think that the maxl can then not work is if you do not have the updated batch updated to call on all LANE changes maxl or if you need to update your environment variables to correct the command essmsh to work in a command prompt.

  • I can compile new procedures/packages on my instant watch?

    Hello

    I can compile new procedures/packages on my watch to the snapshot ?
    I need to test the new version of the application, which include some changes to the current packages

    Thank you

    Yes, that's the purpose of the eve of the snapshot
    You can test your application with real data
    When you are finished, all changes will be devulcanization (flashback), and the standby database will follow the new primary side

  • How to automate the process of deploying VM?

    Are there sources where I could find info how to automate the deployment of virtual machines? For example, if I have to deploy 100 VM, how to add script, or maybe there are tools to do?

    Thanks in advance for the answers.

    I have not yet tested, but it should work if you have VI kit installation. If its only 10-20 why not plan tasks to clone vcenter and set the frequency to be repeated every hour and stop once you have done with all of them?

    If you found this information useful, please consider awarding points to 'Correct' or 'useful '. Thank you!!!

    Kind regards

    Stefan Nguyen

    VMware vExpert 2009

    iGeek Systems Inc.

    VMware, Citrix, Microsoft Consultant

Maybe you are looking for