centos 6.5 에 Oacle 11gR 2 와 Oracle 이 자동 으로 시작 하 는 설정 을 설치 합 니 다.

메모: 다음 명령 은 루트 사용자 작업 을 사용 합 니 다.
설치 의존 패키지
주요 사고방식 은 oracle yum 창 고 를 설정 하고 yum 명령 을 사용 하여 의존 패 키 지 를 설치 하 며 수 동 으로 하나하나 의존 패 키 지 를 설치 하 는 것 을 피 하 는 것 이다.
orcale 의존 패 키 지 를 다운로드 하기 위해 yum 창 고 를 설정 합 니 다.
메모: 여 기 는 CentOS 6. X 의 Oacle 의존 창고 입 니 다. 다른 버 전 은 다 릅 니 다.
GPG 키 가 져 오기

wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle --no-check-certificate

Oacle 의존 설치

yum install oracle-rdbms-server-11gR2-preinstall

hostname 설정
파일 / etc / sysconfig / network 를 열 고 HOSTNAME 를 수정 합 니 다.

vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oracle.buzheng.org

/ etc / host 를 열 고 서버 를 추가 합 니 다.

vi /etc/hosts
192.168.1.15 oracle.buzheng.org oracle

Oacle 사용자 설정
Oacle 의존 을 설치 한 후에 Oacle 사용 자 는 이미 만 들 었 습 니 다. Oacle 사용자 와 관련 된 사용자 그룹 을 수 동 으로 만 들 필요 가 없습니다.
Oacle 사용자 비밀번호 수정

[root@oracle ~]# passwd oracle
     oracle     。
     :
         :
passwd:                。

시스템 제한 수정
파일 / etc / security / limits. d / 90 - proc. conf 에 다음 과 같은 마지막 줄 을 추가 합 니 다.

[root@oracle ~]# vi /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
*   soft nproc  1024
root  soft nproc  unlimited
*   -  nproc  16384

SELinux 를 permissive 모드 로 변경 합 니 다.
파일 수정 / etc / selinux / config 는 다음 과 같 습 니 다.

[root@oracle ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#  enforcing - SELinux security policy is enforced.
#  permissive - SELinux prints warnings instead of enforcing.
#  disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#  targeted - Targeted processes are protected,
#  mls - Multi Level Security protection.
SELINUXTYPE=targeted

기 계 를 재가 동 하 다

[root@oracle]# reboot

Oacle 설치 디 렉 터 리 를 만 들 고 권한 을 부여 합 니 다.

[root@oracle]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[root@oracle]# chown -R oracle:oinstall /u01
[root@oracle]# chmod -R 775 /u01

Oacle 사용자 가 X Server 에 접근 할 수 있 도록 권한 을 부여 합 니 다.

[root@oracle]# xhost + #        ,      shell

메모: 다음 명령 은 Oacle 사용자 작업 을 사용 합 니 다.
Oacle 설치 환경 변 수 를 설정 합 니 다.
Oacle 사용자 로 전환, 편집. bashprofile 파일 은 다음 과 같이 환경 설정 을 추가 합 니 다.

[root@oracle]# su oracle
[oracle@oracle]# vi .bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=oracle.buzheng.org; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH export PATH

Oacle 설치 파일 다운로드, 압축 해제 후 설치
oracle 다운로드
Oacle 다운로드 페이지 열기,http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 다음 두 파일 을 / home / oracle 로 다운로드 합 니 다.

linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip

압축 파일 을 풀 고 실행 하기

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
cd database
./runInstaller

만약 에 중국어 시스템 이 라면 설치 인터페이스 에 중국어 오류 가 발생 할 수 있 습 니 다. 먼저 환경 을 영어 로 바 꾸 고 설치 해 야 합 니 다.

export LANG=en_US
./runInstaller

캡 처 하지 않 았 습 니 다. 설치 절 차 는 대체적으로 다음 과 같은 몇 단 계 를 포함 합 니 다.
  • Create and configure a database
  • Server Class
  • Single instance database installation
  • Advanced install
  • Language: English
  • Enterprise Edition
  • database type: General Purpose / Transaction Processing
  • Memory: Enable Automatic Memory Management
  • Character sets: Use Unicode(AL32UTF8)

  • 그래 픽 인 터 페 이 스 를 설치 하면 다음 두 개의 스 크 립 트 를 ROOT 로 실행 할 수 있 음 을 알려 줍 니 다.
    
    [root@oracle ~]# /u01/app/oraInventory/orainstRoot.sh 
    Changing permissions of /u01/app/oraInventory.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    Changing groupname of /u01/app/oraInventory to oinstall.
    The execution of the script is complete.
    
    [root@oracle ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh 
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
     ORACLE_OWNER= oracle
     ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
    Enter the full pathname of the local bin directory: [/usr/local/bin]: 
     Copying dbhome to /usr/local/bin ...
     Copying oraenv to /usr/local/bin ...
     Copying coraenv to /usr/local/bin ...
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.

    발생 한 문제
    1, 환경 변수 중의 ORACLESID 가 설치 할 때 실제 설정 과 일치 하지 않 을 때 startup 에 오류 가 발생 할 수 있 습 니 다. 오류 정 보 는 다음 과 같 습 니 다.
    
    ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initDB11G.ora'

    2. 원 격 클 라 이언 트 연결 이 잘못 되 었 다 면: ora - 12514 tns 감청 프로그램 이 현재 연결 설명자 에서 요청 한 서 비 스 를 식별 할 수 없 으 면 listener. ora 를 설정 하고 다음 노드 를 추가 해 야 합 니 다.
    
    SID_LIST_LISTENER = 
     (SID_LIST= 
     (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
     )
     )

    자, 이 설치 가 완료 되 었 습 니 다. 웹 관리 인터페이스 에 방문 하면 검증 할 수 있 습 니 다.다음 절차 도 중요 하 니 계속 하 세 요.
    메모: 다음 명령 은 루트 사용자 작업 을 사용 합 니 다.
    방화벽 규칙 을 설정 하고 수사 포트 를 개방 합 니 다.
    원 격 사용자 가 Oacle 서비스 에 순조롭게 접근 할 수 있 도록 1521 (설정 한 Oacle 탐지 포트) 포트 를 방화벽 규칙 에 추가 합 니 다.
    
    iptables -I INPUT 4 -m state --state NEW -p tcp --dport 1521 -j ACCEPT
    service iptables save
    service iptables reload

    Oacle 자동 시작 설정
    Oacle 설 치 를 마 친 후에 저 희 는 명령 을 통 해 데이터 베 이 스 를 정지 할 수 있 습 니 다. 그러나 기계 가 다시 시작 할 때 랜 덤 으로 작 동 하지 못 하 는 것 도 불편 을 가 져 왔 습 니 다. 다음은 Oacle 을 서비스 에 어떻게 가입 하고 랜 덤 으로 작 동 하 는 지 기록 하 였 습 니 다.
    프로필 수정 / etc / oratab
    / etc / oratab 의 마지막 줄 의 마지막 문 자 를 수정 하고 N 을 Y 로 변경 합 니 다.이것 은 주로 Oacle 의 dbstart 명령 이 시스템 이 시 작 될 때 실 행 될 수 있 도록 하기 위 한 것 입 니 다.다음 과 같다.
    
    [root@oracle ~]# vi /etc/oratab
    #
    # This file is used by ORACLE utilities. It is created by root.sh
    # and updated by the Database Configuration Assistant when creating
    # a database.
    # A colon, ':', is used as the field terminator. A new line terminates
    # the entry. Lines beginning with a pound sign, '#', are comments.
    #
    # Entries are of the form:
    #  $ORACLE_SID:$ORACLE_HOME::
    #
    # The first and second fields are the system identifier and home
    # directory of the database respectively. The third filed 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:/u01/app/oracle/product/11.2.0/dbhome_1:Y

    생 성 / etc / init. d / oracle
    / etc / init. d / 에서 파일 Oacle 을 만 듭 니 다. 이것 은 Oacle 자체 시작 스 크 립 트 입 니 다.내용 은 다음 과 같다.
    
    #!/bin/sh
    # chkconfig: 345 61 61
    # description: Oracle 11g R2 AutoRun Servimces
    # /etc/init.d/oracle
    #
    # Run-level Startup script for the Oracle Instance, Listener, and
    # Web Interface
    ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1"
    ORA_OWNR="oracle"
    # if the executables do not exist -- display error
    if [ ! -f "$ORACLE_HOME/bin/dbstart" ]
    then
    echo "Oracle startup: cannot start"
    exit 1
    fi
    # parameter: start, stop, restart
    case "$1" in
    start)
    # Oracle listener and instance startup
    su $ORA_OWNR -s /bin/bash $ORACLE_HOME/bin/dbstart $ORACLE_HOME
    echo "Oracle Start Succesful!OK."
    ;;
    stop)
    # Oracle listener and instance shutdown
    su $ORA_OWNR -s /bin/bash $ORACLE_HOME/bin/dbshut $ORACLE_HOME
    echo "Oracle Stop Succesful!OK."
    ;;
    restart)
    $0 stop
    $0 start
    ;;
    *)
    echo $"Usage: `basename $0` {start|stop|restart}"
    exit 1
    esac
    exit 0

    시작 스 크 립 트 실행 권한 부여 및 링크:
    
    # chmod 750 /etc/init.d/oracle
    # ln -s /etc/init.d/oracle /etc/rc1.d/K61oracle
    # ln -s /etc/init.d/oracle /etc/rc3.d/S61oracle

    시작 스 크 립 트 가 설정 되 어 있 으 면 service 명령 으로 Oacle 을 시작 할 수 있 습 니 다. 이 때 Oacle 은 이미 시스템 서비스 입 니 다.
    
    service oracle start
    service oracle stop
    service oracle restart

    Oacle 서 비 스 를 시작 으로 설정 합 니 다.
    
    # chkconfig --add oracle
    # chkconfig --level 345 oracle on

    총결산
    자, 기 계 를 다시 켜 보 세 요.이상 은 이 글 의 전체 내용 입 니 다. 본 논문 의 내용 이 여러분 의 학습 이나 업무 에 어느 정도 도움 이 되 기 를 바 랍 니 다. 궁금 한 점 이 있 으 면 댓 글 을 남 겨 주 십시오.

    좋은 웹페이지 즐겨찾기