CentOS 静默安装Oracle
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CentOS 静默安装Oracle,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含7499字,纯文字阅读大概需要11分钟。
内容图文
![CentOS 静默安装Oracle](/upload/InfoBanner/zyjiaocheng/863/746ff7f474344db3b11d919e845f7cd0.jpg)
Oracle 数据库安装:
- 安装前依赖验证:
rpm -q \
binutils\
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat\
gcc\
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel\
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel | grep "not installed"
pdksh 在本系统中安装了ksh,可替代pdksh
2、创建运行Oracle数据库的系统用户和用户组
创建用户:
[root@moke-1 ~]# groupadd oinstall
[root@moke-1 ~]# groupadd dba
[root@moke-1 ~]# user
useradd? ? ?userdel? ? ?userhelper? usermod? ? ?usernetctl? users
[root@moke-1 ~]# useradd -g oinstall -g dba -m oracle
[root@moke-1 ~]# passwd oracle
设置密码
[root@moke-1 ~]# id oracle
uid=1000(oracle) gid=1001(dba) 组=1001(dba)
[root@moke-1 ~]# su oracle
[oracle@moke-1 root]$
user =oracle
passwd=111@1222
创建Oracle数据库安装目录
[root@moke-1 /]# mkdir -p /data/oracle#安装目录
[root@moke-1 /]# mkdir -p /data/oraInventory #数据库配置文件
[root@moke-1 /]# mkdir -p /data/database#数据库软件包解压目录
[root@moke-1 /]# cd /data/
[root@moke-1 data]# ls
database? oracle? oraInventory
[root@moke-1 data]# chown -R oracle:oinstall /data/oracle
[root@moke-1 data]# chown -R oracle:oinstall /data/oraInventory
[root@moke-1 data]# chown -R oracle:oinstall /data/database
[root@moke-1 data]# ls
database? oracle? oraInventory
[root@moke-1 data]# ll -l
总用量 12
drwxr-xr-x 2 oracle oinstall 4096 6月? 22 15:18 database
drwxr-xr-x 2 oracle oinstall 4096 6月? 22 15:17 oracle
drwxr-xr-x 2 oracle oinstall 4096 6月? 22 15:18 oraInventory
[root@moke-1 data]# chmod -R 775 /data
[root@moke-1 data]# ll -l
总用量 12
drwxrwxr-x 2 oracle oinstall 4096 6月? 22 15:18 database
drwxrwxr-x 2 oracle oinstall 4096 6月? 22 15:17 oracle
drwxrwxr-x 2 oracle oinstall 4096 6月? 22 15:18 oraInventory
3、修改OS系统标识
[root@moke-1 home]# cat /proc/version
Linux version 3.10.0-327.28.3.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Aug 18 19:05:49 UTC 2016
[root@moke-1 home]#[root@moke-1 home]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@moke-1 home]#
[root@moke-1 home]# vim /etc/redhat-release
redhat-7
~
[root@moke-1 home]# cat /etc/redhat-release
redhat-7
[root@moke-1 home]#
4、关闭防火墙
5、关闭selinux(重启生效)
[root@moke-1 home]# vim /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=disabled #表示已关闭
# SELINUXTYPE= can take one of three two values:
#? ? ?targeted - Targeted processes are protected,
#? ? ?minimum - Modification of targeted policy. Only selected processes are protected.
#? ? ?mls - Multi Level Security protection.
SELINUXTYPE=targeted
6、修改内核参数
[root@moke-1 ~]# vim /etc/sysctl.conf# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv4.conf.all.accept_redirects=0#oracle database install confignet.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1fs.file-max = 6815744 #设置最大打开文件数
fs.aio-max-nr = 1048576kernel.shmall? = 2097152 #共享内存的总量
kernel.shmmax = 2147483648 #最大共享内存的段大小
kernel.shmmni? = 4096 #整个系统共享内存端的最大数
kernel.sem? ? ?= 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500 #可使用的IPV4端口范围net.core.rmem_default = 262144
net.core.rmem_max? ? ?= 4194304
net.core.wmem_default = 262144
net.core.wmen_max? ? ?= 1048576
//使生效 sysctl -p
7、对oracle用户设置限制,提高软件运行性能(结尾增加)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
8、配置用户环境变量
[root@moke-1 database]# vim /home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functionscd /da
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATH# oracle database profile
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport LC_ALL=en_US
export LANG=en_US
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
环境变量开机生效
vim /etc/bashrc
# oracle profile
source /home/oracle/.bash_profile
#
source /etc/profile
9、解压安装包:
unzip linux.x64_11gR2_database_1of2.zip -d /data/database/ #解压文件1
unzip linux.x64_11gR2_database_2of2.zip -d /data/database/ #解压文件2
chown -R oracle:oinstall /data/database/database/ #分配安装文件授权Oracle
10、编辑Oracle数据库安装应答文件
vim /data/database/database/response/db_install.rsp
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=sidOracle11GR2
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=512
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=111222@qaz
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/data/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/data/oracle/fast_recovery_area
DECLINE_SECURITY_UPDATES=true
11、执行安装(进入/data/database/database/)
[oracle@moke-1 ~]$ ./runInstaller -ignorePrereq? -silent -force -responseFile /data/database/database/response/db_install.rsp
12、已root用户执行脚本
cd /data/oracle/product/11.2.0/db_1/
ls
./root.sh
13、配置静默监听
[oracle@moke-1 bin]$ netca /silent /responsefile /data/database/database/response/netca.rsp
bash: netca: command not found
[oracle@moke-1 bin]$ echo $ORACLE_BASE[oracle@moke-1 bin]$ cd ~
[oracle@moke-1 ~]$ vim .bash_profile
[oracle@moke-1 ~]$ source .bash_profile
[oracle@moke-1 ~]$ echo $ORACLE_BASE
/data/oracle
[oracle@moke-1 ~]$ echo $ORACLE_HOME
/data/oracle/product/11.2.0/db_1
[oracle@moke-1 ~]$ netca /silent /responsefile /data/database/database/response/netca.rspParsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /data/database/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/data/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
14、 查看监听端口
[oracle@moke-1 oradata]$ netstat -tnulp | grep 1521
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1521 ::
标签:,,,,,,,, 来源: https://www.cnblogs.com/moke-cn/p/14500397.html
内容总结
以上是互联网集市为您收集整理的CentOS 静默安装Oracle全部内容,希望文章能够帮你解决CentOS 静默安装Oracle所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。