华为欧拉系统安装oracle11g

划水佬
2025-10-04 / 0 评论 / 4 阅读 / 正在检测是否收录...

--确保服务器可以yum安装包
yum -y install unzip
--关闭防火墙
systemctl stop firewalld
systemctl disable firewalld

--关闭selinux
vi /etc/selinux/config
disable
setenforce 0

--查看swap是否存在(需要有swap)
free -m

--在/etc/hosts中添加主机名如下,前面为ip,后面为主机名称。
10.4.7.100 oracle

--安装依赖包
yum install -y gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel

--确认安装无误
rpm -qa gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel

--确认安装完包之后
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
1
1

--修改内核参数
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 16777216
kernel.shmmax = 68719476735
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
--修改完之后立即执行修改:
sysctl -p

--修改用户的限制文件/etc/security/limits.conf添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

--修改/etc/pam.d/login文件:添加如下内容
session required /lib64/security/pam_limits.so
session required pam_limits.so

--修改/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
---执行生效
source /etc/profile

--创建目录
mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
mkdir /u01/app/oracle/oradata
mkdir /u01/app/oraInventory
mkdir /u01/app/oracle/fast_recovery_area
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory

--上传1of7 2of7的linux oracle安装包到/opt/oracle下
chown -R oracle:oinstall /opt/oracle
chmod 755 -R /opt/oracle
su - oracle
cd /opt/oracle
unzip p13390677_112040_Linux-x86-64_1of7.zip && unzip p13390677_112040_Linux-x86-64_2of7.zip

--编辑oracle环境变量
vi ~/.bash_profile
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
export NLS_LANG='AMERICAN_AMERICA.al32utf8'

source ~/.bash_profile

--修改静默文件
vi /home/oracle/database/response/db_install.rsp
需要设置的选项如下:

oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true

单机版本(非集群需要配置↓)

oracle.install.db.CLUSTER_NODES=

---安装数据库软件
cd /home/oracle/database
./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp -ignorePrereq

As a root user, execute the following script(s):

    1. /u01/app/inventory/orainstRoot.sh
    2. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh



--静默方式安装监听
netca /silent /responseFile /home/oracle/database/response/netca.rsp

dbca -silent -createDatabase -templateName /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc -gdbname orcl -sid orcl -responseFile /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/dbca.rsp -characterSet al32utf8 -sysPassword Oracle_1234 -systemPassword Oracle_1234 -automaticMemoryManagement false

1

评论 (0)

取消