>  기사  >  운영 및 유지보수  >  Linux에서 Oracle 11g 데이터베이스를 설치하는 방법은 무엇입니까?

Linux에서 Oracle 11g 데이터베이스를 설치하는 방법은 무엇입니까?

青灯夜游
青灯夜游앞으로
2020-08-22 11:53:035259검색

Linux에서 Oracle 11g 데이터베이스를 설치하는 방법은 무엇입니까? 다음 문서에서는 Linux에서 Oracle 11g 데이터베이스를 설치하고 구성하는 방법을 소개합니다. 도움이 필요한 친구들이 모두 참고할 수 있기를 바랍니다.

Linux에서 Oracle 11g 데이터베이스를 설치하는 방법은 무엇입니까?

Linux의 명령줄에서 oracle 11g 데이터베이스 설치

1. 준비:

이 설치를 위한 기본 환경: vmware에 설치된 centos6.10 (가상 머신 설치는 여기서 소개하지 않습니다)

가상 머신 요구 사항: 2G 이상의 메모리 권장

Linux 버전에서 해당 Oracle 설치 패키지를 다운로드해야 합니다.

다운로드 주소: http://www.oracle.com/technetwork/database/enterprise-edition/downloads /index.html

해당 oracle 버전:

gR 이 Linux 추천 강좌: "linux 강좌

"

2. 머신 기본 구성 수정 (

1

) 시스템 설정:

Oracle 만 지원 작업 시스템 Red Hat Enterprise Linux 6이므로 /etc/redhat-release의 내용을 Red Hat으로 변경해야 합니다. 으아아아 (2) 머신 정보 꺼짐, selinux, 불필요한 방화벽 서비스

[root@Oracle ~]# vi /etc/redhat-release  
#CentOS release 6.10 (Final)
Red Hat Enterprise Linux 6
(3) 사용자 제한 파일 수정
[root@Oracle ~]# cat /etc/selinux/config                         //selinux关闭(disabled)
# 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=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@Oracle ~]# /etc/init.d/iptables stop                        //防火墙关闭
[root@Oracle ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.152.130   Oracle                          //新增行:IP 机器名(这是我的ip和主机名)
(4) 커널 매개변수 수정
[root@Oracle ~]# cat /etc/security/limits.conf                //在该文件内添加以下内容
oracle           soft    nproc           2047
oracle           hard    nproc           16384
oracle           soft    nofile          1024
oracle           hard    nofile          65536
oracle           soft    stack           10240
(5) 종속 패키지 설치
[root@Oracle ~]# cat /etc/sysctl.conf		//在文件中添加以下内容
net.ipv4.ip_local_port_range= 9000 65500 
fs.file-max = 6815744 
kernel.shmall = 10523004 
kernel.shmmax = 6465333657 
kernel.shmmni = 4096 
kernel.sem = 250 32000 100128 
net.core.rmem_default=262144 
net.core.wmem_default=262144 
net.core.rmem_max=4194304 
net.core.wmem_max=1048576 
fs.aio-max-nr = 1048576
[root@Oracle ~]# sysctl –p				// 执行这条语句使配置生效
3. 사용자, 그룹, 설치 디렉터리 생성

(1) 사용자 및 그룹 생성

[root@Oracle ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp

(2) 새 설치 디렉터리 생성

[root@Oracle ~]# groupadd oinstall
[root@Oracle ~]# groupadd dba
[root@Oracle ~]# groupadd oper
[root@Oracle ~]# useradd -g oinstall -G dba,oper oracle
[root@Oracle ~]# echo "oracle" | passwd --stdin oracle
[root@Oracle ~]# id oracle		//查看用户所属组
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper)

(3) 환경 변수 설정 및 새로 고침

[root@Oracle ~]# mkdir -p /var/app
[root@Oracle ~]# mkdir -p /var/app/oracle
[root@Oracle ~]# mkdir -p /var/app/oracle/product
[root@Oracle ~]# mkdir -p /var/app/oracle/product/11.2.0
[root@Oracle ~]# mkdir -p /var/app/oracle/product/11.2.0/dbhome_1
[root@Oracle ~]# mkdir -p /home/oracle/backup
[root@Oracle ~]# mkdir -p /home/oracle/oraInventory
[root@Oracle ~]# chown -R oracle:oinstall /var/app
[root@Oracle ~]# chown -R oracle:oinstall /home/oracle/backup
[root@Oracle ~]# chown -R oracle:oinstall /home/oracle/oraInventory
[root@Oracle ~]# chmod -R 775 /var/app

4.

(1) Oracle 설치 파일을 복사하여

[root@Oracle ~]# cat /home/oracle/.bash_profile   //给该文件添加以下内容
umask 022
export ORACLE_BASE=/var/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ora11g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
[root@Oracle ~]# source /home/oracle/.bash_profile		//执行该句使配置生效

디렉터리를 지정합니다. (2) oracle 사용자로 전환하고 설치 패키지

[root@Oracle ~]# cp linux.x64_11gR2_database_*.zip /var/app/oracle/

의 압축을 풀고 압축을 푼 후 데이터베이스 디렉터리를 가져옵니다. 응답 디렉터리에 세 개의 rsp 파일이 있습니다. 자동 설치 중에 응답 파일의 템플릿으로 사용됩니다.

[root@Oracle ~]# su - oracle
[oracle@Oracle ~]$ cd /var/app/oracle/
[oracle@Oracle oracle]$ unzip linux.x64_11gR2_database_1of2.zip
[oracle@Oracle oracle]$ unzip linux.x64_11gR2_database_2of2.zip

(5) 구성 파일 수정 및 Oracle 데이터베이스 설치

[oracle@Oracle response]$ ls -l
total 76
-rw-rw-r-- 1 oracle oinstall 44960 Aug  8 17:10 dbca.rsp      //安装应答
-rw-rw-r-- 1 oracle oinstall 22752 Aug  8 14:23 db_install.rsp      //创建数据库应答
-rwxrwxr-x 1 oracle oinstall  5740 Feb 26  2009 netca.rsp //建立监听,本地服务名等网络设置

(6) 수정된 자동 설치 구성 파일 db_install.rsp의 내용은 다음과 같습니다.

[oracle@Oracle database]$ cp /var/app/oracle/database/response/ /home/oracle/           //备份

(7) 자동 설치 시작

[root@db response]# cat db_install.rsp | grep -v '^#' | grep -v '^$'
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=db
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/var/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/var/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/var/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ora11g
oracle.install.db.config.starterdb.SID=ora11g
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=1500
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=

(8) 설치 진행 상황 확인

[oracle@Oracle database]$ cd /var/app/oracle/database
[oracle@Oracle database]$ ./runInstaller -silent -responseFile  /var/app/oracle/database/response/db_install.rsp

(9) 다음 메시지가 나타날 경우

[oracle@Oracle database]$ cd /var/app/oracle/oraInventory/logs
[oracle@Oracle logs]$ tail -f installActions*log

새 클라이언트를 열고 루트로 다음 스크립트를 실행

var/app/oracle/oraInventory/orainstRoot.sh
var/app/oracle/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
	1. Open a terminal window
	2. Log in  as "root"
	3. Run the scripts
	4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.

(10) 위 스크립트를 실행한 후 다시 클라이언트로 복귀 설치 인터페이스를 선택하고 Enter를 눌러 계속하세요.

5. Oracle 청취 구성

(1) 청취 파일 실행

[root@Oracle ~]# var/app/oracle/oraInventory/orainstRoot.sh
[root@Oracle ~]# var/app/oracle/product/11.2.0/dbhome_1/root.sh

작업이 성공적으로 완료되면 /var/app/oracle/product/11.2.0/dbhome_1/network/에 sqlnet.ora 및 리스너가 생성됩니다. admin 디렉터리 .ora 두 파일

[oracle@Oracle ~]$ cd /var/app/oracle/database/response
[oracle@Oracle response]$ netca /silent /responsefile /var/app/oracle/database/response/netca.rsp

다음 명령을 실행하여 리스너가 포트 1521에서 작업을 시작했는지 확인하세요

[oracle@Oracle admin]$ ls
listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

리스닝이 시작되지 않으면 수동으로 리스너를 시작하세요

[root@Oracle ~]# netstat -tlnp | grep 1521
tcp        0      0 :::1521                     :::*                        LISTEN      1792/tnslsnr

(2) Oracle 데이터베이스 구성

[oracle@Oracle ~]$ lsnrctl start

(3 ) 데이터베이스 생성

[oracle@Oracle response]$ pwd
/var/app/oracle/database/response
[oracle@Oracle response]$ vi dbca.rsp
GDBNAME = "orcl11.us.oracle.com"     //78 行 全局数据库的名字=SID+主机域名
SID="ora11g"    //149行 SID
SYSPASSWORD = "oracle"    //190行
SYSTEMPASSWORD = "oracle"   //200行
CHARACTERSET="AL32UTF8" //415行 编码
NATIONALCHARACTERSET="UTF8" //425行 编码

6. 데이터베이스 시작

Oracle SQL 명령줄 입력

[oracle@Oracle ~]$ sqlplus / as sysdba
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/var/app/oracle/product/11.2.0/dbhome_1/dbs/initora11g.ora'

启动时会出现以上错误,解决方法如下:找到init.ora.78201817526文件,将其复制到/var/app/oracle/product/11.2.0/dbhome_1/dbs目录下

[oracle@Oracle admin]$ locate init.ora           //定位寻找目标文件
/var/app/admin/orcl11g/pfile/init.ora.78201817526               //目标文件
/var/app/oracle/product/11.2.0/dbhome_1/dbs/init.ora
/var/app/oracle/product/11.2.0/dbhome_1/srvm/admin/init.ora
[oracle@Oracle admin]$ cd /var/app/admin/orcl11g/pfile/
[oracle@Oracle pfile]$ ls
init.ora.78201817526
[oracle@Oracle pfile]$ cp init.ora.78201817526  /var/app/oracle/product/11.2.0/dbhome_1/dbs/
[oracle@Oracle dbs]$ mv init.ora.78201817526 initora11g.ora    //将目标文件改成所需文件名

进入到Oracle SQL命令行中,执行startup

[oracle@Oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 10 01:59:43 2018
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup                                         //启动数据库实例
ORACLE instance started.
Total System Global Area  839282688 bytes
Fixed Size                  2217992 bytes
Variable Size             494929912 bytes
Database Buffers          339738624 bytes
Redo Buffers                2396160 bytes
Database mounted.
Database opened.

**** 参考文章:

https://blog.csdn.net/JIANG123456T/article/details/77745892 

https://blog.csdn.net/zxx2403/article/details/46594597

相关推荐:《Linux运维

위 내용은 Linux에서 Oracle 11g 데이터베이스를 설치하는 방법은 무엇입니까?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 csdn.net에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제