오라클 클라이언트 설치
Oracle 11 on RHEL / CentOS 6 x86_64 without X-server
http://www.binaryvision.nl/118/oracle-on-rhel-centos-6-x64-without-x-server/
Oracle 11 on RHEL / CentOS 6 x86_64 without X-server
--------------------------------------------------------------------------------
This article describes how to prep a RHEL 6 / CentOS 6 x86-64 environment and the subsequent installation of Oracle 11.2 database software without an X-server being installed on the server. It assumes you already have a Linux server up and running. You can use this manual to setup a 32 bit Linux version, the difference being the packages that have to be installed. Refer to the Oracle Database Installation Guide for Linux x86 for details on those packages.
Memory requirements
Memory should be at least 1 GB, but 2 GB or more is recommended. Check the amount of internal memory available to the system.
grep MemTotal /proc/meminfo
If you do not meet the minimum requirements, you have to add more memory.
Swap space requirements
The minimum is 1 GB swap space, but usually, the rule of thumb is to have approximately twice the amount of internal memory as swap space.
Check the amount of swap space available to the system.
grep SwapTotal /proc/meminfo
If you do not meet the minimum requirements, you can add swap space.
Disk space requirements
The minimum temp space requirement is 1GB. Temp space is usually stored in the /tmp partition. If /tmp is part of the root file system then the root file system should have at least 1 GB free space in addition to other space requirements.
Check the /tmp space available to the system.
df -h /tmp
If /tmp is too small, you can temporarily create a tmp directory on another file system.
umount tmpfs
mount -t tmpfs shmfs -o size=1024m /dev/shm
To install the Enterprise Edition, around 4.7 GB is needed for the Oracle software. A standard database consumes about 1.7 GB of space.
Automatic Memory Management
Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm) and file descriptors.
The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on that computer. MEMORY_TARGET is the sum of SGA_TARGET plus the larger value of either PGA_AGGREGATE_TARGET or the maximum PGA allocated.
To determine the amount of shared memory available, enter the following command:
df -h /dev/shm/
MEMORY_MAX_TARGET and MEMORY_TARGET cannot be used when LOCK_SGA is enabled or with HugePages on Linux.
If you need to allocate more shared memory, execute the following steps:
vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=2G 0 0
Save the file and remount tmpfs.
mount -o remount /dev/shm
If your amount of shared memory is too low, you might run into “ORA-00845: MEMORY_TARGET not supported on this system ” when creating a database that has MEMORY_TARGET set too high.
System architecture
To determine whether the system architecture can run the software, enter the following command:
grep "model name" /proc/cpuinfo
This does not tell you whether you should be running 32- or 64 bit Linux, just the architecture of the machine. To determine whether you are running 32- or 64-bit Linux, enter the following command:
uname -mi
Oracle binaries
Reserve at least 4.7 GB for Oracle 11g binaries.
Also reserve about 10 GB space for installation files and Oracle patches.
Oracle database files
Reserve at least 1.7 GB for Oracle 11g database files.
You probably want to reserve more than that because the database will grow over time.
Kernel requirements
To determine which distribution and version of Linux is installed, enter the following command:
cat /proc/version
To determine whether the required kernel is installed, enter the following command:
uname -r
The output must show at least 2.6.32
Packages
You need to install certain software packages to support the Oracle binaries.
yum install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ \
glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel \
make sysstat
Press “y” to install when asked to do so.
The system will ask you to install a GPG key.
Press “y”.
Users and groups
Before you can install Oracle on Linux, two users and two or three Oracle groups should be present, depending on the choice of separation of administrative duties.
The Oracle Inventory group (oinstall)
This group owns the Oracle inventory, which is a catalog of all Oracle software installed on the system. Members of this group could be Linux administrators who install new versions of Oracle. To check if the oinstall group exists, run:
groupadd oinstall
The OSDBA group (dba)
This group identifies operating system user accounts that have database administrative privileges (the SYSDBA privilege). The default name for this group is dba. To check if the oinstall group exists, run:
groupadd dba
The OSOPER group (oper)
This is an optional group. Create this group if you want a separate group of operating system users to have a limited set of database administrative privileges (the SYSOPER privilege). By default, members of the OSDBA group also have the SYSOPER privilege.
If you want to specify a separate OSOPER group, other than the default dba group, then you must choose the Custom installation type to install the software or start Oracle Universal Installer as a user that is not a member of the dba group. In this case, Oracle Universal Installer prompts you to specify the name of this group. The usual name chosen for this group is oper. To check if the oinstall group exists, run:
groupadd oper
The Oracle software owner
This user owns all of the software installed during the installation. This user must have the Oracle Inventory group (oinstall) as it’s primary group. It must also have the OSDBA (dba) and, if you decide to use it, OSOPER (oper) groups as secondary groups. Create the user and set the password.
useradd -g oinstall -G dba,oper,wheel oracle
passwd oracle
Give the Oracle user sudo rights, by following this article.
Kernel parameters
In order for the Oracle database to function properly certain OS resources must be configured. By default, some of these are set too low. Linux allows these parameters to be modified dynamically, no reboot is required to activate the changes. The kernel parameters can be altered by modifying the values in the /proc pseudo file system.
Do not change the value of a kernel parameter if it is already higher than required by Oracle.
Below is a list of how to check, and if necessary correct the kernel parameters. These are minimum values, adjust upwards for bigger environments.
semmsl, semmns, semopm and semmni
Default is usually set lower than minimum requirement.
sysctl -a | grep sem
echo 'kernel.sem = 250 32000 100 128' >> /etc/sysctl.conf
shmall
Default is usually set higher than minimum requirement.
sysctl -a | grep shmall
echo 'kernel.shmall = 2097152' >> /etc/sysctl.conf
shmmax
Should be between half the size of physical memory and and installed memory – 1 byte.
Default is usually set higher than minimum requirement.
sysctl -a | grep shmmax
echo 'kernel.shmall = 2097152' >> /etc/sysctl.conf
shmmni
Default is usually set to minimum requirement.
sysctl -a | grep shmmni
echo 'kernel.shmmni = 4096' >> /etc/sysctl.conf
file-max
Default is usually set lower than minimum requirement.
sysctl -a | grep file-max
echo 'fs.file-max = 6815744' >> /etc/sysctl.conf
aio-max-nr
Default is usually set lower than minimum requirement.
sysctl -a | grep aio-max-nr
echo 'fs.aio-max-nr = 1048576' >> /etc/sysctl.conf
aio-max-nr limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.
ip_local_port_range
Default is usually set at a smaller range than minimum requirement.
sysctl -a | grep ip_local
echo 'net.ipv4.ip_local_port_range = 9000 65500' >> /etc/sysctl.conf
rmem_default
Default is usually set lower than minimum requirement.
sysctl -a | grep rmem_default
echo 'net.core.rmem_default = 1048576' >> /etc/sysctl.conf
rmem_max
Default is usually set lower than minimum requirement.
sysctl -a | grep rmem_max
echo 'net.core.rmem_max = 4194304' >> /etc/sysctl.conf
wmem_default
Default is usually set lower than minimum requirement.
sysctl -a | grep wmem_default
echo 'net.core.wmem_default = 262144' >> /etc/sysctl.conf
wmem_max
Default is usually set lower than minimum requirement.
sysctl -a | grep wmem_max
echo 'net.core.wmem_max = 1048576' >> /etc/sysctl.conf
To make the changes effective immediately, run:
sysctl -p
Shell Limits
ulimit provides control over the resources available to processes started by the shell, on systems that allow such control.
To check all current limits enter the commands:
ulimit -a
ulimit -Ha
The first command shows the soft limits, the second command the hard limits.
PAM is an abbreviation for Pluggable Authentication Modules. On most Linux systems you have two directories on your system “/etc/pam.d/” and “/etc/security/”. /etc/pam.d/ is where the modules are located and /etc/security/ is where some of the configuration files for some of these modules are.
In certain kinds of attacks, the attacker doesn’t attempt to gain access, but instead tries to break a certain part of your computer’s operation. You can protect against certain types of DoS attacks by modifying /etc/security/limits.conf. This file sets limits on system resources for each user. Since several major daemons, including the web, name and ftp servers, may run as a particular user, this has the effect of stopping many attacks against these applications from crippling the entire machine.
To limit the processes and open files for the oracle user, execute the following:
cat >> /etc/security/limits.conf << EOF
oracle soft nofile 1024
oracle hard nofile 64000
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
EOF
This sets the maximum number of open files to 64000, the maximum number of user processes to 16384 and the maximum size of stack segments for a process to 32768.
In the Oracle documentation, the maximum number of open files should be set to 65536. During configuration of the kernel parameters, file-max was also set to 65536, which would enable the Oracle user to use up all the file handles available to the system. Therefore it’s better to lower this value a little.
The last step is to modify the PAM module.
cat >> /etc/pam.d/login << EOF
session required pam_limits.so
EOF
This will invoke the limits shared library during login.
Disk layout
Four separate physical disks are used. This will spread the load on the database and gives some extra protection against failure.
Mount point | Contains |
/u01/app/oracle | Oracle software |
/u01/oradata | Datafiles |
/u02/oradata | control01.ctl, Redo Group1a, 2a and 3a |
/u03/oradata | control02.ctl, Redo group1b, 2b and 3b |
Software directories
You must identify or create the following directories for the Oracle software:
- Oracle inventory directory
- Oracle base directory
- Oracle data directory
- Oracle flash recovery directory (optional)
Create the required Oracle mountpoints and mount them.
mkdir -p {/u01/app/oracle,/u01/oradata,/u02/oradata,u03/oradata}
mount -a
Create the subdirectories and set the correct permissions and ownership.
mkdir -p /u01/app/oracle/{11.2.0/db1,admin,diag,flash_recovery_area,oraInventory} && \
chmod -R 770 /u01/app/oracle /u01/app/oracle /u01/oradata /u02/oradata /u03/oradata && \
chown -R oracle:oinstall /u01/app/oracle /u01/oradata /u02/oradata /u03/oradata
cat >> /home/oracle/.bash_profile << EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/11.2.0/db1
export ORACLE_HOME_LISTNER=\$ORACLE_HOME
export TNS_ADMIN=\$ORACLE_HOME/network/admin
export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH
EOF
Logout and back in so these variables are in effect.
Oracle software installation
To install Oracle 11 on a server that has no X-server installed you won’t be able to use the standard GUI installer. Instead, you can use a silent install using a response file.
Creat oraInst.loc file if it doesn’t exist
If you want to install Oracle using silent mode, you must manually create the oraInst.loc file if it does not exist. This file specifies the location of the Oracle Inventory directory where the installer creates the inventory of Oracle products installed on the system.
cat >> /etc/oraInst.loc << EOF
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
EOF
chown oracle:oinstall /etc/oraInst.loc && chmod 664 /etc/oraInst.loc
Silent install with responsefile
You can find the template db_install.rsp on your installation media, in database/response. Copy this template to the directory containing runInstaller and enter the values as they should be on your system. The response file below is setup for this specific article. Change the necessary parameters to meet your environment.
cat >> db_install.rsp << EOF
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=$ORACLE_HOME
ORACLE_BASE=$ORACLE_BASE
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
[email protected]
MYORACLESUPPORT_PASSWORD=mypassword
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
EOF
Using this response file will install Oracle Enterprise edition in /opt/oracle using user “oracle” and group “oinstall” without creating the starter database. Run the response file by executing:
./runInstaller -silent -noconfig -ignorePrereq -responseFile /u01/app/oracle/install/database/db_install.rsp
Do not specify a relative path to the response file. If you specify a relative path, then Oracle Universal Installer fails.
Also, to prevent “[FATAL] [INS-13013] Target environment do not meet some mandatory requirements” when installing on CentOS, add -ignorePrereq as an option to the installer.
The following text should pop up if nothing went wrong:
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 5937 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-12-07_09-28-00PM. Please wait ...
You can find the log of this install session at: /u01/app/oracle/oraInventory/logs/installActions2013-12-07_09-28-00PM.log
Now it’s time to grab a coffee and sit back, this will take some time.
Once you have finished your coffee, the message below should be on the screen:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/u01/app/oracle/11.2.0/db1/root.sh
To execute the configuration scripts:
- Open a terminal window
- Log in as "root"
- Run the scripts
- Return to this window and hit "Enter" key to continue
Successfully Setup Software.
So open a root-terminal and execute:
/u01/app/oracle/11.2.0/db1/root.sh
참고URL
- http://www.binaryvision.nl/118/oracle-on-rhel-centos-6-x64-without-x-server/
'리눅스' 카테고리의 다른 글
[리눅스] svn(subversion) 설치 (0) | 2015.01.20 |
---|---|
fmt 명령어 (0) | 2015.01.15 |
[리눅스] UMASK 변경 쉘 (0) | 2014.11.24 |
리눅스에서 글꼴(font)을 추가하는 방법 (0) | 2014.11.10 |
CentOS 7에서 SNMP v3을 설정하는 방법 (2) | 2014.11.05 |