출처: [리눅스]Linux(Redhat) 기반 Oracle 11g Express 설치 (tistory.com)
Linux(Redhat) 기반 Oracle 11g Express 설치
리눅스에 오라클 설치하는 방법이 저 같은 초보에게는 생각보다 까다롭네요. 다른 블로그들이나 설치 가이드를 찾아보았지만 부족한 거 같아서, 저처럼 헤매시는 분 없도록 설치 방법을 정리해 보았습니다.
목차
설치 전체 Process
step1. 요구사항 확인 및 필수 설치 파일 사전 설치
- 요구사항을 확인한 뒤 yum 명령으로 관련 패키지들을 설치합니다.
step2. 오라클 다운로드
- wget명령어로 리눅스 OS에 Oracle 11g Express를 다운로드 받습니다.
step3. 그룹 권한 설정
- 오라클을 설치하려면 사용자 계정이 따로 필요합니다.
step4. 커널 및 자원 제한 설정 (선택)
- 커널 파라미터 값을 오라클에서 권장한 값으로 바꾸어 줍니다.
step5. 오라클 환경변수 설정
- 오라클을 설치하기 전에, 오라클 이용을 위하여 사용자 환경 변수를 설정해줍니다..
step6. 오라클 설치
- 사전 Setting이 끝났으므로, rpm을 이용해 Oracle을 설치해 줍니다.
step7. 오라클 세부 환경 설정
- listener.ora와 tnsnames.ora를 수정하여 오라클의 세부 환경을 설정합니다.
step8. 오라클 서비스 실행
- Oracle listener를 실행하여 서비스가 정상 동작하는지 확인해 봅니다.
step9. 테스트
- sql plus로 관리자 계정으로 접속하여 쿼리를 실행시켜 봅니다.
1. 요구사항 확인 및 필수 설치 파일 사전 설치
오라클을 설치하기 이전에, 아래의 요구 사항들을 확인하고 관련 패키지들을 설치해 주어야 합니다.
(아래 참고1. 패키지 요구사항 볼것)
1. root권한으로 로그인 2. 최소사양 확인 Minimum: 1 GB of RAM Recommended: 2 GB of RAM or more 1GB of disk space( /tmp directory 위해) |
ㅁ 메모리의 용량 확인
$grep MemTotal /proc/meminfo
ㅁ Swap 용량 확인
$grep SwapTotal /proc/meminfo
ㅁ 메모리와 Swap의 사용 가능한 공간 확인
$free
ㅁ 특정 디렉토리의 사용 가능한 공간 확인 (예: TMP)
$df -k /tmp
ㅁ 디스크 여유 공간 확인
$df -k
(1) 사전 필수 설치 패키지 리스트를 확인합니다.
(2) 위의 패키지들을 yum을 이용하여 전부 설치합니다.
2. 오라클 다운로드
먼저 http://www.oracle.com/kr/index.html 에 접속하셔서 회원 가입을 하신 후 따라하세요. 여기서 회원 가입 방법은 따로 언급하지 않겠습니다.
따라하기
(1) 웹 브라우저에서 http://www.oracle.com/kr/index.html 에 접속하여 로그인합니다.
(2) http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html 로 이동합니다.
(3) Accept License Agreement 에 체크하고, Oracle Database Express Edition 11g Release 2 for Linux x64 링크를 클릭하여 다운로드를 진행합니다.
(4) 다운로드를 진행하면 웹 브라우저 하단에 진행 목록이 보이는데, ‘전체 보기’ 를 클릭하여 다운로드 창으로 이동합니다.
(5) 현재 다운로드 중인 oracle….rpm.zip 파일의 링크 주소를 복사합니다.
(이 과정이 필요한 이유는, 리눅스에서 wget을 이용해 zip 파일을 다운받기 위하여 링크에 있는 AuthParam 값이 필요하기 때문입니다. 만료시간이 있기 때문에, 링크 주소를 복사한 이후에는 빠르게 (6)의 과정을 진행해야 합니다.)
(6) 리눅스로 돌아와서 다운로드할 디렉터리로 이동 후, $ wget [파일명] [링크주소] 명령어를 통해 다운로드를 진행합니다.
3. 그룹 권한 설정
root 계정으로 oracle 계정과 그룹을 생성해줍니다.
따라하기
$ groupadd oinstall
$ groupadd dba
$ useradd –g oinstall –G dba oracle
$ passwd oracle
4. 커널 및 자원 제한 설정
커널 파라미터 값을 오라클에서 권장한 값으로 바꾸어 줍니다.
(1) 터미널에서 $ vi /etc/sysctl.conf 를 입력한 후, 파일 제일 아래 쪽에 다음을 입력합니다.
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
(2) :wq를 입력하여 저장 후 vi 에디터에서 빠져 나와 터미널로 복귀합니다.
(3) 자원 제한 설정을 위하여, 터미널에서 $ vi /etc/security/limits.conf 를 입력한 후, 파일 제일 아래 쪽에 다음을 입력합니다.
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
(4) 적용을 위해서 reboot 명령어를 통해 리눅스를 재부팅 합니다.
(5) 제대로 설정되었는지 $ /sbin/sysctl –p 로 확인해 봅니다.
5. 오라클 환경 변수 설정
오라클을 이용하기 위해서 사용자 환경 변수를 수정합니다.
따라하기
(1) oracle 디렉토리로 이동합니다. $ cd /home/oracle
(2) $ vi .bash_profile 명령어를 입력하여 맨 밑에 아래의 내용을 추가합니다.
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=XE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe ORACLE_HOME_LISTNER=$ORACLE_HOME/bin/lsnrctl
PATH=$ORACLE_HOME/bin:$PATH
export PATH
export ORACLE_BASE
export ORACLE_SID
export ORACLE_HOME
export ORACLE_LISTNER
export TMP=/tmp
export TMPDIR=$TMP
(3) bash_profile의 적용을 위해 터미널에서 # source .bash_profile 을 입력합니다.
6.오라클 설치
사전 준비가 끝났습니다. 오라클을 설치합니다.
따라하기
(1) 1 과정에서 oracle zip 파일을 다운받은 디렉토리로 이동합니다.
(2) unzip [다운로드 받은 zip 파일명] 명령어를 입력하여 압축을 해제합니다.
(3) 다른 조건을 주지 않은 경우, Disk1이라는 디렉토리가 생성되어 이 디렉토리 안에 압축이 해제됩니다. $ cd Disk1 명령어를 입력하여 Disk1 디렉토리로 이동합니다.
(4) Disk1에 있는 rpm 설치 파일의 설치를 진행합니다.
$ rpm –Uvh oracle11g_express.rpm
설치 절차가 완료되면, /u01/app/oracle 디렉토리에 설치됩니다.
<에러 발생시 조치 방안>
*에러 case 1: error : open of …………rpm failed : No such file or directory 오류
-> 원인 : 해당 파일이 완전히 구성되지 않아서 발생한 문제일 확률이 높습니다.
-> 해결 방안 : 2. 오라클 다운로드 과정을 다시 진행해 봅니다.
*에러 case 2: This system does noet meet the minimum requirments for swap space…
-> 원인 : swap 공간 부족으로 인한 문제입니다. oracle xe 11g에서 필요로 하는 swap 공간은 2048MB, 2GB 입니다.
-> 해결 방안 : 2048MB의 swap 공간을 정의해 줍니다.
- $ mkdir /swap
- $ dd if=/dev/zero of=/swap/swapfile bs=1024 count=2097152 (bscount = swapsize )
- $$ cd /swap (반드시 해주어야 함)
- $$ mkswap swapfile
- $$ swapon swapfile
- 이후 다시 경로 이동하여 rpm 설치
7. 오라클 세부 환경 설정
오라클 설치가 끝났으니, 오라클 세부 환경 설정을 진행합니다.
따라하기
(1) $ cd /u01/app/oracle/product/11.2.0/xe/network/admin
(2) $ vi listener.ora
(3) 아래와 같이 내용을 수정합니다.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc) )
(SID_DESC =
(GLOBAL_DBNAME = XE)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(SID_NAME = XE)
(SERVICE_NAME = XE)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
(4) $ vi tnsnames.ora
(5) 아래와 같이 내용을 수정합니다.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
8. 오라클 서비스 실행
오라클 리스너는 네트워크를 이용하여 클라이언트에서 오라클 서버로 연결하기 위한 오라클 네트워크 관리자입니다. 네트워크를 통한 연결은 모두 리스너가 담당합니다. 리스너를 실행시켜 보겠습니다.
따라하기
(1) $ lsnrctl 입력
(2) $ start 입력
(3) $ status 입력 후, 아래 이미지와 같이 Service가 동작하고 있으면, 모든 설치 및 설정이 완료된 것입니다.
9. 테스트
3. 그룹 계정 설정에서 ‘oracle’ 이라는 계정을 만들었습니다. 오라클에 접속하기 위해서는 이 계정이 필요합니다. 만약 다른 계정 이름을 생성했다면, 그 계정을 이용해 오라클에 접속해야 합니다.
따라하기
(1) $ su oracle 입력하여 oracle 계정으로 전환
(2) $ sqlplus / as sysdba 입력하여 최상의 User로 sql plus 접속
(3) 정삭적으로 쿼리 작성 가능한 상태인지 확인
출처: https://pliss.tistory.com/105 [리오집사의 기억저장소:티스토리]
참고1: 패키지 요구사항
Oracle® DatabaseQuick Installation Guide11g Release 2 (11.2) for Linux x86-64 E24326-09 September 2017 This guide describes how to quickly install Oracle Database 11g Release 2 (11.2) on Linux x86-64 systems. It includes information about the following:
1 Reviewing Information About This GuideThis guide describes how to install Oracle Database by using the default installation options.Tasks Described in This Guide The procedures in this guide describe how to:
After you successfully install Oracle Database:
This guide covers the Typical Installation scenario and does not describe how to complete the following tasks:
For more information about installing Oracle Database, including information about the tasks not described in this guide, refer to one of the following guides:
2 Logging In to the System as rootBefore you install the Oracle software, you must complete several tasks as the root user. To log in as the root user, complete one of the following procedures:Note:
You must install the software from an X Window System workstation, an X terminal, or a PC or other system with X server software installed
3 Checking the Hardware RequirementsThe system must meet the following minimum hardware requirements:3.1 Memory RequirementsThe following are the memory requirements for installing Oracle Database 11g Release 2 (11.2):
If necessary, refer to the operating system documentation for information about how to configure additional swap space. To determine the available RAM and swap space, enter the following command: Note:
Automatic Memory Management
Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm)and file descriptors. The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on that computer. To determine the amount of shared memory available, enter the following command: Note:
MEMORY_MAX_TARGET and MEMORY_TARGET cannot be used when LOCK_SGA is enabled or with HugePages on Linux. 3.2 System ArchitectureTo determine whether the system architecture can run the software, enter the following command:Note:
This command displays the processor type. Verify that the processor architecture matches the Oracle software release to install. If you do not see the expected output, then you cannot install the software on this system. 3.3 Disk Space RequirementsThe following are the disk space requirements for installing Oracle Database 11g Release 2 (11.2):
4 Checking the Software RequirementsDepending on the products that you intend to install, verify that the following software is installed on the system.
Note:
Oracle Universal Installer performs checks on the system to verify that it meets the listed requirements. To ensure that these checks pass, verify the requirements before you start Oracle Universal Installer. Note:
The platform-specific hardware and software requirements included in this guide were current when this guide was published. However, because new platforms and operating system software versions might be certified after this guide is published, review the certification matrix on the My Oracle Support website for the most up-to-date list of certified hardware platforms and operating system versions:https://support.oracle.com/ 4.1 Operating System RequirementsThe following or later versions of the operating system are required for Oracle Database 11g Release 2 (11.2):Note:
To determine the distribution and version of Linux installed, enter the following command: # cat /proc/version 4.2 Kernel RequirementsThe following are the kernel requirements for Oracle Database 11g Release 2 (11.2):
See Also:
To determine whether the required kernel is installed, enter the following command:"About Oracle Unbreakable Enterprise Kernel for Linux" section in Oracle Database Installation Guide for Linux The following is a sample output displayed by running this command on an Oracle Linux 5.0 system: In this example, the output shows the kernel version (2.6.18) and errata level (-128.el5PAE) on the system. If the kernel version does not meet the requirement specified earlier in this section, then contact the operating system vendor for information about obtaining and installing kernel updates. 4.3 Package RequirementsThe following are the list of packages required for Oracle Database 11g Release 2 (11.2):Note:
Note:
Starting with Oracle Database 11g Release 2 (11.2.0.2), all the 32-bit packages, except for gcc-32bit-4.3, listed in the following table are no longer required for installing a database on Linux x86-64. Only the 64-bit packages are required.However, for any Oracle Database 11g release before 11.2.0.2, both the 32-bit and 64-bit packages listed in the following table are required.
If a package is not installed, then install it from the Linux distribution media or download the required package version from the Linux vendor's website. 4.4 Compiler RequirementsIntel C++ Compiler 10.1 or later and the version of GNU C and C++ compilers listed under "Package Requirements" are supported with these products.Note:
Intel Compiler v10.1 can be used only with the standard template libraries of the gcc versions mentioned in the Package Requirements section, to build Oracle C++ Call Interface (OCCI) applications.Oracle XML Developer's Kit is supported with the same compilers as OCCI. 4.5 Additional Software RequirementsDepending on the components you want to use, you must ensure that the following software are installed:
4.5.1 Oracle ODBC DriversYou should install ODBC Driver Manager for UNIX. You can download and install the Driver Manager from the following URL:http://www.unixodbc.org To use ODBC, you must also install the following additional ODBC RPMs, depending on your operating sytem:
4.5.2 Oracle JDBC/OCI DriversUse JDK 6 (Java SE Development Kit 1.6.0_21) or JDK 5 (1.5.0_24) with the JNDI extension with the Oracle Java Database Connectivity and Oracle Call Interface drivers. However, these are not mandatory for the database installation. Note that IBM JDK 1.5 is installed with this release.4.5.3 Linux-PAM LibraryInstall the latest Linux-PAM (Pluggable Authentication Modules for Linux) library to enable the system administrator to choose how applications authenticate users.4.5.4 Oracle Messaging GatewayOracle Messaging Gateway supports the integration of Oracle Streams Advanced Queuing (AQ) with the following software:
http://www.ibm.com/ 4.5.5 Programming LanguagesThe following products are certified for use with:
4.5.6 Browser RequirementsYou do not require a web browser to install Oracle Database. However, browsers are required to access documentation, and if you intend to use Oracle Enterprise Manager Database Control and Oracle Application Express. Web browsers must support JavaScript, and the HTML 4.0 and CSS 1.0 standards.Oracle Enterprise Manager Database Control supports the following browsers:
5 Creating Required Operating System Groups and UsersThe following local operating system groups and users are required if you are installing Oracle Database:
6 Configuring Kernel Parameters and Resource LimitsVerify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown. The procedure following the table describes how to verify and set the values.Note:
The kernel parameter and shell limit values in this section are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. Refer to your operating system documentation for more information about tuning kernel parameters. Note:
To view the current value specified for these kernel parameters, and to change them if necessary:If the current value of any parameter is higher than the value listed in this table, then do not change the value of that parameter.
On Oracle Linux systems, Oracle recommends that you install Oracle Preinstallation RPMs to meet preinstallation requirements like configuring your operating system to set the resource limits in the limits.conf file. Oracle Preinstallation RPM only configures the limits.conf file for the oracle user. If you are implementing Oracle Grid Infrastructure job role separation, then copy the values from the oracle user to the grid user in the limits.conf file. For each installation software owner, check the resource limits for installation, using the following recommended ranges: Table 1 Installation Owner Resource Limit Recommended Ranges
To check resource limits:
Note:
If the grid or oracle users are logged in, then changes in the limits.conf file do not take effect until you log these users out and log them back in. You must do this before you use these accounts for installation. 7 Creating Required DirectoriesCreate directories with names similar to the following, and specify the correct owner, group, and permissions for them:
Note:
To create the Oracle base directory:If you do not want to create a separate Oracle data file directory, then you can install the data files in a subdirectory of the Oracle base directory. However, this is not recommended for production databases.
8 Configuring the oracle User's EnvironmentYou run Oracle Universal Installer from the oracle account. However, before you start Oracle Universal Installer, you must configure the environment of the oracle user. To configure the environment, you must:
9 Mounting the Product DiscOn most Linux systems, the disk mounts automatically when you insert it into the installation media. If the disk does not mount automatically, then follow these steps to mount it:
10 Installing Oracle DatabaseAfter configuring the oracle user's environment, start Oracle Universal Installer and install Oracle Database as follows:
11 Installing Oracle Database ExamplesIf you plan to use the following products or features, then download and install the products from the Oracle Database Examples media:
12 What to Do Next?To become familiar with this release of Oracle Database, it is recommended that you complete the following tasks:
13 Additional InformationThis section contains information about the following:
You are welcome to install and evaluate the products included in this media pack for 30 days under the terms of the Trial License Agreement. However, you must purchase a program license if you want to continue using any product after the 30 day evaluation period. See the following section for information about purchasing program licenses. Purchasing Licenses and Version Updates You can purchase program licenses and updated versions of Oracle products from the Oracle Store website: https://shop.oracle.com Contacting Oracle Support Services If you have purchased Oracle Product Support, you can call Oracle Support Services for assistance 24 hours a day, seven days a week. For information about purchasing Oracle Product Support or contacting Oracle Support Services, go to the Oracle Support Services website: http://www.oracle.com/us/support/index.html Locating Product Documentation Product documentation includes information about configuring, using, or administering Oracle products on any platform. The product documentation for Oracle Database products is available in both HTML and PDF formats online: http://docs.oracle.com/ 14 Documentation AccessibilityFor information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired. E24326-09 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle. |
'정보관리(데이터베이스, DB) > 오라클' 카테고리의 다른 글
Toad(토드)에서 .dmp파일로 테이블 이관 (import, export) 작업 방법 (0) | 2023.11.27 |
---|---|
Oracle Instant Client ODBC 설치 (0) | 2023.11.26 |
[Oracle] 오라클 12c 설치 완벽 가.이.드. (feat HR/SCOTT 계정 생성까지) (1) | 2023.11.25 |
[CentOS7] Oracle 11g 설치 (1) | 2023.11.24 |
Oracle 설치 18c (1) | 2023.11.24 |