tag:blogger.com,1999:blog-58973458777023014152023-11-15T06:50:12.416-08:00Tech-ShareWelcome to Tech-Sharephanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5897345877702301415.post-24604593551889009772012-02-07T02:23:00.000-08:002012-02-07T02:23:42.428-08:00How to Identify OS or Oracle 64 bit or 32 bit<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
How to Identify OS or Oracle 64 bit or 32 bit on Unix<br />---------------------------------------------------------------<br />It is very common question which version of oracle I need to install. 32 bit or 64 bit? As a 64-bit operating system can support either a 32-bit database or a 64-bit database. A 32-bit operating system cannot support a 64-bit database. So, version identification of the OS is necessary prior to install oracle. The following procedure will hopefully help you.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Check whether OS is 64 bit or 32 bit.<br />-----------------------------------------<br />On Solaris,</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
SQL> !/usr/bin/isainfo -kv<br />64-bit amd64 kernel modules</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
SQL> !/usr/bin/isainfo -v<br />64-bit amd64 applications<br />cx16 mon sse3 pause sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu<br />32-bit i386 applications<br />cx16 mon sse3 pause sse2 sse fxsr mmx cmov sep cx8 tsc fpu</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
This output tells us that solaris operating systems allow co-existence of 32-bit and 64-bit files.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
On AIX,<br />$ getconf -a | grep KERN<br />$ file /usr/lib/boot/unix*<br />On Linux,</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
On HP-UX,<br />/usr/bin/ getconf KERNEL_BITS<br />/usr/bin/file /stand/vmunix</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
On linux,</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
$uname -a<br />Linux debian 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
If the output is x86_64 then 64-bit and i686 or similar for 32-bit.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
On windows,</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Start>All Programs>accessories> System Tools>System Information>look for under System summary.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Or start>run>dixdiag>Then check for WHQL digital signature.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Determine of whether Oracle Software is 32 bit or 64 bit.<br />--------------------------------------------------------------------------------<br />Method 1:<br />--------------<br />Go to $ORACLE_HOME/bin and see.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
# cd $ORACLE_HOME/bin<br /># file oracle<br />oracle: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Here it comes 64 bit and hence oracle software is 64 bit. If the output of the "file oracle" command does not say 64-bit explicitly then you are running 32-bit Oracle.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
If you had 32 bit oracle software installed then output will be like,</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
oracle@sol:/db/oracle/bin$ file oracle<br />oracle: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Method 2:<br />----------------------<br />Log on to SQL*plus and see the banner.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
-bash-3.00$ sqlplus / as sysdba</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
SQL*Plus: Release 10.2.0.2.0 - Production on Thu May 15 02:50:37 2008</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Connected to:<br />Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production<br />With the Partitioning, OLAP and Data Mining options</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Method 3:Query from v$version.<br />-------------------------------------<br />sys@THERAP> select * from v$version;</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
BANNER<br />----------------------------------------------------------------<br />Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod<br />PL/SQL Release 10.2.0.2.0 - Production<br />CORE 10.2.0.2.0 Production<br />TNS for Solaris: Version 10.2.0.2.0 - Production<br />NLSRTL Version 10.2.0.2.0 - Production</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Method 4: Check for lib, lib32<br />--------------------------------------</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
1) $ORACLE_HOME/lib32<br />2) $ORACLE_HOME/lib</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
If the two directories $ORACLE_HOME/lib32 and $ORACLE_HOME/lib are existing then it is 64 bit.</div>
<div style="background-color: white; color: #333333; font-family: 'Trebuchet MS', Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1.2em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
If there is only an ORACLE_HOME/lib directory then it is 32 bit client.</div>
</div>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0tag:blogger.com,1999:blog-5897345877702301415.post-9371642093676227902011-01-18T02:33:00.001-08:002011-01-18T02:33:35.605-08:00Linux / Unix Command: top<div id="abw" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-top-color: rgb(255, 51, 0); border-top-style: solid; border-top-width: 3px; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; margin-left: auto; margin-right: auto; margin-top: 0px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px; position: relative; text-align: left; text-decoration: inherit; width: 930px;"><div class="clear" id="abm" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-decoration: inherit; zoom: 1;"><div id="abc" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: -336px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-decoration: inherit; width: 930px;"><div id="articlebody" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; margin-left: 0px; margin-right: 351px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: static; text-decoration: inherit;"><h2 style="color: inherit; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; font: normal normal normal 14px/1.3 Verdana; margin-bottom: 1.3em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">NAME</h2>top - display top CPU processes<a href="" name="lbAC" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"></a><h2 style="color: inherit; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; font: normal normal normal 14px/1.3 Verdana; margin-bottom: 1.3em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">SYNOPSIS</h2><b style="font-weight: bold;">top</b> [<b style="font-weight: bold;">-</b>] [<b style="font-weight: bold;">d</b> <i style="font-style: italic;">delay</i>] [<b style="font-weight: bold;">p</b> <i style="font-style: italic;">pid</i>] [<b style="font-weight: bold;">q</b>] [<b style="font-weight: bold;">c</b>] [<b style="font-weight: bold;">C</b>] [<b style="font-weight: bold;">S</b>] [<b style="font-weight: bold;">s</b>] [<b style="font-weight: bold;">i</b>] [<b style="font-weight: bold;">n</b> <i style="font-style: italic;">iter</i>] [<b style="font-weight: bold;">b</b>]<a href="" name="lbAD" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"></a><h2 style="color: inherit; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; font: normal normal normal 14px/1.3 Verdana; margin-bottom: 1.3em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">DESCRIPTION</h2><b style="font-weight: bold;">top</b> provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes. It can sort the tasks by CPU usage, memory usage and runtime. can be better configured than the standard top from the procps suite. Most features can either be selected by an interactive command or by specifying the feature in the personal or system-wide configuration file. See below for more information.<div style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"><a href="" name="lbAE" style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"></a></div><h2 style="color: inherit; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; font: normal normal normal 14px/1.3 Verdana; margin-bottom: 1.3em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">COMMAND-LINE OPTIONS</h2><dt style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"><b style="font-weight: bold;">-d</b></dt><br />
<dd style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; margin-left: 3em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">Specifies the delay between screen updates. You can change this with the <b style="font-weight: bold;">s</b>interactive command.</dd><br />
<dt style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;"><b style="font-weight: bold;">-p</b></dt><br />
<dd style="font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; margin-left: 3em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;">Monitor only processes with given process id. This flag can be given up to twenty times. This option is neither available interactively nor can it be put into the configuration file.</dd></div></div></div></div>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0tag:blogger.com,1999:blog-5897345877702301415.post-63429914842207879682011-01-10T07:41:00.000-08:002011-01-10T07:41:08.640-08:00oraenv or coraenv, ORACLE_HOME, ORACLE_SID & oratab<div style="font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"><b><span class="Apple-style-span" style="font-weight: normal;"></span></b></div><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;"><div style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1pt; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; color: black; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"> <h1 style="border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 1.2pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"><span class="Apple-style-span" style="font-size: large;"><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; font-weight: normal; line-height: 19px;"><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;"><br />
</h1><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;">Oraenv</h1><div id="bodyContent"><div id="contentSub" style="color: #7d7d7d; font-size: 11px; line-height: 1.2em; margin-bottom: 1.4em; margin-left: 1em; margin-right: 0px; margin-top: 0px; width: auto;"></div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"><b>Oraenv</b> and <b>coraenv</b> are <a href="http://www.orafaq.com/wiki/Unix" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Unix">Unix</a>/ <a href="http://www.orafaq.com/wiki/Linux" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Linux">Linux</a> command line utilities that sets the required environment variables (<a href="http://www.orafaq.com/wiki/ORACLE_SID" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="ORACLE SID">ORACLE_SID</a>, <a href="http://www.orafaq.com/wiki/ORACLE_HOME" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="ORACLE HOME">ORACLE_HOME</a> and PATH) to allow a user to connect to a given database instance. If these environment variables are not set, commands such as <a href="http://www.orafaq.com/wiki/SQL%2APlus" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="SQL*Plus">SQL*Plus</a>, imp, exp, or any other utility for that matter, will not work (or not be found).</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Use <i>coraenv</i> when using the C Shell and <i>oraenv</i> when using a Bourne, Korn or Bash shell.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Note the syntax: ". oraenv" or {period} {space} oraenv.</div><a href="" name="Examples" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;"></a><h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; font-weight: normal; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em;"><span class="editsection" style="float: right; font-size: 13px; margin-left: 5px;">[<a href="http://www.orafaq.com/wiki/index.php?title=Oraenv&action=edit&section=1" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Edit section: Examples">edit</a>]</span><span class="mw-headline">Examples</span></h2><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Interactive:</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">$ . oraenv
ORACLE_SID = [] ? orcl
</pre><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Non-interactive (handy for scripting):</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">$ export ORACLE_SID=orcl
$ export ORAENV_ASK=NO
$ . oraenv</pre></div></span></span></h1></div><div style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1pt; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; color: black; font-size: 24px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"><h1 style="border: none; margin-bottom: 1.2pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; mso-border-bottom-alt: solid #AAAAAA .75pt; mso-line-height-alt: 14.4pt; mso-padding-alt: 0in 0in 0in 0in; padding: 0in;"><span style="color: black; font-family: "Arial","sans-serif"; font-size: 18.0pt; font-weight: normal;"></span><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; font-weight: normal; line-height: 19px;"><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;"><br />
</h1><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;">ORACLE HOME</h1><div id="bodyContent"><div id="contentSub" style="color: #7d7d7d; font-size: 11px; line-height: 1.2em; margin-bottom: 1.4em; margin-left: 1em; margin-right: 0px; margin-top: 0px; width: auto;"></div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"><b>ORACLE_HOME</b> refers to either:</div><ol style="line-height: 1.5em; list-style-image: none; margin-bottom: 0px; margin-left: 3.2em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="margin-bottom: 0.1em;">a <i>directory</i> where the Oracle software is installed; or</li>
<li style="margin-bottom: 0.1em;">an <i>environment variable</i> pointing to the directory where the Oracle software is installed.</li>
</ol></div></span></h1></div><div style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: initial; background-origin: initial; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1pt; color: black; font-size: 24px; padding-bottom: 12pt; padding-left: 12pt; padding-right: 12pt; padding-top: 12pt;"><pre style="background: #F9F9F9; border: none; line-height: 13.2pt; mso-border-alt: dashed #2F6FAB .75pt; mso-padding-alt: 12.0pt 12.0pt 12.0pt 12.0pt; padding: 0in;"><span class="Apple-style-span" style="font-family: sans-serif; font-size: 19px; font-weight: normal; line-height: 19px; white-space: normal;">Windows</span></pre></div><div style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: initial; background-origin: initial; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1pt; color: black; font-size: 24px; padding-bottom: 12pt; padding-left: 12pt; padding-right: 12pt; padding-top: 12pt;"><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; font-weight: normal; line-height: 19px;"><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Check current value:</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">echo The current ORACLE_HOME is %ORACLE_HOME%
</pre><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Set the ORACLE_HOME environment variable:</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">set ORACLE_HOME=C:\oracle\ora10.2
</pre><a href="" name="Unix_.26_Linux" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;"></a><h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; font-weight: normal; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em;"><span class="editsection" style="float: right; font-size: 13px; margin-left: 5px;">[<a href="http://www.orafaq.com/wiki/index.php?title=ORACLE_HOME&action=edit&section=2" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Edit section: Unix & Linux">edit</a>]</span><span class="mw-headline">Unix & Linux</span></h2><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Check current value:</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">env | grep ORACLE_HOME
</pre><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Change the ORACLE_HOME environment variable (valid for bash and ksh):</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">export ORACLE_HOME=/app/oracle/product/10.2.0/db_1</pre></span></div><div style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1pt; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; color: black; font-size: 24px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"> <span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; font-weight: normal; line-height: 19px;"><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;"><br />
</h1><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;">ORACLE SID</h1><div id="bodyContent"><div id="contentSub" style="color: #7d7d7d; font-size: 11px; line-height: 1.2em; margin-bottom: 1.4em; margin-left: 1em; margin-right: 0px; margin-top: 0px; width: auto;"></div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">The <b>Oracle System ID</b> (<a href="http://www.orafaq.com/wiki/SID" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="SID">SID</a>) is used to uniquely identify a particular database on a system. For this reason, one cannot have more than one database with the same SID on a computer system.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">When using <a href="http://www.orafaq.com/wiki/RAC" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="RAC">RAC</a>, all instances belonging to the same database must have unique SID's.</div><a href="" name="Switching_between_databases" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;"></a><h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; font-weight: normal; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em;"><span class="editsection" style="float: right; font-size: 13px; margin-left: 5px;">[<a href="http://www.orafaq.com/wiki/index.php?title=ORACLE_SID&action=edit&section=1" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Edit section: Switching between databases">edit</a>]</span><span class="mw-headline">Switching between databases</span></h2><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Set the <b>ORACLE_SID</b> environment variable (or ORA_SID on VMS systems) to work on a particular database. Remember that the SID is case sensitive in Unix / Linux environments.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Windows:</div><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;">set ORACLE_SID=orcl
</pre><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Unix/ Linux:</div></div></span><h1 style="border: none; margin-bottom: 1.2pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; mso-border-bottom-alt: solid #AAAAAA .75pt; mso-line-height-alt: 14.4pt; mso-padding-alt: 0in 0in 0in 0in; padding: 0in;"><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 24px; font-weight: normal;"><span class="Apple-style-span" style="font-family: monospace; font-size: 13px; line-height: 14px; white-space: pre;">export ORACLE_SID=orcl</span></span></h1><div><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 24px; font-weight: normal;"><span class="Apple-style-span" style="font-family: monospace; font-size: 13px; line-height: 14px; white-space: pre;"><span class="Apple-style-span" style="font-family: sans-serif; line-height: 19px; white-space: normal;"><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;"><br />
</h1><h1 class="firstHeading" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 24px; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-top: 0.5em;">Oratab</h1><div id="bodyContent"><div id="contentSub" style="color: #7d7d7d; font-size: 11px; line-height: 1.2em; margin-bottom: 1.4em; margin-left: 1em; margin-right: 0px; margin-top: 0px; width: auto;"></div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"><b>Oratab</b> is a colon-delimited text file on <a href="http://www.orafaq.com/wiki/Unix" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Unix">Unix</a> and <a href="http://www.orafaq.com/wiki/Linux" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Linux">Linux</a> systems that associates <a href="http://www.orafaq.com/wiki/ORACLE_SID" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="ORACLE SID">ORACLE_SID</a> and <a href="http://www.orafaq.com/wiki/ORACLE_HOME" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="ORACLE HOME">ORACLE_HOME</a> values.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">The last field contains a "Y" or "N" for database startup when the machine boots up. One can also use hashes (#) to start comment lines.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">This file is either found in the <i>/var/opt/oracle</i> or the <i>/etc</i> directories.</div><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">Scripts like <a href="http://www.orafaq.com/wiki/Oraenv" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Oraenv">oraenv</a>, <i>dbhome</i>, <i>dbstart</i> and <i>dbshut</i> use the oratab file.</div><a href="" name="Sample_oratab_file" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;"></a><h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; font-weight: normal; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em;"><span class="editsection" style="float: right; font-size: 13px; margin-left: 5px;">[<a href="http://www.orafaq.com/wiki/index.php?title=Oratab&action=edit&section=1" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #002bb8; text-decoration: none;" title="Edit section: Sample oratab file">edit</a>]</span><span class="mw-headline">Sample oratab file</span></h2><pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;"># This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/opt/oracle/product/10.2.0/db_1:Y
</pre><div style="line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;">The above <i>oratab</i> file describes an Oracle instance called <i>orcl</i> (don't confuse this with the database name!) that uses directory <i>/opt/oracle/product/10.2.0/db_1</i> as its Oracle home. The <i>Y</i>indicates that this database should be started when the system boots up.</div></div></span></span></span></div></div></h1>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0tag:blogger.com,1999:blog-5897345877702301415.post-91788393086492946752011-01-10T06:31:00.000-08:002011-01-10T06:31:00.357-08:00SUDO <br />
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="mso-cellspacing: 0in; mso-padding-alt: 0in 0in 0in 0in; mso-yfti-tbllook: 1184; width: 100.0%;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"> <td style="padding: 0in 0in 0in 0in;" valign="top"> <div class="MsoListParagraph" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto;"><span style="font-family: "Times New Roman","serif"; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <b><span class="Apple-style-span" style="color: red;">Linux / Unix Command: <i>sudo</i></span></b></span><span style="font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div></td> </tr>
</tbody></table><br />
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: 0in; margin-right: 11.25pt; margin-top: .25in; text-indent: .5in;"><span style="color: #333333; font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";">sudo - execute a command as another user<a href="" name="lbAC"></a><o:p></o:p></span></div><div class="MsoListParagraphCxSpFirst" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: .5in; margin-right: 11.25pt; margin-top: .25in; mso-add-space: auto; mso-outline-level: 2;"><span style="font-family: 'Times New Roman', serif;"><b><span class="Apple-style-span" style="color: red;">SYNOPSIS</span></b><span class="Apple-style-span" style="color: #333333;"><o:p></o:p></span></span></div><div class="MsoListParagraphCxSpMiddle" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: .5in; margin-right: 11.25pt; margin-top: .25in; mso-add-space: auto;"><a href="" name="ixAAC"></a><b><span style="color: #333333; font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";">sudo</span></b><span style="color: #333333; font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";"> <b>-V</b> | <b>-h</b> | <b>-l</b> | <b>-L</b> | <b>-v</b> | <b>-k</b> | <b>-K</b> | <b>-s</b> | [ <b>-H</b> ] [<b>-P</b> ] [<b>-S</b> ] [ <b>-b</b> ] | [ <b>-p</b> <i>prompt</i> ] [ <b>-c</b> <i>class</i>|<i>-</i> ] [ <b>-a</b> <i>auth_type</i> ] [ <b>-u</b> <i>username</i>|<i>#uid</i> ] <i>command<a href="" name="lbAD"></a><o:p></o:p></i></span></div><div class="MsoListParagraphCxSpMiddle" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: .5in; margin-right: 11.25pt; margin-top: .25in; mso-add-space: auto;"><br />
</div><div class="MsoListParagraphCxSpMiddle" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: .5in; margin-right: 11.25pt; margin-top: .25in; mso-add-space: auto; mso-outline-level: 2;"><span style="font-family: 'Times New Roman', serif;"><b><span class="Apple-style-span" style="color: red;">DESCRIPTION</span></b><span class="Apple-style-span" style="color: #333333;"><o:p></o:p></span></span></div><div class="MsoListParagraphCxSpLast" style="background: white; line-height: normal; margin-bottom: .25in; margin-left: .5in; margin-right: 11.25pt; margin-top: .25in; mso-add-space: auto;"><a href="" name="ixAAD"></a><b><span style="color: #333333; font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";">sudo</span></b><span style="color: #333333; font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman";"> allows a permitted user to execute a <i>command</i> as the superuser or another user, as specified in the <i>sudoers</i> file. The real and effective uid and gid are set to match those of the target user as specified in the passwd file (the group vector is also initialized when the target user is not root). By default, <b>sudo</b> requires that users authenticate themselves with a password (NOTE: by default this is the user's password, not the root password). Once a user has been authenticated, a timestamp is updated and the user may then use sudo without a password for a short period of time (5<br />
minutes unless overridden in <i>sudoers</i>).<o:p></o:p></span></div>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0tag:blogger.com,1999:blog-5897345877702301415.post-8054133116371669262011-01-10T06:23:00.000-08:002011-01-10T06:23:43.621-08:00Crontab<div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">L<a href="http://kevin.vanzonneveld.net/techblog/tag/linux/" style="background-color: inherit; color: #cb4721; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;">inux</a> has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. You could also use it to automatically create backups, synchronize files, <a href="http://kevin.vanzonneveld.net/techblog/article/schedule_automatic_updates_on_ubuntu/" style="background-color: inherit; color: #cb4721; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;">schedule updates</a>, and much more. Welcome to the wonderful world of <a href="http://kevin.vanzonneveld.net/techblog/tag/crontab/" style="background-color: inherit; color: #cb4721; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;">crontab</a>.</div><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">The crontab (cron derives from <em style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">chronos</em>, Greek for time; tab stands for <em style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">table</em>) command, found in Unix and Unix-like operating systems, is used to schedule commands to be executed periodically. To see what crontabs are currently running on your system, you can open a terminal and run:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">sudo crontab -l</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">To edit the list of <em style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">cronjobs</em> you can run:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">sudo crontab -e</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">This wil open a the default editor (could be vi or pico, if you want you can <a href="http://kevin.vanzonneveld.net/techblog/article/change_the_default_editor/" style="background-color: inherit; color: #cb4721; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;">change the default editor</a>) to let us manipulate the crontab. If you save and exit the editor, all your cronjobs are saved into crontab. Cronjobs are written in the following format:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">* * * * * /bin/execute/this/script.sh</pre></span><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Scheduling explained</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">As you can see there are 5 stars. The stars represent different date parts in the following order:</div><ol style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 30px; margin-right: 30px; margin-top: 10px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">minute (from 0 to 59)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">hour (from 0 to 23)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">day of month (from 1 to 31)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">month (from 1 to 12)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">day of week (from 0 to 6) (0=Sunday)</li>
</ol><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Execute every minute</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">If you leave the star, or asterisk, it means <strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong>. Maybe that's a bit unclear. Let's use the the previous example again:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">* * * * * /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">They are all still asterisks! So this means execute <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">/bin/execute/this/script.sh</code>:</div><ol style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 30px; margin-right: 30px; margin-top: 10px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong> minute</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of <strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong> hour</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of <strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong> day of the month</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of <strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong> month</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">and <strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">every</strong> day in the week.</li>
</ol><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">In short: This script is being executed every minute. Without exception.</div><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Execute every Friday 1AM</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">So if we want to schedule the script to run at 1AM every Friday, we would need the following cronjob:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</span> <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> * * <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">5</span> /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Get it? The script is now being executed when the system clock hits:</div><ol style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 30px; margin-right: 30px; margin-top: 10px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">minute: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of hour: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of day of month: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</code> (every day of month)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of month: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</code> (every month)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">and weekday: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">5</code> (=Friday)</li>
</ol><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Execute on workdays 1AM</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">So if we want to schedule the script to Monday till Friday at 1 AM, we would need the following cronjob:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</span> <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> * * <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-5</span> /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Get it? The script is now being executed when the system clock hits:</div><ol style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 30px; margin-right: 30px; margin-top: 10px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">minute: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of hour: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of day of month: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</code> (every day of month)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">of month: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</code> (every month)</li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">and weekday: <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1-5</code> (=Monday til Friday)</li>
</ol><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Execute 10 past after every hour on the 1st of every month</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Here's another one, just for practicing</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span> * <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> * * /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Fair enough, it takes some getting used to, but it offers great flexibility.</div><div class="bsap_1240801 bsap" id="bsap_1240801" style="color: #525252; display: block; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 590px;"></div><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Neat scheduling tricks</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">What if you'd want to run something every 10 minutes? Well you could do this:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</span>,<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span>,<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">20</span>,<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">30</span>,<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">40</span>,<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">50</span> * * * * /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">But crontab allows you to do this as well:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">*/<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span> * * * * /bin/execute/this/script.sh</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Which will do exactly the same. Can you do the the math? ;)</div><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Special words</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">If you use the first (minute) field, you can also put in a keyword instead of a number:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">@reboot Run once, at startup
@yearly Run once a year <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"0 0 1 1 *"</span>
@annually <span style="color: #66cc66; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>same as @yearly<span style="color: #66cc66; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>
@monthly Run once a month <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"0 0 1 * *"</span>
@weekly Run once a week <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"0 0 * * 0"</span>
@daily Run once a day <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"0 0 * * *"</span>
@midnight <span style="color: #66cc66; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>same as @daily<span style="color: #66cc66; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>
@hourly Run once an hour <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"0 * * * *
</span></pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Leave the rest of the fields empty so this would be valid:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">@daily /bin/execute/this/script.sh</pre></span><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Storing the crontab output</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">By default cron saves the output of <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">/bin/execute/this/script.sh</code> in the user's mailbox (root in this case). But it's prettier if the output is saved in a separate logfile. Here's how:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">*/<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span> * * * * /bin/execute/this/script.sh <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2</span>>&<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> >> /var/log/script_output.log</pre></span><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Explained</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Linux can report on different levels. There's standard output (STDOUT) and standard errors (STDERR). STDOUT is marked 1, STDERR is marked 2. So the following statement tells Linux to store STDERR in STDOUT as well, creating one datastream for messages & errors:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2</span>>&<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span></pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Now that we have 1 output stream, we can pour it into a file. Where <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">></code> will overwrite the file, <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">>></code> will append to the file. In this case we'd like to to append:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">>> /var/log/script_output.log</pre></span><div class="bsap_1240804 bsap" id="bsap_1240804" style="color: #525252; display: block; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 590px;"></div><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Mailing the crontab output</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">By default cron saves the output in the user's mailbox (root in this case) on the local system. But you can also configure crontab to forward all output to a real email address by starting your crontab with the following line:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;"><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MAILTO=</span><span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"yourname@yourdomain.com"</span></pre></span><h3 style="clear: both; color: #c34e23; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.5em; font-weight: normal; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; line-height: 19px; margin-bottom: -8px; margin-left: 0px; margin-right: 15px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Mailing the crontab output of just one cronjob</h3><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">If you'd rather receive only one cronjob's output in your mail, make sure this package is installed:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">aptitude install mailx</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">And change the cronjob like this:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">*/<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span> * * * * /bin/execute/this/script.sh <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2</span>>&<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> | mail -s <span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"Cronjob ouput"</span> yourname@yourdomain.com</pre></span><h2 style="border-bottom-color: orange; border-bottom-style: dotted; border-bottom-width: 1px; clear: both; color: #390e02; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 1.7em; font: normal normal normal 1.8em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: -1px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 18px; margin-top: 22px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;">Trashing the crontab output</h2><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Now that's easy:</div><span class="Apple-style-span" style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px;"><pre class="mycode" style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: #424242; display: block; font: normal normal normal 11px/normal 'Lucida Console', 'courier new', monospace; line-height: 12px; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; max-height: 500px; overflow-x: auto; overflow-y: visible; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: pre; width: 550px;">*/<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">10</span> * * * * /bin/execute/this/script.sh <span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2</span>>&<span style="color: #cc66cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span> > /dev/null</pre></span><div style="color: #525252; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; font-size: 12px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 15px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Just pipe all the output to the null device, also known as the black hole. On Unix-like operating systems, <code style="background-attachment: initial; background-clip: initial; background-color: #fcfcf9; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font: normal normal 500 1em/1.5em 'Lucida Console', 'courier new', monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">/dev/null</code> is a special file that discards all data written to it.</div>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0tag:blogger.com,1999:blog-5897345877702301415.post-60513459241945422432010-11-21T05:35:00.000-08:002010-11-21T05:35:59.601-08:00My First post on Oracle<span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px;"><span class="Apple-style-span" style="color: #e06666;">Oracle database system—identified by an alphanumeric system identifier or SID—comprises at least one <a href="http://en.wikipedia.org/wiki/Database" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;" title="Database">instance</a> of the application, along with data storage. An instance—identified persistently by an instantiation number (or activation id: SYS.V_$DATABASE.ACTIVATION#)—comprises a set of operating-system <a href="http://en.wikipedia.org/wiki/Process_(computing)" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;" title="Process (computing)">processes</a> and <a href="http://en.wikipedia.org/wiki/Computer_data_storage" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;" title="Computer data storage">memory</a>-structures that interact with the <a href="http://en.wikipedia.org/wiki/Computer_data_storage" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;" title="Computer data storage">storage</a>. Typical processes include PMON (the process monitor) and SMON (the system monitor).</span></span>phanirajahttp://www.blogger.com/profile/02627355534272310501noreply@blogger.com0