오라클클라이언트설치

보통 DB 서버가 따로 있기에, 웹서버에 클라이언트만 설치하고 

웹서버 설정과 jdbs 설정만 하면 되죠. 

다들 아시리라 생각되는 것 정리(이곳저곳,그리고프로젝트) 하여 올려 드립니다. 

   

우리너니앚너나나

   

[ Oracle Instant Client 설치 -예제는 solaris64] 

   

1. 다운로드 후 설치 파일 임의 디렉토리에 FTP 이용하여 올리기 

http://www.oracle.com/technology/global/kr/tech/oci/instantclient/instantclient.html 

(해당 클라이언트를 선택하여, 다운 받으시고 ftp 이용해 서버로 옮기시길...) 

   

Instant Client Package - Basic 

Instant Client Package - JDBC Supplement 

Instant Client Package - SQL*Plus 

Instant Client Package - SDK 

   

   

2. 압축 해제 및 실행폴더로 복사 

# unzip instantclient-basic-solaris64-10.2.0.3-20070101.zip 

# unzip instantclient-jdbc-solaris64-10.2.0.3-20070101.zip 

# unzip instantclient-sdk-solaris64-10.2.0.3-20070101.zip 

# unzip instantclient-sqlplus-solaris64-10.2.0.3-20070101.zip 

# cd instantclient_10_2 

# mkdir /usr/lib/oracle 

# mv * /usr/lib/oracle/ 

   

   

3. profile 및 tnsnames 파일 수정 

   

# vi /etc/profile 

----------------------------------------------------------------- 

# for Oracle Instant Client 

# for Oracle Instant Client

if [ -d /usr/lib/oracle ]

then

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client64/lib;export LD_LIBRARY_PATH

PATH=~/bin/:/svc/AOA/was/php-5.4.6/bin/:/svc/AOA/MYSQL/bin:$PATH:/usr/lib/oracle/12.1/client64/bin:;export PATH;

NLS_LANG=Korean_Korea.KO16KSC5601;export NLS_LANG;

TNS_ADMIN=/usr/lib/oracle; export TNS_ADMIN;

SQLPATH=/usr/lib/oracle; export SQLPATH;

fi

----------------------------------------------------------------- 

   

# vi /usr/lib/oracle/tnsnames.ora 

----------------------------------------------------------------- 

ORA=

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST =211.XXX.XXX.XXX)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = ora)

)

)

----------------------------------------------------------------- 

혹시 재접속 에러가 발생하면 ^M 이 문자열에 있을 것입니다. 아마 복사해서 사용할 경우 

발생할수도 있습니다. vi로 직접 입력하시던지 editplus를 이용해서... 

   

   

4. 로그아웃 후 재접속. 테스트 

# sqlplus user/passwd@ORA 

SQL*Plus: Release 10.2.0.2.0 - Production on 화 10월 21 16:47:39 2007 

Copyright (c) 1982, 2005, Oracle. All Rights Reserved. 

   

다음에 접속됨: 

Oracle10g Enterprise Edition Release 10.2.0.1.0 - Production 

With the Partitioning, OLAP and Oracle Data Mining options 

JServer Release 10.2.0.1.0 - Production 

SQL> 

   

   

출처: <http://www.sqler.com/?mid=bOracleTip&listStyle=webzine&document_srl=113221>

   

'DBMS > Oracle' 카테고리의 다른 글

Oracle Client의 user home 에 로그 안쌓이게 하는 방법  (0) 2015.03.16

MySQL 5.5 부터 컴팔 옵션이 바뀌었네요..

 

설치전 bison과 ncurses-devel 패키지를 설치 해주십니다.

#yum -y install bison ncurses-devel


먼저 cmake 부 터 설치 하여야 합니다. 

# wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz

# wget http://www.cmake.org/files/v2.8/cmake-2.8.9.tar.gz

# tar xvf cmake-2.8.9.tar.gz

# cd cmake-2.8.9

# ./bootstrap

 

cmake 설치시 요류가 날경우  gcc의 c++ 이 없거나 버전이 낮은 경우 입니다.

최신버전으로 업그래이드 해줍니다.

# yum -y install gcc-c++

# ./bootstrap 

# gmake && gmake install

 



 http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz

이전 버전에는 configure로 환경을 잡던 것이 cmake로 바꼇네요.

/usr/local/bin/cmake \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DMYSQL_DATADIR=/usr/local/mysql/data \

-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.socket

 

/usr/local/bin/cmake \

-DCMAKE_INSTALL_PREFIX=/home/local/mysql \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DMYSQL_DATADIR=/home/local/mysql/data \

-DMYSQL_UNIX_ADDR=/home/local/mysql/mysql.socket




/usr/local/bin/cmake \

-DCMAKE_INSTALL_PREFIX=/svc/AOA/MYSQL \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DMYSQL_DATADIR=/svc/AOA/MYSQL_DATA \

-DMYSQL_UNIX_ADDR=/svc/AOA/MYSQL_DATA/mysql.socket 

-Denable-thread-safe-client




#make && make install

 

shell> groupadd mysql

shell> useradd -r -g mysql mysql

shell> cd /usr/local

shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

shell> ln -s full-path-to-mysql-VERSION-OS mysql

shell> cd mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

shell> scripts/mysql_install_db --user=mysql


<< 모든 작업 완료 후 >>

shell> chown -R root .

shell> chown -R mysql data

# Next command is optional


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:


./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h say_shop password 'new-password'


Alternatively you can run:

./bin/mysql_secure_installation


which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl



shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> bin/mysqld_safe --user=mysql &

# Next command is optional

shell> cp support-files/mysql.server /etc/init.d/mysql.server


서비스 등록

chkconfig --add mysql.server

chkconfig --level 35 mysql.server on

chkconfig --list mysql.server



이 다음부터 유저 생성하고 하는 것은 기존과 동일한 것 같습니다.

또 변동 사항이 있을 경우 공유 하겠습니다.

 

참고로 MySQL Source tarball 좌표는

http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz

입니다.

centos nfs설정


yum -y install nfs-utils nfs-utils-lib


[root@h-NAS data]# cat /etc/exports
/data/share 10.0.0.1/255.255.255.0(rw,no_root_squash)

vi /etc/sysconfig/nfs
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020


방화벽 설정
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT

NFS 서비스 시작
service rpcbind restart
service nfslock restart
service nfs restart

클라이언트
포트 mount
mkdir /share
mount 10.0.0.20:/data/share /share
cat /share/hosts > /etc/hosts
cat /etc/hosts




[root@h001 /]# cat /etc/fstab

#
# /etc/fstab
H-NAS:/data/share /share nfs hard 0 0




크론탭으로 배치돌릴경우 최소 1분에 1회만 돌릴수 있는데

계속 돌리고 싶을때 아래와 같이 쉘스크립트로 1분동안 반복 수행 할 수 있도록 한다.


#!/bin/bash

ymd=`date +"%Y%m%d"`
hm=`date +"%H%M"`
now_hm=`date +"%H%M"`

#while [ $number -le 5 ]
while [ $hm -eq $now_hm ] ## 만일 분이 바꼇을 경우 돌지 않음
do
    /usr/local/bin/php /www/batch_phonechk.php
    number=`expr $number + 1`
    now_hm=`date +"%H%M"`
    echo $hm $now_hm
    echo $number
    date

    sleep 5 # 한번 수행 후 5초 슬립
done


'linux' 카테고리의 다른 글

ElasticSearch 5.1.1 외부에서 접근  (0) 2017.03.22
ElasticSearch 5.1.1 설치  (0) 2017.03.22
ElasticSearch 5.1.1 한글형태소(kr_analize) 지원(동전한닢)  (0) 2017.02.28
Apache + PHP + Oracle  (0) 2015.02.28
CentOS NFS 설정  (0) 2015.02.27

+ Recent posts