oracle安装

将oracle安装包拷贝到安装机器,指定目录/opt/install

借助xftp来将Oracle安装包放在stall目录下;

 

关闭防火墙

[root@localhost install]# systemctl stop firewalld.service

[root@localhost install]# systemctl disable firewalld.service

 

安装依赖包

yum -y install binutils compat-libcap1 compat-libstdc++-33 
compat-libstdc++-33*i686 compat-libstdc++-33*.devel 
compat-libstdc++-33 
compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 
glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686

 

难依赖包(用来验证是否安装完成)

rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel

 

创建oracle用户

[root@localhost install]# groupadd -g 502 oinstall

[root@localhost install]# groupadd -g 503 dba

[root@localhost install]# groupadd -g 504 oper

[root@localhost install]# groupadd -g 505 asmadmin

[root@localhost install]# useradd -u 502 -g oinstall -G oinstall,dba,asmadmin,oper -s /bin/bash -m oracle

给用户设置密码,它会显示少于8位字符,你重新输入一次刚刚的密码就行,不用理会。

[root@localhost install]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

创建oradata目录,解压oracle安装

[root@localhost install]# mkdir /oradata

将install下安装包复制到oratada目录下

cp p10404530_112030_Linux-x86-64_* /oradata/

 再删除掉install目录下的安装包

将/oradata上当及目录内的所有文件和文件夹的归属都修改为oracle用户

[root@localhost oradata]# ll

total 2442044

-rw-r--r--. 1 root root 1358454646 Dec 12 10:43 p10404530_112030_Linux-x86-64_1of7.zip

-rw-r--r--. 1 root root 1142195302 Dec 12 10:43 p10404530_112030_Linux-x86-64_2of7.zip

[root@localhost oradata]# chown -R oracle:oinstall /oradata

[root@localhost oradata]# ll

total 2442044

-rw-r--r--. 1 oracle oinstall 1358454646 Dec 12 10:43 p10404530_112030_Linux-x86-64_1of7.zip

-rw-r--r--. 1 oracle oinstall 1142195302 Dec 12 10:43 p10404530_112030_Linux-x86-64_2of7.zip

解压安装包需要下载unzip

[root@localhost oradata]# yum install -y unzip

切换操作oracle用户

[root@localhost oradata]# su oracle

解压两个安装包

[oracle@localhost oradata]$ unzip p10404530_112030_Linux-x86-64_1of7.zip

[oracle@localhost oradata]$ unzip p10404530_112030_Linux-x86-64_2of7.zip

修改系统配置参数

操作用户: root

[oracle@localhost oradata]$ su root

Password:

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

60 oracle          soft    nproc           2047

61 oracle          hard    nproc           16384

62 oracle          soft    nofile          1024

63 oracle          hard    nofile          65536

64 oracle          soft    stack           10240

 配置oracle安装目录

操作用户:oracle

[root@localhost oradata]# su oracle

[oracle@localhost oradata]$ mkdir -p /oradata/soft/oracle11g

配置环境变量

[oracle@localhost oracle11g]$ cd

[oracle@localhost ~]$ pwd

/home/oracle

[oracle@localhost ~]$ vim .bash_profile

13 export ORACLE_BASE=/oradata/soft/oracle11g

 14 export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3/dbhome_1

 15 export ORACLE_SID=prod

 16 export NLS_LANG=.AL32UTF8

 17 export PATH=${PATH}:${ORACLE_HOME}/bin:$ORACLE_HOME/lib64

 

使环境变量生效

[oracle@localhost ~]$ source .bash_profile

修改安装配置文件

[oracle@localhost ~]$ cd /oradata/

拷贝安装文件db_install.rsp到/oradata目录下

[oracle@localhost oradata]$ cp /oradata/database/response/db_install.rsp /oradata

编辑db_install.rsp

[oracle@localhost oradata]$ vim db_install.rsp

(前面的编号是行号,可以用set nu打开)

29 oracle.install.option=INSTALL_DB_AND_CONFIG

37 ORACLE_HOSTNAME=192.168.78.142

42 UNIX_GROUP_NAME=oinstall

49 INVENTORY_LOCATION=/oradata/soft/oraInventory

86 SELECTED_LANGUAGES=en,zh_CN

91 ORACLE_HOME=/oradata/soft/oracle11g/product/11.2.0.3/dbhome_1

96 ORACLE_BASE=/oradata/soft/oracle11g

107 oracle.install.db.InstallEdition=EE

154 oracle.install.db.DBA_GROUP=dba

160 oracle.install.db.OPER_GROUP=oper

189 oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

194 oracle.install.db.config.starterdb.globalDBName=prod

199 oracle.install.db.config.starterdb.SID=prod

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

221 oracle.install.db.config.starterdb.memoryOption=true

229 oracle.install.db.config.starterdb.memoryLimit=1024

262 oracle.install.db.config.starterdb.password.ALL=oracle

336 oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

344 oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/oradata/soft/oracle11g/data

351 oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/oradata/soft/oracle11g/fast_recovery_area

400 DECLINE_SECURITY_UPDATES=true

安装数据库

操作用户oracle

[oracle@localhost database]$ pwd

/oradata/database

安装前将/oradata文件及目录下的所有文件文件夹的权限都属于oracle用户

[root@localhost soft]# chown -R oracle:oinstall /oradata/

[oracle@localhost database]$ ./runInstaller -silent -ignoreSysPrereqs -responseFile /oradata/db_install.rsp -ignorePrereq

tail -f /oradata/soft/oraInventory/logs/installActions2022-12-12_12-01-52PM.log

[oracle@localhost database]$ The installation of Oracle Database 11g was successful.

Please check '/oradata/soft/oraInventory/logs/silentInstall2022-12-12_12-01-52PM.log' for more details.

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

        1. /oradata/soft/oraInventory/orainstRoot.sh

        2. /oradata/soft/oracle11g/product/11.2.0.3/dbhome_1/root.sh

Successfully Setup Software.

我在安装的时候遇到遇到同一个问题,显示一个目录里面不能被使用,里面不为空

 解决方法是删除掉这个目录里面的内容

[oracle@localhost database]$ rm -rf /oradata/soft/oraInventory/*

以上两句执行命令将拷贝到root用户下执行

进入oracle

[oracle@localhost database]$ sqlplus / as sysdba

SQL> connect /as sysdba

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值