当前位置:网站首页>linux下安装oracle11g 静默安装教程
linux下安装oracle11g 静默安装教程
2022-06-27 19:23:00 【高粱】
1、环境准备
操作系统:CentOS7 64位
Oracle11g压缩包及各种依赖包
2、依赖包检测
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel
3、安装缺少的依赖包
执行命令:yum -y install 依赖包名称 # 能够联网情况下
rpm -ivh 依赖包名称 # 不能联网情况下
4、创建目录用户及属组和权限配置
#创建组
groupadd oinstall
groupadd dba
#创建用户
useradd -g oinstall -G dba oracle
#设置密码
passwd oracle
#创建安装目录
mkdir -p /usr/local/oracle/product/11.2.0/db_1
mkdir -p /usr/local/oracle/oradata
mkdir -p /usr/local/oracle/inventory
mkdir -p /usr/local/oracle/fast_recovery_area
#授权
chown -R oracle.oinstall /usr/local//oracle
chmod -R 755 /usr/local/oracle
5、服务器配置修改
#修改主机名
vim /etc/hosts
#在host文件中添加
127.0.0.1 oracledb
#开放1521端口
firewall-cmd --zone=public --add-port=1521/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports --zone=public
#关闭selinux
vim /etc/sysconfig/selinux
#修改selinux中的值
SELINUX=disabled
#执行命令使修改生效:
setenforce 0
#修改内核参数
vim /etc/sysctl.conf
#添加以下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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
#修改用户限制文件
vim /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文件
vim /etc/pam.d/login
#添加以下内容
session required /lib64/security/pam_limits.so
session required pam_limits.so
#配置oracle用户的环境变量(使用oracle用户)
su - oracle
vim ~/.bash_profile
#添加
ORACLE_BASE=/usr/local/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
#执行命令使修改生效
. ~/.bash_profile
6、开始安装
#切换到root用户
su root
cd /tmp/
mkdir oracle
cd oracle
#解压
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
#解压完成后
#编辑静默安装响应文件
cd /tmp/oracle/database/response/
vim db_install.rsp
#修改以下内容
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/usr/local/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/usr/local/oracle/product/11.2.0/db_1
ORACLE_BASE=/usr/local/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.config.starterdb.password.ALL=密码
DECLINE_SECURITY_UPDATES=true
#开始安装软件
chown -R oracle:oinstall /tmp/oracle/
su - oracle
cd /tmp/oracle/database/
./runInstaller -silent -responseFile /tmp/oracle/database/response/db_install.rsp -ignorePrereq
#安装完成后切换回root用户执行脚本
/usr/local/oracle/inventory/orainstRoot.sh
/usr/local/oracle/product/11.2.0/db_1/root.sh
#配置监听
su - oracle
netca /silent /responseFile /tmp/oracle/database/response/netca.rsp
#查看1521端口是否被监听
netstat -tnulp | grep 1521
#监听启动和关闭命令
lsnrctl start
lsnrctl stop
#建库
cd /tmp/oracle/database/response/
cp dbca.rsp dbca.rsp.bak
vim dbca.rsp
#修改参数
GDBNAME= "orcl"
SID =" orcl"
SYSPASSWORD= "oracle"
SYSTEMPASSWORD= "oracle"
SYSMANPASSWORD= "oracle"
DBSNMPPASSWORD= "oracle"
DATAFILEDESTINATION=/usr/local/oracle/oradata
RECOVERYAREADESTINATION=/usr/local/oracle/fast_recovery_area
CHARACTERSET= "ZHS16GBK"
#物理内存
TOTALMEMORY= "1638"
#执行命令
dbca -silent -responseFile /tmp/oracle/database/response/dbca.rsp
#测试是否可用
sqlplus / as sysdba
SQL> select 1 from dual;
1
----------
1
#这里可能出现部分目录不存在或者获取不到实例的问题,只需要创建或修改对应目录 既可
#启动或关闭实例
sqlplus / as sysdba
SQL> startup;
SQL> shutdown;
7、创建表空间用户并授权
2、创建表空间;
create temporary tablespace MDGHPS_TEMP tempfile '/usr/local/MDGHPS_TEMP.dbf' size 100m reuse autoextend on next 20m maxsize unlimited;
create tablespace MDGHPS datafile '/usr/local/MDGHPS.dbf' size 100M reuse autoextend on next 40M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);
3、创建用户;
create user MDGHPS identified by MDGHPS default tablespace MDGHPS temporary tablespace MDGHPS_TEMP;
4、给用户授权;
grant connect,resource to demo;
grant create any sequence to demo;
grant create any table to demo;
grant delete any table to demo;
grant insert any table to demo;
grant select any table to demo;
grant unlimited tablespace to demo;
grant execute any procedure to demo;
grant update any table to demo;
grant create any view to demo;
-- dba权限
grant connect, resource, dba to demo;
5、切换用户;
MDGHPS/MDGHPS;
6、导入完整数据库脚本MDGHPS.sql;
@/usr/MDGHPS.sql;
commit;
边栏推荐
- io流代码
- Go从入门到实战——依赖管理(笔记)
- Go从入门到实战——所有任务完成(笔记)
- 今晚战码先锋润和赛道第2期直播丨如何参与OpenHarmony代码贡献
- 本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
- squid代理服务器
- Icml2022 | scalable depth Gaussian Markov random field
- Love math experiment | phase VI - Financial anti fraud case study
- Love math experiment | Issue 8 - building of Singapore house price prediction model
- 送你12个常用函数公式,用过的都说好
猜你喜欢

How to participate in openharmony code contribution

Go from introduction to actual combat - context and task cancellation (notes)

Animal breeding production virtual simulation teaching system | Sinovel interactive

DO280OpenShift访问控制--security policy和章节实验

01-Golang-环境搭建

Codeforces Round #719 (Div. 3)

Codeforces Round #716 (Div. 2)

Go从入门到实战——CSP并发机制(笔记)

Data platform scheduling upgrade and transformation | operation practice from Azkaban smooth transition to Apache dolphin scheduler

Codeforces Round #723 (Div. 2)
随机推荐
MySQL client tools are recommended. I can't imagine that it is best to use Juran
The difference between scrum and Kanban
Go from introduction to actual combat - package (notes)
Codeforces Round #717 (Div. 2)
Is it safe to open an account and buy stocks? Who knows
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
Codeforces Global Round 14
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
GoLand permanently activated
Codeforces Round #721 (Div. 2)
送你12个常用函数公式,用过的都说好
SQL必需掌握的100个重要知识点:用通配符进行过滤
非常全面的DolphinScheduler(海豚调度)安装使用文档
Codeforces Round #722 (Div. 2)
Industry case | see the operation of bank digital transformation from the king of retail
Golang 使用正则来匹配出子字符串函数
uniapp拦截请求
Educational Codeforces Round 108 (Rated for Div. 2)
ICML2022 | 可扩展深度高斯马尔可夫随机场
100 important knowledge points that SQL must master: filtering data