Using automater to run the daily maintenance scripts

I like to put my computer to sleep over night but the problem is that when I do that it doesn't run the maintenace scripts. Does anyone know how to do this with automater so that I can quickly run it before I put my powerbook to sleep?

Derek
I have my iMac go to sleep after an hour of non-use so it is shut down all night, usually.
I downloaded the freeware program Anacron which runs the cron daily, weekly and monthly processes automatically when you wake your computer. I never have to worry about maintenance that way.

Similar Messages

  • Daily Maintenance Scripts

    I put my iMac to sleep every night. I have been using Cocktail to run the scripts as I have been told they run early in the morning while the machine is sleeping. In Leopard is this still true? Do I still need to run the scripts or does the machine do it automatically when it wakes up?

    I don't think it's necessary. In fact, I never heard of a Mac go down from over-bloated periodics. IMO, too much attention is paid to this feature. It is a carry over from UNIX servers which handle a large volume of traffic. The reason the scripts are scheduled to run in the wee hours are because that is when the server traffic was lowest.
    -mj

  • Error while running the root.sh script during Grid installation on a pre-installed 11g database .

    Hi Oracle Experts,
    I am trying to setup a new GRID Standalone Infrastructure on a previously installed Oracle 11g database.
    It runs all fine but when prompts to run the root.sh script it does not allow to proceed as it prompts to overwrite the existing path for /usr/bin/local
    well, I google'd and tried with overwrite : Y . It prompted to run the script but it failed ...
    Could you please help me on this ..
    [root@asm ~]# /u01/app/11.2.0/grid/root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/11.2.0/grid
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying dbhome to /usr/local/bin ...
    The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying oraenv to /usr/local/bin ...
    The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying coraenv to /usr/local/bin ...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
    /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
    [root@asm ~]# /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/                              crs/install/roothas.pl
    2015-03-18 01:42:25: Checking for super user privileges
    2015-03-18 01:42:25: User has super user privileges
    2015-03-18 01:42:25: Parsing the host name
    Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
    Creating trace directory
    LOCAL ADD MODE
    Creating OCR keys for user 'oracle', privgrp 'oinstall'..
    Operation successful.
    CRS-4664: Node asm successfully pinned.
    Adding daemon to inittab
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    acfsroot: ACFS-9320: Missing advmutil.
    acfsroot: ACFS-9320: Missing advmutil.bin.
    acfsroot: ACFS-9320: Missing fsck.acfs.
    acfsroot: ACFS-9320: Missing fsck.acfs.bin.
    acfsroot: ACFS-9320: Missing mkfs.acfs.
    acfsroot: ACFS-9320: Missing mkfs.acfs.bin.
    acfsroot: ACFS-9320: Missing mount.acfs.
    acfsroot: ACFS-9320: Missing mount.acfs.bin.
    acfsroot: ACFS-9320: Missing acfsdbg.
    acfsroot: ACFS-9320: Missing acfsdbg.bin.
    acfsroot: ACFS-9320: Missing acfsutil.
    acfsroot: ACFS-9320: Missing acfsutil.bin.
    acfsroot: ACFS-9301: ADVM/ACFS installation can not proceed:
    acfsroot: ACFS-9302: No installation files found at /u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5xen-x86_64/bin.
    asm     2015/03/18 01:43:06     /u01/app/11.2.0/grid/cdata/asm/backup_20150318_014306.olr
    Successfully configured Oracle Grid Infrastructure for a Standalone Server
    when I checked for ASM instance its not running ... but just ohasd service and nothing else ..
    [root@asm grid]# ps -ef | grep pmon
    oracle    5831     1  0 01:15 ?        00:00:01 ora_pmon_db11g1
    root     12625  8794  0 02:30 pts/2    00:00:00 grep pmon
    [root@asm grid]#
    [root@asm grid]#
    [root@asm grid]# ps -ef | grep d.bin
    oracle   12643     1  5 02:30 ?        00:00:00 /u01/app/11.2.0/grid/bin/ohasd.bin reboot
    root     12715  8794  0 02:30 pts/2    00:00:00 grep d.bin
    [root@asm grid]#
    Could you please help .

    hi,
    The issue not with /usr/bin/local.  When you excute root.sh, it will try configure the ASM with New GRID HOME. Issue started, whent tried to start
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting <<=================================================================
    acfsroot: ACFS-9320: Missing advmutil.
    Please let us know the below details
    ==> Acfs is configured the servers??
         ==>acfsutil registry
                   acfsutil info fs output.
    ==> With out ASM instance , How the database, CRS STarted ???
    ==> Please try stop and start the crs.
    ==> crsctl query crs activeversion output
    Regards
    Krishnan

  • DDLIMP utility is failing while running the DDL_OLTP.ctl script for Siebel

    DDLIMP utility is failing while running the DDL_OLTP.ctl script for Siebel source on DB2.
    Below is the the log details:
    2021 2012-11-08 03:23:46 2012-11-08 03:25:56 -0700 0000002a 001 003f 0001 09 ddlimp 604 736 C:\OBIA\Upgrade\CTLFiles\DDL_.log
    ContextInit     ContextInit     0     0     2012-11-08 03:23:46     Message Facility failed to init. Siebel Root: C:\DAC\client\utilities
    Trace     Trace     3     0     2012-11-08 03:23:46     Siebel Enterprise Applications ODBC DDL Import Utility, Version 7.7 [18030] ENU
    Trace     Trace     3     0     2012-11-08 03:23:46     Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.
    Trace     Trace     3     0     2012-11-08 03:23:46     
    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.
    User agrees that any use of this software is governed by: (1) the applicable
    user limitations and other terms and conditions of the license agreement which
    has been entered into with Siebel Systems or its authorized distributors; and
    (2) the proprietary and restricted rights notices included in this software.
    WARNING: THIS COMPUTER PROGRAM IS PROTECTED BY U.S. AND INTERNATIONAL LAW.
    UNAUTHORIZED REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PORTION
    OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.
    If you have received this software in error, please notify Siebel Systems
    immediately at (650) 295-5000.
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:46     ddlimp /U SIEBEL /P ***** /C siebel /G SSE_ROLE /F C:\OBIA\Upgrade\CTLFiles\DDL_OLTP.CTL /L C:\OBIA\Upgrade\CTLFiles\DDL_
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:46     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:46     Connecting to the database...
    DBCLog     DBCLogError     1     0     2012-11-08 03:23:52     SQL Warning, SQL State 01004, 0, [DataDirect][ODBC DB2 Wire Protocol driver]String data, right truncated.
    DBCLog     DBCLogError     1     0     2012-11-08 03:23:52     SQL Warning, SQL State ”, 40042692, CLog     DBCLogError     1     0     2012-11-08 03:23:52     SQL Warning, SQL State 01004, 0, [DataDirect][ODBC DB2 Wire Protocol driver]String data, right truncated.
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     Connected.
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     Reading tables and indexes from DDL file...
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     Read 522 tables and 1084 indexes from DDL file...
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:23:52     Reading existing schema...
    SARMLog     SARMInformation     3     0     2012-11-08 03:23:52     SARM is OFF -change param SARMLevel to enable
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     Read 0 tablespaces, 6137 tables and 24846 indexes from existing schema...
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     Running SQL statements against the database...
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     Merging table S_ETL_COSTLST ...
    SQLError     Statement     0     0     2012-11-08 03:25:56     SQL Statement:
    alter table S_ETL_COSTLST modify
    CONFLICT_ID varchar(15)
    DBCLog     DBCLogError     1     0     2012-11-08 03:25:56     [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
    SQLError     Statement     0     0     2012-11-08 03:25:56     SQL Statement:
    alter table S_ETL_COSTLST modify
    CONFLICT_ID varchar(15)
    DBCLog     DBCLogError     1     0     2012-11-08 03:25:56     [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
    SQLError     Statement     0     0     2012-11-08 03:25:56     SQL Statement:
    alter table S_ETL_COSTLST modify
    CONFLICT_ID default '0'
    DBCLog     DBCLogError     1     0     2012-11-08 03:25:56     [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     37000: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
    SQLError     Statement     0     0     2012-11-08 03:25:56     SQL Statement:
    alter table S_ETL_COSTLST modify
    CONFLICT_ID default '0'
    DBCLog     DBCLogError     1     0     2012-11-08 03:25:56     [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     56098: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     alter table S_ETL_COSTLST modify
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     CONFLICT_ID default '0'
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     ;
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     writeExecDDL error (UTLOdbcExecDirectDDL pDDLSql).
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     writeExecDDL error (UTLDbDdlColModify).
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     Error in MainFunction (UTLDbDdlDbMerge).
    SQLDBUtilityLog     SQLDBUtilityLog     3     0     2012-11-08 03:25:56     Error in Main function...
    GenericLog     GenericError     1     0     2012-11-08 03:25:56     (logapi.cpp (167) err=1 sys=126) SBL-GEN-00001: (logapi.cpp: 167) error code = 1, system error = 126, msg1 = (null), msg2 = (null), msg3 = (null), msg4 = (null)

    If you run DAC on a 64-bit windows Operating System, you must create the ODBC data source using the ODBC Administrator tool in %windir%\SysWOW64\odbcad32.exe. for creating the data warehouse tables.
    If helps pls mark

  • 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.

  • HT204088 Help me! All I want to do is eliminate automatic renewal of the Daily Show with Jon Stewart. What do I do?

    I have done EVERTHING under the sun to make this go away.  I cannot find that magic wand that will all me to eliminate my automatic renewal of the Daily Show w/Joh Stewart.   If not I have to pay 9.99 for every 8 episodes.  If I had the space on my iPad I would, but I don't so what can I do? I just want it just to go away.  Can you  help me?  Anyone?

    Welcome to the Apple community.
    AirPlay Mirroring requires a second-generation Apple TV or later, OS X 10.8 or better and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). It also requires the computer to be using wi-fi.

  • When do the perodic maintenance scripts run?

    In previous versions of OS X, we could see at what time the scripts were running by looking the files:
    com.apple.periodic-daily.plist
    com.apple.periodic-weekly.plist
    com.apple.periodic-weekly.plist
    In fact I had a script for that:
    cd  /System/Library/LaunchDaemons
    PLISTBUDDY=/usr/libexec/PlistBuddy
    $PLISTBUDDY -x -c "Print :StartCalendarInterval" com.apple.periodic-daily.plist
    $PLISTBUDDY -x -c "Print :StartCalendarInterval" com.apple.periodic-weekly.plist
    $PLISTBUDDY -x -c "Print :StartCalendarInterval" com.apple.periodic-weekly.plist
    But is Mavericks, the content of these files have changed and the time is missing. Here is an example of the new files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>AbandonProcessGroup</key>
              <true/>
              <key>Label</key>
              <string>com.apple.periodic-weekly</string>
              <key>LaunchEvents</key>
              <dict>
                        <key>com.apple.xpc.activity</key>
                        <dict>
                                  <key>com.apple.periodic-weekly</key>
                                  <dict>
                                            <key>AllowBattery</key>
                                            <false/>
                                            <key>GracePeriod</key>
                                            <integer>14400</integer>
                                            <key>Interval</key>
                                            <integer>604800</integer>
                                            <key>Priority</key>
                                            <string>Maintenance</string>
                                            <key>Repeating</key>
                                            <true/>
                                  </dict>
                        </dict>
              </dict>
              <key>LowPriorityIO</key>
              <true/>
              <key>Nice</key>
              <integer>1</integer>
              <key>ProgramArguments</key>
              <array>
                        <string>/usr/libexec/periodic-wrapper</string>
                        <string>weekly</string>
              </array>
    </dict>
    </plist>
    Does anybody know where we can set the times for these scripts? The purpose is to allow the iMacs to sleep at night.

    DlacVal wrote:
    Does anybody know where we can set the times for these scripts? The purpose is to allow the iMacs to sleep at night.
    There is no need for that. Unlike traditional *NIX OS's that run these jobs using cron, OS X now uses launch daemons to run these (& many other) jobs. The benefit is a cron job won't run if the computer is asleep or powered down at the time set for a job, while ones started by launch daemons are queued up & run the next time the computer is awake.
    For more about this, see page 12 of the Mavericks Core Technology Overview pdf. (Also maybe check out the Timer Coalescing discussion beginning on page 8.)
    The battery, priority, & other key/value pairs in the plists insure that the maintenance tasks will run only when they have the least impact on performance & power consumption.
    If you want to see when they have run you can use Console to look at the daily.out, weekly.out, & monthly.out logs (in the /var/log section). You should see that they do not run at fixed times, nor should they.

  • How to use DBMS_JOB to run the OWB scripts?

    Can anyone pls explain how I can use the DBMS_JOB to run the scripts which are generated by OWB.
    Suroop

    CREATE OR REPLACE PACKAGE "LOAD_DATAMART"
    AS
    TYPE t_global IS RECORD
    ( plsql_map VARCHAR2(50) := 'transactions_map_exp', -- Default mapping plsql program
    plsql_map_main VARCHAR2(50) := 'transactions_map_exp.main', -- Default mapping plsql main program
    servers NUMBER(2) := 19, -- Default concurrent loading servers
    max_reloads NUMBER(3) := 3 , -- Default maximum load retrys
    mail_sender VARCHAR2(99) := '"Certegy Data Warehouse"', -- Default Mail Sender
    mail_notice VARCHAR2(99) := '[email protected]', -- Default Recepient Notification
    mail_error VARCHAR2(99) := '[email protected]' -- Default Recepient for Errors.
    GLOBAL t_global ;
    PROCEDURE start_monitor_load(p_date IN DATE);
    PROCEDURE monitor_load( p_date IN DATE , p_dwh_load# IN NUMBER DEFAULT NULL, p_servers IN NUMBER DEFAULT GLOBAL.servers );
    PROCEDURE start_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs IN VARCHAR2);
    PROCEDURE create_job_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs VARCHAR2 DEFAULT 'batch01_rbs' );
    FUNCTION dependency_on(p_type IN VARCHAR2, p_date IN DATE) RETURN BOOLEAN;
    PROCEDURE send_mail (p_sender IN VARCHAR2, p_recipient IN VARCHAR2, p_subject IN VARCHAR2, p_message IN VARCHAR2);
    PROCEDURE start_load_guard;
    PROCEDURE load_guard(p_job IN INTEGER);
    END load_datamart;
    CREATE OR REPLACE PACKAGE BODY "LOAD_DATAMART"
    AS
    PROCEDURE start_monitor_load(p_date IN DATE) IS
    v_plsql VARCHAR2(32000);
    BEGIN
    v_plsql := 'load_datamart.monitor_load(to_date('''||TO_CHAR(p_date,'DD-MON-YYYY HH24:MI:SS')||''',''DD-MON-YYYY HH24:MI:SS''));';
    EXECUTE IMMEDIATE 'declare v_job integer; begin dbms_job.submit(v_job,:v_plsql); end;'
    USING v_plsql;
    END start_monitor_load;
    PROCEDURE monitor_load( p_date IN DATE, p_dwh_load# IN NUMBER DEFAULT NULL , p_servers IN NUMBER DEFAULT GLOBAL.servers ) IS
    TYPE t_server IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    v_server t_server;
    v_dwh_load# NUMBER;
    v_reload_limit NUMBER := 0;
    v_plsql_error VARCHAR2(32000);
    pending_jobs BOOLEAN;
    p_batch VARCHAR2(20) := 'batch01_rbs';
    FUNCTION job_server_running(p_dwh_load_seq NUMBER) RETURN BOOLEAN IS
    CURSOR c1 IS SELECT * FROM DWH_LOAD_DETAIL
    WHERE dwh_load# = v_dwh_load#
    AND load_seq = p_dwh_load_seq;
    r1 c1%ROWTYPE;
    PROCEDURE try_resubmit_job(p_dwh_load_seq OUT NUMBER) IS
    v_load_seq NUMBER;
    BEGIN
    SELECT COUNT(*) INTO v_load_seq
    FROM DWH_LOAD_DETAIL
    WHERE dwh_load# = v_dwh_Load#;
    IF v_load_seq < v_reload_limit THEN
    INSERT INTO DWH_LOAD_DETAIL(dwh_load#,load_seq,load_server,plsql_map,map_parameters)
    VALUES(v_dwh_load#,v_load_seq+1,0,r1.plsql_map,r1.map_parameters||'| SEQ '||v_load_seq);
    COMMIT;
                   ELSE
                   RAISE_APPLICATION_ERROR(-20000,'Maximum '||v_reload_limit||' retrys reached, load aborted.');
    END IF;
    END;
    BEGIN
    OPEN c1;
    FETCH c1 INTO r1;
    IF c1%NOTFOUND THEN
    RETURN FALSE;
    ELSIF c1%FOUND AND r1.job_end_time IS NULL THEN
    RETURN TRUE;
    ELSIF c1%FOUND AND r1.job_end_time IS NOT NULL THEN
    IF r1.job_end_time = 'BROKEN' THEN
    try_resubmit_job(r1.load_seq); -- Oracle Errors
    END IF;
    RETURN FALSE;
    END IF;
    CLOSE c1;
    END job_server_running;
    FUNCTION get_next_load_seq(p_dwh_load_server IN NUMBER) RETURN NUMBER IS
    CURSOR c1 IS SELECT * FROM DWH_LOAD_DETAIL
    WHERE dwh_load# = v_dwh_load#
    AND load_server = 0
    ORDER BY dwh_load#,load_seq
    FOR UPDATE OF load_server;
    r1 c1%ROWTYPE;
    BEGIN
    OPEN c1;
    FETCH c1 INTO r1;
    IF c1%FOUND THEN
    UPDATE DWH_LOAD_DETAIL
    SET load_server = p_dwh_load_server
    WHERE CURRENT OF c1;
    END IF;
    CLOSE c1;
    COMMIT;
    RETURN r1.load_seq;
    END get_next_load_seq;
    BEGIN
    v_dwh_load# := p_dwh_load#;
    -- Defining the Max Retry to load
    SELECT COUNT(*) + GLOBAL.max_reloads INTO v_reload_limit
    FROM DWH_LOAD_DETAIL
    WHERE dwh_load# = v_dwh_load#;
    FOR i IN 1..99 LOOP
    v_server(i) := NULL;
    END LOOP;
    LOOP
    pending_jobs := FALSE;
    FOR i IN 1..p_servers LOOP
    IF NOT job_server_running(v_server(i)) THEN
    v_server(i) := get_next_load_seq(i);
    IF v_server(i) IS NOT NULL THEN
    load_datamart.create_job_load(v_dwh_load#,v_server(i),p_batch);
    IF p_batch = 'batch01_rbs' THEN
    p_batch :='batch02_rbs';
    ELSIF p_batch = 'batch02_rbs' THEN
    p_batch :='batch03_rbs';
    ELSIF p_batch = 'batch03_rbs' THEN
    p_batch :='batch01_rbs';
    END IF;
    END IF;
    END IF;
    IF v_server(i) IS NOT NULL THEN
    pending_jobs := TRUE;
    END IF;
    END LOOP;
    EXIT WHEN NOT pending_jobs;
    dbms_lock.sleep(05);
    END LOOP;
    COMMIT;
    UPDATE DWH_LOAD_HEADER
    SET plsql_error = 'Completed'
    WHERE dwh_load# = v_dwh_load#;
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    v_plsql_error := SUBSTR(SQLERRM,1,4000);
    load_datamart.send_mail(load_datamart.GLOBAL.mail_sender,load_datamart.GLOBAL.mail_error,
    'Load Datamart - Load '||TO_CHAR(p_date,'MM/DD/YYYY HH24:MI:SS')||' not completed',
    v_plsql_error||CHR(10)||
    ':::::::::::::::::::::::::::::::::::::::::'||CHR(13)||
    '- Parameter Date '||TO_CHAR(p_date,'MM/DD/YYYY')||CHR(13)||
    ':::::::::::::::::::::::::::::::::::::::::'||CHR(13)||
    '- Transmission time '||TO_CHAR(p_date,'hh24:mi:ss')||CHR(13)||
    '- Load Seq# '||TO_CHAR(v_dwh_load#)||CHR(13)||
    ':::::::::::::::::::::::::::::::::::::::::'||CHR(13));
    v_plsql_error := SUBSTR(SQLERRM,1,4000);
    UPDATE DWH_LOAD_HEADER
    SET plsql_error = v_plsql_error
    WHERE dwh_load# = v_dwh_load#;
    COMMIT;
                        RAISE_APPLICATION_ERROR(-20000,v_plsql_error);
    END monitor_load;
    PROCEDURE start_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs IN VARCHAR2) IS
    v_plsql_map VARCHAR2(200);
    v_sqlerrm VARCHAR2(4000);
    BEGIN
    UPDATE DWH_LOAD_DETAIL
    SET job_start_date = TRUNC(SYSDATE) ,
    job_start_time = TO_CHAR(SYSDATE,'HH24:MI:SS')
    WHERE dwh_load# = p_dwh_load#
    AND load_seq = p_load_seq
    RETURN plsql_map INTO v_plsql_map;
    COMMIT;
    EXECUTE IMMEDIATE 'set transaction use rollback segment '||p_rbs;
    v_plsql_map := 'begin '||v_plsql_map||' end;';
    EXECUTE IMMEDIATE v_plsql_map;
    EXECUTE IMMEDIATE 'begin
    UPDATE DWH_LOAD_DETAIL
    SET job_end_date = SYSDATE,
    job_end_time = TO_CHAR(SYSDATE,''HH24:MI:SS''),
    rta_iid = '||global.plsql_map||'.get_runtime_audit_id,
    rta_select = '||global.plsql_map||'.get_selected,
    rta_update = '||global.plsql_map||'.get_updated,
    rta_insert = '||global.plsql_map||'.get_inserted,
    rta_errors = '||global.plsql_map||'.get_errors,
    rta_delete = '||global.plsql_map||'.get_deleted
    WHERE dwh_load# = :p_dwh_load#
    AND load_seq = :p_load_seq;
    UPDATE DWH_LOAD_HEADER
    SET rows_inserted = NVL(rows_inserted,0) + NVL('||global.plsql_map||'.get_inserted,0)
    WHERE dwh_load# = :p_dwh_load#;
    END;' using p_dwh_Load#,p_load_seq;
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    v_sqlerrm := SUBSTR(SQLERRM,1,3999);
    EXECUTE IMMEDIATE ' begin
    UPDATE DWH_LOAD_DETAIL
    SET job_end_date = SYSDATE,
    job_end_time = ''BROKEN'',
    rta_iid = '||global.plsql_map||'.get_runtime_audit_id,
    rta_select = '||global.plsql_map||'.get_selected,
    rta_update = '||global.plsql_map||'.get_updated,
    rta_insert = '||global.plsql_map||'.get_inserted,
    rta_errors = '||global.plsql_map||'.get_errors,
    rta_delete = '||global.plsql_map||'.get_deleted,
    plsql_error = :v_sqlerrm
    WHERE dwh_load# = :p_dwh_load#
    AND load_seq = :p_load_seq;
    UPDATE DWH_LOAD_HEADER
    SET rows_inserted = NVL(rows_inserted,0) + NVL('||global.plsql_map||'.get_inserted,0)
    WHERE dwh_load# = :p_dwh_load#;
    END; ' using v_sqlerrm, p_dwh_load#,p_load_seq;
    COMMIT;
    END start_load;
    PROCEDURE create_job_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs VARCHAR2 DEFAULT 'batch01_rbs' ) IS
    p_job INTEGER;
    v_date DATE;
    BEGIN
    -- Submitting Job Load
    DBMS_JOB.SUBMIT(p_job,'load_datamart.start_load('||p_dwh_load#||','||p_load_seq||','||''''||p_rbs||''');');
    COMMIT;
    END create_job_load;
    FUNCTION dependency_on(p_type IN VARCHAR2, p_date IN DATE) RETURN BOOLEAN IS
    CURSOR c1 IS SELECT * FROM DWH_DATA_LOADS
    WHERE data_type = p_type
    AND file_date >= TRUNC(p_date);
    r1 c1%ROWTYPE;
    BEGIN
    OPEN c1;
    FETCH c1 INTO r1;
    IF c1%FOUND AND r1.status = 'Done' THEN
    RETURN FALSE;
    END IF;
    CLOSE c1;
    RETURN TRUE;
    END;
    PROCEDURE send_mail (p_sender IN VARCHAR2,
    p_recipient IN VARCHAR2,
    p_subject IN VARCHAR2,
    p_message IN VARCHAR2) IS
    * This procedure is usefull for sending e-mails for single or multiples recipients up to 50 *
    * the limitation is Lotes Notes e-mail service. *
    * Lewis Cunnigham Package is good also for massive distribuition to multiples e-mails, *
    v_mailhost VARCHAR2(30) := '172.27.2.157'; -- Titan and Eagle available SMTP service, through the GATEWAY
    v_mailhost    VARCHAR2(30) := 'STPMTA1ML';      old one
    v_mailhost    VARCHAR2(30) := 'stpnh1ml';       Main SMTP, all other are replicated, not available.
    v_mailhost    VARCHAR2(30) := 'STPMS6ML';       Replicated server, not available.
    v_mail_conn utl_smtp.connection;
    v_crlf VARCHAR2(2) DEFAULT CHR(13)||CHR(10);
    v_date VARCHAR2(255) DEFAULT TO_CHAR( SYSDATE, 'MM/DD/YYYY hh24:mi AM' ); -- Lotus Notes default format.
    --pragma autonomous_transaction;
    PROCEDURE writeData( p_text IN VARCHAR2 ) AS
    BEGIN
    IF ( p_text IS NOT NULL ) THEN
    utl_smtp.write_data( v_mail_conn, p_text || v_crlf );
    END IF;
    END;
    BEGIN
    v_mail_conn := utl_smtp.open_connection(v_mailhost, 25); -- Default port
    utl_smtp.helo(v_mail_conn, v_mailhost);
    utl_smtp.mail(v_mail_conn, p_sender);
    utl_smtp.rcpt(v_mail_conn, p_recipient);
    utl_smtp.open_data(v_mail_conn);
    writeData( 'To: '|| p_recipient ); -- Redundant, but necessary to complete format
    writeData( 'From: ' || p_sender); -- Redundant, but necessary to complete format
    writeData( 'Date: ' || v_date ); -- Database completion time
    writeData( 'Subject: ' || NVL( p_subject , '(no subject) ' ) ); -- Default Subject
         --writeData( 'Content-Type: text/html');
    utl_smtp.write_data(v_mail_conn, '' || v_crlf );
    utl_smtp.write_data(v_mail_conn, p_message ); -- Message body
    utl_smtp.close_data(v_mail_conn );
    utl_smtp.quit(v_mail_conn);
    --commit;
    EXCEPTION WHEN OTHERS THEN null;                                Since we are just sending e-mails,
    -- We don't care about mail errors like when server down, only when needed.
    END;
    PROCEDURE start_load_guard IS
    v_job INTEGER;
    BEGIN
    DBMS_JOB.SUBMIT(v_job,'load_datamart.load_guard(100);',SYSDATE+100);
         DBMS_JOB.CHANGE(v_job,'load_datamart.load_guard('||v_job||');',SYSDATE,'sysdate+((1/60)*1/24)');
         COMMIT;
    END start_load_guard;
    PROCEDURE load_guard(p_job IN INTEGER) IS
    v_job INTEGER;
         CURSOR c1 IS SELECT * FROM DWH_DATA_LOADS
         WHERE file_date BETWEEN TRUNC(SYSDATE) AND TRUNC(SYSDATE)+(86399/86400);
    did_PAYC_load BOOLEAN := NULL;
    did_ARMS_load BOOLEAN := NULL;
    did_CLMS_load BOOLEAN := NULL;
    did_STAT_load BOOLEAN := NULL;
    did_TRAN_load BOOLEAN := NULL;
    did_VCOM_load BOOLEAN := NULL;
    did_BCRD_load BOOLEAN := NULL;
    did_PNET_load BOOLEAN := NULL;
    BEGIN
    FOR i IN c1 LOOP
         NULL;
         --if i.status in ('Ready','Done') then
         --if i.data_type = 'PAYC' then
         END LOOP;
         IF NOT ( SYSDATE >= TO_DATE(TO_CHAR(SYSDATE,'DD-MON-YYYY')||' 13:35:00','DD-MON-YYYY HH24:MI:SS') )THEN
    send_mail('"Load Datamart"','[email protected]','I am the guard','This is my body messaje at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS')||'.');
    ELSE
    send_mail('"Load Datamart"','[email protected]','I am the guard, this is the last message.','This is my body messaje at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS')||'.');
    DBMS_JOB.SUBMIT(v_job,'begin dbms_job.next_date('||p_job||',to_date('''||TO_CHAR(SYSDATE+1,'DD-MON-YYYY')||' 03'||''',''DD-MON-YYYY HH24'')); commit; exception when others then null; end;',TRUNC(SYSDATE));
         END IF;
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    load_datamart.send_mail('"Load Datamart"','[email protected]','I am the guard, I break at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'),SQLERRM);
    END load_guard;
    END load_datamart;

  • The overnight maintenance scripts and permissions errors

    I know that the weekly script modifies some permissions when it runs and then disk utility finds them and repairs them. I saw this one this time:
    2008-09-20 20:53:44 -0400: Permissions differ on "private/var/log/secure.log", should be -rw------- , they are -rw-r----- .
    2008-09-20 21:00:28 -0400: Permissions differ on "Library", should be drwxrwxr-t , they are drwxrwxr-x .
    2008-09-20 21:00:43 -0400: Group differs on "private/etc/cups", should be 0, group is 26.
    2008-09-20 21:00:43 -0400: Permissions differ on "private/var/spool/cups/cache/rss", should be drwxr-xr-x , they are drwxrwxr-x .
    The Library one I am not use to seeing. I wonder if the 10.5.5 update changed something.
    Note however, I ran the microsoft office 12.1.2 update before running this one two macbook pros (that are exactly the same). Only one macbook pro had this library thing, but, it hasn't run the weekly script yet either..
    anyone "in the know" know about this library thing?

    Well, I did the 10.5.5 update, ran Repair Permissions afterwards, and did not see /Library error. My /Library is drwxrwxr-t, as it is evidently meant to be. I believe the final "x" on directories is replaced with a "t" to mean that only the owner of files in that folder can delete them. I think it quite possible that it was changed to the more usual x by the the MS Updater. If so, the Repair Permissions process put it back to what it is supposed to be.
    Francine
    Francine
    Schwieder

  • Automate to run the report & save it a name with date prefix

    We are planning to build a new in-house system. And would like to
    schedule some reports running in mid-night & automatically distribute to the
    users. Also, we would like to make a hardcopy per each day in case the users
    need some previous info which may not be found in the database since the data
    might be changed. So I thought the file name of each hardcopy should use the
    date as prefix.
    Do we need Oracle application server for such requirement?

    Hello,
    We have integrated oracle reports into oracle portal and it works great. The reports can be scheduled by a user in the front-end. What I would suggest is at the same time of scheduled report to the user's email is to schedule the same report to a printer. If you have more than one report engine, then your reports will run simultaneously.
    Yes, I think you need the oracle 9ias because oracle reports does not come standalone.
    Martin

  • Why does do shell work differntly from running the same bash script in terminal?

    i have the following a/s:
    set scriptPath to quoted form of ((POSIX path of (path to me)) & lnThumb)       set ftn to ""       repeat            try                 do shell script scriptPath & " " & ppath & " " & ftn                 exit repeat            on error error_message number error_number                  if error_number is not -128 then                      set ftn to (choose file with prompt "select folder thumbnail" default location dir without invisibles)                      set ftn to quoted form of the POSIX path of ftn                 end if            end try       end repeat
    calling this bash script:
    #!/bin/bash -f   cd "$1"  rm ./folderthumb.jpg   if [ $# -gt 1 ]  then      ft=${2/#"$1"\//}  else      ft=$(awk '/folderIcon=/{printf("%s",$1)}' meta.properties  | sed s/folderIcon=// )      if [ 0$ft -eq 0 ]       then          exit 1      fi      ft="thumbs/"$ft  fi  ln -s $ft ./folderthumb.jpg  exit 0
    which works as expected when run from the cli:
    tomw> /Applications/imageProc/fixJAlbum.app/Contents/Resources/Scripts/lnThumb.sh `pwd` `pwd`/thumbs/P1040161.JPG   tomw> ls -l folderthumb.jpg lrwxr-xr-x  1 tomw  admin  19 Oct 22 10:36 folderthumb.jpg -> thumbs/P1040161.JPG
    but fails to strip the common directory when called from do shell:
    tomw> ls -l folderthumb.jpg   lrwxr-xr-x  1 tomw  admin  89 Oct 22 10:36 folderthumb.jpg -> /Users/tomw/Desktop/trip2albequerque/albequerque/oldRailyards2nobHill/thumbs/P1 040133.JPG
    w-t-f???

    Click on the "Use Advanced editor" on the upper Right of the edit box.
    Select the text you want preserved
    Click on the >> icon then select "Syntax Highlighting" -> "Plain"
    And you will get this
       kind of
    output    when    you     post

  • Question: how to use JAVAEE to run the WAP program of mobile phone  on web?

    I want to develop a web program by JAVAEE. It uses the simulator of mobile phone to run the WAP program of mobile phone on web. You can operate the program on the page just as do on mobile phone. tell me how to develop on details soon. show the code, please.

    Haha, there's no way in hell you can do that. And nobody in their right mind would write the code for you, at least for free.
    Jesus with you people these days..."Java_Researcher". I bet you've never written a single line of Java.

  • I want to cancel my automatic renewal for the daily

    How do I cancel my automatic renewal for the daily

    iTunes - cancel newspaper subscription - https://discussions.apple.com/message/18044734
    iTunes Store: Purchasing and managing auto-renewing subscriptions - http://support.apple.com/kb/ht4098

  • An error ocurred while running the specified calc script. Check the log...

    Hi,
    I get the following error when I use the "Mass Mllocate" of hyperion planning (11.1.1.3) , specifically when i try to use "Spread Type" and select "Relational Spread".
    I check the log for details, i see the following messages:
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Info(1013162)
    Received Command [Calculate] from user [admin]
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Info(1200481)
    Formula for member [FY11] will be executed in [CELL] mode
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Error(1200315)
    Error parsing formula for [FIX STATEMENT] (line 24): invalid object type
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Error(1012001)
    Invalid Calc Script syntax [
    FIX ("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic","42300007","CC_054","CIA_063","PPTO","TRABAJO","S_241","S_251","S_252","S_253","S_254","S_255","S_259","S_260","S_227","S_228","S_229","S_230","S_231","S_232","S_233","S_234...]
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Error(1200421)
    Error encountered on or after line [25]
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Info(1020055)
    Spreadsheet Extractor Elapsed Time : [0] seconds
    [Mon Mar  5 17:34:18 2012]Local/TCM/VtaCto/admin/Info(1020082)
    Spreadsheet Extractor Big Block Allocs -- Dyn.Calc.Cache : [0] non-Dyn.Calc.Cache : [0]
    But i can not identify which calculation is referenced and that I understand is what is failing.
    Could guide me about that would have to check to find what is generating the error.
    Thanks in advance!!!

    Hi,
    One problem is that I can not identify the script because it was not created by me, as I understand this calc is implicit in planning, only runs when you select the option "mass allocate".
    The published extract was obtained from the log of the application in which the calculation is running, this was extracted from essbase directory that hosts the application.
    Hector Ortega

  • How can i re-automate/re-enable the daily, weekly, & monthly 'tasks'

    some time ago i was having trouble burning a home video with imovie. one of the suggested remedies was to disable the overnight cleaning up tasks, which i did. however, i'd now like to reset this so that these tasks are once again automated whilst i sleep (currently using MacJanitor).
    but i cannot for the life of me work out how to do this. please help.

    Open the application TextEdit. Under the TextEdit menu open the Preferences. Under the heading New Document Atributes select the Plain text radio button. Under the heading Default Plain Text Encodings select Unicode(UTF-8) in the drop down menu by Save:. Under the heading Saving check the box Overwrite read-only files. Put TextEdit into your Dock.
    From the Finder > Go menu select Go to Folder... Type /etc in the dialog box and press return. Locate the file- crontab. Drag the file onto the TextEdit icon in your Dock. The file should open. Your crontab file probably looks like this:
    # /etc/crontab
    SHELL=/bin/sh
    PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    HOME=/var/log
    #minute hour mday month wday who command
    #*/5 * * * * root /usr/libexec/atrun
    # Run daily/weekly/monthly jobs.
    #15 3 * * * root periodic daily
    #30 4 * * 6 root periodic weekly
    #30 5 1 * * root periodic monthly
    You need to remove the # on the following three lines.
    #15 3 * * * root periodic daily
    #30 4 * * 6 root periodic weekly
    #30 5 1 * * root periodic monthly
    Save the file and you should be good to go.

Maybe you are looking for

  • Accounts Recievable - Installment Payment Terms

    Hello Experts, This question is regarding installment payment terms. Let's talk about a scenario with installment term with 3 installments... Standard SAP generates 1 invoice with 3 line items The question and the requirement is that we need to gener

  • Business System of type Integration Server In SLD .

    Hi Can anybody tell what is the criteria on which we decide whether a business system to be created in the sld should be of type Integration Server or Application System . And also can we have only one  Business system of the type integration server

  • Publish to facebook business page

    how do I get my lightroom 4 publish services to link with my facebook Business account instead of my personal account

  • Blog Post Links Won't Work

    Greetings! My blog post links at http://HealthyDayFitness.com/ won't work and I can't figure out how to remedy the problem. Any help would be greatly appreciated! Cheers!

  • How to fix the error code B200 of MP258 canon printer?

    please help me how to fix the priter that has an error code B200 of MP258.