눈바래다

echo "++++++++++++++++++++++++++"

echo "         FTP           "

echo "++++++++++++++++++++++++++"

ftp -v -n 10.10.10.10 << EOF

        user ope unix1

        bin

        cd /home/pro/rte/var/log/hist

        mget an_${JOB_DATE}*

        bye

EOF

#!/bin/sh

if [ $LOGNAME != horany ]

then

 echo "Must have horany privileages to run this program"

 cat << EOF

  Warning: Must have horany privileages to run this program

  Please Try Again this program.

  Otherwise press Control C.

EOF

 exit 1

fi

echo "Coding your program!"

shell 에서 sqlldr 사용하기


export ctlfile=hist_${JOB_DATE}.ctl

echo "load data"                                                  > $ctlfile

echo "infile $file"                                                  >> $ctlfile

echo "badfile ${file}.bad"                                           >> $ctlfile

echo "append"                                                    >> $ctlfile

echo "into table hist_tmp"                                          >> $ctlfile

echo "( actv_date    position(34:47)  date \"yyyymmddhh24miss\"," >> $ctlfile

echo "  ent_seq_no   sequence(${seq_no},1),"                      >> $ctlfile

echo "  ban          position(25:33)   integer external,"            >> $ctlfile

echo "  oper_id      position(01:07)   integer external,"             >> $ctlfile

echo "  imq_mac_addr position(08:24)   char nullif imq_mac_addr = '@@         '," >> $ctlfile

echo "  org_id       position(48:54)   integer external,"             >> $ctlfile

echo "  window_name  position(55:114)  char,"                     >> $ctlfile

echo "  ctn          position(115:125) char,"                       >> $ctlfile

echo "  model_id     position(126:129) integer external,"            >> $ctlfile

echo "  msn          position(130:149) char,"                      >> $ctlfile

echo "  log_ind      position(150:150) char,"                       >> $ctlfile

echo "  dealer_code  position(151:157) char)"                       >> $ctlfile


sqlldr control=$ctlfile userid=$ORA_USER/$ORA_PASS@$ORA_INST



쉘에서 sqlplus 로 delete drop create insert 구문 사용하기


sqlplus -s $ORA_USER/$ORA_PASS@$ORA_INST << EOF


delete from call_statistics

where work_date = '$JOB_DATE';


drop table call_stat_tmp2;


create table call_stat_tmp2

tablespace $var_tablespace

storage (initial 1M next 1M pctincrease 0 maxextents unlimited)

as

select a.dealer_code,

       a.contract_cnt,

       nvl(nvl(b.l33_org_id, b.l21_org_id), b.l35_org_id)  l33_org_id,

from   call_stat_tmp1 a,

       og_org_master b

where  b.org_id = a.dealer_code

and    b.org_div not in ('A', 'K');


insert into CALL_STATISTICS

select '$JOB_DATE',

       null

from   call_stat_tmp2;

EOF



1. Network 

/etc/nsswitch.conf

hosts: files dns (추가)


/etc/resolv.conf

domain suned.co.kr

nameserver 10.10.10.10


/etc/defaultrouter

192.0.0.1


#rlogin 가능

.rhosts

+ root

#+ 모든 hosts 인정 , root 만 인정


/etc/hosts

192.168.10.11 myhost


2. login shell 변경

pssswd -e

 new shell : /bin/ksh


3. user home directory

useradd -D -b /export/home


4.초기화파일

.profile

 stty -istrip cs8 erase ^H #cs 는 character set

 umast 022

 PATH=/usr/bin:/usr/bin:/usr/ucb/:/sbin:/usr/dt/bin:/usr/local/bin:/usr/ccs/bin:.

 EDITOR=vi

 ENV=$HOME/.kshrc

 export PATH EDITOR ENV


.kshrc

 PS1='[$PWS] #'

 export PS1

 set -o vi

 alias c=clear

 alias ll='ls -l'


5. /etc/default/login

#CONSOLE=/dev/console #주석처리