Chuyện của sys

DevOps Blog

Cài đặt Oracle Client Full 11R2 trên Linux dùng Response File trên Terminal July 2, 2015

Mục tiêu: Cài đặt gói client full 11R2 ( thay vì bản Instant client) trên server CentOS 6.x 64bit.
Chuẩn bị:
–  Download bản cài đặt trên trang chủ Oralce ( Down bản 64bit) ( linux.x64_11gR2_client.zip)
– Chuẩn bị OS 6.x 64bit đã cài đặt các gói cần thiết cho Oracle client.
Bắt đầu:
1. Cài đặt các gói sau:

yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 ksh elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 make sysstat unixODBC unixODBC-devel
2. Thiết lập lại kernel ( phía client không cần thiết nhưng phải thỏa mãn 1 số yêu cầu tối thiểu)
Ví du:
vi /etc/sysctl.conf
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
Chạy lệnh để áp dụng:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 65536
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
4. Tạo user và group để cài đặt
groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba oracle
echo “oracle:oracle” | chpasswd
id oracle
5. Tạo thư mục lưu trữ
mkdir -p /opt/oracle
chown oracle:oinstall /opt/oracle/
6. Chuyển sang user oracle
su – oracle
7. Chỉnh sửa file response để cài đặt.
unzip linudx.x64_11gR2_client.zip
Thư mục chứa source cài đặt : /home/oracle/client
cd response/
cp client_install.rsp client_install.rsp.orig
 vi client_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=oracle.local.test
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/oracle/OraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/opt/oracle/product/11.2.0.1/client
oracle.install.client.installType=Administrator
8. Tiến hành cài đặt
./runInstaller -silent -responseFile ~/client/response/client_install.rsp
Có thể thêm -debug để thêm mode debug.
Sample Output
[WARNING] [INS-13014] Target environment do not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /opt/oracle/OraInventory/logs/installActions2015-07-02_12-13-40AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /opt/oracle/OraInventory/logs/installActions2015-07-02_12-13-40AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The following configuration scripts need to be executed as the “root” user.
#!/bin/sh
#Root scripts to run
/opt/oracle/OraInventory/orainstRoot.sh
/opt/oracle/product/11.2.0.1/client/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as “root”
3. Run the scripts
4. Return to this window and hit “Enter” key to continueSuccessfully Setup Software.
Một số warning do hệ thống không đáp ứng được requirements, nhưng có thể bỏ qua được.
Làm theo hướng dẫn và nhấn Enter.
/opt/oracle/OraInventory/orainstRoot.sh
/opt/oracle/product/11.2.0.1/client/root.sh
 Như vậy việc cài đặt đã hoàn thành, bạn có thể kiếm tra việc cài đặt bằng xem log được lưu trữ trong thư mục :/opt/oracle/OraInventory/logs
9. Set biến môi trường:
 vi ~/.bash_profile
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1/client
export PATH=$ORACLE_HOME/bin:$PATH
 10. Test thử cài đặt bằng SQLPLUS
sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 2 19:58:21 2015
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Enter user-name:
Như vậy bạn đã hoàn thành được việc cài đặt Oracle client trên linux bằng cách dùng response file trong trường hợp không thể cài đặt bằng GUI.

Leave a Reply

Your email address will not be published. Required fields are marked *