linux安装oracle详细步骤

42 篇文章 0 订阅

友情提示–若没有安装过jdk则先安装jdk

1.安装JDK

在应用服务器,使用root账户安装JDK

①创建安装目录(root权限)

[root@orcl     /]# cd /usr/local
[root@orcl local]# mkdir java
[root@orcl local]# cd java

②将jdk安装包移到该目录(root权限)

[root@orcl etc]# mv /home/uflinux/software/jdk-8u191-linux-x64.tar.gz /user/local/java

③解压安装包(root权限)

[root@orcl java]# tart -zxvf jdk-8u191-linux-x64.tar.gz

④配置环境变量(root权限)

[root@orcl etc]#  vi /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_191
export PATH=$PATH:$JAVA_HOME/bin

# 使修改的配置文件生效

[root@orcl etc]# source /etc/profile  

⑤检查JDK是否安装正常(root权限)
----------------------正确打印Jdk版本,则安装成功--------------------------

[root@orcl etc]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
[root@orcl  etc]# 

2、修改内核参数、swap分区

1、配置swap

Oracle推荐安装database RAM>2GB,且swap大小与RAM大小满足如下要求:

RAMSwap Space
1GB<RAM<2GB1.5 * RAM
2GB<RAM<16GBRAM
>16GB16G
①检查swap分区
free -m    #首先查看当前的内存和swap 空间大小(默认单位为k, -m 单位为M)
②若没有分区信息,我们就需要手动添加交换分区。

1、增加swap交换文件

#在根目录创建swap文件夹 并在swap文件夹下,(本人内存=2G)增加一个大小为2G的交换文件

1.1、切换到根目录:

[root@orcl etc]# cd /
[root@orcl /]# mkdir swap 

换算公式:102410242G=2097152
1.2、 创建swap文件

dd if=/dev/zero of=/swap/swap bs=1024 count=2097152

1.3、将swap文件夹下的swap文件创建成swap格式的文件

mkswap /swap/swap

1.4、挂载swap分区

swapon /swap/swap

1.5、修改/etc/fstab将分区永久保存,并设置为开机启动

[root@orcl /]# vim /etc/fstab
/swap/swap swap swap default 0 0		#将左边的复制到/etc/fstab文件末尾
2、修改内核参数:
2.1、 selinux配置

编辑文件/etc/selinux/config禁用selinux(默认为enforcing模式)

[root@orcl /]# vim /etc/selinux/config		
SELINUX=disabled					#将selinux设置为禁止
2.2、修改内核参数

编辑 Linux内核配置文件

[root@orcl /]# vim /etc/sysctl.conf

基本上把下面的复制进去即可

fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

要使 /etc/sysctl.conf 更改立即生效,执行以下命令。 输入:sysctl -p 显示如下:
在这里插入图片描述

2.3、修改profile文件

注意:不配置可能没有$ORACLE_HOME

ORACLE_BASE=/orahome/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
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

oracle用户下的.bash_profile文件【添加如下内容】

export ORACLE_BASE=/orahome/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

NLS_LANG=AMERICAN_AMERICA.AL32UTF8

刷新配置

source /etc/profile
2.4、修改限制配置

2.4.1、 增加oracle用户资源限制参数

[root@orcl /]#  vim /etc/security/limits.conf

添加如下内容

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

注意:注销用户oracle用户,重新登陆后生效

2.4.2、 确认加载PAM模块,在/etc/pam.d/login中添加如下

[root@orcl /]#  vim /etc/pam.d/login

添加如下内容,注意64位机器是的lib64

session required pam_limits.so
session    required     /lib64/security/pam_limits.so  确保该文件存在,否则不添加

2.4.3、在/etc/pam.d/su中添加如下

[root@orcl /]#  vim /etc/pam.d/su

添加如下内容,注意64位机器是的lib64[下面的例子时64位的]

session         required        /lib64/security/pam_limits.so
2.5、网络安全配置

修改主机名

[root@orcl /]#  hostname      - 查看本地名称 
localhost.localdomain        - 一般默认的是localhost.localdomain

修改主机名称,使用root账户,输入如下命令

# vi /etc/sysconfig/network      其他Linx
添加或修改
例如: HOSTNAME=orcl
---------------------------------------------------
# vi /etc/hostname               redhat 7
修改为
例如: orcl
---------------------------------------------------

#vi /etc/hosts   #并添加内网IP地址对应的hostname
例如:192.168.0.4 orcl
2.6、防火墙配置

关闭防火墙(如果可能)

systemctl stop firewalld

或者将防火墙的1521端口开放

firewall-cmd --zone=public --add-port=1521/tcp --permanent

开启完成之后,需要运行reload命令才能生效

firewall-cmd --reload

4、oracle相关

0、创建数据库用户

在数据库服务器,创建数据库用户和组,Orcle的安装用户需要使用多个组:dba、oinstall

[root@orcl /]# groupadd oinstall
[root@orcl /]# groupadd dba
[root@orcl /]# useradd -g oinstall -G dba oracle   # 设置oracle用户主组为dba,副组为oinstall
[root@orcl /]# passwd oracle  # 设置oracle用户的密码
根据修改密码提示输入2次密码
1、创建Oracle安装路径

以root用户创建如下路径

[root@orcl /]# mkdir -p /orahome/app/oracle
[root@orcl /]# mkdir -p /orahome/app/oracle/oraInventory
[root@orcl /]# mkdir -p /orahome/app/oracle/oradata
[root@orcl /]# mkdir -p /orahome/data
[root@orcl /]# chown -R oracle:oinstall /orahome/
[root@orcl /]# chown -R oracle:oinstall /orahome/data
[root@orcl /]# chown -R oracle:oinstall /orahome/app
[root@orcl /]# chown -R oracle:oinstall /orahome/app/oracle
[root@orcl /]# chown -R oracle:oinstall /orahome/app/oracle/oraInventory
[root@orcl /]# chmod -R 775 /orahome/app/oracle
2、 安装所需rpm

root用户,通过yum安装所需的rpm包:

yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686elfutils-libelf elfutils-libelf-devel gcc gcc-c++  glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686  libgcc libgcc.i686 libstdc++ libstdc++.i686libstdc++-devel make sysstat unixODBC unixODBC-devel

注意:此处的依赖包可根据检测安装过程中缺少的包在安装。

-------------2.1、如果yum没有安装上compat-libstdc++compat-libstdc++.i686的话,
需要将附件中的compat-libstdc++-33-3.2.3-72.el7.i686.rpmcompat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
拷贝到/root目录,并在/root目录执行:

[root@orcl /]#  rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
[root@orcl /]#  rpm -ivh compat-libstdc++-33-3.2.3-72.el7.i686.rpm

若需要解决依赖关系,则解决就好!也可以采用yum方式安装上面的2个依赖

另外:需要注意,rpm包cvuqdisk需要从oracle安装包中单独安装

[root@orcl rpm]# rpm -ivh cvuqdisk-1.0.7-1.rpm
3、安装中
3.1 、解压安装软件

①以oracle用户解压安装软件:

[root@orcl /]# unzip linux.x64_11gR2_database_1of2.zip
[root@orcl /]# unzip linux.x64_11gR2_database_2of2.zip

②拷贝Response文件到用户目录,在此基础上修改

[root@orcl /]# cp -R /home/oracle/database/response /home/oracle

修改db_install.rsp文件
①修改db_install.rsp文件内容为:

####################################################################
## Copyright(c) Oracle Corporation 1998,2008. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.                                                        ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################

#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=orcl

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/orahome/app/oracle/oraInventory

#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en   : English                  ja   : Japanese
# fr   : French                   ko   : Korean
# ar   : Arabic                   es   : Latin American Spanish
# bn   : Bengali                  lv   : Latvian
# pt_BR: Brazilian Portuguese     lt   : Lithuanian
# bg   : Bulgarian                ms   : Malay
# fr_CA: Canadian French          es_MX: Mexican Spanish
# ca   : Catalan                  no   : Norwegian
# hr   : Croatian                 pl   : Polish
# cs   : Czech                    pt   : Portuguese
# da   : Danish                   ro   : Romanian
# nl   : Dutch                    ru   : Russian
# ar_EG: Egyptian                 zh_CN: Simplified Chinese
# en_GB: English (Great Britain)  sk   : Slovak
# et   : Estonian                 sl   : Slovenian
# fi   : Finnish                  es_ES: Spanish
# de   : German                   sv   : Swedish
# el   : Greek                    th   : Thai
# iw   : Hebrew                   zh_TW: Traditional Chinese
# hu   : Hungarian                tr   : Turkish
# is   : Icelandic                uk   : Ukrainian
# in   : Indonesian               vi   : Vietnamese
# it   : Italian
#
# Example : SELECTED_LANGUAGES=en,fr,ja
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en,zh_CN

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------------
ORACLE_HOME=/orahome/app/oracle/product/11.2.0/dbhome_1

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#------------------------------------------------------------------------------
ORACLE_BASE=/orahome/app/oracle

#------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# EE     : Enterprise Edition
# SE     : Standard Edition
# SEONE  : Standard Edition One
# PE     : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE

#------------------------------------------------------------------------------
# This variable is used to enable or disable custom install.
#
# true  : Components mentioned as part of 'customComponents' property
#         are considered for install.
# false : Value for 'customComponents' is not considered.
#------------------------------------------------------------------------------
oracle.install.db.isCustomInstall=false

#------------------------------------------------------------------------------
# This variable is considered only if 'IsCustomInstall' is set to true.
#
# Description: List of Enterprise Edition Options you would like to install.
#
#              The following choices are available. You may specify any
#              combination of these choices.  The components you choose should
#              be specified in the form "internal-component-name:version"
#              Below is a list of components you may specify to install.
#
#              oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning
#              oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining
#              oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault
#              oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security
#              oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing
#              oracle.oraolap:11.2.0.1.0 - Oracle OLAP
#------------------------------------------------------------------------------
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

###############################################################################
#                                                                             #
# PRIVILEGED OPERATING SYSTEM GROUPS                                          #
# ------------------------------------------                                  #
# Provide values for the OS groups to which OSDBA and OSOPER privileges       #
# needs to be granted. If the install is being performed as a member of the   #
# group "dba", then that will be used unless specified otherwise below.       #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=oinstall

#------------------------------------------------------------------------------
# Specify the cluster node names selected during the installation.
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=

#------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING
# - DATA_WAREHOUSE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=orcl

#------------------------------------------------------------------------------
# Specify the Starter Database SID.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=orcl

#------------------------------------------------------------------------------
# Specify the Starter Database character set.
#
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.characterSet=AL32UTF8

#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=true

#------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=

#------------------------------------------------------------------------------
# This variable controls whether to load Example Schemas onto the starter
# database or not.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.installExampleSchemas=false

#------------------------------------------------------------------------------
# This variable includes enabling audit settings, configuring password profiles
# and revoking some grants to public. These settings are provided by default.
# These settings may also be disabled.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableSecuritySettings=true

###############################################################################
#                                                                             #
# Passwords can be supplied for the following four schemas in the             #
# starter database:                                                           #
#   SYS                                                                       #
#   SYSTEM                                                                    #
#   SYSMAN (used by Enterprise Manager)                                       #
#   DBSNMP (used by Enterprise Manager)                                       #
#                                                                             #
# Same password can be used for all accounts (not recommended)                #
# or different passwords for each account can be provided (recommended)       #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=oracle

#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=

#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=

#-------------------------------------------------------------------------------
# Specify the SYSMAN password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSMAN=

#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=

#-------------------------------------------------------------------------------
# Specify the management option to be selected for the starter database.
# It can be one of the following:
# 1. GRID_CONTROL
# 2. DB_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.control=DB_CONTROL

#-------------------------------------------------------------------------------
# Specify the Management Service to use if Grid Control is selected to manage
# the database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

#-------------------------------------------------------------------------------
# This variable indicates whether to receive email notification for critical
# alerts when using DB control.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false

#-------------------------------------------------------------------------------
# Specify the email address to which the notifications are to be sent.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.emailAddress=

#-------------------------------------------------------------------------------
# Specify the SMTP server used for email notifications.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=


###############################################################################
#                                                                             #
# SPECIFY BACKUP AND RECOVERY OPTIONS                                         #
# ------------------------------------                                        #
# Out-of-box backup and recovery options for the database can be mentioned    #
# using the entries below.                                                    #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable is to be set to false if automated backup is not required. Else
# this can be set to true.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.enable=false

#------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if
# automated backups are enabled, a job will be scheduled to run daily at
# 2:00 AM to backup the database. This job will run as the operating system
# user that is specified in this variable.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.osuid=

#-------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if
# automated backups are enabled, a job will be scheduled to run daily at
# 2:00 AM to backup the database. This job will run as the operating system user
# specified by the above entry. The following entry stores the password for the
# above operating system user.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.ospwd=

#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/orahome/data

#-------------------------------------------------------------------------------
# Specify the backup and recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username.
#
#  Example   : MYORACLESUPPORT_USERNAME=metalink
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password.
#
# Example    : MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#------------------------------------------------------------------------------
# Specify whether user wants to give any proxy details for connection.
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example    : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example    : PROXY_HOST=proxy.domain.com
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and atleast 2 chars.
#
# Example    : PROXY_PORT=25
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_USER=username
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_PWD=password
#------------------------------------------------------------------------------
PROXY_PWD=

②可查看oracle文件夹的大小的变化

[root@orcl /]# watch -d -n 2 'du -sh /orahome/app/oracle'

oracle用户在/home/oracle/software/database文件夹,执行静默安装命令:

./runInstaller -silent -responseFile /home/oracle/software/response/db_install.rsp

④当出现以下界面时, 表示安装成功了,按照其提示操作。
在这里插入图片描述
⑤切换到root账户,执行如下命令:

[root@orcl /]# cd /
/orahome/app/oracle/oraInventory/orainstRoot.sh
/orahome/app/oracle/product/11.2.0/dbhome_1/root.sh
3.2 、配置Net监听

根据需要修改/home/oracle/response/netca.rsp的相关参数,也可以不修改,默认创建的监听名称为 LISTENER。静默安装 NET Listener:

[root@orcl /]$ cd $ORACLE_HOME
[root@orcl /]$ netca /silent /responseFile /home/oracle/software/response/netca.rsp

在这里插入图片描述
然后,输入命令:vim /orahome/app/oracle/cfgtoollogs/dbca/orcl/orcl.log

查看创建日志里面有没有异常信息,没有则说明数据库和实例创建成功了。

验证

lsnrctl status

在这里插入图片描述



遇到问题1、

在这里插入图片描述

遇到问题2、

在这里插入图片描述
解决方式:yum install -y libXext

遇到问题3:

在这里插入图片描述

监听配置成功:如下

[oracle@orcl dbhome_1]$ netca /silent /responseFile /home/oracle/software/response/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/software/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /orahome/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@orcl dbhome_1]$ 

在新创建的root窗口内执行以下提示的脚本:

3.3、创建dbca实例

拷贝dbca.rsp文件到/home/oracle下,并编辑为:

RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase" 
GDBNAME = "orcl"
SID = "orcl"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
DATAFILEDESTINATION = /u01/app/oradata
CHARACTERSET = "ZHS16GBK"#AL32UTF8

然后使用$ORACLE_HOME/bin里面的dbca执行命令:

[oracle@orcl /]$ cd $ORACLE_HOME/bin
[oracle@orcl /]$ dbca -silent -responseFile /home/oracle/software/response/dbca.rsp

在这里插入图片描述
表示数据库监听正在运行,数据库实例正在运行。

[oracle@orcl /]$ sqlplus / as sysdba       进入oracle的命令界面
[oracle@orcl /]$ startup					    启动数据库程序

创建库表等相关:
1、创建报送系统永久默认表空间:

create tablespace UFLINUX datafile '/orahome/data/uflinux.dbf' size 1g;

2、创建数据库用户:

create user UFLINUX identified by uflinux123 default tablespace UFLINUX ;

3、给数据库用户赋权限:

grant connect, resource,dba to UFLINUX ;

到此未出现其他问题,采用三方工具连接Oracle成功

彩蛋:https://www.cnblogs.com/renato/p/13710114.html 附录了12c的安装教程
相关参考:https://blog.csdn.net/qq_23659871/article/details/80680669

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值