ÃֽŠ°Ô½Ã±Û(DB)
2018.05.27 / 24:50

[CentOS] Oracle 11g R2 ¼³Ä¡ 1ºÎ

ÀλçÀ̵åÀÚ¹Ù
Ãßõ ¼ö 180
[CentOS] Oracle 11g R2 ¼³Ä¡ 1ºÎ

¿À¶óŬ ¼³Ä¡´Â X-Window¿¡¼­ ¼³Ä¡ µÇ±â ¶§¹®¿¡ 1, 2ºÎ·Î ³ª´²¼­ Æ÷½ºÆà ÇÑ´Ù.

1ºÎ´Â X-Window¿Í »ó°ü¾øÀÌ Terminal¿¡¼­ ÁøÇà °¡´ÉÇÑ ºÎºÐ¿¡ ´ëÇÑ ³»¿ëÀ¸·Î Á¤¸®ÇÏ°í, 2ºÎ¿¡¼­´Â X-Window¿¡¼­ ¿À¶óŬ ¼³Ä¡ È­¸éÀ» À§ÁÖ·Î ÁøÇà ÇÒ ¿¹Á¤ÀÌ´Ù.

 

1. ¼³Ä¡ È¯°æ 

- OS Version : CentOS release 5.8 (Final)

- RAM : 1024MB <- È£½ºÆÃÇϴµ¥¼­´Â ¿ø·¡ 512MG ¿´´Âµ¥ ¿À¶óŬ ¼³Ä¡ ÇÑ´ä½Ã°í µ· ´õ³»°í ¿Ã·È´Ù... ¤Ð¤Ð

- HDD : 20GB

- ¿À¶óŬ ¹öÀü : Oracle 11g R2 (64bit)

 

 

2. ¿À¶óŬ °ü·Ã Package ¼³Ä¡

- °³ÀÎÀûÀ¸·Î ÇѲ¨¹ø¿¡ ¼³Ä¡Çϴ°Š¾ÈÁÁ¾ÆÇÑ´Ù. À߸ø µÇ´õ¶óµµ ¹¹°¡ À߸ø µÇ¾ú´ÂÁö È®ÀÎÇϱ⵵ Èûµé°í... ^^;

[root@jjangwani123 ~]# yum -y install binutils-*
[root@jjangwani123 ~]# yum -y install compat-db-*
[root@jjangwani123 ~]# yum -y install control-center-*
[root@jjangwani123 ~]# yum -y install gcc-*
[root@jjangwani123 ~]# yum -y install gcc-c++-*
[root@jjangwani123 ~]# yum -y install glibc-*
[root@jjangwani123 ~]# yum -y install glibc-common-*
[root@jjangwani123 ~]# yum -y install gnome-libs-*
[root@jjangwani123 ~]# yum -y install libstdc++-*
[root@jjangwani123 ~]# yum -y install libstdc++-*
[root@jjangwani123 ~]# yum -y install make-*
[root@jjangwani123 ~]# yum -y install pdksh-*
[root@jjangwani123 ~]# yum -y install sysstat-*
[root@jjangwani123 ~]# yum -y install xscreensaver-*

 

3. ¿À¶óŬ °èÁ¤ ¼³Á¤

- ¿À¶óŬ ¼³Ä¡ ¹× ¿î¿µÀ» À§ÇØ °èÁ¤ ¹× ±×·ì µîÀ» »ý¼º ÇÑ´Ù.

[root@jjangwani123 ~]# groupadd oinstall
groupadd: ±×·ì oinstallÀÌ(°¡) ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù
[root@jjangwani123 ~]# groupadd dba
groupadd: ±×·ì dbaÀÌ(°¡) ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù
[root@jjangwani123 ~]# useradd -m -g oinstall -G dba oracle
useradd: »ç¿ëÀÚ oracleÀÌ(°¡) ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù
[root@jjangwani123 ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
[root@jjangwani123 ~]# mkdir /oracle
mkdir: `/oracle' µð·ºÅ丮¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù: ÆÄÀÏÀÌ Á¸ÀçÇÕ´Ï´Ù
[root@jjangwani123 ~]# chown -R oracle.dba /oracle
[root@jjangwani123 ~]# chmod -R 755 /oracle

-> ÀÌ Æ÷½ºÆÃÀ» ¸¸µç ½ÃÁ¡¿¡¼­´Â ¿À¶óŬ ¼³Ä¡¸¦ ¿Ï·áÇÑ ½ÃÁ¡À̱⠶§¹®¿¡ °èÁ¤ ¹× ±×·ìµîÀÌ ÀÌ¹Ì Á¸Àç ÇÑ´Ù.

-> Ãß°¡·Î ¿À¶óŬ ¼³Ä¡´Â /oracle¿¡ ¼³Ä¡ ÇÑ´Ù.

 

4. ¿À¶óŬ ¼³Ä¡¸¦ À§ÇÑ Kernel Parameter ¼³Á¤

- ¾Æ·¡ ³»¿ëÀº ÃÖ¼Ò »ç¾çÀ¸·Î ÀÌ¹Ì ÇØ´ç °ªº¸´Ù Å©°Ô ¼³Á¤ µÇ¾î ÀÖ´Â °æ¿ì ±âÁ¸ ¼³Á¤°ªÀ» »ç¿ëÇÑ´Ù.

[root@jjangwani123 ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296


# -------------------------------------------------
# oracle 11gR2 Setting

# -------------------------------------------------
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000  65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.msgmni = 2878

# -------------------------------------------------

 

- Kernel Parameter ¼öÁ¤ ÈÄ System Reboot ¾øÀÌ Àû¿ëÇÏ´Â ¸í·É¾î

[root@jjangwani123 ~]# /sbin/sysctl -p
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
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000  65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.msgmni = 2878

 

5. oracle °èÁ¤ÀÇ Shell Limit ¼³Á¤

- /etc/security/limits.conf ¸Ç ¹Ø¿¡ Ãß°¡

[root@jjangwani123 ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - an user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4


# -------------------------------------------------
# oracle 11gR2 Setting

# -------------------------------------------------

#<domain> <type> <item> <value>
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

# -------------------------------------------------

# End of file

 

- /etc/pam.d/login ¸Ç ¹Ø¿¡ Ãß°¡

[root@jjangwani123 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth       include      system-auth
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    optional     pam_keyinit.so force revoke
session    required     pam_loginuid.so
session    include      system-auth
session    optional     pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open

 

# -------------------------------------------------
# oracle 11gR2 Setting

# -------------------------------------------------
session required /lib/security/pam_limits.so

# -------------------------------------------------

 

6. oracle °èÁ¤ÀÇ È¯°æ º¯¼ö º¯°æ

- /home/oracle/.bash_profile ¸Ç ¹Ø¿¡ Ãß°¡

[root@jjangwani123 ~]# cat /home/oracle/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

 

# -------------------------------------------------
# oracle 11gR2 Setting

# -------------------------------------------------
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=/oracle/11g; export ORACLE_HOME
ORACLE_SID=ora11g; export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin

# export PATH

# -------------------------------------------------

 

7. VNC Server ¼³Á¤ º¯°æ

- ¿À¶óŬ ¼³Ä¡´Â X-Window¿¡¼­ ¼³Ä¡ ÇØ¾ß ÇÑ´Ù. ³ª´Â È£½ºÆÃÀ» ¹Þ°í Àֱ⠶§¹®¿¡ VNC Server¸¦ ¼³Ä¡ÇÏ¿© ¿ø°Ý Á¢±ÙÀ» ÅëÇØ OracleÀ» ¼³Ä¡ Çß´Ù. ´Ù¸¥ ÇÁ·Î±×·¥µéÀº ÀÌ¹Ì ¼³Ä¡ µÇ¾ú´Ù´Â ¼³Á¤ ÇÏ¿¡ ¿©±â¼­´Â ¿À¶óŬ ¼³Ä¡¿¡ ÇÊ¿äÇÑ ºÎºÐ¸¸ ¼³Á¤ÇÑ´Ù. Ãß°¡·Î ÇÊ¿äÇÑ ³»¿ëÀº VNC Server ¼³Ä¡KDE ¶Ç´Â GNOME ¼³Ä¡ Æ÷½ºÆÃÀ» ÂüÁ¶ÇÒ°Í 

- VNCSERVERSÀÇ °ª root¸¦ oracle·Î º¯°æÇÑ´Ù.

[root@jjangwani123 ~]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.  
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

VNCSERVERS="1:oracle"                   #--- 1¹øºÎÅÍ 5901 port¸¦ »ç¿ë ÇÑ´Ù.
VNCSERVERARGS[1]="-geometry 1152x864"   #--- Ãß°¡ ¿É¼Ç : -nolisten -nohttpd -localhost

 

8. oracle °èÁ¤ÀÇ VNC Æнº¿öµå ¼³Á¤ 

- ¿À¶óŬ 11g R2¸¦ ¼³Ä¡½Ã oracle °èÁ¤À¸·Î ¼³Ä¡¸¦ ÁøÇà ÇØ¾ß Çϱ⠶§¹®¿¡ VNCµµ oracle °èÁ¤À¸·Î ½ÃÀÛÇϱâ À§ÇØ oracle °èÁ¤ÀÇ VNC Password¸¦ ¼³Á¤ÇÑ´Ù. 

[root@jjangwani123 ~]# su - oracle
[oracle@jjangwani123 ~]$ cd .vnc
[oracle@jjangwani123 .vnc]$ vncpasswd
Password:
Verify:

 



9. °³º° »ç¿ëÀÚÀÇ VNC ¼³Á¤ 

- oracle °èÁ¤ÀÇ xstartup ¼³Á¤ º¯°æÀ» ÅëÇØ X-Window ½ÃÀ۽à KDE·Î ½ÃÀÛÇÒ°ÍÀÎÁö, GNOMEÀ¸·Î ½ÃÀÛÇÒ°ÍÀÎÁö ¼³Á¤ÇÑ´Ù.

[oracle@jjangwani123 ~]$ cat /home/oracle/.vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &
# gnome-session & # gnome À¸·Î vnc ½ÃÀÛ

startkde &        # kde ·Î vnc ½ÃÀÛ

 

10. VNC Server Àç½ÃÀÛ

- rootÀÇ °èÁ¤À¸·Î VNC Server Àç½ÃÀÛ

[root@jjangwani123 ~]# service vncserver restart
VNC ¼­¹ö¸¦ Á¾·á Áß: 1:oracle [ OK ]
VNC ¼­¹ö (À»)¸¦ ½ÃÀÛ Áß: 1:oracle 
New 'jjangwani123.cafe24.com:1 (oracle)' desktop is jjangwani123.cafe24.com:1

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/jjangwani123.cafe24.com:1.log

[ OK ]