CentOS Stream 8 安装Oracle 19C (静默模式)

CentOS Stream 8 安装Oracle 19C (静默模式)
1.提前准备工作
说明:必须严格遵守用户规则去创建目录,否则会导致缺少目录权限进而影响安装!
安装以下软件包最新版本(注意:如果打算使用 32 位客户端应用程序访问 64 位服务器,则还必须安装(如果可用)此表中列出的包的最新 32 位版本。)

[root@Test2CentOSStream8 ~]# dnf install bc binutils elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc-devel ksh libaio libaio-devel libXrender libXrender libX11 libXau libXi libXtst libgcc libnsl librdmacm libstdc++ libstdc++-devel libxcb libibverbs make policycoreutils policycoreutils-python-utils smartmontools sysstat

oracle建议将系统时钟源设置为tsc(如果可用)
查看可用时钟源

[root@Test2CentOSStream8 ~]# cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
tsc hpet acpi_pm 

查看当前时钟源

[root@Test2CentOSStream8 ~]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
tsc
[root@Test2CentOSStream8 ~]# 

如果tsc时钟源可用,可将tsc设置为系统时钟源

# echo "tsc">/sys/devices/system/clocksource/clocksource0/current_clocksource

将 clocksource 指令附加到 /etc/default/grub 文件中的GRUB_CMDLINE_LINUX行,即使在重新启动后也能保留此时钟源设置。

GRUB_CMDLINE_LINUX="rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never clocksource=tsc" 

检查系统中是否已经安装过了Oraccle数据(本教程为全新安装

使用该命令确定系统上是否有 Oracle 中央清单。
# more /etc/oraInst.loc

使用该命令确认指定为 Oracle 清单组的组是否仍存在于系统上。例如:
grep groupname /etc/group

注意:不要将目录放在新安装的 Oracle 基本目录下,因为这可能会导致其他安装的用户权限错误.

作为计划安装的一部分,手动创建 Oracle 清单组,尤其是在服务器上安装了多个 Oracle 软件产品的情况下。
默认情况下,如果 oraVentory 组不存在,则安装程序将使用要安装的 Oracle 软件的安装所有者的主要组作为 oraVentory 组。确保此组可用作所有计划内的 Oracle 软件安装所有者的主要组。
如果该文件不存在,则通过以下命令来创建 Oracle 清单组

/usr/sbin/groupadd -g 1521 oinstall

增加OSDBA组(dba组是必须要创建的,主要用作于SYSDBA)

/usr/sbin/groupadd -g 1522 dba

创建oralce用户并且指定组,同时自动创建用户目录

[root@Test2CentOSStream8 home]# /usr/sbin/useradd -g oinstall -G dba -m oracle	
#-g参数指定主要组 ,-G指定次要组 -m参数自动创建用户目录

查看用户组gid的值

[root@Test2CentOSStream8 ~]# getent group oinstall
oinstall:x:1521:
[root@Test2CentOSStream8 home]# getent group dba
dba:x:1522:

验证要使用的 Oracle 安装所有者是否将 Oracle 清单组作为其主要组

[root@Test2CentOSStream8 ~]# id oracle
uid=1001(oracle) gid=1521(oinstall)=1521(oinstall),1522(dba)

修改用户oracle密码

passwd oracle

2.数据库安装
使用root用户创建能oracle基础目录,同时为目录指定所有者,组,权限

# mkdir -p /u01/app/oracle
# mkdir -p /u01/app/oraInventory
# chown -R oracle:oinstall /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oraInventory
# chmod -R 775 /u01/app

使用oracle用户创建下面目录

[oracle@Test2CentOSStream8 ~]$ mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1

将下载下来的oracle19c zip文件传输到oracle用户下的相关目录中(这个目录按照实际情况指定即可)

[oracle@Test2CentOSStream8 ~]$ scp -P 3301 ttzo@192.168.133.140:/home/ttzo/下载/LINUX.X64_193000_db_home.zip /u01/app     /oracle/product/19.3.0/dbhome_1/

进入到dbhome_1目录中解压Oracle zip文件

[oracle@Test2CentOSStream8 ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/
[oracle@Test2CentOSStream8 dbhome_1]$ unzip -q LINUX.X64_193000_db_home.zip

使用用户oracle登录系统后打开终端,切换至目录dbhome_1/中执行安装
如果是通过ssh直接连接到服务器,则需要安装相关图形界面,可以参考oracle官网说明文档
安装时如果centos stream系统默认语言设置的为中文,则安装oralce会出现乱码,乱码方式的解决方案可自行进行百度或者参考本人之前写过的文章

[oracle@Test2CentOSStream8 ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/
[oracle@Test2CentOSStream8 dbhome_1]./runInstaller 

如果出现报错Unexpected error while executing the action at State:‘supportedOSCheck’,说明操作系统不适用,执行下面命令即可解决

export CV_ASSUME_DISTID=RHEL8.0	#临时修改参数,建议临时修改,保证软件正常安装即可

说明:Oracle for Linux官方标准是RHEL8 或RHEL7.5,但是这里也可设置成7.6或者其他的版本号,但是建议遵守Oracleg官网参数,因为这里的环境是CentOS Stream 8,对标的是RHEL8系列而不是RHEL7系列。当然这里只是为了让环境符合安装要求而已(CentOS Stream 9按照官方文档修改相关值即可)。就类似于windows server 2022安装oracle 19c时会提示操作系统不符合要求,可以通过修改WINDOWS.X64_193000_db_home\cv\cvdata\cvu_prereq.xml文件相关内容后,安装Oracle 19C就会环境检测通过。但是,这里不同的是winows就算不修改参数,仅仅是提示而已,仍旧可以安装,但是Linux操作系统不行。必须要解决该报错后软件才能正常安装。

最后一步安装提示需要使用root用户执行相关sh文件,则正常执行后再点击对话框“ok"按键

[root@Test2CentOSStream8 ~]# sh /u01/app/oracle/
checkpoints/ diag/        product/     
[root@Test2CentOSStream8 ~]# sh /u01/app/oraInventory/orainstRoot.sh 
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.  
   
[root@Test2CentOSStream8 ~]# sh /u01/app/oracle/product/19.3.0/dbhome_1/root.sh 
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19.3.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:/usr/local/bin #这里的路径建议按照系统提示路径输入
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA - Standalone Mode) is available at :
    /u01/app/oracle/product/19.3.0/dbhome_1/bin/tfactl

Note :
1. tfactl will use TFA Service if that service is running and user has been granted access
2. tfactl will configure TFA Standalone Mode only if user has no access to TFA Service or TFA is not installed
[root@Test2CentOSStream8 ~]# 

安装成功并且提示 ”Oracle Enterprise Manager Database Express URL: https://Test2CentOSStream8:5500/em“

以上就是Centos Stream 8通过”静默“模式安装Oracle 19C教程,Oracle 21C安装过程与该教程基本一致,可以参照该教程进行安装部署。 至于安装后的环境变量配置,登录,解锁用户及使用客户端工具连接等教程,之后会发布相关文档供大家借鉴学习。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
静默安装Oracle 19cCentOS 7上可以按照以下步骤进行: 1. 下载Oracle 19c安装文件,并将其解压缩到指定目录。 引用中的命令演示了如何解压缩安装文件。你可以将LINUX.X64_193000_db_home.zip文件解压缩到/u01/app/oracle/product/19c/db_1/目录中。 2. 创建一个哑应文件以配置安装参数。在安装过程中,你可以使用该文件来提供安装过程中需要的参数,以避免手动输入。 你可以创建一个名为response.txt的文本文件,并在其中指定以下参数: ``` oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 ORACLE_HOSTNAME=<hostname> ORACLE_UNQNAME=<unqname> ORACLE_BASE=<oracle_base> ORACLE_HOME=<oracle_home> oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=dba oracle.install.db.OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba oracle.install.db.OSKMDBA_GROUP=dba oracle.install.db.OSRACDBA_GROUP=dba oracle.install.db.storageOption=FS oracle.install.db.fileSystemStorage.dataLocation=/u01/app/oracle/oradata oracle.install.db.fileSystemStorage.recoveryLocation=/u01/app/oracle/fast_recovery_area oracle.install.db.fileSystemStorage.cdbFileSystem=ORCLCDB oracle.install.db.fileSystemStorage.pdbFileSystem=ORCLPDB1:Y oracle.install.db.ConfigureAsContainerDB=false ``` 请注意,你需要根据你的环境更改参数的值。 3. 创建一个安装哑应文件的脚本。 在安装目录下创建一个名为install.sh的脚本,并将以下内容复制到该文件中: ``` #!/bin/bash ./runInstaller -silent -responseFile /path/to/response.txt ``` 4. 提供必要的权限并运行安装脚本。 在终端中,转到Oracle安装文件的目录,并运行以下命令: ``` chmod +x install.sh ./install.sh ``` 5. 等待安装完成。 安装过程将自动运行,并根据提供的哑应文件中的参数进行配置。请耐心等待,直到安装完成。 至此,你已经完成了在CentOS 7上静默安装Oracle 19c的步骤。 其他
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值