[Cron] Unix, Linux

 

주기적인 프로그램 수행 : cron 시설  [ 04/05/27 03:18 ]

cron주기적으로 프로그램을 수행할 수 있게 해주는 유닉스 시설이다.

crontab 파일
보통 : /var/spool/cron/crontabs / FreeBSD : /var/cron/tabs, /etc/crontab
리눅스 : /var/spool/cron(레드햇) / /var/spool/cron/tabs(수세)
/etc/crontab(레드햇,수세)


crontab 형식
보통 : 시스템 V (사용자 필드가 없음)
BSD : /etc/crontab(사용자 이름이 6번째 필드여야 함)


cron.allow, cron.deny 파일
보통 : /var/adm/cron / FreeBSD : /var/cron
리눅스 : /etc(레드햇) , /var/spool/cron(수세)
솔라리스 : /etc/cron.d


관련기능
보통 : 없음 / FreeBSD : periodic 유틸리티
리눅스 : /etc/cron.*(houry, daily, weekly, monthly)
레드햇 : anacron 유틸리티


cron 로그 파일
보통 : /var/adm/cron/log / FreeBSD : /var/log/cron
리눅스 : /var/log/cron / 솔라리스 : /var/cron/log


crond의 pid 가 기록되어 있는 파일
보통 : 없음 / FreeBSD : /var/run/cron.pid
리눅스 : /var/run/crond.pid(레드햇), /var/run/cron.pid(수세)


cron을 시작하는 부팅 스크립트
FreeBSD : /etc/rc / HP-UX : /sbin/init.d/cron
리눅스 : /etc/init.d/cron / 솔라리스 :/etc/init.d/cron


부팅 스크립트 설정 파일 cron 관련 엔트리
FreeBSD : /etc/rc.conf / cron_enable="YES",cron_flags="args-to-cron"
HP-UX : /etc/rc.config.d/cron (CRON=1) / 리눅스 : 사용하지 않음
솔라리스 : /etc/default/cron (CRONLOG=yes)


 

crontab 파일

무엇을 실행하고 언제 실행할지 여부를 결정하는 파일, cron 스케줄.

*시스템 V 방식 에서 사용자는 기본적으로 crontab 엔트리는 사용자마다 /var/spool/cron/crontabs/사용자명 디렉토리에 저장된다.
예) /var/spool/cron/crontabs/root

* BSD 방식은 전통적으로 /etc/crontab 파일 하나만 사용한다.
*FreeBSD,리눅스 시스템은 파일도 사용하고 디렉토리도 사용한다.

crontab 파일은 직접적인 편집보다 crontab 명령어를 이용하여 생성 수정한다.

crontab 파일의 엔트리
 
                |-----------------------------------------------|
                | 필드  |   표기되는 대상   |    사용가능한 값       |
                |-----------------------------------------------|
                | 필드1 |             분            |         0 - 59, *         |
                | 필드2 |            시간          |         0 - 23, *         |
                | 필드3 |             일            |         1 - 31, *         |
                | 필드4 |             월            |         1 - 12, *         |
                | 필드5 |            요일          | 0 - 6 (0=sunday), * |
                | 필드6 | 명령(행의 끝까지) |                             |
                |-----------------------------------------------|


minutes hours day-of-month weekday command
  
1.각필드는 공백으로 구분하고 요일후에는 모든것을 명령어로 취급하므로 공백이 포함될수 있다.
2.필드에는 단일 숫자, 숫자-숫자(범위) , 쉼표로 분리한 단일숫자 또는 범위 목록, 애스터리크 사용가능
3. 첫문자가 # 일경우 주석처리
4. 명령어에 퍼센트기호(%)가 있으면 기호 이후에 나타나는 텍스트를 표준 입력으로 사용한다. 이후에 나타나는 퍼센트 기호는 텍스트를 여러행으로 분리하는 데 사용한다.
  예) 30 11 31 12 * /usr/bin/wall%Hppy New Year!%Let's make it treat!
5. 요일과 날짜는 OR 처리된다고 생각할수 있다.
  예) * * 1 1 1 /usr/local/bin/test55 (1월1일 과 매 월요일에 실행된다)
<참고> BSD 시스템에서는 여섯 번째 필드는 명령어를 실행할 사용자 계정이고 요일도 달라서 월요일이 1이고 일요일이 7이다
  예) 0 3 * * 6-7 root /var/adm/weekend.sh


FreeBSD, 리눅스 crontab 엔트리 형식 향상점
1. 월과 요일은 처음 세글자로 줄여 지정가능 (예, mon, jan, feb....)
2. 일요일을 0과 7모두 사용 가능
3. 범위 목록을 동시에 사용가는 (예, 2,4,6-7) -> HP-UX에서도 가능함
4. /n 을 통해 주기를 지정할수 있다.
   (예) 시를 8-18/2 -> 8시부터18시까지 2시간마다
      분을 */5 5분마다
5. crontab 파일에서 본 셸 형식으로 환경 변수 정의 가능
   (예) MAILTO=kenauros
6. FreeBSD 시스템에서는 스케쥴 필드 대신 특수 문자열을 사용할수 있다
    @reboot
    @yearly    1월1일 자정
    @monthly 매달 1일 자정
    @weekly 매주 일요일 자정
    @daily 자정
    @hourly 매시간 0분


crontab 엔트리 추가 하기
$crontab mycron
/var/spool/cron/crontabs/유저명 에 mycron 파일 생성

$crontab -l
crontab 엔트리 보기

$crontab -r
crontab 엔트리 제거

$crontab -e
직접 crontab 파일을 변경

#crontab -e adm
루트가 adm 의 crontab 엔트리 변경
FreeBSD,리눅스 에서는 -u 를 통해 사용자를 지정가능
#crontab -e -u adm


cron 보안 문제

cron.allow 파일이 존재할경우 사용자 이름이 있어야만 crontab을 실행할수 있다
cron.allow 파일은 없지만 cron.deny가 있으면 cron.deny 에 없는 사람만 crontab

명령어를 사용할수 있다. cron.deny가 빈파일이면 아누나 cron 기능을 사용할수 있다.
두 파일 모두 없으면 루트만 하용할수 있다.(리눅스 , FreeBSD 에서는 두파일 모두 없으면

아무나 사용할수 있다.)

 

 

[Cron] Solaris, HP, AIX

 

[Solaris]
솔라리스에서는 crondtab -e하면 않되네요..
어떻게 해야 편집되요?

EDITOR=vi
export EDITOR

 

[HP]

$ crontab -e
crontab: you are not authorized to use cron.  Sorry.
$ crontab -l
crontab: you are not authorized to use cron.  Sorry.

 

#vi /var/adm/cron/cron.allow


# ps -ef | grep cron
    root  1132     1  0  Mar 31  ?         0:00 /usr/sbin/cron
    root 10570 10174  0 09:50:09 pts/tc    0:00 grep cron
#cd /sbin/init.d

# ./cron stop
cron stopped
# ps -ef | grep cron
    root 10579 10174  0 09:50:33 pts/tc    0:00 grep cron
# ./cron start
cron started
#

 

[AIX]

# more /etc/inittab

cron:23456789:respawn:/usr/sbin/cron

...

 

http://unix.co.kr/data/irix/?p=11

inittab: script for the init process
형식: id:level:action:process
기능: 
 id : 유일한 두개 또는 하나의 문자.
 level: (0~6, s, S)
level이 빈란이면 action은 모든 level들에대하여 가능.
 action :  어떤 행동을 취해야 하 는지를 알고있는 스크립를 실행.
action의 종류는
sysinit int가 시스템 콘솔을 다루기를 시도하기전에 수행해야할 활동을 해라.
respawn 프로세스를 시작하고, 이것이 죽으면 자동으로 재 시작해라.
wait 프로세스를 시작하고, 이 실행 상태를 위한 다음 에트리로 가기 전에 , 끝날때까지 기다려라.
boot  단지 부팅시에만 에트리를 시작한다.
powerfail init가  power fail 신호를 받았을때 실행 해라.
bootwait 이것은 시스템이 부팅된후 single-user에서 multi-user 상태로 갈때 실행된다.
off 이것은 무시해라.
initdefault 디폴트 실행 단계를 지정해라. 일반적으로 2혹은 3으로 정해라.
once 이미 실행하고 있지않으면 프로세스를 시작한다.
bcheckrc root file system을 준비한다.
brc /etc/fstab을 체크해서 모든 파일 시스템을 마운트 시켜라.
rc0 shutdown level script
rc2 multiuser level script
uadmin 시스템 종료를 초기화하는 명령어.
 process :This is a sh command to be executed. 
예;
is:2:initdefault:
fs::sysinit:/etc/bcheckrc </dev/console >/dev/console 2>&1 
mt::sysinit:/etc/brc </dev/console >/dev/console 2>&1 
link::wait:/etc/lnsyscon > /dev/console 2>&1 < /dev/null 
s0:06s:wait:/etc/rc0 >/dev/console 2>&1 </dev/console 
s1:1:wait:/etc/shutdown -y -iS -g0 >/dev/console 2>&1 </dev/console 
s2:23:wait:/etc/rc2 >/dev/console 2>&1 </dev/console 
s3:3:wait:/etc/rc3 >/dev/console 2>&1 </dev/console 
s4:06:wait:/etc/umountfs > /dev/console 2>&1 
of:0:wait:/etc/uadmin 2 0 >/dev/console 2>&1 </dev/console 
RB:6:wait:/etc/init.d/announce restart 
rb:6:wait:/etc/uadmin 2 1 >/dev/console 2>&1 </dev/console 


# on-board ports or on Challenge/Onyx MP machines, first IO4 board ports 
t1:23:respawn:/sbin/getty ttyd1 co_9600         # alt console 
t2:23:off:/sbin/getty -N ttyd2 co_9600          # port 2 
t3:23:off:/sbin/getty -N ttyd3 co_9600          # port 3 
t4:23:off:/sbin/getty -N ttyd4 co_9600          # port 4 
 

option:
 
 SEE ALSO 
     getty(1M), init(1M), sh(1), who(1), exec(2), open(2), signal(2). 
 

 

변경 ..

cron:23456789:wait:/usr/sbin/cron

 

재부팅 후..

#ps -ef | grep cron

#kill -9 ??

#/usr/sbin/cron start &

 

 

stopsrc [-h host] [-f | -c] -s subsystem_name

startsrc [-h host] [-e environment] [-a argument] -s subsystem_name

#stopsrc -s sendmail


 

 

[Cron][Log] SecureOS & Cron_Shellscript

 

SecureOS & Shellscript
#vi shellscript.pl

#/bin/bash
chmod 777 /root/testdir/testfile
cat /root/testdir/testfile

#./shellscript.pl
번호 서버 시간 접속IP목적IP 사용자 프로세스 대상 접근형태 대응방법 롤 인증서비스 터미널 시스템콜 
1 WOW7.3 08-11 01:18 192.168.22.1   (102 : root : 0) chmod (3610,47421) /root/testdir ACTL : W DENY Test_shellscript    chmod 
2 WOW7.3 08-11 01:18 192.168.22.1   (102 : root : 0) cat (3611,47459) /root/testdir ACTL : R DENY Test_shellscript  pts/1 open 
----------------------------------------------------------------------------------------

SecureOS & Cron

crontab -e 명령어를 통해서 예약작업을 설정하면..
/var/spool/cron/사용자명 파일로 저장됩니다.

$ crontab -l
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * cat /root/testdir/procfile
# crontab -l
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * cat /root/testdir/testfile

번호 서버 시간 접속IP목적IP 사용자 프로세스 대상 접근형태 대응방법 롤 인증서비스 터미널 시스템콜 
1 WOW7.3  08-11 01:41 0.0.0.0   (-1 : a : 102)         cat (1382,47459) /root/testdir ACTL : R ACPT Test_shellscript  notty open 
2 WOW7.3  08-11 01:41 0.0.0.0   (-1 : root : 0) cat (1381,47459) /root/testdir ACTL : R ACPT Test_shellscript  notty open 
----------------------------------------------------------------------------------------

SecureOS & Cron+Shellscript

# crontab -l
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * /root/HZ_Test/shellscript.pl

번호 서버 시간 접속IP목적IP 사용자 프로세스 대상 접근형태 대응방법 롤 인증서비스 터미널 시스템콜 
1 WOW7.3  08-11 01:53 0.0.0.0   (-1 : root : 0) chmod (1309,47421) /root/testdir ACTL : W ACPT Test_shellscript  notty chmod 
2 WOW7.3  08-11 01:53 0.0.0.0   (-1 : root : 0) cat (1310,47459) /root/testdir ACTL : R ACPT Test_shellscript  notty open 

 

 

목적 :

Cron을 사용하면서 luid=-1값을 가지고 cp, sh 등의 프로세스를 가지고 /var/adm에 접근하는 문제를 해결하도록 모색해 본다.

 

테스트 환경 :

Linux, Solaris, HP, AIX에 대해 테스트 하였습니다.

 

테스트 내용 :

시스템이 부팅된 후 Cron을 설정하면 다음과 같이 luid=-1 이 나옵니다.

17 03-22 09:35 155 0.0.0.0   (-1 : root : 0) abc.sh (8606,313631) /opt/XXXXX ACTL : X DENY .XXXXX tty/255   
18 03-22 09:35 155 0.0.0.0   (-1 : jhlee : 100) user.sh (8612,313631) /opt/XXXXX ACTL : X DENY .XXXXX tty/255 

 

root의 사용자로 로긴한 후 root 사용자가 Cron을 재시작하면 다음과 같이 luid=0 이 나옵니다.

19 03-22 09:38 155 0.0.0.0   (0 : root : 0) abc.sh (8652,313631) /opt/XXXXX ACTL : X DENY .XXXXX tty/255   
20 03-22 09:38 155 0.0.0.0   (0 : jhlee : 100) user.sh (8657,313631) /opt/XXXXX ACTL : X DENY .XXXXX tty/255 

 

(단 AIX만이 프로세스 명이 abc.sh이라고 나오지 않고 sh로 나왔습니다.)

 

결론 :

Cron을 사용하게 되면서 /var/adm 의 디렉토리에 cp, sh .. 등의 프로세스를 설정해 주어야 했는데..

Cron을 root가 재시작하고 정책에 관리자로서 root를 포함하여 위의 문제를 우회할 수 있을것 같습니다.

[출처] Cron|작성자 maniacat


'LinuX' 카테고리의 다른 글

klogin과 rlogin  (0) 2009.06.08
linux 파티션 나누기  (0) 2009.05.08
USB 휴대용 저장 장치 마운트  (0) 2008.09.08
linux make law device(리눅스 raw device 생성)  (0) 2008.09.04
dpkg와 apt 사용하기  (0) 2008.01.08

제목: How to Relink Oracle Database Software on UNIX
  문서 ID: NOTE:131321.1 유형: BULLETIN
  마지막 개정 날짜: 04-JUL-2008 상태: PUBLISHED

PURPOSE
-------

Provide relinking instructions for Oracle Database software
on UNIX platforms.

 
SCOPE & APPLICATION
-------------------

Anyone who maintains Oracle RDBMS software on a UNIX platform.


Relinking Oracle
================

Background:
Applications for UNIX are generally not distributed as complete executables.  
Oracle, like many application vendors who create products for UNIX, distribute 
individual object files, library archives of object files, and some source 
files which then get "relinked" at the operating system level during 
installation to create usable executables.  This guarantees a reliable
integration with functions provided by the OS system libraries.

Relinking occurs automatically under these circumstances:

 - An Oracle product has been installed with an Oracle provided installer.
 - An Oracle patch set has been applied via an Oracle provided installer.  

The following information has been added to the 'Certify' section of Metalink:

   General Notes For Oracle Database - Enterprise Edition:
   O/S Information: 
   The vendors guarantee operating system binary compatibility; therefore, no 
   reinstall or relink of the Oracle software is required when upgrading these
   operating systems unless specifically stated otherwise.

Relinking Oracle manually is suggested under the following circumstances
(even though the OS vendor may not require it):

 - An OS upgrade has occurred.
 - A change has been made to the OS system libraries.  This can occur during 
   the application of an OS patch.
 - A new install failed during the relinking phase.
 - Individual Oracle executables core dump during initial startup.
 - An individual Oracle patch has been applied (however, explicit relink 
   instructions are usually either included in the README or integrated into 
   the patch install script) 

Customers who want to (or have been advised to) manually relink should follow 
the procedure below.

[Step 1] Log into the UNIX system as the Oracle software owner
==============================================================================
Typically this is the user 'oracle'.
 

[STEP 2] Verify that your $ORACLE_HOME is set correctly:
===============================================================================
For all Oracle Versions and Platforms, perform this basic environment check 
first:
 
 % cd $ORACLE_HOME
 % pwd    

 ...Doing this will ensure that $ORACLE_HOME is set correctly in your current 
    environment.
 

[Step 3] Verify and/or Configure the UNIX Environment for Proper Relinking:
===============================================================================
For all Oracle Versions and UNIX Platforms:
 The Platform specific environment variables LIBPATH, LD_LIBRARY_PATH, & 
 SHLIB_PATH typically are already set to include system library locations like
 '/usr/lib'.  In most cases, you need only check what they are set to first, 
 then add the $ORACLE_HOME/lib directory to them where appropriate.
 i.e.:  % setenv LD_LIBRARY_PATH ${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
 (see Note 131207.1 How to Set UNIX Environment Variables for help with 
 setting UNIX environment variables)

If on AIX with:
--------------
    
    NOTE: Before relinking, after stopping all required processes, issue the
    following as root to detach all files from memory that are not attached 
    to an active process:

         # /usr/sbin/slibclean

    Oracle 7.3.X:
       - Set LIBPATH to include $ORACLE_HOME/lib
    
    Oracle 8.0.X:
       - Set LIBPATH to include $ORACLE_HOME/lib
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib and 
         $ORACLE_HOME/network/lib (Required when using Oracle products that 
         use Java)
       - Set LINK_CNTRL to L_PTHREADS_D7 if using AIX 4.3. ('oslevel' verifies 
         OS version)
    
    Oracle 8.1.X, 9.X.X, 10.X.X or 11.x.x:
       - For 8.1.5, set LINK_CNTRL to L_PTHREADS_D7
       - If not 8.1.5, ensure that LINK_CNTRL is not set
       - Set LIBPATH to include $ORACLE_HOME/lib
      

If on DATA GENERAL AVIION (DG) with:
-----------------------------------

    Oracle 7.3.X or 8.0.X:
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib
       - ensure TARGET_BINARY_INTERFACE is unset
    
    Oracle 8.1.X:
       - Set LD_LIBRARY_PATH to include 
         $ORACLE_HOME/lib:$ORACLE_HOME/JRE/lib/PentiumPro/native_threads

If on HP-UX with:
----------------

    Oracle 7.3.X, 8.0.X, 8.1.X;
       - Set SHLIB_PATH to $ORACLE_HOME/lib
       If using 64bit 8i Oracle, also
       - Set LD_LIBRARY_PATH to $ORACLE_HOME/lib64
       - ensure LPATH is unset
 
    Oracle 9.X.X, 10.X.X or 11.x.x;
       - ensure LPATH is unset

If on NCR with:
--------------

    Oracle 7.3.X, 8.0.X or 8.1.X:
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib:/usr/ccs/lib

If on SCO UNIXware with:
-----------------------

    Oracle 7.3.X or 8.0.X:
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib
    
    Oracle 8.1.X:
       - Set LD_LIBRARY_PATH to include 
         $ORACLE_HOME/lib:$ORACLE_HOME/JRE/lib/x86at/native_threads

If on SGI with:
--------------

    32bit Oracle 7.3.X or 8.0.X:
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib
       - Set SGI_ABI to -32  

    64bit Oracle 8.0.X or 8.1.X (8i is only available in 64bit):
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib
       - Set SGI_ABI to -64
       - If one does not already exist, create the file compiler.defaults and 
         set the COMPILER_DEFAULTS_PATH variable:

     In the Oracle software owner's $HOME directory, create a file called
     'compiler.defaults':
  
        % cd $HOME
        % echo "-DEFAULT:abi=64:isa=mips3:proc=r10k" > compiler.defaults

     Then set the environment variable COMPILER_DEFAULTS_PATH to point to the
     $HOME directory.
  
        % setenv COMPILER_DEFAULTS_PATH $HOME
  
     If this is not set, relinking will fail because the compiler defaults to
     MIPS4 objects although Oracle requires MIPS3.
       - Set LD_LIBRARY64_PATH to include the $ORACLE_HOME/lib and the 
         $ORACLE_HOME/javavm/admin directories. 
       - Set LD_LIBRARYN32_PATH to include the $ORACLE_HOME/lib32 directory. 
         NOTE: LD_LIBRARY64_PATH & LD_LIBRARYN32_PATH must be undefined when 
         installing software with Oracle Universal Installer. 

If on SOLARIS (Sparc or Intel) with:
------------------------------------

    Oracle 7.3.X, 8.0.X, or 8.1.X:
       - Ensure that /usr/ccs/bin is before /usr/ucb in $PATH  
         % which ld   ....should return '/usr/ccs/bin/ld'

       If using 32bit(pre 9i) Oracle, 
       - Set LD_LIBRARY_PATH=$ORACLE_HOME/lib

       If using 64bit(pre 9i) Oracle, 
       - Set LD_LIBRARY_PATH=$ORACLE_HOME/lib
       - Set LD_LIBRARY_PATH_64=$ORACLE_HOME/lib64

    Oracle 9.X.X or higher:
       - LD_LIBRARY_PATH & LD_LIBRARY_PATH_64 do not need to be set to include
         a reference to $ORACLE_HOME/lib or $ORACLE_HOME/lib64 for a generic database
         software installation. 
         (However they should not contain a reference to the ORACLE_HOME of another Oracle version)

If on Digital/Tru64, IBM/Sequent PTX, Linux or any other UNIX Platform not 
mentioned above with:
------------------------------------------------------------------------------

    Oracle 7.3.X, 8.0.X, 8.1.X, 9.X.X, 10.X.X or 11.x.x:
       - Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib


[Step 4] For all Oracle Versions and UNIX Platforms: 
===============================================================================
Verify that you performed Step 2 correctly:

 % env|pg  ....make sure that you see the correct absolute path for 
   $ORACLE_HOME in the variable definitions.
 

[Step 5] For all Oracle Versions and UNIX Platforms: 
===============================================================================
Verify umask is set correctly:

 % umask

This must return 022.  If it does not, set umask to 022.

 % umask 022
 % umask

[Step 6] Run the OS Commands to Relink Oracle: 
===============================================================================
Important Note:  Before relinking Oracle, shut down both the database and the 
                 listener.
Important Note:  The following commands will output a lot of text to your 
                 session window.  To capture this output for upload to support,
                 redirect the output to a file.
Important Note:  If relinking a client installation, it's expected that some 
                 aspects of the following commands will fail if the components
                 were not originally installed.

For all UNIX platforms:

Oracle 7.3.x 
------------
 For executables:  oracle, exp, imp, sqlldr, tkprof 

      % cd $ORACLE_HOME/rdbms/lib 
      % make -f ins_rdbms.mk install

 For executables:  svrmgrl, svrmgrm 

      % cd $ORACLE_HOME/svrmgr/lib 
      % make -f ins_svrmgr.mk linstall minstall      <- linstall is for svrmgrl, 
                                                        minstall is for svrmgrm

 For executables:  sqlplus 

      % cd $ORACLE_HOME/sqlplus/lib 
      % make -f ins_sqlplus.mk install

 For executables:  dbsnmp, oemevent, oratclsh 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_agent.mk install

 For executables:  names, namesctl 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_names.mk install

 For executables:  tnslsnr, lsnrctl, tnsping, csmnl, trceval, trcroute 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_network.mk install


Oracle 8.0.x 
------------
 For executables:  oracle, exp, imp, sqlldr, tkprof, mig, dbv, orapwd, rman, 
                   svrmgrl, ogms, ogmsctl 

      % cd $ORACLE_HOME/rdbms/lib 
      % make -f ins_rdbms.mk install

 For executables:  sqlplus 

      % cd $ORACLE_HOME/sqlplus/lib 
      % make -f ins_sqlplus.mk install

 For executables:  dbsnmp, oemevent, oratclsh, libosm.so 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_oemagent.mk install

 For executables:  tnslsnr, lsnrctl, namesctl, names, osslogin, trcasst, 
                   trcroute 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_network.mk install


Oracle 8.1.X, 9.X.X, 10.X.X or 11.x.x
-------------------------------------
  *** NEW IN 8i AND ABOVE ***

   A 'relink' script is provided in the $ORACLE_HOME/bin directory.
     % cd $ORACLE_HOME/bin
     % relink      ...this will display all of the command's options.
       usage: relink <parameter>
       accepted values for parameter: all, oracle, network, client, 
       client_sharedlib, interMedia, precomp, utilities, oemagent, ldap 
  
  Note: ldap option is available only from 9i. In 8i, you would have to manually relink
  ldap.

  You can relink most of the executables associated with an Oracle Server Installation
  by running the following command:
     % relink all    
  This will not relink every single executable Oracle provides(you can
  discern which executables were relinked by checking their timestamp with
  'ls -l' in the $ORACLE_HOME/bin directory).  However, 'relink all' will 
  recreate the shared libraries that most executables rely on and thereby
  resolve most issues that require a proper relink. 

 
 -or-

  Since the 'relink' command merely calls the traditional 'make' commands, you 
  still have the option of running the 'make' commands independently:

 For executables:  oracle, exp, imp, sqlldr, tkprof, mig, dbv, orapwd, rman, 
                   svrmgrl, ogms, ogmsctl 

      % cd $ORACLE_HOME/rdbms/lib 
      % make -f ins_rdbms.mk install

      NOTE: After relinking the oracle executable, make sure that the 
      permissions on the executable are 6751 (-rwsr-s--x). If they are
      not, run the following command as the Oracle software owner:

      % cd $ORACLE_HOME/bin
      % chmod 6751 oracle

 For executables:  sqlplus 

      % cd $ORACLE_HOME/sqlplus/lib 
      % make -f ins_sqlplus.mk install

 For executables:  isqlplus   (Oracle9i and higher versions)

      % cd $ORACLE_HOME/sqlplus/lib 
      % make -f ins_sqlplus.mk install_isqlplus

 For executables:  dbsnmp, oemevent, oratclsh 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_oemagent.mk install

      NOTE: After relinking the dbsnmp executable, it is necessary to run
      the following commands as root (so that the ownership/permissions on
      the executable are correct):

      # cd $ORACLE_HOME/bin
      # chown root dbsnmp
      # chmod 6750 dbsnmp

      @ References: Note 233559.1 and Bug 2858326

 For executables:  names, namesctl 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_names.mk install

 For executables:  osslogin, trcasst, trcroute, onrsd, tnsping 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_net_client.mk install

 For executables:  tnslsnr, lsnrctl 

      % cd $ORACLE_HOME/network/lib 
      % make -f ins_net_server.mk install

 For executables related to ldap (for example Oracle Internet Directory):

      % cd $ORACLE_HOME/ldap/lib
      % make -f ins_ldap.mk install

How to Tell if Relinking Was Successful:
===============================================================================
If relinking was successful, the make command will eventually return to the OS 
prompt without an error. There will NOT be a 'Relinking Successful' type
message.


If You Receive an Error Message During Relinking:
===============================================================================
Confirm that the message you received is an actual fatal error and not a 
warning. Relinking errors usually terminate the relinking process and contain 
verbage similar to the following:
'Fatal error', 'Ld: fatal', 'Exit Code 1'
While warnings will look similar to: 'ld: warning: option -YP appears more than
once, first setting taken' and can most often be ignored.

If you receive an error that terminates the relinking process, your first step 
should be to extract the relevant information about the error from the make 
output:

This can be broken down into three basic steps:
 1. Identify the OS utility that is returning the error.
    'ld', 'make', 'cc', 'mv', 'cp', 'ar' are common sources.
 2. Identify the type of error:
    'Permission Denied', 'Undefined Symbol', 'File Not Found' are common types.
 3. Identify the files or symbols involved.

Using the information from above as keywords, search Oracle's Metalink 
repository ( http://metaLink.oracle.com ) for previous occurrences of the same 
error. If no previous occurances are found or a solution is not provided, 
generate an iTAR that includes the complete error text.

Help setting environment variables.
==============================================================================
See Note 131207.1 How to Set UNIX Environment Variables 
for help with setting UNIX environment variables.


Relinking with Orainst:
===============================================================================
For Oracle7 & Oracle8 only, the following document illustrates how to relink 
with the 'orainst' utility:
   Note 1032747.6 HOW TO RELINK ORACLE USING THE 7.3.X INSTALLER
While 'orainst' will run the same commands as [Step 4], performing [Step 4] 
manually from a UNIX shell is the preferred approach.


RELATED DOCUMENTS
-----------------

Note 131207.1   How to Set UNIX Environment Variables
Note 109621.1   HP/UX: LD_LIBRARY_PATH and SHLIB_PATH
Note 1032747.6  HOW TO RELINK ORACLE USING THE 7.3.X INSTALLER
Bug 1337908     THE $ORACLE_HOME/BIN/RELINK SCRIPT DOES NOT RELINK EXP, IMP 
                  SQLLOADER


+ Recent posts