Scheduling Jon in OEM

Hi,
I want to write a shell script to Send a mail if any ORA error occurs in Alert.log file .This job has to be configured thru OEM .
below is my code (right now I am searching alertlog.file and writng these ORA errors to a file )
sqlnet.sh
cd /oracle/oradata/aplthyd/bdump;
tdate=`date | cut -c 1-10`;
thead=`grep -n "$tdate" alert_apltHyd.log | head -1 | cut -d : -f 1`;
ttail=`grep -n "$tdate" alert_apltHyd.log | tail -1 | cut -d : -f 1`;
echo $thead;
echo $ttail;
tlines=`expr "$ttail" - "$thead"`;
echo $tlines;
echo $tdate;
tail -n $tlines alert_apltHyd.log >/root/priya/pr.txt;
for i in `grep -n "ORA-" /root/priya/pr.txt | cut -d : -f 1 `;
do
echo $i
sed -n "$i"p /root/priya/pr.txt >> /root/priya/ora_"$tdate".txt
done.
can anyone please advice on scheduling shell script thru OEM and to send a mail

Perhaps there is a miscommunication some where...I am not sure.
You do realize the OEM has the capability of sending you emails right? You also realize the OEM automatically monitors the alert log for errors and can send you these errors via email?
So the question from the other poster was basically why reinvent the wheel?
Well if your environment is anything like mine, they do not have SMTP setup on the various environments and can only use the local mail function of the linux/unix environment.
You can setup the jobs through the OEM by going to the JOBs tab. Go to Job Library. Make sure 'Create Library Job' has OS Command selected and click GO.
You should be able to follow the tabs and inputs from there. You probably need to take the commands you posted and put them into a script with the appropriate priviliges.
Does this answer your question?
Regards
Tim

Similar Messages

  • Which are the required roles/privs for viewing all scheduler jobs in OEM?

    Platform: Oracle 11.1.0.6 Enterprise Edition (64) Windows 2008 R2 Server
    - I've created a new Admin user in "OEM>Setup>Adminstrators>Create"
    - I checked the user in "OEM>Server>Users":
    CREATE USER "SA_ADMIN"
    PROFILE "DEFAULT"
    INDENTIFIED BY "saadminsa"
    DEFAULT TABLESPACE "SYSAUX"
    TEMPORARY TABLESPACE "TEMP"
    ACCOUNT UNLOCK;
    GRANT SELECT ANY DICTIONARY TO "SA_ADMIN";
    GRANT "MGMT_USER" TO "SA_ADMIN"
    - "SA_ADMIN" was granted only the permissions above.
    - I can log in OEM as "SA_ADMIN"
    - I can see OEM backup jobs and the history
    - But I cannot see any "scheduler" jobs in "OEM>Server>Jobs"
    - I get a lists of the jobs in "OEM>Scheduler Central" but I cannot display any more information of "scheduler jobs"
    - I logged off from OEM
    - I granted SCHEDULER_ADMIN role to "SA_ADMIN"
    GRANT SCHEDULER_ADMIN TO "SA_ADMIN";
    - I logged back in OEM as "SA_ADMIN
    - I can now see some scheduler jobs, but not all of the jobs, I still cannot see any of the new jobs I created logged in OEM as SYS.
    Which are the required roles/privs for viewing all scheduler jobs in OEM?

    if you grant "SYSDBA" to the new Admin user then you can see the "scheduler" jobs.
    GRANT SYSDBA TO "SA_ADMIN";
    I wanted to grant "read" access in OEM for the new user.
    This behaviour is strange.
    Without the "SYSDBA" role the new user can see the OEM backup jobs that were create in as SYS, but it cannot see the "scheduler" jobs.

  • Required roles/privs for viewing all scheduler jobs in OEM 10g

    Hello,
    I would like to know wchich role/priv schould have user to view all scheduler jobs
    in OEM console 10g. My user can see only few jobs in Scheduler jobs part of OEM 10g. User sys see all scheduler jobs.
    Thank you for reply

    Hi,
    If this is a highly privileged user you can consider the CREATE ANY JOB privilege. But this privilege allows a user to run code as any other user so it should only be granted very carefully.
    A user can also view any job he is granted ALTER privileges on directly.
    Hope this helps,
    Ravi.

  • How to edit RMAN schedule script on OEM?

    I created a schedule backup script on RMAN using OEM. But I didin't include the log error clause in the script. But now I can't find in OEM where can I change the script. I found only where the script is showed.
    Someone could help me?

    You need to create new backup schedule with corrected script and remove the old one.

  • Scheduling jobs in OEM

    Hi,
    I get the following error-message:
    VNI-2015 : The Node preferred credentials for the target node are either invalid or do not have sufficient privileges to complete the operation.
    On Windows platforms, the Node credentials specified for the Windows target should have the "Logon as a batch job" privilege.
    Logon as batch job right has been given to the administrator-user. Node credentials have been set. I am trying to execute the OEM_EXEC_TEMPLATE. The used parameters: RUNTIME_OWNER LOC_STAG PLSQL MAP_CREDIT_LIMITS "," ","
    I have selected the Run SQLplus script option. Another question is where to find the deployed process scripts to execute.
    Hope you can help. Thankz in advance.
    Eric

    Eric,
    The preference is all about being able to logon as a background user and execute a batch job. If you are on Windows 2000, you would find this setting under your control panel, administrative tools, local security policy, local policies, user rights assignments, for the user you have selected to be your default logon credential. The 'Log on as batch job' privileges is by default not available for anyone, and you have to explicitly grant it in order for the OEM scheduling piece to work. This is documented in the installation and configuration guide.
    Hope this helps,
    Mark.

  • Monitor Scheduled Jobs in OEM

    Does anyone use OEM to monitor the success or failure of Scheduled Jobs?
    Can somebody point me in the right direction, either documentation or how you do this at your place of work.
    Documentation out there seems to be a little scarce with regards to this.
    Thanks!

    I should make myself a little clearer. I would like a job failure to automatically notify me - whether by email or any other means.
    The small bit of documentation that I find is in the OEM Advanced Configuratin Guide (B16242-01) section: 12.4 Passing Job Execution Status Information
    Thanks.

  • Scheduled Backups on OEM

    I suspect this is a silly question, but, I've always done backups using scripts from the OS. I recently set up one using OEM and it worked. I have two questions:
    1. Is there a backup schedule page that shows the next time it will run?
    2. How do I delete this backup job if I should choose to use OS scripts?
    Thanks,
    John

    1.<< Is there a backup schedule page that shows the next time it will run? >>
    --Log into the Grid control
    --Click on the Jobs tab on the top right hand side
    --select the Job activity subtab on the Jobs home page.
    -- select the status value to "Active" and hit the Go button .. It should list all the
    backup jobs which are running currently and the ones which are scheduled.
    2. How do I delete this backup job if I should choose to use OS scripts?
    -- Under the Job activity page, select the job you want to stop/delete and hit the
    stop/delete button based on what you want to do.

  • Scheduled backups on oem disappear after hardware crash

    I am using OEM12c 12.1.0.3 to manage 12 databases (11.2.0.3 and 11.2.0.4) on several suse11 linux machines.
    We schedule the backups thru oem (availability->backup&recovery->schedule backups)
    Last friday the hardware crashed, and once we got everything backup and running we noticed all of the scheduled backups
    were missing and we had to reschedule everything. Has anyone seen this behavior before or know how to prevent the schedules from disappearing,.
    It's a pain to have to reschedule everything.

    What had to be restored?  OMS/Repository? Or target databases?  
    If you look in EM at Enterprise -> Jobs -> Job Activity, be sure to go to advanced search, look for all Scheduled and see if they're there?
    If they were a group backup, might be scheduled as a Deployment Procedure instead.

  • Schedule AWR through OEM

    is there a way to schedule AWR reports using OEM

    As 1772421 suggested - have you tried running from enterprise reports?I recall creating something similar - you can create either a HTML or test report (using the plsql packages) and bundle / schedule from EM.
    If you navigate:
    Enterprise -> Reports -> BI Publisher Reports ->
    You will need to create a new report, monitoring type, target will be DB.
    If you run a table or report from sql you can then put in your awr statement (you'll need some dynamic sql to pull the last n snapshots into your comparison report).
    If you go for a custom report you can schedule it daily against one or more target DBs & also stipulate the DB group. It's commonly done for the tablespace usage report (which is a good template to use also).

  • Using &variables in a SQL Script scheduled job within OEM

    Hi...I've been searching through the forum looking for any examples of setting up a job within OEM, using the SQL Script job type, where I can basically use a WHERE clause that says 'where column_name = &variable_name' and somehow provide that at run time, as if I were in a SQL*Plus session and using a PROMPT and ACCEPT command. I thought there might be a way to emulate that situation by placing the value I'd like to qualify on within some placeholder in the Parameter section of the job. We have a few users who have limited access to OEM and need to run queries on GRANTS and ROLES for various users etc. I realize there are other ways to do this, however I'm wondering if OEM has a capability like this. Any info is appreciated! Tks!

    Looks like you're missing the schema name and you'll want to use QUOTENAME to add delimiters to the objects
    e.g. 
    DECLARE @DATABASE AS VARCHAR(50)
    DECLARE @SchemaName as SYSNAME;
    DECLARE @TABLE AS VARCHAR(50)
    DECLARE @QUERY AS VARCHAR(MAX)
    SELECT @DATABASE = '602'
    SELECT @SchemaName = 'dbo' --change as appropriate
    SELECT @TABLE = 'Items'
    SET @QUERY = 'SELECT TOP 10 * FROM ' + QUOTENAME(@DATABASE)+'.' + QUOTENAME(@SchemaName) + '.'+QUOTENAME(@TABLE)
    print @query
    EXEC( @QUERY)

  • Process Flow developing/deploying/executing and scheduling through OEM

    I have installed OWB92 and Oracle 9i, OEM configured, Oracle workflow 2.6.2 installed. I know OWB and scheduling mapping from OEM.
    I have created two mappings and a process flow. I want to schedule process flow from OEM. After creation of process flow, while I deploy it ask for a user/password/port/sid/host. I want to know which user I need to enter here.
    If anybody help me out in the this regard providing the detail steps.
    Thanks in advance.
    Liyakat

    Hi Henrik,
    After deploying the process flow, I am getting the following error:
    RPE-02085: Failed to test wb_rti_workflow_util.initialize through deployed Workflow Database Link R2MIS.US.ORACLE.COM@WB_LK_PACK1. Please check that "EXECUTE ANY PROCEDURE" privilege is set and that the OWB Runtime is available.
    - ORA-06550: line 1, column 7:
    PLS-00201: identifier '[email protected]@WB_LK_PACK1' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    OWB runtime is available.What I need to do now?
    Thanks and Regards,
    Liyakat

  • OEM 11g The Notification Schedule; Edit Schedule Definition buttons does not work

    When I go to the Edit Schedule Definition in OEM 11g and check the Days of Week schedule and try to hit the Batch-Fill-in button or any of the other buttons, nothing happens. It's as if the buttons
    are not working. I could really use some help on this.

    Hi,
    Are you using EM 11g Dbcontrol
    Is yes then we have a known issue marked in BUG 13907733
    Refer to below doc and apply the recommended patch
    Dbcontrol Email Notifications Are not received for metric alerts with a valid Notification Rule (Doc ID 1927762.1)
    Regards,
    Rahul

  • Error -Job scheduling

    Hi
    I am getting the following error while scheduling job using OEM:
    SQL*Plus: Release 9.2.0.1.0 - Production on Wed Jun 8 12:22:36 2005
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Enter user-name: ERROR:
    ORA-28009: connection to sys should be as sysdba or sysoper
    Enter user-name: Enter password: ERROR:
    ORA-01005: null password given; logon denied
    Enter user-name:
    ora-28009: connection to sys should be as sysdba or sysoper
    Can anybody help me in resolving this issue.
    TIA
    Aqueel.

    Don't connect as SYS, it should not be used for such daily tasks. Use a non-SYSDBA user, if you use SYS it must be a connection as SYSDBA (9i and higher), this is not possible in all OEM areas, so this error message occurs.

  • RMAN backup job status not showing in OEM

    Hi, I have created an RMAN backup job and scheduled it through OEM to run daily. The first run of this backup job completed today - however I do not see any entry for the job in OEM through SERVER - ORACLE SCHEDULER - JOBS
    A lot of scheduler jobs are listed but not my backup job.
    Has anyone else experienced this ?

    Duplicate post. Please do not add to this thread.

  • RMAN settings in OEM not accepting changed password

    Database 10.2.0.3.0, 32 and 64 bit versions.
    OSes: Windows 2003 R2 Standard Edition
    The previous DBA had the same password for the sys, system, and rman accounts. The RMAN backups are scheduled through the OEM's Backup/Recovery Schedule Backup. I finally changed the passwords so that sys, system, and rman are now different. I changed the rman password to be the same as in the Oracle rman account in the Windows local user accounts and made sure that the rman account is in the ora_dba account and that batch jobs are permitted. Note that these scheduled jobs were working just fine so I suspect the windows accounts are correctly configured. The rman account I'm using is the rman account used in a repository. This is the only Oracle rman account among all the databases that I backup.
    I attempted to schedule a job to run immediately using the new password in the Host Credentials and I check the box for 'Save as Preferred Credential' but at the end of the run I get the error: RMAN-04004: error from recovery catalog database: ORA-01017: invalid username/password; logon denied
    I'm logged into the OEM with the same exact system account log in as I would use from the rman command line target connection.
    The Recovery Catalog Settings will not accept this new password. Instead I get the error message:
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    After so many attempts the error message will say the account is locked and it is locked in the repository so it appears to be attempting validation against the correct location.
    I prefer using the OEM over the Windows Task Scheduler - any ideas on what to do?
    Edited by: pointreyes on Feb 4, 2010 8:30 AM - Discovered that a scheduled job ran immediately will fail to work as well.
    Edited by: pointreyes on Feb 4, 2010 8:39 AM - note that I did not change all the passwords at the same time. The sys and system passwords were changed last week and the backups continued to work. Only after the RMAN password was changed did the backups fail.

    EdStevens wrote:
    pointreyes wrote:
    Database 10.2.0.3.0, 32 and 64 bit versions.
    OSes: Windows 2003 R2 Standard Edition
    <snip>
    I prefer using the OEM over the Windows Task Scheduler - any ideas on what to do?
    Edited by: pointreyes on Feb 4, 2010 8:30 AM - Discovered that a scheduled job ran immediately will fail to work as well.
    Edited by: pointreyes on Feb 4, 2010 8:39 AM - note that I did not change all the passwords at the same time. The sys and system passwords were changed last week and the backups continued to work. Only after the RMAN password was changed did the backups fail.This is exactly why I don't schedule my rman backups in OEM. I never was able to figure out what was going on under the covers, but if I have to recreate something every time I change the password, then I'm looking for a different approach. Since I work in Unix, create shell scripts to execute my rman backups, and schedule them with cron. If on windows, I'd take the same approach .. the one you prefer not to use. OEM is a great tool, but it's not the perfect solution for every problem.Actually this is not really an OEM problem. I discovered this when I changed the rman catalog schema owner password and then attempted to backup the system through a remote job on another server. I am surprised if you changed your rman catalog schema owner that you have not ran into this yourself. Unless you are doing backups from a centralzied server that the rman catalog resides on.
    You come across all kinds of interesting things no matter which tool us use. For example we are to log onto the system using our personal accounts and then sudo to Oracle....guess what happened when the Oracle users password expired...
    Now that was a fun day....other DBA..."Backups are not working.."....Me..."Yes they are just fine when I execute them.".....other DBA.."Well cron jobs do not work."....Me..."Anyone log in recently with Oracle user??"
    Problem was that the Oracle user password had expired and was needing to be changed.....cronjobs don't like it when that happens.

Maybe you are looking for

  • Delivery costs to stock account for GR

    Dear All, For the delivery cost for purchasing, I created new condition types for each and mapped them to transaction keys(all of them are mapped to FRE and FR1 keys).  While creating PO, related conditions are entered to item details and planned cos

  • Xslt mapping can't get date from java

    I am trying to get the current date/time from java in my xsl mapping. I can't seem to get it to work. This is the code I am using in my xsl file. <IDField>   <xsl:template name="currentTime" xmlns:date="java:java.util.Date"> <xsl:value-of select="dat

  • BPM Studio 11g: New Process doesn't work

    Hi, Just downloaded JDeveloper 11.1.1.3 and extension "Oracle BPM Studio 11g". I created a BPM application, a BPM project and in this project a try to make a new Process, but after new > BPM Tier > Process, nothing happens. Am I missing something? Th

  • CS UI not displayed correctly

    On a normal 2560*1440 resolution on windows Adobe products are not displayed correctly. the UI elements are tiny and unusable. Is there a setting to tell Adobe CS to behave normally?

  • When looking at videos on Facebook I get an error that says something went wrong try again

    When looking at videos on Facebook I get an error that says "something went wrong try again"