Why my cron for primary/secondary server does not work, but worked at the prompt of

I have redhat linux version 5, oracle servers 11 GR 2.

I have cronjobs to monitor the use of tablespace and alert logs.

However they do not work to the task, but if I execute them at the command prompt, it worked.

What could be the problem?
example cron script:
Head of the script:

#! / bin/bash
. / u01/app/Oracle/bin/hydev_env
MAILTO = "DBA.com"
LOG=/U01/app/Oracle/dba_cron/out/tablespace_90_full.html
echo $ORACLE_SID
sqlplus-s < <-EOF > > / dev/null
/ as sysdba


Cron job set is like this:


#------------------------TABLESPACES Check------------------------------------------------------------------------
0.35 * /u01/app/oracle/dba_cron/scripts/tablespaces_over_90%.sh > /u01/app/oracle/dba_cron/out/tablespaces_over_90%.log > 2 > & 1


VI/var/spool/mail/oracle:

At the error like this:
/ bin/sh:-c: line 0: about syntax error unexpected token '2'
/ bin/sh:-c: line 0: ' /u01/app/oracle/dba_cron/scripts/chk_ora_alert_all.sh > /u01/app/oracle/dba_cron/out/chk_oracle_alert_all.log > 2 > & 1'


Any help guru?

Hello;

Usually it is a question of the environment.

The script works in command prompt, because when you signed on your chosen username environment of a profile settings, for example .bash_profile.

A crontab task presents no environment. That's why you call hydev_env at the beginning of the script. If something things are missing in your env file especially likely.

What I do is keep a file for each database in the environment to a place like this:

/ u01/app/Oracle/dba_tool/env (/ u01/app/oracle/dba_tool/env/PRIMARY.env)

The PRIMARY.env file is .env

What I keep in there, that's all I need a job like crontab background would need:

ORACLE_BASE=/u01/app/oracle

ULIMIT=unlimited

ORACLE_SID=PRIMARY

ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2

ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

LIBPATH=$LD_LIBRARY_PATH:/usr/lib

TNS_ADMIN=$ORACLE_HOME/network/admin

PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/lbin:/GNU/bin/make:/u01/app/oracle/dba_tool/bin:/home/oracle/utils/SCRIPTS:/usr/local/bin:.

export TERM=vt100

export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT

export ORACLE_HOME

export LIBPATH LD_LIBRARY_PATH ORA_NLS33

export TNS_ADMIN

export PATH

export MAILTO=

Important If you are not sure, a setting on your system type "env" at a Linux prompt, when you are logged in as user where the script works. Change as needed in your file .env.

I have here a script call in crontab to check the tablespaces

#!/bin/bash
####################################################################
#

if [ "$1" ]
then DBNAME=$1
else
echo "basename $0 : Syntax error : use . quickcheck  "
exit 1
fi

#
# Set the Environmental variable for the instance
#
. /u01/app/oracle/dba_tool/env/${DBNAME}.env
#
#

$ORACLE_HOME/bin/sqlplus /nolog <

Note how I passes the name of the comic as a parameter to the script if I can use the script with several database without changing.

/U01/app/Oracle/dba_tool/bin/quickCheck.sh primary SCHOOL

Is the crontab to run every day at 05:12:

12 05 * /u01/app/oracle/dba_tool/bin/quickcheck.sh PRIMARY > /tmp/quickcheck.out

Best regards

mseberg

Tags: Database

Similar Questions

  • 85.255.116.148 primary dns server does not work

    I am trying to view an email and it telling me I can't because of the server main dns 85.255.116.148 and it keeps failing how to fix this problem

    Hello

    How are you connected?  Do you have a router?

    What do you use to get/reviews by e-mail?

    Look at this thread, read the answer in the section starting with:

    "One of the most common problems associated with Windows Vista Update error 80244019 is DNSChanger Trojan."

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_other-windows_update/Windows-Update-error-x080244019/42bf67c9-b97d-435D-bfb3-a93f30e1e598

  • I often trust my Norton Toolbar for sites, and it does not work with the new updates. Can I uninstall updates recent Mozilla up to what this module works with Mozilla, but I'm stuck? Thank you!

    It's probably very easy to understand this and to uninstall the updates to date, but, well, I am slightly tech-illiterate! I use my Norton Toolbar a lot for the sites I visit frequently, and this no compatibility issue is the same reason I stick with Mozilla on Chrome, but now I can not even use my Norton with Mozilla information. Thank you.

    http://community.Norton.com/T5/Norton-Internet-security-Norton/Norton-toolbar-not-compatible-with-FF-4-0-1/TD-p/442788

  • I put Windows 7 on Windows 10 and Photoshop CS wants to turn back me and get and the Adobe authorization code.  The online server does not work and the provided phone number is out of service.  How can I get this Adobe authorization code?

    How can I get the authorization code of Adobe for re - activate Photoshop CS?  It worked fine until I updated Windows 7 Windows 10.

    The activation for Cs2 servers and more have been disabled by Adobe, and they offer a free download of CS2, which comes with a new serial number and doesn't require activation.

    There is no need to register your old software, follow the instructions in the link I gave you and download CS2. The series number is next to the download.

  • HP 6450 b HARD drive in secondary Bay does not work

    I bought a HARD drive caddy to mount a drive to expand on my HP 6450 b (Win 10) using the connection of SATA DVD ROM.

    First with SO HARD drive is a WD 250 GB SATA 2 3 GB/s.

    I see my product spec TEC and I chose a HARD Seagate 500 GB SATA 3 6 Gbps drive to put in the caddy as a secondary HARD drive.

    I mounted the caddy with the new HARD drive, but it does not work: initially, the portable green light turn on, but does not Society. Without any error message, after a few seconds the led become yellow and green for some time and after that the PC turns off.

    When I put off the caddy with the secondary HARD disk, the OS starts correctly.

    I read similar posts in the forum and I have:

    (1) check the option in the BIOS to activate the secondary HARD drive is active (in FACT, it is enable)

    (2) turn off the launch of the er disk HARD secondary (DONE)

    (3) test on the HARD drive (in FACT, it's OK)

    I tried to set up in BIOS the SATA 3 GB/s speed, but I can't find the option. I see that someone has done this action.

    That would be the problem?

    I also think that could be a problem with drivers to support the new secondary HARD drive, but I don't know how to do.

    Is there someone who could help me?

    Thank you

    Andrea

    Andrea_Mogni wrote:

    New test: the pc does not start if I put on the caddy without hard drive.

    I think it is proof that the problem is my caddy.

    I would also come to this conclusion. Request a RMA number for that one and find another brand.

  • Why ERP login does not work in the same host?

    Hello
    I installed 5 OEL and Oracle ERP 12.0.4. Everything went smoothly, all services are up & running and capable of connection/working from a remote computer on the network using microsoft xp. Why don't ERP login page does not work in the same host (linux server) using Mozilla Firefox? I missed extra configuration?

    Concerning

    Hello

    You go head with the downloaded version. It will work Fine.

    Thank you
    Yakub.

    Published by: 900856 on November 27, 2012 12:58 AM

  • Crush the account for new host settings does not work.

    I would be grateful if someone could help me, my email hosting company a supplier has changed, but my two addresses remain the same. Crushing my two POP3 accounts with the new settings of the server does not work. I checked with the new owner that the settings are correct, but they suggest that this problem is probably down to Thunderbird and profiles in a way works and is outside their mission of support. My provider is puzzled, but to be honest I only have a small amount of ability here. I need to keep all of my old emails and their structure files and to get the connection to the new servers host works. Anyone who wants to help?

    Thank you, Simon

    I had the help of my provider to fix this.

    Basically, you cannot overwrite an existing account with new parameters. The answer is to create a new account and edit the old one so it does not carry the same settings of server and user name. Now, I spend all my archives of old emails to the new account, but which is described elsewhere, I think.

  • Firefox 10 for Mac - 11 installation does not work with Cooliris I have to install Firefox 10

    Firefox 10 for Mac - 11 installation does not work with Cooliris I have to install Firefox 10

    Double post please see also /questions/925441 #answer - 326583

  • WiFi link for printer EPSON-750 does not work

    WiFi link for printer EPSON-750 does not work. In spite of reset the WiFi on the printer and reset the EPSON 750 as default printer on the IMac, the connection between the iMac and the printer does not work

    Have you also tried to restart the router?

  • My mother has forgotten her password. Reset does not work and the e-mail for it no longer works.

    My mothers account is * address email is removed from the privacy *. She cannto remember his password. A standard to reset request does not work as the old email not available more

    Hi MorganSilver,

    Thank you for visiting the Microsoft answers community.

    The question you have posted is bound using Windows Live and would be better suited in the Center of Windows Live Help solutions. Please visit this link to find a community that will support what ask you

  • 4clipika for satluj police (Punjabi) does not work with windows 8

    R/Sir

    4clipika software for satluj police (Punjabi) does not work with windows 8, but it works with 7 and windows xp. Please solve this problem.

    BSwakaf

    I suggest you cont developer patches or updates.  It is for the developer to make it work with win 8-not the other way around.

  • Serial number does not work after the transfer of OSX and apps for the new Macbook Pro

    My serial number does not work after the transfer of applications and OS X for my new Mac.  Although the Adobe specifications say it is compatible with the older OS X, it does not seem to have no compatibility issues because

    -My old Macbook Pro has Yosemite and was fully running CS5 Web premium without a problem.

    -My new computer has the same * exact * OS X transferred in which the suite was fully functional with the trial.

    A support of top-level, software engineer, or someone who takes care of the soap operas could

    -Please provide a number of test series to test with?

    - And/or activate my series?

    - Or show how to disable the publication series on the old disk hard if I can't use the old computer?  So that I can use with the new computer?

    I chatted with technical support that keeps saying that it's a compatibility problem, to install with old OS X or buy a newer version. But I know that CS5 works with Yosemite (as I use it myself), and the only question I had is that serial # says invalid, which is separate from the functionality of the program.

    I'd rather not spend hundreds more to get a new suite, when I spent a lot for CS5 already and know is fully functional on Yosemite.  I have also not return to an older operating system and break things.

    Moreover, I used to be a general technical Support and I am a coder of web applications, so I understand that this isn't just some sort of "reboot" of the question

    No info to solve this, or a means to achieve at the highest level Tech support, would be greatly appreciated!

    Thank you!

    Transferred apps will certainly question of activation, because licenses files creation is completely dependent on machine, it willl created according to the particular Machine ID, if you transfer the application from one computer to another, there is incompatibility.

    Therefore, it is very necessary that you are using the original installation media.

    Download the CS5 products

    If you do not agree with the process of removing and reinstalling, try wiping the contents of SLCache and rename the SLStore folder.


    WARNING: Do not forget once erase you the contents of this folder, all Adobe applications will ask the new license or re-enter the serial number.

    Location: /Library/Application Support / Adobe.

    It is strictly recommended to install Adobe applications using the original installation media.

  • The license we use for an old PC no longer valid for the new PC - uninstall of the old PC and still does not work on the new PC

    Hello

    The license we use for an old PC no longer valid for the new PC - uninstall of the old PC and still does not work on the new PC

    A disable the old installation before you uninstalled?  If this isn't the case, then it is always considered as enabled, which could mean that you have all your activations in use.  You can contact the Adobe Support via chat and ask them to reset your activations.

    Chat support - the link below click the still need help? the option in the blue box below and choose the option to chat...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Serial number and activation support (non - CC) chat
    http://helpx.Adobe.com/x-productkb/global/Service1.html ( http://adobe.ly/1aYjbSC )

    If none of this helps can you identify which software it comes and what error messages you get when you try to run on the new machine?

  • Hyperlink does not work in the Adobe Viewer, why?

    Hello world! I create an interactive newsletter in Indesign CS6 for the iPad and iPhone. I have a 3D model I want to demonstrate, but that's the problem. I have a link to the Viewer IPM (the 3D model is there), but when I use this URL does not work. The address begins with: ipm: / /.

    When I press the link in the Adobe viewer it shows: a error 101 Also just to inform that I have on my ipad and iphone viewer IPM.

    I really want to have this link to work. Please help me out! Is there another way to show a 3D model in Indesign?

    Thank you

    VV

    PS Plus early I tried to use the 360 view full of images, but finally the saddest is that it works ONLY horizontally! And that made me very disappointed honestly say.

    Hyperlinks open in the in-app browser, which will not work. Try to create a button, not a hyperlink. In the overlays Panel, set the button to view it in an external browser. See if it works.

  • Why do code grayscaler site image Web does not work with Mozilla Firefox, but it does to another browser?

    I just noticed that my code (in my blog site), which is a regular code that allows the image to transform into its form in grayscale and cast its original color, does not work with the Mozilla Firefox browser. But with other browsers, it works. I hope you can help me with this little problem. Thank you!

    Should I use a CSS rule that is similar to:

    filter: grayscale(100%)
    

    This property is not yet implemented in Firefox. It is supposed to be implemented in Firefox 34, according to https://developer.mozilla.org/en-US/docs/Web/CSS/filter

Maybe you are looking for

  • I want that my shop, found in card apple

    in apple card, I can't find my shop, I have my shop position in card apple

  • I get a message saying "Windows cannot open the file...". »

    I had a lot of problems with infections, so I was running many scanning programs. After getting my computer almost completely cleaned, I ran the Super Anti-Spyware program.  We find 3 infections, which I'd delete (I don't have no way of knowing that

  • Outlook Express sent items have disappeared

    Outlook Express 6 compacted my messages. Once she had finished I went to sent items and all of my emails I sent between March 2010 and now (August 2010) disappeared. I searched the file store, located the sent items.dbx ran through a program of dbx a

  • S2110 - screenshot, how do you take one?

    How to take a screenshot with this Tablet? I couldn't get a power + home-work. These forums allow us to upload photos or any link is based? I don't know how to read the battery meter. I ran to 1% left and he says he's on for 11 hours and 26 minutes.

  • ImageButton does not appear in C++ instead of QML mode?

    Goal: Show the image on the screen buttons. ERRO: ImageButton does not appear in C++ instead of QML mode. Question: something wrong in my code?, or the imagebutton control develops now? Mini code: imageButton = ImageButton:: create().defaultImage (QU