ORACLE/INSTALL2009. 5. 27. 16:02
반응형
vi /etc/system


forceload:sys/shmsys  
forceload:sys/semsys
set shmsys:shminfo_shmmax=2147483648
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100 
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmni=100 
set semsys:seminfo_semmsl=256 
set semsys:seminfo_semmns=500 
set semsys:seminfo_semopm=100 
set semsys:seminfo_semvmx=32767 

# groupadd -g 101 oinstall
# groupadd -g 102 dba    
# useradd -m -d /u0/oracle -g oinstall -G dba -u 103 -s /bin/bash oracle


.bash_profile

PS1='$PWD  $'
umask=022
export EDITOR=vi
export LANG=C
export ORACLE_BASE=/u0/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0/db_1
export ORACLE_SID=ring
export ORACLE_TERM=vt100
export PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin:/sbin:/usr/ccs/bin:/usr/ucb
#export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/network/lib (HP 용)     
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/network/lib
#export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/usr/lib:/lib:/usr/ccs/lib (AIX 용)
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export TNS_ADMIN=$ORACLE_HOME/network/admin
export DISPLAY=220.76.205.26:0.0

패치셋 적용후
db생성시에  
만약 13% 쯤에 에러메시지와 코드가 뜬다면 무시해도 된다.
물론 내용이 ORA-29807  Specified Operator does not exist. 일때 말이다.

listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME =/u0/oracle/product/9.2.0/db_1)



      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ring )(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )
 


반응형

'ORACLE > INSTALL' 카테고리의 다른 글

LINUX ORACLE 10G 패키지  (0) 2009.08.04
LINUX ORALCE 10G설치  (0) 2009.08.04
오라클 삭제 방법  (0) 2009.03.18
CentOS 5.2에 Oracle 9i 설치하기  (0) 2009.02.23
HP-UX 11.11(64bit)에 Oracle 9.2.0.1 설치하기  (0) 2009.01.21
Posted by [PineTree]
ORACLE/INSTALL2009. 3. 18. 17:21
반응형

오라클 완전삭제 왜 할까요?  오라클이 싫어서?  아니죠.

 

1. 서비스기동중지 oracle과 관련된 서비스가 기동되어 있으면 전부 중지 시킨다.
2. universal installer 를 이용하여 오라클 삭제
3. registry 에서 오라클과 관련된 키를 삭제한다.
  HKEY_CURRENT_USER->Software->Oracle
  HKEY_LOCAL_MACHINE->Software->Oracle
  HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services 밑의 오라클 관련 키
  HKEY_CURRENT_CONFIG->System->CurrentControlSet->SERVICES 밑의 오라클 관련 키
4. 디렉토리삭제
  C:\Program Files\Oracle
  D:\oracle
5. 시작->프로그램->Oracle관련 메뉴 삭제

<< Windows 95/98 >>


1. 시작-> 실행-> regedit을 기동하여
   HKEY_LOCAL_MACHINESOFTWAREORACLE folder 전체를 삭제한다.
2. HKEY_LOCAL_MACHINESOFTWAREodbc를 삭제한다.
3. autoexec.bat file에서 %ORACLE_HOME%bin과 JRE path를 remove한다.
4. windows 탐색기에서 Oracle directory를 삭제한다.
5. <system_drive>: Program FilesOracle folder를 삭제한다.
6. 이전에 설치한 HOME name인 <HOME>을 다음에서 찾아보고 Icon을 삭제한다.
   <system_drive>: windowsStart MenuProgramsOracle-<HOME> 과
   <system_drive>: windowsStart MenuProgramsOracle Installation Products
7. 시스템을 재기동시킨다.

 

 

<< Windows NT >>


1. Administrator 권한으로 NT를 log on 한다 .
2. 시작-> 실행-> regedit을 기동하여
   HKEY_LOCAL_MACHINESOFTWAREORACLE 폴더 전체를 삭제한다.
3. HKEY_LOCAL_MACHINESOFTWAREodbc 를 삭제한다.
4. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices 에서 oracle로 시작되는 폴더들을 삭제한다.
5. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventLog Application 에서 oracle로 시작되는
폴더들을 삭제한다.
6. regedit을 종료한다.
7. 설정-> 제어판 -> 시스템을 실행하여 환경 tab에서
8. autoexec.bat 화일에서 %ORACLE_HOME%bin과 JRE path를 remove한다.
9. <system_drive>: WinntProfilesAll Users시작메뉴ProgramsOracle 폴더를 삭제한다.
10. <system_drive>: Program FilesOracle 폴더를 삭제한다.
11. 시스템을 재기동시킨다.
12. Oracle Home directory를 삭제한다.
    (HKEY_LOCAL_MACHINESOFTWAREORACLEORACLE_HOME 에서 확인 가능).

* CWI32.DLL 파일 삭제가 안될경우에는 재부팅시 F8 누르고 안전모드로 부팅해서 삭제하면 된다.

 

<< Linux >>


1. 시디를 넣고 GUI 화면이 뜨면 언인스톨 버튼이 나온다.
2. 언인스톨 버튼을 클릭하여 인스톨된 오라클을 삭제한다.
3. /etc/ 디렉토리로 이동한다.
4. ls -al ora* 로 오라클 관련 파일을 확인한다.
5. 확인된 파일 oraInst.loc, oratab 파일을 삭제한다.
6. /usr/local/bin 디렉토리로 이동한다.
7. 오라클 관련 파일이 있을것이다. 삭제한다.

 

* 시디를 넣고 하지않고 삭제하는 방법은 설치된 오라클 디렉토리를 과감하게 삭제하면된다.
물론 3,4,5번은 행해져야한다.


반응형

'ORACLE > INSTALL' 카테고리의 다른 글

LINUX ORALCE 10G설치  (0) 2009.08.04
solaris10 oracle install 9i 설정값  (0) 2009.05.27
CentOS 5.2에 Oracle 9i 설치하기  (0) 2009.02.23
HP-UX 11.11(64bit)에 Oracle 9.2.0.1 설치하기  (0) 2009.01.21
Linux에서 Pro C 설치  (0) 2008.12.11
Posted by [PineTree]
ORACLE/INSTALL2009. 2. 23. 11:36
반응형

Oracle 9i 데이터베이스를 설치하기 위하여 다음 사항을 확인해야 한다.

 

1. CentOS 5.2 설치 전이라면, swap 공간을 물리 메모리의 4배로 잡아준다. 

    이미 설치하였다면 Oracle 인스턴스가 시작되기 전에 미리 할당 작업을 완료한다.

2. CentOS 5.2 가 기본적으로 X-window로 설치되어 있어야 한다. (Server-GUI 선택하면 될 듯)

3. Oracle 9i 설치를 위해 하드디스크의 사용 가능한 용량이 4GB 이상이어야 한다.

 

< 사용자 생성 및 그룹 생성 >

groupadd dba

groupadd oinstall

useradd -g oinstall -G dba oracle

passwd oracle

 

< 디렉토리 생성 >

mkdir -p /opt/oracle/product/9.2.0.4

mkdir -p /opt/oracle/oradata

chown -R oracle:oinstall /opt/oracle

chmod 755 /opt/oracle/oradata

 

< Oracle 파일 다운로드 >

http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html

위 사이트에서 파일을 다운로드 받는다. (32bit CPU 기준이다.)

 

< 다운로드 받은 압축 파일 압축 해제 >

사이트에 명시된되로 "gunzip 파일명" 으로 압축을 해제하고,

"cpio -idmv < 파일명" 으로 최종 압축을 해제해서 "Disk1~3" 디렉토리가 생성된 것을 확인한다.

 

< 요구되는 패키지를 검사 >

rpm -q compat-db

              compat-gcc-34

              compat-gcc-34-c++

              compat-libgcc-296

              compat-libstdc++-296

              compat-libstdc++-33

              gcc

              gcc-c++

              glibc

              glibc-common

              glibc-devel

              glibc-headers

              libgcc

              make

              libXp

 

< root 계정 로그 아웃 >

이제 root 계정의 접속은 끊고, 위에서 생성한 oracle 계정으로 접속한다. (su - oracle)

참고로 oracle 인스톨 중에 root 계정이 필요하니, 필히 su - 명령어의 사용 그룹에 oracle 계정 추가!!

 

< 환경 설정 >

# vi ~oracle/.bash_profile

 

ORACLE_BASE=/opt/oracle

ORACLE_HOME=$ORACLE_BASE/920

ORACLE_SID=ORCL

LD_LIBRARY_PATH=$ORACLE_HOME/lib

PATH=$PATH$ORACLE_HOME/bin

 

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH

 

# source ~oracle/.bash_profile

 

< 나머지 설정_1 >

su -

# cd /usr/lib

# ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2

 

< 패키지 다운로드 및 인스톨 >

http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-libcwait-2.1-1.i386.rpm

http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-oracle-rhel4-1.0-5.i386.rpm

 

rpm -ivh compat-libcwait-2.1-1.i386.rpm

rpm -ivh compat-oracle-rhel4-1.0-5.i386.rpm --nodeps

 

< 나머지 설정_2 >

su -

# cd /usr/bin

# ln -s gcc34 gcc32

 

< 나머지 설정_3 >

su -

# cd /usr/lib

# ln -s libgdbm.so.2.0.0 libdb.so.2

 

< 나머지 설정_3에서 NETCA/DBCA 실패할 경우 >

cd $ORACLE_HOME

rm JRE

ln -s $ORACLE_BASE/jre/1.3.1 JRE

cd JRE/bin

ln -s java jre

cd i386/native_threads/

ln -s java jre

9.2.0.8 패치 이전에 적용한다.

 

< oracle 설치 >

# cd /opt/oracle/Disk1

# export LANG=en

# ./runinstaller

 

1) Welcome : Next

2) Inventory Location : /oracle/oraInventoryss
3) UNIX Group Name : oinstall 
4) 루트권한으로 : /tmp/orainstRoot.sh 실행 !!
(새로운 터미널을 열고, su - 명령으로 root권한 획득 후 실행)
5) 위 명령어 실행후 : Continue
6) File Locations : 대부분 기본값 => Next
7) Available Products : Oracle9i Database 9.2.0.4.0 => Next
8) Installation Types : Enterprise Edition (2.84GB) => Next
9) Database Configuration : General Purpose => Next
10) Database Identification : ORCL(대표DB명) => Next
11) Database File Location : 대부분 기본 값 => Next
12) Database Character Set :
Choose one of the common character sets :
Korean KO16KSC5601 <== 이거선택(EUC-KR) => Next
13) Summary => Next
14) Setup Privileges
루트권한으로 : /opt/oracle/product/920/root.sh
Enter the full pathname of the local bin directory: [/usr/local/bin]: <엔터키입력>

15) 위 명령어 실행후 : OK

16) Database Configuration Assistant
SYS Password:
Confirm SYS Passwork :
SYSTEM Password :
Confirm SYSTEM Password :
위 항목 비밀번호 입력

17) Agent Configuration Assistant 가 에러가 나서 취소된다. 무시한다.

18) 완료되면 => Next
19) End of Installation => EXIT

이렇게되면. 오라클 설치가 끝나고.
에이전트 및 웹서버 시작이 된다.
기본 DB 및 리스너도 시작이 되어 있다.


반응형
Posted by [PineTree]
ORACLE/INSTALL2009. 1. 21. 16:27
반응형

■ 오라클 다운 받기

      ① http://www.oracle.com/technology/software/products/oracle9i/index.html 에 접속한다.

      ② Oracle9i Release2 (9.2.0.1)에서 Oracle9i Database Release 2 Enterprise/Standard Edition for HP-UX를 선택한다.

 

■ 오라클과 관련된 HP-UX 11.11 패치 다운 받기

    ① http://www2.itrc.hp.com/service/patch/searchHPUXPatchSet.do?BC=main|에 접속한다.

            Step1 : Oracle 선택

            Step2 : hpux: 11.11 선택

            Step3 : conservative 선택

    ② 검색을 클릭한다.

    ③ add to selected patch list 를 클릭한다.

    ④ 제일 하단의 download selected를 클릭한다.

    ⑤ 상단의 download를 클릭한다.

 

■ 오라클 설치 조건 확인

    ① OS 커널의 64bit 여부 확인

        #> /bin/getconf KERNEL_BITS      <== 결과가 64이어야 함

    ② 메모리 : 최소 256MB 이상

        #> /usr/sbin/dmesg | grep Physical

    ③ Swap 공간 : 물리메모리의 2배 권장, 적어도 400MB 이상

        #> /usr/sbin/swapinfo -a 추가할swap용량

    ④ 디스크 공간 : 3G ~ 6G이상의 공간 필요

    ⑤ Temporary Disk 공간 : /tmp에 400MB 이상이 필요

        만일 없다면 오라클 계정의 환경변수에 다음을 적용

        export TEMP=/oracle/tmp

        export TEMPDIR=/oracle/tmp

 

■ HP-UX 11.11 패치 설치하기

    ① HP 서버에 /tmp/patches 폴더를 생성한다.

    ② 해당 zip 파일을 압풀을 풀어서 ftp로 HP 서버의 /tmp/patches에 전송한다.

    ③ /tmp/patches/create_depot_hp-ux_11를 실행한다.

        #>cd /tmp/patches

        #> . ./create_depot_hp-ux_11

    ④ swinstall을 실행하다.

        #> cd /

        #> swinstall -s /tmp/patches/depot

    ⑤ 스패이스 바를 이용하여 BUNDLE을 선택한다.

    ⑥ F3와 방향키를 이용하여 Actions로 이동하여 엔터를 클릭한다.

    ⑦ 방향키를 이용하여 Install을 선택한다.

 

■ HP-UX 패치 정보 확인하기

    ① 현재 설치된 패치를 확인하는 방법

        #> /usr/sbin/swlist -l patch | grep PH

    ② Patch번호를 통해 설치된 패치를 확인하는 방법

        #> /usr/sbin/swlist -l patch patch_number

    ③ 어떤 bundle이 설치되어 있는지 확인하는 방법

        #> /usr/sbin/swlist -l bundle

 

■ HP-UX 11.11 커널 변경하기 (reboot이 필요함)

  #> kmtune|grep shm

  #> kmtune|grep sem

  #> sam

         shmmax=536870912 or 0x40000000     (기본값 0x4000000)       <= 물리적 메모리 만큼 적용

         shmseg=10                                   (기본값 120)           
         shmmni=100                                  (기본값 200)
         semmns=1000                               (기본값 128)    <= (NPROC * 2) * 2 이상
         semmni=100                                  (기본값 64)    
 
    ※ 약어
        NPROC : 오라클의 init.ora에 정의되어 있는 PROCESS 파라미터의 값
    ※ 참고
         SHMMAX = 1개의 shared memory segment 의 maximum size
         SHMMIN = 1개의 shared memory segment 의 minimum size
         SHMSEG = 1개의 process에 attach 되는 shared memory segment의 maximum 개수
         SHMMNI = shared memory identifier 의 숫자
         SEMMNS = system의 semaphore 개수
         SEMMNI = 시스템에서 identifier 를 setting하는 semaphore 수
 

■ JRE 버전 확인

 

 

■ Link 설정

    ※ $ORACLE_HOME/ctx/lib/ins_ctx.mk 오류를 막기 위해 아래의 링크를 미리 생성한다.

ln -s /usr/lib/libX11.3 /usr/lib/libX11.sl
ln -s /usr/lib/libXIE.2 /usr/lib/libXIE.sl
ln -s /usr/lib/libXext.3 /usr/lib/libXext.sl
ln -s /usr/lib/libXhp11.3 /usr/lib/libXhp11.sl
ln -s /usr/lib/libXi.3 /usr/lib/libXi.sl
ln -s /usr/lib/libXm.4 /usr/lib/libXm.sl
ln -s /usr/lib/libXp.2 /usr/lib/libXp.sl
ln -s /usr/lib/libXt.3 /usr/lib/libXt.sl
ln -s /usr/lib/libXtst.2 /usr/lib/libXtst.sl

 

■ 오라클 설치 마운트 포인트 생성
 
 
■ 오라클 계정 생성 (root 권한으로)
    ① 그룹 생성
        #> group dba
    ② 오라클 사용자 생성
        #> useradd -g dba -d /oracle -s /usr/bin/ksh oracle
    ③ 오라클 사용자 암호 생성
        #> passwd oracle
    ④ 오라클 사용자 환경변수 설정
        #> su - oracle
        #> vi .profile
             ## Environment variables for Oracle
             export ORACLE_SID=ORA920
             export ORACLE_BASE=/oracle
             export ORACLE_HOME=/oracle/app/product/920
             export NLS_LANG=American_America.KO16KSC5601
             export PATH=$PATH:$ORACLE_HOME/bin
             export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
 
             ##CLASSPATH must include the following JRE locations:
             export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
             export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
 
             export EDITOR='vi'
             export PS1=`uname -n`':$PWD> '
             umask 022
             set -o vi
 
■ CD-ROM 마운트 (root 권한으로)
    ① CD-ROM 확인
        #> ioscan -funC disk
             Class     I  H/W Path       Driver S/W State   H/W Type     Description
             =======================================================================
             disk      0  10/0/14/0.0.0  sdisk CLAIMED     DEVICE       TEAC    CD-532E-B
                                        /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
    ② CD-ROM mount
        #> nohup /usr/sbin/pfs_mountd &
        #> nohup /usr/sbin/pfsd &
        #> pfs_mount -o xlat=unix /dev/rdsk/c0t0d0 /cdrom
    ③ CD-ROM umount
        #> cd /
        #> su root
        #> /usr/sbin/pfs_umount /cdrom
 
■ X 윈도우 설정
    ① 콘솔에서 root 권한으로 xhost의 접속을 모두 허용한다.
        #> xhost +
    ② 설치할 oracle 계정으로 DISPLAY를 설정한다.
        #> ksh
        #> export DISPLAY=localhost:0.0
 
■ 오라클 설치 (oracle 계정)
     ① runInstaller 실행
         #> . /cdrom/runInstaller
     ② JAVA_HOME 경로 설정
         /opt/JAVA1.3
 

 

설치시 오류 해결

"Error in invoking target install of makefile  <ORACLE_HOME>/ctx/lib/ins_ctx.mk"

   #> ln -s /usr/lib/Motif2.1/libXm.4 /usr/lib/libXm.sl

반응형

'ORACLE > INSTALL' 카테고리의 다른 글

오라클 삭제 방법  (0) 2009.03.18
CentOS 5.2에 Oracle 9i 설치하기  (0) 2009.02.23
Linux에서 Pro C 설치  (0) 2008.12.11
Oracle 9iR2 64-bit on RHEL 4 x86-64 (AMD64/EM64T) Update6 설치하기  (0) 2008.06.03
Oracle 10.1.0.4 Update  (0) 2008.04.08
Posted by [PineTree]
ORACLE/INSTALL2008. 12. 11. 17:20
반응형
Linux에서 Pro C 설치

Pro*C Precompiler 설치
?Oracle Database Install 시
-Database Install 후 Oracle Client Category에서 Precompiler를 다시 Install 해야 한다.
-Oracle v9.2.x 인 경우
-Oracle 9i Database -> Enterprise Edition 설치 후, 다시 Installer 를 실행하여 Oracle 9i Client -> Administrator Edition 설치.
-Oracle 9i Client 의 Net Services 와 Pro*C 가 필요하기 때문.
-Oracle v10.1.x인 경우
-Oracle 10g Database -> Enterprise Edition 설치 후, 다시 Installer 를 실행하여 Oracle 10g Client -> Administrator Edition 설치.
-Oracle 10g 에서는 Sample Code 가 설치 되지 않으므로, 다시 Installer 를 실행하여 Companion CD 를 설치.
-Sample Code 의 위치 : $ORACLE_HOME/precomp/demo


Pro*C Precompiler 옵션


?Precompiler optiion 확인
-option 의 종류와 current value 등을 확인할 수 있다.
?Precompiler option 설정 방법
1.System configuration file 에 설정
$ORACLE_HOME/precomp/admin/pcscfg.cfg
2.User configuration file 에 설정
Precompiler option의 “CONFIG” option으로 user configuration file을 지정할 수 있다.
3.Command line 에 설정
$ proc iname=[program명] userid=scott/tiger ...
4.Pro*C 소스 내에 설정
EXEC ORACLE OPTION(HOLD_CURSORS=NO);


 
Pro*C Precompiler 환경 변수(Unix, Linux)


?Compile 시 필요한 환경변수
-ORACLE_HOME
-PATH
-$ORACLE_HOME/bin과 정확한 C compiler가 있는 directory 설정.
-LD_LIBRARY_PATH
-libclntsh shared library를 찾기 위해 $ORACLE_HOME/lib ( 또는 $ORACLE_HOME/lib32 ) 설정.
** SUN : LD_LIBRARY_PATH
** HP : LD_LIBRARY_PATH, SHLIB_PATH
** AIX : LD_LIBRARY_PATH, LIBPATH
** LINUX : LD_LIBRARY_PATH
-LINUX 에서 stddef.h, stddef.h 등 default library directory 에 없는 파일은 찾아서 symbolic link를 생성해 줘야 하는 경우도 있다.

Pro*c sample program
 
$ cd $ORACLE_HOME/precomp/demo/proc
$ make ?f demo_proc.mk smaple1

user program


 
$ cd [user program이 있는 위치]
$ cd $ORACLE_HOME/precomp/demo/proc .
$ make ?f demo_proc.mk EXE=[prog] OBJS=[prog].o build
$ make ?f demo_proc.mk EXE=[prog]
                          OBJS=“prog1.o prog2.o”build


###################################

프리컴파일, 즉 잘 변형이 안되는 고정적인 헤더 파일들(ex : Windows.h등)을 미리
컴파일해서 정보를 가지고 있게 하는 기능을 가지고 있다.
위의 헤더 파일안에 변형이 잘 안되는 헤더 파일들을 넣고 첨에 컴파일 할땐 느리지만...
두 번째 부턴 미리 컴파일된 정보를 가지고 있어서 stdafx.h 안에 속한 헤더 파일들은 다시 컴파일 안하므로
컴파일 속도가 높아진다.
#####################################
Pro*C란?
"Oracle RDBMS에 준비된 Pro*C들은 SQL문을 써넣은 C프로그램을 Oracle 데이타베이스
에 있는 데이터의 액세스와 조작을 할 수 있는 C 프로그램으로 변환하기 위한 것이다.
Pro*C는 프리컴파일러이기 때문에, 입력 파일내에 있는 EXEC SQL문을 적당한 Oracle
Call로 변환해서 출력 파일을 작성한다. 그 다음, 이 출력 파일을 C 프로그램에 대한
통상의 방법으로 컴파일하고 링크해서 실행할 수 있다.
Pro*C(또는 Pro*Fortran이나 Pro*PL/I 등과 같은 제품)를 Oracle Call 인터페이스와
비교해 보자. Oracle Call 인터페이스(OCI)는 Oracle 데이터베이스의 Call 인터페이스
이므로 유저는 C, Fortran, Cobol 등의 고급언어 내에 직접 Oracle Call을 짜넣는다.
각각의 트랜잭션은 복수개의 Call과 Cursor(커서:이해할려나?)를 사용함으로써 수행된
다."
<<<<< 장점 및 이점 >>>>>
-. 1개의 Pro*C Call은 자동적으로 복수의 실행시 라이브러리 콜로 변환되기 때문에
프로그램 작성에 필요한 시간을 단축할 수 있다.
-. 1개의 프로그램을 다른 데이터베이스내의 데이터에 대해서 사용할 수 있다.
-. 복수의 프로그램을 각각 프리컴파일해서 함께 실행할 수 있다.
이상이 한글판 메뉴얼에 나와 있는 Pro*C에 대한 개략적인 정의입니다.
일반 C언어에 SQL query 문장을 넣어 파일로 저장한 다음 Pro*C로 컴파일(프리컴파일:
전처리 컴파일)하면 pc(맞나?)라는 확장자가 나오는데, 이것을 C 컴파일러로 컴파일하
면 일반 C 프로그램과 마찬가지로 실행파일이 생긴다. 이러한 실행파일은 일반적인
CGI 스크립트(이것도 이해할려나?)와 같이 작동해서 DB내에 있는 데이타를 query 해
온다.

[출처] http://tong.nate.com/odusan/21789892
반응형
Posted by [PineTree]
ORACLE/INSTALL2008. 6. 3. 03:02
반응형
Installing Oracle 9iR2 64-bit on RHEL 4 x86-64 (AMD64/EM64T)

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle


/etc/passwd 파일 수정 oracle홈 디렉토리 변경

mkdir -p /u0/oracle
chown -R oracle:oinstall /u0
chmod -R 775 /u0


Requirements for Installing Oracle 9iR2 64-bit on RHEL 4 x86-64 (AMD64/EM64T)
1. Install the required OS components

    * This list is based upon a "default-RPMs" installation of RHEL AS/ES 4 update
    1. When a newer "update" level is used, the RPM release numbers (such as 2.4-9.1.87) may be slightly higher
        (such as 2.4-9.1.93 or 2.4-9.2.37). This is fine so long as you are still using RHEL AS/ES 4 RPMs.
    * glibc-kernheaders-2.4-9.1.87.x86_64.rpm
    * glibc-headers-2.3.4-2.9.x86_64.rpm
    * glibc-devel-2.3.4-2.9.x86_64.rpm     << both ARCH's are required. See below.
    * glibc-devel-2.3.4-2.9.i386.rpm    << both ARCH's are required. See above.
    * compat-gcc-32-3.2.3-47.3.x86_64.rpm
    * compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm
    * libstdc++-devel-3.4.3-22.1.x86_64.rpm
    * libaio-0.3.103-3.x86_64.rpm

확인하기
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep glibc-kernheaders
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-headers              
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  compat-gcc-32
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  compat-gcc-32-c++
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  libstdc++-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  libaio




2. Configure the Unix environment

The first critical environment item is related to the gcc v3.2 and g++ v3.2 RPMs that were installed above. Run these commands:

    mv /usr/bin/gcc /usr/bin/gcc.orig
    mv /usr/bin/g++ /usr/bin/g++.orig
    ln -s /usr/bin/x86_64-redhat-linux-gcc32 /usr/bin/gcc
    ln -s /usr/bin/x86_64-redhat-linux-g++32 /usr/bin/g++
   
.bash_profile
   
TMDIR=/tmp
export TMDIR
export ORACLE_BASE=/u0/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2/db_1
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/java/lib:$ORACLE_HOME/lib:$ORACLE_HOME/oracm/lib
export ORACLE_SID=dbSID   <<==SID
export ORACLE_OWNER=oracle
export LANG=C
export LD_ASSUME_KERNEL=2.4.19 
#CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/usr/local/java/bin:$PATH:.
export TNS_ADMIN=$ORACLE_HOME/network/admin
export CLASSPATH
export umask=022
export DISPLAY=ip:0.0

/etc/sysctl.conf

kernel.hostname   = magic.xxx.co.kr
kernel.domainname = magic

kernen.nem = 250 32000 100 128
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.shmall = 2097152
fs.file-max = 327679
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

/etc/profile
           if [ $USER = "oracle" ]; then
               if [ $SHELL = "/bin/ksh" ]; then
                   ulimit -p 16384
                   ulimit -n 65536
               else
                   ulimit -u 16384 -n 65536
               fi
           fi
          
/etc/security/limits.conf
          
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536

reboot 후에 install
엔진설치
9.2.0.8 패치셋 설치
db생성


반응형
Posted by [PineTree]
ORACLE/INSTALL2008. 4. 8. 01:06
반응형

Oracle 10.1.0.4 Update

 
지난번 포스팅시 마지막에 예고했었던 오라클 패치업데이트(10.1.0.2 에서 10.1.0.4) 에 관한 내용. 전제로 OS는 리눅스 환경이다.

예비서버의 오라클 패치를 끝내고 본서버와 교체후 이번에는 본서버의 패치를 실행했다. 2번째라 그런지 별 문제없이 끝났다. 다만 Enterprise Manager에서 트러블이 있었는데 이건 다음에 포스팅하겠음.


>> 10.1.0.2(혹은 10.1.0.3)에서 10.1.0.4로의 패치수순

0. HP유닉스, AIX의 경우는 방법이 일부 다르므로 오라클 홈페이지의 메뉴얼이나 KROWN문서를 참조해서 알아서 수정할것.

1. OiSC에서 패치파일(용량 571MB)를 다운로드해서 서버에 복사.

2. 패치를 실행하기전에 먼저 구패키지에 포함되어 있는 Oracle Database 10g Companion CD에서 Oracle Database 10g Products 인스톨 타입을 선택해서 인스톨을 해야한다. 이안에는 Java퍼포먼스를 향상시키는 Natively Compiled Java Libraries (NCOMP)가 들어있는데 이걸 인스톨하지 않으면 나중에 패치를 실행할때 "ORA-29558: JAccelerator(NCOMP) not installed" 라는 에러가 발생하며 더이상 패치 진행이 불가능하다.


3. RAC환경에서 운영시에는 CRS를 먼저 패치를 실행한 후 본 패치를 실행해야한다. CRS의 패치순서는 다음과 같다.
(1) 기존의 Oracle Database 10g 서비스를 전부 다음의 순서로 정지시킨다.
- srvctl을 사용해서 전노드의 모든 RAC인스턴스, 데이터베이스를 정지시킨다.
srvctl stop instance -d <db_unique_name> -i <inst_name_list> [-o <stop_options>]
srvctl stop database -d <db_unique_name> [-o <stop_options>] [-c <connect_str>]
srvctl stop instance -d SERAC -i SERAC1 -o immedate
srvctl stop instance -d SERAC -i SERAC2 -o immedate
srvctl stop database -d SERAC -o immediate

- srvctl을 사용해서 전노드의 모든 ASM인스턴스를 정지시킨다.
srvctl stop asm -n <node_name> [-i <inst_name>] [-o <stop_options>]
srvctl stop asm -n togos-db1 -i +ASM1 -o immedate
srvctl stop asm -n togos-db2 -i +ASM1 -o immedate

- srvctl을 사용해서 전노드의 노드어플리케이션을 정지시킨다.
srvctl stop nodeapps -n <node_name>
srvctl stop nodeapps -n togos-db1
srvctl stop nodeapps -n togos-db2

- 다음 커맨드를 실행해서 모든 노드의 CRS프로세스를 정지시킨다.
# /etc/init.d/init.crs stop (솔라리스, 리눅스)
# /sbin/init.d/init.crs stop (HP유닉스)
# /etc/init.crs stop (AIX)

(3) 그밖에 혹시 ORA_CRS_HOME를 사용하는 어플리케이션, 프로세스가 존재한다면 모두 정지시킨다.

(4) 패치파일을 압축해제한 디렉토리에서 runInstaller를 실행한다.

(5) 파일의 장소를 지정하는 화면까지 이동한다. 소스지정은 products.xml, 인스톨 장소는 기존 인스톨장소인 ORA_CRS_HOME를 선택한후 계속 진행한다. (데폴트는 이름은 OraCr10ghome1, 패스는 /u01/app/oracle/product/10.1.0/crs)

(6) 이후는 쭉 진행하다가 마지막에 커맨드모드에서 다음의 쉘파일을 모든 노드에서 루트권한으로 실행한다. (메세지에 나온다)
$ORA_CRS_HOME/install/root10104.sh

(7) 여기까지로 CRS패치는 모두 종료되었다. 이후 계속해서 데이터베이스의 패치를 진행하기 위해서 다음의 명령들을 실행해서 (1) 에서 소개한 커맨드들을 다시 실행해서 패치중 재기동된 오라클 서비스들을 정지시킨다. 작업이 끝나면 crs_stat -t 커맨드를 실행해서 전 노드의 리소스가 OFFLINE상태가 되었는지를 재확인한다.


4. EM가 기동중이라면 먼저 정지시킨다. (emctl stop dbconsole)

5. 패치파일의 runInstaller를 기동해서 파일의 장소를 지정하는 화면까지 이동한다. 소스지정은 products.xml, 인스톨 장소는 기존 인스톨장소인 ORACLE_HOME를 선택한후 계속 진행한다. (데폴트는 이름은 OraDb10ghome1, 패스는 /u01/app/oracle/product/10.1.0/db)

6. 쭉 순서에 따라 진행한 후 인스톨화면을 종료한다.


여기까지로 기본 패치 프로그램의 인스톨작업은 끝났다. 하지만 아직 전체작업이 끝난것은 아니다. 다음 작업들을 실행하지 않으면 데이타베이스가 에러("ORA-13516: SWRF Operation failed: CATPROC not valid")를 내며 기동되지 않으므로 계속 패치 수순을 진행한다.


>> 패치 인스톨 후의 작업

1. RAC환경의 경우 클러스터의 모든 노드에 대해서 노드어플리케이션을 기동시킨다.
srvctl start nodeapps -n <nodename>
srvctl start nodeapps -n togos-db1
srvctl start nodeapps -n togos-db2

2. ASM사용시에는 ASM인스턴스를 기동시킨다.
srvctl start asm -n <nodename>

srvctl start asm -n togos-db1
srvctl start asm -n togos-db2

3. sysdba권한으로 sqlplus에 로그인한다.
sqlplus / as sysdba

4. 데이터베이스를 기동한다.
SQL> STARTUP NOMOUNT

5. SHARED_POOL_SIZE, JAVA_POOL_SIZE 파라메터의 값을 다음과 같이 수정한다. 패치작업을 종료한후 원래대로 다시 수정해도 상관없다.
SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='180M' SCOPE=both; (에러발생시 both대신 spfile)
SQL> ALTER SYSTEM SET JAVA_POOL_SIZE='180M' SCOPE=both; (에러발생시 both대신 spfile)

6. RAC환경의 경우 CLUSTER_DATABASE 파라메터의 값을 FALSE로 수정한다. 패치작업이 모두 종료되면 다시 TRUE 로 값을 되돌려야 한다. 그렇지 않으면 RAC환경이 정상적으로 기동되지 않는다.
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;

7. 수정한 파라메터를 반영시키고 새로운 업데이트를 실시하기위해 데이터베이스를 재기동한다.
SQL> SHUTDOWN
SQL> STARTUP UPGRADE

8. 다음의 커맨드를 실행한다.
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catpatch.sql
(머신파워에 따라 다르지만 내 경우 위커맨드는 실행후 종료까지 30분정도 걸렸다)
SQL> SPOOL OFF

9. 출력된 patch.log파을을 확인해서 에러가 발생하지 않았는지 확인한다. 에러가 발생했을 경우 문제점을 수정하고 다시 catpatch.sql 을 재실행해야한다.

10. 지금까지 문제가 없을경우 데이터베이스를 다시 재기동한다.
SQL> SHUTDOWN
SQL> STARTUP

11. 다음의 커맨드를 실행해서 INVALID스테이터스 상태가 된 PL/SQL패키지를 재컴파일한다.
SQL> @?/rdbms/admin/utlrp.sql
위커맨드 실행시 스탠다드 에디션의 경우는 OLAP관련의 INVALID오브젝트가 여전히 남게되나 이부분은 엔터프라이즈버전에서만 활성화되는 기능이므로 무시한다.

12. RAC환경의 경우 모든 노드에서 configPatch.pl 스크립트를 실행한다.
# perl $ORACLE_HOME/sysman/install/configPatch.pl
log4j: ERROR 가 발생하지만 무시한다.


이로써 10.1.0.4 의 패치작업은 모두 끝났다. 혹시나 발생할 문제점을 미연에 발견하기 위해 전노드의 재기동을 추천한다. 그리고 Enterprise Manager 기능에 관련해서 문제가 발생할 경우는 이를 수정하는것보다 EM을 삭제후 재설치하는 편이 훨씬 빠르다. EM의 재설치에 관련해서는 이전 포스팅 을 참조한다.


이상.

 

반응형
Posted by [PineTree]
ORACLE/INSTALL2008. 2. 27. 00:22
반응형
 

 Installing Oracle 9iR2 64-bit on RHEL 4 x86-64 (AMD64/EM64T)

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle


/etc/passwd 파일 수정 oracle홈 디렉토리 변경

mkdir -p /u0/oracle
chown -R oracle:oinstall /u0
chmod -R 775 /u0


Requirements for Installing Oracle 9iR2 64-bit on RHEL 4 x86-64 (AMD64/EM64T)
1. Install the required OS components

    * This list is based upon a "default-RPMs" installation of RHEL AS/ES 4 update
    1. When a newer "update" level is used, the RPM release numbers (such as 2.4-9.1.87) may be slightly higher
        (such as 2.4-9.1.93 or 2.4-9.2.37). This is fine so long as you are still using RHEL AS/ES 4 RPMs.
    * glibc-kernheaders-2.4-9.1.87.x86_64.rpm
    * glibc-headers-2.3.4-2.9.x86_64.rpm
    * glibc-devel-2.3.4-2.9.x86_64.rpm     << both ARCH's are required. See below.
    * glibc-devel-2.3.4-2.9.i386.rpm    << both ARCH's are required. See above.
    * compat-gcc-32-3.2.3-47.3.x86_64.rpm
    * compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm
    * libstdc++-devel-3.4.3-22.1.x86_64.rpm
    * libaio-0.3.103-3.x86_64.rpm

확인하기
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep glibc-kernheaders
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-headers              
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  glibc-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  compat-gcc-32
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  compat-gcc-32-c++
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  libstdc++-devel
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep  libaio




2. Configure the Unix environment

The first critical environment item is related to the gcc v3.2 and g++ v3.2 RPMs that were installed above. Run these commands:

    mv /usr/bin/gcc /usr/bin/gcc.orig
    mv /usr/bin/g++ /usr/bin/g++.orig
    ln -s /usr/bin/x86_64-redhat-linux-gcc32 /usr/bin/gcc
    ln -s /usr/bin/x86_64-redhat-linux-g++32 /usr/bin/g++
   
.bash_profile
   
TMDIR=/tmp
export TMDIR
export ORACLE_BASE=/u0/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2/db_1
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/java/lib:$ORACLE_HOME/lib:$ORACLE_HOME/oracm/lib
export ORACLE_SID=dbSID   <<==SID
export ORACLE_OWNER=oracle
export LANG=C
export LD_ASSUME_KERNEL=2.4.19 
#CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/usr/local/java/bin:$PATH:.
export TNS_ADMIN=$ORACLE_HOME/network/admin
export CLASSPATH
export umask=022
export DISPLAY=ip:0.0

/etc/sysctl.conf

kernel.hostname   = magic.xxx.co.kr
kernel.domainname = magic

kernen.nem = 250 32000 100 128
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.shmall = 2097152
fs.file-max = 327679
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

/etc/profile
           if [ $USER = "oracle" ]; then
               if [ $SHELL = "/bin/ksh" ]; then
                   ulimit -p 16384
                   ulimit -n 65536
               else
                   ulimit -u 16384 -n 65536
               fi
           fi
          
/etc/security/limits.conf
          
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536

reboot 후에 install
엔진설치
9.2.0.8 패치셋 설치
db생성

반응형
Posted by [PineTree]
ORACLE/INSTALL2007. 3. 16. 19:23
반응형

oracle8i client를 XP에서는 설치되나


win2000/winxp/win2003에서 setup.exe를 실행해도 아무 것도 나타나지 않는 경우는
오라클 8i의 jre에 문제가 있기 때문.

 

오라클8i설치디렉토리\stage\Components\oracle.swd.jre\1.1.7.30\1\DataFiles\Expanded\jre\win32\bin\symcjit.dll


이 파일이 문제라는군요

오라클 9i에 들어있는 이 파일을 복사해서 사용하면 설치됨.

 

cpu가 pentium-4일 경우는 symcjit.dll 때문에 설치가 안됨.

오라클 9i에서 복사 또는 symcjit.dll을 삭제하시거나 이름을 바꿔서 설치해도됨.

반응형
Posted by [PineTree]
ORACLE/INSTALL2007. 2. 26. 00:47
반응형

Installing Oracle Database 10g Release 2 on Linux x86

by John Smiley

Learn the basics of installing Oracle Database 10g Release 2 on Red Hat Enterprise Linux or Novell SUSE Enterprise Linux, from the bare metal up (for evaluation purposes only).

Contents
Overview
Part I: Installing Linux
    RHEL4
    SLES9
Part II: Configuring Linux for Oracle
    Verify System Requirements
    Create Directories
    Create the Oracle Groups and User Account
    Configure Linux Kernel Parameters
    Set Shell Limits for the oracle User
Part III: Installing Oracle
    Install the Software
Part IV: Configuring Storage
    Filesystems
    Automatic Storage Management
Conclusion
Appendix

Updated March 2006


Overview

The guide provides a walkthrough of installing an Oracle Database 10g Release 2 database on commodity hardware for the purpose of evaluation.  If you are new to Linux and/or Oracle, this guide is for you. It starts with the basics and walks you through an installation of Oracle Database 10g Release 2 from the bare metal up.

This guide will take the approach of offering the easiest paths, with the fewest number of steps for accomplishing a task.  This approach often means making configuration choices that would be inappropriate for anything other than an evaluation.  For that reason, this guide is not appropriate for building production-quality environments, nor does it reflect best practices.

The  Linux distributions certified for Oracle Database 10g Release 2 are:

  • Red Hat Enterprise Linux  4 (RHEL4)
  • Red Hat Enterprise Linux 3 (RHEL3)
  • Novell SUSE Linux Enterprise Server 9 (SLES9)

We will cover both of the Linux 2.6 kernel-based distributions: RHEL4 and SLES9.  RHEL3 is not covered here.  

Please note that as an alternative Novell offers the orarun package for installation of SLES9 and Oracle. To use that method instead of the one described here, refer to this Novell-supplied install guide.

This guide is divided into four parts: Part I covers the installation of the Linux operating system, Part II covers configuring Linux for Oracle, Part III discusses the essentials of installing the Oracle Database, and Part IV covers creating additional filesystems and  Automatic Storage Management (ASM)—a new storage option in Oracle Database 10g that greatly simplifies storage administration and management.  The Appendix provides information to help you get started using your new database including how to access the database interactively and how to stop and start the database and related services.


Part I: Installing Linux

This guide assumes a server with the following hardware:

  • 800MHz Pentium III CPU
  • 1024MB of RAM
  • SCSI host adapter (Ultra SCSI 160)
  • Four SCSI disk drives (1 x 9GB + 3 x 36GB)
  • One 100Base-T Ethernet adapter

Your hardware does not have to match this in order to use this guide.  All that is necessary for a basic database install is a single CPU, 1024MB of RAM, and one disk drive (IDE, SCSI, or FireWire) with at least 7GB of free space.

Now, let's walk through the process of installing the Linux operating system on a server. The instructions assume a fresh install of Linux (as opposed to an upgrade), that the server will be dedicated to Oracle, and that no other operating systems or data are on the server.


RHEL4

Oracle Database 10g Release 2 is certified to run the base release of RHEL4 (Advanced Server and Enterprise Server) without updates. (Free evaluation copies of RHEL4 are available for download.) If you have update CDs, you can use the boot CD from the update instead of the boot CD from the base release to automatically apply all updates during the installation. All updates from Red Hat are supported by Oracle.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.

  1. Boot the server using the first CD.
    • You may need to change your BIOS settings to allow booting from the CD.
  2. The boot screen appears with the boot: prompt at the bottom of the screen.
    • Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
    • The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
  3. Language Selection
    • Accept the default.
  4. Keyboard Configuration
    • Accept the default.
  5. Welcome Screen
    • Click on Next.
  6. Disk Partitioning Setup
    • A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

      (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

      This guide uses the following partitioning scheme, with ext3 for each filesystem:

      The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
      - 100MB /boot partition
      -1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
      -7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

  7. Boot Loader Configuration
    • Accept the default.
  8. Network Configuration
    • It is usually best to configure database servers with a static IP address. To do so, click on Edit .
    • A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK .
    • In the Hostname box, select manually and enter the hostname.
    • In the Miscellaneous Settings box, enter the remaining network settings.
  9. Firewall Configuration
    • For the purposes of this walk-through, no firewall is configured. Select No firewall
    • Select Disabled on the "Enable SELinux" drop down list. 
    • Click on Proceed when the "Warning - No Firewall" window appears.
  10. Additional Language Support
    • Accept the default.
  11. Time Zone Selection
    • Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
  12. Set Root Password
    • Enter a password for root, and enter it again to confirm.
  13. Package Installation Defaults
    • Select Customize software packages to be installed.
  14. Package Group Selection
    • Select only the package sets shown here and leave all others unselected. 
    • Desktop
      • X Window System
      • Gnome
    • Applications
      • Graphical Internet (optional)
    • Servers
      • Do not select anything in this group.
    • Development
      • Development Tools
    • System
      • Administration Tools
      • System Tools
        • Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.
    • Miscellaneous
      • Do not select anything in this group.
    • Click on Next to proceed.
  15. Installing Packages
    • Software will be copied to the hard disk and installed. Change disks as prompted.
  16. Congratulations
    • Remove the installation media from the system, and click on Reboot .
  17. The system automatically reboots and presents a new welcome screen.
    • Click on Next.
  18. License Agreement
    • Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
  19. Date and Time
    • Set the Date and Time.
    • If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
  20. Display
    • Accept the defaults or change as required.
  21. Red Hat Login
    • Enter your Red Hat Network login and password or create a new one.
  22. System User
    • Create an account for yourself.
    • Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
  23. Additional CDs
    • Click on Next.
  24. Finish Setup
    • Click on Next.
  25. A graphical login screen appears.
  26. Congratulations! Your RHEL4 software is now installed.

Verifying Your Installation

Required kernel version: 2.6.9-5.0.5.EL  This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g Release 2 .

Check your kernel version by running the following command:

uname -r

Ex:
# uname -r
2.6.9-22.ELsmp

Once you've completed the steps above, all of the packages required for Oracle Database 10g Release 2 will have been installed.  Verify this using the example below.

Required package versions (or later):
    • binutils-2.15.92.0.2-10.EL4
    • compat-db-4.1.25-9
    • control-center-2.8.0-12
    • gcc-3.4.3-9.EL4
    • gcc-c++-3.4.3-9.EL4
    • glibc-2.3.4-2
    • glibc-common-2.3.4-2
    • gnome-libs-1.4.1.2.90-44.1
    • libstdc++-3.4.3-9.EL4
    • libstdc++-devel-3.4.3-9.EL4
    • make-3.80-5
    • pdksh-5.2.14-30
    • sysstat-5.0.5-1
    • xscreensaver-4.18-5.rhel4.2
    • libaio-0.3.96
    • openmotif21-2.1.30-11.RHEL4.2  (Required only to install Oracle demos.  Installation of Oracle demos is not covered by this guide.)
      To see which versions of these packages are installed on your system, run the following command:
      rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
      gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
      Ex: 
      # rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
      > gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
      binutils-2.15.92.0.2-15
      compat-db-4.1.25-9
      control-center-2.8.0-12.rhel4.2
      gcc-3.4.4-2
      gcc-c++-3.4.4-2
      glibc-2.3.4-2.13
      glibc-common-2.3.4-2.13
      gnome-libs-1.4.1.2.90-44.1
      libstdc++-3.4.4-2
      libstdc++-devel-3.4.4-2
      make-3.80-5
      pdksh-5.2.14-30.3
      sysstat-5.0.5-1
      xscreensaver-4.18-5.rhel4.9
      libaio-0.3.103-3
      openmotif21-2.1.30-11.RHEL4.4



      SLES9

      Oracle Database 10g Release 2 is certified to run on the base release of SLES9. Service Packs and package updates are available from Novell, either on CDs or online via its support portal. In this guide, we will install on the SLES9 base release.

      1. Boot the server, using the SLES9 CD.
        • You may need to change your BIOS settings to allow booting from the CD.
      2. The Novell SLES installation screen appears.
        • Select Installation.
        • The installer scans your hardware and presents the YaST interface.
      3. Language Selection
        • Accept the license agreement.
        • Accept the default, English (US).
      4. Installation Settings
        • Select New Installation.
      5. Partitioning
        • A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

          (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

          This guide uses the following partitioning scheme, with ext3 for each filesystem:

          The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
          - 100MB /boot partition
          -1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
          -7,150MB root partition—this partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

      6. Software
        • Click on the link for Software.
        • The Software Selection screen appears.
        • Click on Detailed Selection.
        • The left-hand window displays a list of software selections. Click on the box next to each selection to select/deselect it.
        • Select the following software (this is the recommended set; all others should be deselected):
          - Basis Runtime System
          - YaST
          - Linux Tools
          - Help & Support Documentation
          - Graphical Base System
          - GNOME System
          - C/C++ Compiler and Tools
          - Analyzing Tools
        • It is recommended that the following items not be installed, as they may conflict with Oracle products providing the same service:
          - Simple Webserver
          - Authentication Server (NIS, LDAP, Kerberos)
      7. Time Zone
        • Set your time zone.
      8. Click on Accept.
      9. A warning box appears. Click on Yes, install when ready to proceed.
      10. Change CDs as prompted by the installer.
      11. Confirm Hardware Detection
        • Network Cards – Click on OK.
      12. Password for "root." the system administrator.
        • Enter the root password and repeat to confirm.
      13. Configure your network interface(s), and click on Next when ready to proceed.
        • Static IP addresses are recommended for servers.
        • There is no need to configure printers, modems, ISDN adapters, or sound in order to build a database.
      14. Test Internet Connection
        • There is no need to connect to the Internet to download release notes or Linux updates. Select No, Skip This Test.
      15. Service Configuration
        • There is no need to configure CA Management or OpenLDAP Server. Select Skip Configuration.
      16. User Authentication Method
        • Select Local(/etc/passwd).
      17. Add a New Local User
        • Create an account for yourself. Do not create the oracle account at this time; we'll do that later.
      18. Release Notes
        • Click on Next
      19. Hardware Configuration
        • Confirm Hardware Detection – Graphics Cards – click on Continue.
        • There is no need to configure sound cards for a database – click on Skip.
        • If the graphics card and monitor have been successfully detected, click on Next. Otherwise, click on the Graphics Cards link and enter the correct information.
      20. Installation Completed
        • Click on Finish.
      21. Congratulations! Your SLES9 software is now installed.
      Verifying Your Installation

      If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g Release 2. However, you can take the steps below to verify your installation.

      Required kernel version: 2.6.5-7.97 (or later)

      Check your kernel version by running the following command:

      uname -r

      Ex:
      # uname -r
      2.6.5-7.97-smp
      Other required package versions (or later):
        • binutils-2.15.90.0.1.1-32.5
        • gcc-3.3.3-43.24
        • gcc-c++-3.3.3-43.24
        • glibc-2.3.3-98.28
        • gnome-libs-1.4.1.7-671.1
        • libstdc++-3.3.3-43.24
        • libstdc++-devel-3.3.3-43.24
        • make-3.80-184.1
        • pdksh-5.2.14-780.1
        • sysstat-5.0.1-35.1
        • xscreensaver-4.16-2.6
        • libaio-0.3.98
          To see which versions of these packages are installed on your system, run the following command as root:
          rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make \
          pdksh sysstat xscreensaver libaio

          Ex:
          # rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make \
          > pdksh sysstat xscreensaver libaio
          binutils-2.15.90.0.1.1-32.10
          gcc-3.3.3-43.34
          gcc-c++-3.3.3-43.34
          glibc-2.3.3-98.47
          gnome-libs-1.4.1.7-671.1
          libstdc++-3.3.3-43.34
          libstdc++-devel-3.3.3-43.34
          make-3.80-184.1
          pdksh-5.2.14-780.7
          sysstat-5.0.1-35.4
          xscreensaver-4.16-2.6
          libaio-0.3.102-1.2

          If any of the package versions on your system are missing or the versions are earlier than those specified above, you can download and install the updates from the Novell SUSE Linux Portal.

          Part II: Configuring Linux for Oracle

          Now that the Linux software is installed, you need to configure it for Oracle. This section walks through the steps required to configure Linux for Oracle Database 10g Release 2.

          Verifying System Requirements

          To verify that your system meets the minimum requirements for an Oracle Database 10g Release 2 database, log in as root and run the commands below.

          To check the amount of RAM and swap space available, run this:
          grep MemTotal /proc/meminfo
          grep SwapTotal /proc/meminfo

          Ex:
          # grep MemTotal /proc/meminfo
          MemTotal: 1034680 kB
          # grep SwapTotal /proc/meminfo
          SwapTotal: 1534196 kB

          The minimum RAM required is 1024MB, and the minimum required swap space is 1GB. Swap space should be twice the amount of RAM for systems with 2GB of RAM or less and between one and two times the amount of RAM for systems with more than 2GB.

          You also need 2.5GB of available disk space for the Oracle Database 10g Release 2 software and another 1.2GB for the database. The /tmp directory needs at least 400MB of free space. To check the available disk space on your system, run the following command:

          df -h

          Ex:
          # df -h
          Filesystem Size Used Avail Use% Mounted on
          /dev/sda3 6.8G 1.3G 5.2G 20% /
          /dev/sda1 99M 17M 77M 18% /boot

          The example shows that the /tmp directory does not have its own filesystem. (It's part of the root filesystem for this guide.) With 5.2 GB available, the root filesystem has just enough space for the installation (2.5 + 1.2 + 0.4 = 4.1GB) with a little room left over.

          Create the Oracle Groups and User Account

          Next, create the Linux groups and user account that will be used to install and maintain the Oracle Database 10g Release 2 software. The user account will be called oracle, and the groups will be oinstall and dba. Execute the following commands as root:

          /usr/sbin/groupadd oinstall
          /usr/sbin/groupadd dba
          /usr/sbin/useradd -m -g oinstall -G dba oracle
          id oracle

          Ex:
          # /usr/sbin/groupadd oinstall
          # /usr/sbin/groupadd dba
          # /usr/sbin/useradd -m -g oinstall -G dba oracle
          # id oracle
          uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

          Set the password on the oracle account:

          passwd oracle

          Ex:
          # passwd oracle
          Changing password for user oracle.
          New password:
          Retype new password:
          passwd: all authentication tokens updated successfully.

          Create Directories

          Now create directories to store the Oracle Database 10g Release 2 software and the database files. This guide adheres to the Optimal Flexible Architecture (OFA) for the naming conventions used in creating the directory structure. For more information on OFA standards, see Appendix C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.

          The following assumes that the directories are being created in the root filesystem. This is done for the sake of simplicity and is not recommended as a general practice. These directories would normally be created as separate filesystems.

          Issue the following commands as root:

          mkdir -p /u01/app/oracle
          chown -R oracle:oinstall /u01/app/oracle
          chmod -R 775 /u01/app/oracle

          Ex:
          # mkdir -p /u01/app/oracle
          # chown -R oracle:oinstall /u01/app/oracle
          # chmod -R 775 /u01/app/oracle

          Configuring the Linux Kernel Parameters

          The Linux kernel is a wonderful thing. Unlike most other *NIX systems, Linux allows modification of most kernel parameters while the system is up and running. There's no need to reboot the system after making kernel parameter changes. Oracle Database 10g Release 2 requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, don't change it.

          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default=262144
          net.core.wmem_default=262144
          net.core.rmem_max=262144
          net.core.wmem_max=262144

          If you're following along and have just installed Linux, the kernel parameters will all be at their default values and you can just cut and paste the following commands while logged in as root.

          cat >> /etc/sysctl.conf <<EOF
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default=262144
          net.core.wmem_default=262144
          net.core.rmem_max=262144
          net.core.wmem_max=262144
          EOF
          /sbin/sysctl -p

          Ex:
          # cat >> /etc/sysctl.conf <<EOF
          > kernel.shmall = 2097152
          > kernel.shmmax = 536870912
          > kernel.shmmni = 4096
          > kernel.sem = 250 32000 100 128
          > fs.file-max = 65536
          > net.ipv4.ip_local_port_range = 1024 65000
          > EOF
          # /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
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default = 262144
          net.core.wmem_default = 262144
          net.core.rmem_max = 262144
          net.core.wmem_max = 262144

          Run the following commands as root to verify your settings:

          /sbin/sysctl -a | grep shm
          /sbin/sysctl -a | grep sem
          /sbin/sysctl -a | grep file-max
          /sbin/sysctl -a | grep ip_local_port_range
          /sbin/sysctl -a | grep rmem_default
          /sbin/sysctl -a | grep rmem_max
          /sbin/sysctl -a | grep wmem_default
          /sbin/sysctl -a | grep wmem_max

          Ex:
          # /sbin/sysctl -a | grep shm
          kernel.shmmni = 4096
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shm-use-bigpages = 0
          # /sbin/sysctl -a | grep sem
          kernel.sem = 250 32000 100 128
          # /sbin/sysctl -a | grep file-max
          fs.file-max = 65536
          # /sbin/sysctl -a | grep ip_local_port_range
          net.ipv4.ip_local_port_range = 1024 65000
          # /sbin/sysctl -a | grep rmem_default
          net.core.rmem_default = 262144
          # /sbin/sysctl -a | grep rmem_max
          net.core.rmem_max = 262144
          # /sbin/sysctl -a | grep wmem_default
          net.core.wmem_default = 262144
          # /sbin/sysctl -a | grep wmem_max
          net.core.wmem_max = 262144

          For Novell SUSE Linux releases, use the following to ensure that the system reads the /etc/sysctl.conf file at boot time:

          /sbin/chkconfig boot.sysctl on

          Setting Shell Limits for the oracle User

          Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root:

          cat >> /etc/security/limits.conf <<EOF
          oracle soft nproc 2047
          oracle hard nproc 16384
          oracle soft nofile 1024
          oracle hard nofile 65536
          EOF

          cat >> /etc/pam.d/login <<EOF
          session required /lib/security/pam_limits.so
          EOF

          For RHEL4, use the following:

          cat >> /etc/profile <<EOF
          if [ \$USER = "oracle" ]; then
          if [ \$SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
          else
          ulimit -u 16384 -n 65536
          fi
          umask 022
          fi
          EOF

          cat >> /etc/csh.login <<EOF
          if ( \$USER == "oracle" ) then
          limit maxproc 16384
          limit descriptors 65536
          umask 022
          endif
          EOF

          For SLES 9, use the following:

          cat >> /etc/profile.local <<EOF
          if [ \$USER = "oracle" ]; then
          if [ \$SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
          else
          ulimit -u 16384 -n 65536
          fi
          umask 022
          fi
          EOF

          cat >> /etc/csh.login.local <<EOF
          if ( \$USER == "oracle" ) then
          limit maxproc 16384
          limit descriptors 65536
          umask 022
          endif
          EOF


          Part III: Installing Oracle

          Oracle Database 10g Release 2 can be downloaded from OTN. Oracle offers a development and testing license free of charge. However, no support is provided and the license does not permit production use. A full description of the license agreement is available on OTN.

          The easiest way to make the Oracle Database 10g Release 2 distribution media available on your server is to download them directly to the server.

          Use the graphical login to log in as oracle.

          Create a directory to contain the Oracle Database 10g Release 2 distribution:

          mkdir 10gR2_db

          To download Oracle Database 10g Release 2 from OTN, point your browser (Firefox works well) to http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linuxsoft.html. Fill out the Eligibility Export Restrictions page, and read the OTN License agreement. If you agree with the restrictions and the license agreement, click on I Accept.

          Click on the 10201_database_linux32.zip  link, and save the file in the directory you created for this purpose (10gR2_db)—if you have not already logged in to OTN, you may be prompted to do so at this point.

          Unzip and extract the file:

          cd 10gR2_db
          unzip 10201_database_linux32.zip

          Install the Software and Create a Database

          Log in using the oracle account.

          Change directory to the location where you extracted the Oracle Database 10g Release 2 software.
          Ex:
          $ cd $HOME/10gR2_db

          Change directory to Disk1.

          Ex:
          $ cd database

          Start the Oracle Universal Installer.

          $ ./runInstaller
          1. Select Installation Method
            • Select Basic Installation
            • Oracle Home Location: /u01/app/oracle/product/10.2.0/db_1
            • Installation Type: Enterprise Edition (1.3GB)
            • UNIX DBA Group:  oinstall
            • Make sure Create Starter Database is checked
            • Global Database Name: demo1
            • Enter the Database Password and Confirm Password
            • Click on Next
          2. Specify Inventory Directory and Credentials
            • Inventory Directory: /u01/app/oracle/oraInventory
            • Operating System group name:  oinstall
            • Click on Next
          3. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          4. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          5. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          6. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          7. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          8. Congratulations! Your new Oracle Database 10g Release 2 database is up and ready for use.


          Part IV: Configuring Storage

          The database we created in Part III used a single filesystem for disk storage. However, there are several other ways to configure storage for an Oracle database.

          Part IV explores other methods of configuring disk storage for a database. In particular, it describes creating additional filesystems and using Automatic Storage Management (ASM). Use of raw devices and Oracle Cluster File System (OCFS) is covered in the next article in this series which walks through installing Oracle RAC Database 10g Release 2 on Linux x86.

          Partition the Disks

          In order to use either file systems or ASM, you must have unused disk partitions available.  This section describes how to create the partitions that will be used for new file systems and for ASM.

          WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data.

          This example uses /dev/sdb (an empty SCSI disk with no existing partitions) to create a single partition for the entire disk (36 GB).

          Ex:
          # fdisk /dev/sdb
          Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
          Building a new DOS disklabel. Changes will remain in memory only,
          until you decide to write them. After that, of course, the previous
          content won't be recoverable.


          The number of cylinders for this disk is set to 4427.
          There is nothing wrong with that, but this is larger than 1024,
          and could in certain setups cause problems with:
          1) software that runs at boot time (e.g., old versions of LILO)
          2) booting and partitioning software from other OSs
          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): p

          Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
          Units = cylinders of 16065 * 512 bytes

          Device Boot Start End Blocks Id System

          Command (m for help): n
          Command action
          e extended
          p primary partition (1-4)
          p
          Partition number (1-4): 1
          First cylinder (1-4427, default 1):
          Using default value 1
          Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):
          Using default value 4427

          Command (m for help): w
          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: If you have created or modified any DOS 6.x
          partitions, please see the fdisk manual page for additional
          information.
          Syncing disks.

          Now verify the new partition:

          Ex:
          # fdisk -l /dev/sdb

          Disk /dev/sdb: 36.4 GB, 36420075008 bytes
          255 heads, 63 sectors/track, 4427 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes

          Device Boot Start End Blocks Id System
          /dev/sdb1 * 1 4427 35559846 83 Linux

          Repeat the above steps for each disk to be partitioned.  The following section on Filesystems uses a single disk partition, /dev/sdb1.  The ASM example uses three partitions on three disks: /dev/sdb1, /dev/sdc1, and /dev/sdd1


          Filesystems

          Filesystems are the most widely used means of storing data file, redo logs, and control files for Oracle databases. Filesystems are easy to implement and require no third-party software to administer.

          In most cases, filesystems are created during the initial installation of Linux. However, there are times when a new filesystem must be created after the initial installation, such as when a new disk drive is being installed.

          This section describes building a new filesystem and using it in an Oracle database. Unless otherwise noted, all commands must be run as root.

          Create the Filesystem

          Use ext3 to create this new filesystem. Other filesystems work just as well, but ext3 offers the fastest recovery time in the event of a system crash.

          Ex:
          # mke2fs -j /dev/sdb1
          mke2fs 1.26 (3-Feb-2002)
          Filesystem label=
          OS type: Linux
          Block size=4096 (log=2)
          Fragment size=4096 (log=2)
          4447744 inodes, 8889961 blocks
          444498 blocks (5.00%) reserved for the super user
          First data block=0
          272 block groups
          32768 blocks per group, 32768 fragments per group
          16352 inodes per group
          Superblock backups stored on blocks:
          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
          2654208, 4096000, 7962624

          Writing inode tables: done
          Creating journal (8192 blocks): done
          Writing superblocks and filesystem accounting information: done

          This filesystem will be automatically checked every 23 mounts or
          180 days, whichever comes first. Use tune2fs -c or -i to override.

          Create the Mount Point

          A filesystem must have a mount point, which is simply an empty directory where the new filesystem "attaches" to the system's directory tree. Mount points should be given names consistent with the Oracle Flexible Architecture (OFA) standard. For more information on OFA standards, see Appendix C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.

          Because you have already created the /u01 directory in Part I, use /u02 for this example.

          Ex:
          # mkdir /u02

          Add the New Filesystem to /etc/fstab

          So that the new filesystem will be mounted automatically when the system boots, you need to add a line to the /etc/fstab file that describes the new filesystem and where to mount it. Add a line similar to the one below to /etc/fstab, using a text editor.

          /dev/sdb1 /u02 ext3 defaults 1 1

          Mount the New Filesystem

          Mounting the filesystem makes it available for use. Until the filesystem is mounted, files cannot be stored in it. Use the following commands to mount the filesystem and verify that it is available.

          mount /u02
          df -h /u02

          Ex:
          # mount /u02
          # df -h /u02
          Filesystem Size Used Avail Use% Mounted on
          /dev/sdb1 33G 33M 31G 1% /u02

          Create Oracle Directories and Set Permissions

          Now you create a directory to store your Oracle files. The directory name used in the example follows the OFA standard naming convention for a database with ORACLE_SID=demo1.

          mkdir -p /u02/oradata/demo1
          chown -R oracle:oinstall /u02/oradata
          chmod -R 775 /u02/oradata

          Create a New Tablespace in the New Filesystem

          The new filesystem is ready for use. Next you create a new tablespace in the filesystem to store your database objects. Connect to the database as the SYSTEM user, and execute the CREATE TABLESPACE statement, specifying the data file in the new filesystem.

          Ex:
          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:50:50 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: system
          Enter password:

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

          SQL> create tablespace data1
          2 datafile '/u02/oradata/demo1/data1_01.dbf' size 100m
          3 extent management local
          4 segment space management auto;

          Tablespace created.


          Now you can use the new tablespace to store database objects such as tables and indexes.

          Ex:
          SQL> create table demotab (id number(5) not null primary key,
          2 name varchar2(50) not null,
          3 amount number(9,2))
          4 tablespace data1;

          Table created.

          Automatic Storage Management (ASM)

          ASM was a new storage option introduced with Oracle Database 10gR1 that provides the services of a filesystem, logical volume manager, and software RAID in a platform-independent manner. ASM can stripe and mirror your disks, allow disks to be added or removed while the database is under load, and automatically balance I/O to remove "hot spots." It also supports direct and asynchronous I/O and implements the Oracle Data Manager API (simplified I/O system call interface) introduced in Oracle9i.

          ASM is not a general-purpose filesystem and can be used only for Oracle data files, redo logs, and control files. Files in ASM can be created and named automatically by the database (by use of the Oracle Managed Files feature) or manually by the DBA. Because the files stored in ASM are not accessible to the operating system, the only way to perform backup and recovery operations on databases that use ASM files is through Recovery Manager (RMAN).

          ASM is implemented as a separate Oracle instance that must be up if other databases are to be able to access it. Memory requirements for ASM are light: only 64 MB for most systems.

          Installing ASM

          On Linux platforms, ASM can use raw devices or devices managed via the ASMLib interface. Oracle recommends ASMLib over raw devices for ease-of-use and performance reasons. ASMLib 2.0 is available for free download from OTN. This section walks through the process of configuring a simple ASM instance by using ASMLib 2.0 and building a database that uses ASM for disk storage.

          Determine Which Version of ASMLib You Need

          ASMLib 2.0 is delivered as a set of three Linux packages:

          • oracleasmlib-2.0 - the ASM libraries
          • oracleasm-support-2.0 - utilities needed to administer ASMLib
          • oracleasm - a kernel module for the ASM library
          Each Linux distribution has its own set of ASMLib 2.0 packages, and within each distribution, each kernel version has a corresponding oracleasm package. The following paragraphs describe how to determine which set of packages you need.

          First, determine which kernel you are using by logging in as root and running the following command:

          uname -rm

          Ex:
          # uname -rm
          2.6.9-22.ELsmp i686

          The example shows that this is a 2.6.9-22 kernel for an SMP (multiprocessor) box using Intel i686 CPUs.

          Use this information to find the correct ASMLib packages on OTN:

          1. Point your Web browser to http://www.oracle.com/technology/tech/linux/asmlib/index.html
          2. Select the link for your version of Linux.
          3. Download the oracleasmlib and oracleasm-support packages for your version of Linux
          4. Download the oracleasm package corresponding to your kernel. In the example above, the oracleasm-2.6.9-22.ELsmp-2.0.0-1.i686.rpm package was used.

            Next, install the packages by executing the following command as root:

            rpm -Uvh oracleasm-kernel_version-asmlib_version.cpu_type.rpm \
            oracleasmlib-asmlib_version.cpu_type.rpm \
            oracleasm-support-asmlib_version.cpu_type.rpm

            Ex:
            # rpm -Uvh \
            > oracleasm-2.6.9-22.ELsmp-2.0.0-1.i686.rpm \
            > oracleasmlib-2.0.1-1.i386.rpm \
            > oracleasm-support-2.0.1-1.i386.rpm
            Preparing... ########################################### [100%]
            1:oracleasm-support ########################################### [ 33%]
            2:oracleasm-2.6.9-22.ELsm########################################### [ 67%]
            3:oracleasmlib ########################################### [100%]

          Configuring ASMLib

          Before using ASMLib, you must run a configuration script to prepare the driver. Run the following command as root, and answer the prompts as shown in the example below.

          # /etc/init.d/oracleasm configure
          Configuring the Oracle ASM library driver.

          This will configure the on-boot properties of the Oracle ASM library
          driver. The following questions will determine whether the driver is
          loaded on boot and what permissions it will have. The current values
          will be shown in brackets ('[]'). Hitting <ENTER> without typing an
          answer will keep that current value. Ctrl-C will abort.

          Default user to own the driver interface []: oracle
          Default group to own the driver interface []: dba
          Start Oracle ASM library driver on boot (y/n) [n]: y
          Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
          Writing Oracle ASM library driver configuration: [ OK ]
          Creating /dev/oracleasm mount point: [ OK ]
          Loading module "oracleasm": [ OK ]
          Mounting ASMlib driver filesystem: [ OK ]
          Scanning system for ASM disks: [ OK ]

          Next you tell the ASM driver which disks you want it to use. Oracle recommends that each disk contain a single partition for the entire disk.  See Partitioning the Disks at the beginning of this section for an example of creating disk partitions.

          You mark disks for use by ASMLib by running the following command as root:

          /etc/init.d/oracleasm createdisk DISK_NAME device_name

          Tip: Enter the DISK_NAME in UPPERCASE letters.

          Ex:
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
          Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
          Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
          Marking disk "/dev/sdd1" as an ASM disk: [ OK ]

          Verify that ASMLib has marked the disks:

          # /etc/init.d/oracleasm listdisks
          VOL1
          VOL2
          VOL3

          Create the ASM Instance

          ASM runs as a separate Oracle instance which can be created and configured using the Oracle Universal Installer.  Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance.

          Log in as oracle and start runInstaller:

          $ ./runInstaller
          1. Select Installation Method
            • Select Advanced Installation
            • Click on Next
          2. Specify Inventory Directory and Credentials
            • Inventory Directory: /u01/app/oracle/oraInventory
            • Operating System group name:  oinstall
            • Click on Next
          3. Select Installation Type
            • Select Enterprise Edition
            • Click on Next
          4. Specify Home Details
            • Name:   OraDB10gASM
            • Path:      /u01/app/oracle/product/10.2.0/asm
              Note:Oracle recommends using a different ORACLE_HOME for ASM than the ORACLE_HOME used for the database for ease of administration.
            • Click on Next
          5. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          6. Select Configuration Option
            • Select Configure Automatic Storage Management (ASM)
            • Enter the ASM SYS password and confirm
            • Click on Next
          7. Configure Automatic Storage Management
            • Disk Group Name:  DATA
            • Redundancy
              - High mirrors data twice.
              - Normal mirrors data once.  This is the default.
              - External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy.
            • Add Disks
              The disks you configured for use with ASMLib are listed as Candidate Disks.  Select each disk you wish to include in the disk group.
            • Click on Next
          8. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          9. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          10. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          11. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          12. Congratulations! Your new Oracle ASM Instance is up and ready for use.


          Create the Database

          Once the ASM instance has been created, create a database that uses ASM for storage:

          Log in as oracle and start runInstaller:

          $ ./runInstaller
          1. Select Installation Method
            • Select Advanced Installation
            • Click on Next
          2. Select Installation Type
            • Select Enterprise Edition
            • Click on Next
          3. Specify Home Details
            • Name:   OraDb10g_home1
            • Path:      /u01/app/oracle/product/10.2.0/db_1
              Note:Oracle recommends using a different ORACLE_HOME for the database than the ORACLE_HOME used for ASM.
            • Click on Next
          4. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          5. Select Configuration Option
            • Select Create a Database
            • Click on Next
          6. Select Database Configuration
            • Select General Purpose
            • Click on Next
          7. Specify Database Configuration Options
            • Database Naming:  Enter the Global Database Name and SID
            • Database Character Set:  Accept the default
            • Database Examples:  Select Create database with sample schemas
            • Click on Next
          8. Select Database Management Option
            • Select Use Database Control for Database Management
            • Click on Next
          9. Specify Database Storage Option
            • Select Automatic Storage Management (ASM)
            • Click on Next
          10. Specify Backup and Recovery Options
            • Select Do not enable Automated backups
            • Click on Next
          11. Select ASM Disk Group
            • Select the DATA disk group created in the previous section
            • Click on Next
          12. Specify Database Schema Passwords
            • Select Use the same password for all the accounts
            • Enter the password and confirm
            • Click on Next
          13. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          14. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          15. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          16. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          17. Congratulations! Your new Oracle Database is up and ready for use.

          Conclusion

          Now that your database is up and running, you can begin exploring the many new features offered in Oracle Database 10g Release 2. A great place to start is Oracle Enterprise Manager, which has been completely re-written with a crisp new Web-based interface. If you're unsure where to begin, the Oracle Database Concepts 10g Release 2 and the 2-Day DBA Guide will help familiarize you with your new database. OTN also has a number of guides designed to help you get the most out of Oracle Database 10g Release 2. 


          Appendix

          Accessing the Database with SQL*Plus

          Log into Linux as oracle. Set the environment.

          Set the Oracle environment variables:

          $ . oraenv
          ORACLE_SID = [oracle] ? demo1

          Run SQL*Plus:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:40:29 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

          SQL>

          Using Oracle Enterprise Manager 10g Database Control

          In a Web browser, connect to the URL provided during the installation.

          Ex:
          http://ds1.orademo.org:1158/em (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

          User Name: SYS
          Password: <The password you chose during installation>
          Connect As: SYSDBA

          Click on <Login>


          Welcome to the world of Oracle Enterprise Manager 10g Database Control!

          Starting and Stopping Oracle Enterprise Manager Database Control:

          $ emctl start dbconsole
          $ emctl stop dbconsole

          Accessing the Database Using iSQL*Plus

          iSQL*Plus is a Web-based version of the venerable SQL*Plus interactive tool for accessing databases. To use iSQL*Plus, click on the iSQL*Plus link in the Related Links section of the OEM console or point your browser to the iSQL*Plus URL provided during installation.

          Ex:
          http://ds1.orademo.org:5560/isqlplus (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

          User Name: SYSTEM
          Password: <The password you chose during installation>

          Click on <Login>.

          Enter SQL commands in the Workspace box, and click on Execute.


          Starting and Stopping iSQL*Plus:

          $ isqlplusctl start
          $ isqlplusctl stop

          Starting and Stopping the Listener:

          The listener accepts connection requests from clients and creates connections to the database once the credentials have been authenticated. Before you can use OEM or iSQL*Plus, the listener must be up.

          $ lsnrctl start
          $ lsnrctl stop

          Starting and Stopping the Database:

          The easiest way to start and stop the database is from the OEM Console. To do that from the command line, use SQL*Plus while logged in as oracle, as follows:

          Startup:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:39:27 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba
          Connected to an idle instance.

          SQL> startup
          ORACLE instance started.

          Total System Global Area 285212672 bytes
          Fixed Size 1218968 bytes
          Variable Size 96470632 bytes
          Database Buffers 180355072 bytes
          Redo Buffers 7168000 bytes
          Database mounted.
          Database opened.

          SQL> exit

          Shutdown:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:40:29 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

          SQL> shutdown immediate
          Database closed.
          Database dismounted.
          ORACLE instance shut down.

          SQL> exit
          반응형
          Posted by [PineTree]