Is it possible to run PLSQL, or SQL script daily?

I am trying to write a script will delete everything that is older then 90 days, and i only want to run this script once a day.
is this something it can be done in apex?
Thanks
John Lau
APEX version: Application Express 4.1.1.00.23
Browser(s) and version(s) used: Firefox
Theme: Midnight Blue

Hello John,
You have not given the database version you are using. If it is Oracle Database 10g Release 3 or higher then you can go with DBMS_SCHEDULER and schedule your script to run periodically.
Following is the Oracle Database 11g Release 2 documentation for DBMS_SCHEDULER:
http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sched.htm#CIHHBGGI
I found the following blog post of @Tobias Arnhold helpful while creating my first scheduled job:
http://www.apex-at-work.com/2009/06/dbmsscheduler-examples.html
If you are looking for APEX built-in solution then here is one using APEX_PLSQL_JOB :
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plsql_job.htm#BGBFGBIB
But I will suggest DBMS_SCHEDULER over APEX_PLSQL_JOB as DBMS_SCHEDULER package has more fine tuning facilities regarding scheduling than the APEX_PLSQL_JOB.
Hope it helps!
Regards,
Kiran

Similar Messages

  • Running the same sql script in multiple databases

    Hello,
    What is the method to run the same sql script in multiple databases? I want to write a unix script that would select from different databases and run a sql/plsql script in those different databases. What are the ways to write such a unix script? Thank you in advance.

    Just have a parameter which takes in the oracle connection parameters and use it in your sqlplus script with your shell script.
    Your sqlplus script can have a procedure/function call or an anonymous block;
    Then have a wrapper script to call the original script with different connection parameters. Hope this helps.

  • Is it possible to load an external sql script by connecting to a mysql data

    hi,
    this is ayesha parween.
    Basically we manually connect to the mysql server and go to the administrator and take the back up of the file
    and load the sql script for creating a schema creating the tables and populating the tables with the data.
    Is it possible through some java jdbc for connecting to the mysql server and creating the schema and creating the table structure and populating the tables with data.
    And if there is any error display some message.
    Regards,
    Ayesha.

    hi,
    this is ayesha parween.
    Basically we manually connect to the mysql server and go to the administrator and take the back up of the file
    and load the sql script for creating a schema creating the tables and populating the tables with the data.
    Is it possible through some java jdbc for connecting to the mysql server and creating the schema and creating the table structure and populating the tables with data.
    And if there is any error display some message.
    Regards,
    Ayesha.

  • ODAC 11.10.7: Problems running Post-installation SQL Scripts"

    Hello:
    I am running the 32-bit version of 11g Release 1.
    I installed ODAC version 11.10.7. The installation was completed without error but advised to run the SQL scripts found in OracleHome\ASP.net\SQL.
    I logged in using SYS account and tried to execute the SQL file, InstallAllOracleASPNETProviders.SQL which calls other SQL scripts:
    @@InstallOracleASPNETCommon.sql
    @@InstallOracleMembership.sql
    @@InstallOraclePersonalization.sql
    @@InstallOracleProfile.sql
    @@InstallOracleRoles.sql
    @@InstallOracleSiteMap.sql
    @@InstallOracleWebEvents.sql
    -- Install OracleSessionState Provider
    -- For Oracle 10gR1(10.1.0.2) database and higher, run InstallOracleSessionState.sql
    -- For Oracle 9iR2(9.2.x) database, run InstallOracleSessionState92.sql instead
    @@InstallOracleSessionState.sql
    --@@InstallOracleSessionState92.sql
    The first SQL was executed without any error.
    However, I received the following error with the second file:
    "ORA-06550: line 2, column 11: PLS-00201: identifier 'ORA_ASPNET_TABLEEXISTS' must be declared
    ORA-06550: line 2, column 6:
    PL/SQL: Statement ignored"
    The offending line has a reference to a function:
    IF ( ora_aspnet_TableExists('ORA_ASPNET_MEMBERSHIP') = 0) THEN
    Can someone advise on what needs to be done?
    venki
    Edited by: user9023421 on Apr 18, 2011 2:28 PM

    I did not have any Macromedia file in syetem 32 when I last replied to your question. I had uninstalled FP 11.8, but my embedded FP on Windows 8 was (and is) still showing in Control Panel Items but did not and does not appear when checking version on the Adobe Find Version page.
    Before reading your last reply, I did UNinstall 11.8 and then installed flashplayer_11_7_plugin_debug   (FP 11.7.700.232).
    This NOW shows up as Shockwave Flash ver. 11.7.700.232 in mozilla add-ons manager and is listed in system32 as a folder: C:\Windows\system32\Macromed with many files in the folder.
    The Flash Player 11.7.700.232 worked on Mozilla FF 22.0 for several hours before not being able to play some flash content and then crashed. An odd window kept appearing while trying to use it, I did not copy the test of it, but will try and reproduce the problem, and copy and post the text here in a further discussion box on our discussion.  A subsequent check to Adobe Find Version page shows that FP 11.7.700.232 is CURRENTLY installed and functoning. But it still does not play all Flash content that I encounter on the internet.
    I did NOT use the Adobe Full Installer to install Flash Player 11.7.700.232, I simply downloaded the file to desktop and manually installed it off line.
    If I DO need to uninstall FP 11.7.700.232, and reinstall it using the Adobe Full Installer, please tell me in detail how because I thought that the Full Installer had a different version of FP in it.
    What I mean is, if I download and run the Full Installer, is that also simultaneously installing a different version of FP? Or do I run it and THEN install FP 11.7.700.232?
    Thank you for following along and replying, Pat. I am not very literate with PC's and the problem is likely something that I am doing wrong!

  • Is it possible to run Go URL SQL and return raw data using Java?

    Hi All,
    I just got GO URL SQL working in HTML, when i type the following URL on to the address bar.
    https://odsau.oraclecorp.com/analytics/saw.dll?Go&SQL=select+"MFG Serial Number"."Job Name","MFG Serial Number".Item+from+"Supply Chain Management"
    It prints out a table with all the data that query from the database in a HTML page. However, I want to be able to manipulate these data in a JAVA script.
    Is there a similar function i can use in Java script and return raw data so i can store them into a variable for data manipulation?
    Or is there a work around that someone has already done ?
    Thanks
    John Lau

    You can excute SQL statemetns throught JDBC, but that doesn't have a facility to read those statements from a file. You'd have to write code to read the file and create and execute statements through JDBC. That should be pretty straightforward though.
    It's conceivable that there's a third party library out there that does it, if you know what to look for.
    If you're not familiar with JDBC, check out http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • ** Is it possible to run a windows .bat script job from ODI between server?

    Hello Friends,
    We have ODI 10.1.3.5 on a Win2003 Server.
    Have a windows Batch script job .bat(this is a related to a different program - DRM) on a different Windows 2003 server...is it possible to execute .bat job thru ODI between servers?
    Appreciate your suggestions...
    Thanks.

    Hi AJ,
    Here are more details:
    Server-A: ODI Server (Win2003)
    Server-B: Oracle DRM Server (Win2003)
    Server-C: ODI scheduler agent is installed (Linux)
    We have a .bat batch script job on Server-B which we are planning to run from Server-A (as part of the ODI package execution flow)
    This .bat job exports the DRM hierarchy data to a table that ODI uses to process next steps.
    So, you are suggesting to install ODI agent on Server-B? If we do that...not sure if there be issues if we have to run the package with other scenario's (interfaces/Procedures) that refer agent isntalled in Server-C??
    Any feedbacks are appreciated!!
    Thanks

  • Run a PL/SQL statement in an Oracle Alert action?

    Hello
    did anyone know is it possible to run a PL/SQL statement in an Oracle Alert action?
    I can run an SQL like “UPDATE Table SET alert_run = 'ok' where id = 10;” but if I run instead of this the following
    “Select XXKN_TEST.UPDATE_XXX_TEST('&USER_NAME') From dual;”
    I get the following error log:
    Alert: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    ALECDC module: Check Periodic Alert
    PL/SQL procedure successfully completed.
    XXKN_TEST.UPDATE_XXX_TEST('GROSS2')
    ERROR at line 2:
    ORA-00904: "XXKN_TEST"."UPDATE_XXX_TEST": invalid identifier
    APP-ALR-04020: Oracle Alert was unable to execute "&VALUE". Check that this file exists and that its read protection is set correctly.
    Many thanks for your help,
    Alois

    Hello Suresh,
    I tried your suggestion but it doesn't work.
    The PL/SQL procedure was successfully completed but no data was modified.
    Are you sure that running a PL/SQL is possible in an alert action?
    Kind Regards,
    Alois

  • Running sql script from pl/sql

    Is there any standard way to run an external sql script from pl/sql
    I really appreciate any assistance.

    If you want, I did start writing a function reading and executing statements out of sql script with utl_file.
    can I issue this command in PL/SQL: EXECUTE IMMEDIATE '@filename.sql';
    the function could be extended for DDL, session setting, etc...
    Regards
    Laurent

  • Running utlbstat.sql script

    for testing performance i want to run the utlbstat.sql script
    can i run this script using windows run command.
    i cant run utlesast.sql also.
    so i cant see the report using report.txt

    The UTLBSTAT.SQL is ran from the SQL prompt in SQLPLUS like this as in the case of UN*X:
    SQL> @ ${ORACLE_HOME}/rdbms/admin/utlbstat.sql
    The @ tells SQLPLUS to read the commands/statements from a file.
    It is on a similar path in windoze.
    William

  • Run of mvdemo.sql in Oracle9i failed

    Hi all,
    I'm new to this list and i have a question to the mvdemo Package.
    We are running Oracle 9i (9.2.0.8.0) with the spatial cartridge installed.
    (NLS_LANG=German_Germany.WE8ISO8859P15)
    Creating the mvdemo User and importing the mvdemo.dmp succeeded, but running the mvdemo.sql script failed while inserting the rows in the customer table:
    Example:
    insert into customers values('BLACKHAWK PLAZA','UNINC CONTRA COSTA COUNTY','CONTRA COSTA','CA',mdsys.sdo_geometry(2001,8307, sdo_point_type(-121.9192,37.80925,NULL),NULL,NULL),76.4)
    FEHLER in Zeile 1:
    ORA-00904: Ungültiger Spaltenname
    we tried the same on a developer machine with Oracle 10gr2 without error.
    Any hints for me ?
    Thanks,
    Wolfgang

    i changed the mvdemo.sql script to reflect this, but on the end of the script iget the following:
    create index opsdx on oriented_points(shape) indextype is mdsys.spatial_index
    FEHLER in Zeile 1:
    ORA-29855: Fehler bei Ausführung der Routine ODCIINDEXCREATE
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in spatial index: [mdrcrtxfergm]
    ORA-13249: Error in spatial index: [mdpridxtxfergm]
    ORA-13200: Interner Fehler [ROWID:AAAIKRAABAAAMGaAAA] bei räumlicher
    Indizierung.
    ORA-13206: Interner Fehler [] beim Erstellen von räumlichem Index
    ORA-13354: Falscher Offset in ELEM_INFO_ARRAY
    ORA-06512: in "MDSYS.SDO_INDEX_METHOD_9I", Zeile 7
    ORA-06512: in Zeile 1
    Any hints on that ?
    Wolfgang

  • Error when running the apxldimg.sql to update the images direct from rel3.0

    Hi everyone,
    I'm new to APEX. I'm upgrading from v3.0 to v3.1. I'm on the post-installation, section on "Updating the Images Directory When Upgrading from Release 3.0", I ran into error below when running the apxldimg.sql script. Has anyone run into the is error before. If yes, how did you fix it?
    Directory created.
    filelist_xml xmltype := xmltype(bfilename(upload_directory_name,file_list),nls_charset_id('AL32UTF8'));
    ERROR at line 15:
    ORA-06550: line 15, column 36:
    PLS-00306: wrong number or types of arguments in call to 'XMLTYPE'
    ORA-06550: line 15, column 25:
    PL/SQL: Item ignored
    ORA-06550: line 38, column 15:
    PLS-00302: component 'EXISTSRESOURCE' must be declared
    ORA-06550: line 38, column 3:
    PL/SQL: Statement ignored
    ORA-06550: line 52, column 46:
    PLS-00320: the declaration of the type of this expression is incomplete or
    malformed
    ORA-06550: line 52, column 3:
    PL/SQL: Statement ignored

    My team member found another post that ran into the same problem and the section is for 11g only. My db is 9.2.0.5.

  • Can i run or test oracle pl sql scripts online?

    Hi Everyone
    Is there any means to test and run oracle pl sql scripts online thru any website?
    Thanks

    ms wrote:
    Hi Everyone
    Is there any means to test and run oracle pl sql scripts online thru any website?
    ThanksWhy do you expect another site to have your tables & data?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Where to running SQL Scripts after install of ODAC for Oracle Client?

    I just installed ODAC for Oracle Client on a windows server, that runs a sql server database, for developers to connect a web app to an Oracle/Unix database. The install states to run SQL scripts located in the $ORACLE_HOME\ASP.NET\SQL directory after the install. I'm not sure where to run them? On the ORACLE DB on the Unix server? If someone could bring me up to speed I would appreciate it. Thanks.

    If I do run the scripts, do you know what user they should be run as? The developer are using ASP.NET for connectivity.
    Why there is no Oracle Expert answer this simple question? ?
    After ODAC 11.1.0.7.20 installation completed, there is a message in the last screen:
    *"Run the SQL script located in c:\app\Administrator\product\11.1.0\client_1\ASP.NET\SQL directory for a new installation or an upgrade of Oracle Providers for ASP.NET"*
    The question is: How to run these 9 SQL scripts ?
    In SQL*Plus, which oracle user should I connect to in order to run these 9 scrips, including:
    InstallAllOracleASPNETProviders.sql
    InstallOracleASPNETCommon.sql
    InstallOracleMembership.sql
    InstallOraclePersonalization.sql
    InstallOracleProfile.sql
    InstallOracleRoles.sql
    InstallOracleSessionState.sql
    InstallOracleSiteMap.sql
    InstallOracleWebEvents.sql

  • How to batch create SSO accounts from Windows or a PL/SQL script

    We have just converted our 6i Forms and Reports to 10g (10.1.2.0.2), and run them against a 9i database. In order to be able to securely run reports we set up and configured SSO for a few accounts via the Oracle Identity Management Provisioning Console. We do not have PORTAL – nor do we want it. However, now we need to create about 500 SSO accounts at once. We would prefer to be able to create these accounts in a batch method – eg run something from Windows command line or run a PL/SQL script. We have the DBMS_LDAP package successfully installed in that 9i database. Currently our list of 500 users is simply in a table in the 9i db.
    Spent several hours looking through both this site and Metalink, but so far no luck – especially because we don’t have or want PORTAL. If anyone can help, would appreciate it very much.
    Thanks

    User dbms_ldap package in the database to use PL SQL to create your database
    account and then an OID account with a RAD to match the database login. If you
    You may have to load the DBMS_Ldap package from the database ADMIN directory first to be available in the database.
    LDAP SQL Ex.
    user_username := LOWER(new_user) || '@domain.com'; -
    retval := dbms_ldap.search_s(my_session, ldap_base,
    dbms_ldap.scope_subtree, 'uid=' || user_username, my_attrs, 0,
    my_message);
    retval := dbms_ldap.count_entries(my_session, my_message);
    my_entry := dbms_ldap.first_entry(my_session,my_message);
    my_dn := dbms_ldap.get_dn(my_session,my_entry);
    dbpassword := 'PASSWD01';
    isvalidrad := forms_rad.newraddefinition(radname,new_user,dbpassword,
    dbtnsnames,errormessage);
    sessionestablished := forms_rad.createoidsession(ldap_user, ldap_passwd,
    ldap_host, ldap_port, ldap_base);
    radcreated := forms_rad.createradforcn(my_dn, 'false', errormessage);
    -- Create new user's database account same as RAD account.
    v_sql := 'CREATE USER "' || new_user || '" IDENTIFIED BY ' || dbpassword ||
    ' DEFAULT TABLESPACE JLIM TEMPORARY TABLESPACE TEMP';
    EXECUTE IMMEDIATE v_sql;
    v_sql := 'GRANT CONNECT TO ' || new_user;
    EXECUTE IMMEDIATE v_sql;

  • Generating SQL Script for Existing Tables and DBs

    Hello,
    is it possible to generate automatically a SQL-Script from an existing table or oracle database ?
    I want to export an existing table from an Oracle DB (g11) if its possible with the data.
    Perhaps somebody could me explain how to to do this.
    I am using the "SQL Developer 2.1" and the "enterprise manager konsole".
    I'm a rookie in using this tools.
    Thank you for any informations.
    N. Wylutzki

    If you want to export data, you should use the export utility. This is documented:
    http://tinyurl.com/23b7on

Maybe you are looking for

  • Truncating last three characters in Mainfram GDG dataset.

    Hi Folks, I had developed a scenario IDOC - > XI -> File and this file is generated on Mainframe system as a GDG dataset . I was able to generate the file but last three characters are getting truncated for each record in the file(dataset). From XI w

  • Light tables and multiple items

    I am trying to discover how to add an image to a light table more than once. Both Apple's documentation and the Luna book say it's possible but I don't quite get the trick involved.

  • [MapViewer] Ugly borders

    When MapViewer creates a image, there's a black border on both left and rightside of the map. Why is this, en can I remove this border? It's very ugly when the background of the map is the same color as the background of the html-page tnx.

  • Can't add music to iPhone 5 from iTunes 11

    I am trying to manually add music to my iPhone 5 from iTunes 11. After dragging and dropping music onto the device, it appears under the music section of the device, except it is greyed out. I can't play the music, and when I check on the phone, the

  • DII with multiple OUT parameters?

    Is it possible to use DII to invoke a web service that has more that one output parameter? My attempts are shown below but I only get a variety of different exceptions. If anyone has a working example, then I would be most grateful for their advice.