<< 설치전준비사항 >> << STEP 1 : root 계정으로해야할일 >> 1. 오라클사용자생성 groupadd dba adduser -g dba oracle passwd oracle 2. /etc/sysctl.conf 를수정 Kernel sysctl conguration le 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 verication net.ipv4.conf.default.rp_lter = 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 lename 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 = 4294967295 Controls the maximum number of shared memory segments, in pages kernel.shmall = 268435456 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.le-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 확인 : sysctl -p 3. /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 rst session rule session required pam_selinux.so close session include system-auth session required pam_loginuid.so 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 session optional pam_keyinit.so force revoke session required pam_limits.so 4. /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 le size (KB) - data - max data size (KB) - fsize - maximum lesize (KB) - memlock - max locked-in-memory address space (KB) - nole - max number of open les - 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 le 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 soft nproc 2047 oracle hard nproc 16384 oracle soft nole 1024 oracle hard nole 65536 End of le 5. /etc/prole 을수정 /etc/prole System wide environment and startup programs, for login setup Functions and aliases go in /etc/bashrc pathmunge () { if! echo $PATH /bin/egrep -q "(^ :)$1($ :)" ; then if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH } ksh workaround if [ -z "$EUID" -a -x /usr/bin/id ]; then EUID=`id -u` UID=`id -ru` Path manipulation if [ "$EUID" = "0" ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin
No core les by default ulimit -S -c 0 > /dev/null 2>&1 if [ -x /usr/bin/id ]; then USER="`id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" HOSTNAME=`/bin/hostname` HISTSIZE=1000 if [ -z "$INPUTRC" -a! -f "$HOME/.inputrc" ]; then INPUTRC=/etc/inputrc export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC for i in /etc/prole.d/*.sh ; do if [ -r "$i" ]; then. $i done unset i unset pathmunge if [ $USER = "oracle" ]; then ulimit -u 16384 -n 65536 6. /etc/redhat-release 를수정 Fedora Core release 6 (Zod) 위의내용지우고아래와같이쓴다. redhat-4 7. /etc/hosts 를수정
* 문장간의간격은탭키로처리 Do not remove the following line, or various programs that require network functionality will fail. ::1 localhost.localdomain localhost 127.0.0.1 localhost.localdomain localhost 8. 필요한 rpm 패키지설치 yum install compat-libgcc-296 yum install libaio-devel yum install libxp yum install openmotif22
<< STEP 2 : oracle 계정으로해야할일 1 >> 1. /home/oracle/.bash_prole 수정.bash_prole Get the aliases and functions if [ -f ~/.bashrc ]; then. ~/.bashrc User specic environment and startup programs export ORACLE_BASE=/home/oracle export ORACLE_HOME=$ORACLE_BASE/10gR2 export ORACLE_OWNER=oracle export ORACLE_SID=orcl export ORACLE_TERM=xterm export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601 export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export TEMPDIR=/tmp export EDITOR=vi export PATH=$PATH:$ORACLE_HOME/bin 2. 오라클압축해제 [oracle@localhost ~] unzip 10201_database_linux32.zip 3. 리부팅
<< STEP 3 : oracle 계정으로해야할일 2 >> 1. x-window 로로그인한후언어를영문으로변경한후 x-window 로그아웃 2. 다시 x-window 로로그인 3. 오라클설치 [oracle@localhost ~] cd /home/oracle/database/ [oracle@localhost database] ls doc install response runinstaller stage welcome.html [oracle@localhost database]./runinstaller * 터미널을연후 root 계정으로변경한후다음 2 가지커맨드를실행후확인하라고나옵니다. [oracle@localhost ~] su - root [root@localhost ~] /home/oracle/orainventory/orainstroot.sh [root@localhost ~] /home/oracle/10gr2/root.sh * 종료버튼을클릭하여종료한다.
* 오라클을시작하는방법 [oracle@linuxora ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 11 23:23:36 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn /as sysdba Connected to an idle instance. <- 오라클이시작되어져있음을않음뜻함 SQL> startup ORACLE instance started. Total System Global Area 276824064 bytes Fixed Size Variable Size Database Buffers Redo Buffers 1218944 bytes 92276352 bytes 180355072 bytes 2973696 bytes Database mounted. Database opened. SQL> exit * 네트워크리스너를시작하는방법 [oracle@linuxora ~]$ lsnrctl start LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2008 23:29:29 Copyright (c) 1991, 2005, Oracle. All rights reserved. Starting /home/oracle/10gr2/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 10.2.0.1.0 - Production System parameter le is /home/oracle/10gr2/network/admin/listener.ora Log messages written to /home/oracle/10gr2/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxora)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias Version LISTENER TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 11-MAR-2008 23:29:30 Uptime Trace Level Security SNMP Listener Parameter File Listener Log File 0 days 0 hr. 0 min. 0 sec off ON: Local OS Authentication OFF /home/oracle/10gr2/network/admin/listener.ora /home/oracle/10gr2/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxora)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully * 네트워크리스너를끝내는방법 [oracle@linuxora ~]$ lsnrctl stop LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2008 23:27:02 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) The command completed successfully * 오라클을끝내는방법 [oracle@linuxora ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 11 23:23:36 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn /as sysdba Connected. <- 오라클이시작되어져있음을뜻함 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit
* 오라클자동실행방법 오라클을설치한디렉터리로가자. /home/oracle/10gr2/bin 인데이곳에 dbstart 와 dbshut 가있다. 이중 dbstart 를 vi /etc/rc.d/rc.local 에적어주면 부팅할때자동으로오라클을실행한다. 그러나이렇게하는건 start만가능할뿐이다. 종료까지하려면스크립트파일을작성해야만한다. /etc/oratab 은오라클을자동시작기능을사용할지여부를결정하는파일이다. 디폴트값은 No 인데 Yes로바꿔주면 dbstart, dbshut 를사용할수있다. vi /etc/oratab This le is used by ORACLE utilities. It is created by root.sh and updated by the Database Conguration Assistant when creating a database. A colon, ':', is used as the eld terminator. A new line terminates the entry. Lines beginning with a pound sign, '', are comments. Entries are of the form: $ORACLE_SID:$ORACLE_HOME:<N Y>: The rst and second elds are the system identier and home directory of the database respectively. The third led indicates to the dbstart utility that the database should, "Y", or should not, "N", be brought up at system boot time. Multiple entries with the same $ORACLE_SID are not allowed. orcl:/home/oracle/10gr2:n orcl:/home/oracle/10gr2:y 그다음 SID 를위한초기화파일을복사해야만한다. SID 이름이 orcl 므로 init.ora.211200823144 라는파일이 /home/oracle/admin/orcl/ple 에존재할것이다. 초기화 파일명은 SID 이름에따라달라지는것이다. < 주의 > sple 로운영되는경우는위의과정을한후에 ple 를업데이트해줘야합니다. SQL> show parameter sple 로 sple 로운영중인지 ple 로운영중인지확인할수있습니다. - ple 로운영중
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sple string - sple 로운영중 SQL> show parameter sple NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sple string /home/oracle/10gr2/dbs/spleorcl.ora 1. SQL> create ple from sple 2. sple 를삭제하고 db 내렸다올리면 ple 로운영이됩니다. /home/oracle/admin/orcl/ple/ initora1.ora.642002224936 을 /home/oracle/10gr2/dbs 디렉터리로 initorcl.ora 로 rename 해서옮긴다. 자이제마지막으로, su - oracle -c /home/oracle/10gr2/bin/dbstart ( 오라클시작!) su - oracle -c /home/oracle/10gr2/bin/lsnrctl start ( 리스너시작!) 이라고쳐서실제로가동되는지 test 해보자. ( 위의내용을 /etc/rc.d/rc.local 에입력하면컴퓨터가처음부팅할때 자동으로오라클과리스너를시작한다. 단리스너의경우엔스크립트에입력할때따옴표로묶어야 start 명령이적용된다. su - oracle -c /home/oracle/10gr2/bin/"lsnrctl start" 참고 ) 오라클리스너설정법먼저 vi /etc/services를해서오라클을위한포트를등록해준다. Xtel 1313/tcp French minitel LISTENER 1521/tcp Oracle Listener by TCP LISTENER 1521/udp Oracle Listener by UDP Support 1529/tcp GNATS, Cygnus bug tracker 위의밑줄친부분을추가해주면된다. 그리고 /home/oracle/10gr2/bin/ 에있는 netmgr 을실행해서리스너를설정한다.( 아마디폴트값이있을것이다. 그냥 사용해도무방하다.) 이렇게하면 /home/oracle/10gr2/network/admin/ 디렉터리에 listener.ora 가있을것이다. 확인하라. 마지막으로 /home/oracle/10gr2/bin/ 에리스너구동프로그램인 lsnrctl 이있다. oracle 계정으로로그인한후
lsnrctl start 를쳐리스너를시작하자. 중지할때는 lsnrctl stop 이다.