在 Oracle 数据库 19c 之前,安装 Oracle 数据库软件需要手动执行 root.sh 脚本。在 19c 中,我们通过自动执行 root.sh 来进行安装。
1. 准备目录
以 root 用户身份登录到服务器,并创建 Oracle Database 19c 软件专用的目录。
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_2
cd /u01/app/oracle/product/19.0.0/dbhome_2
将 LINUX.X64_193000_db_home.zip 解压缩到专用于 Oracle Database 19c 安装的目录。
unzip LINUX.X64_193000_db_home.zip
cd /u01
chown -R oracle *
chgrp -R oinstall *
exit
2. 安装 Oracle 19c
在本节中,将使用 Oracle Universal Installer 和自动执行 root.sh 脚本来安装 Oracle Database 19c。
以 oracle 用户身份登录到服务器,然后转到 Oracle Database 19c 软件专用的目录。
cd /u01/app/oracle/product/19.0.0/dbhome_2
./runInstaller
选择配置选项
页面中,选择仅安装软件
。选择数据库安装选项
页面中,单击下一步
。选择数据库版本
页面中,单击下一步
。指定安装位置
页面中,单击下一步
。特权操作系统组
页面中,单击下一步
。root.sh脚本执行配置
页面中,选中自动运行配置脚本
,并提供root用户的密码。点击下一步
。执行先决条件检查
页面中,选中全部忽略
,然后单击下一步
。如果有警告消息,请选择是
。摘要
页面中,单击保存响应文件...
。这使您可以观察根脚本自动执行记录在响应文件中的方式。选择 /tmp
目录以保存db.rsp
响应文件。单击保存
,然后单击安装
。安装产品
页面上,进度
将显示执行的步骤,直到出现是否继续提示消息时,选择是
。完成
页面中,单击关闭
。安装完成。3. 查看响应文件
转到创建响应文件的目录,并查看响应文件。
cd /tmp
cat db.rsp
内容如下:
oracle.install.db.rootconfig.executeRootScript=true
#--------------------------------------------------------------------------------------
# Specify the configuration method to be used for automatic root script execution.
#
# Following are the possible choices:
# - ROOT
# - SUDO
#--------------------------------------------------------------------------------------
oracle.install.db.rootconfig.configMethod=ROOT
至此 Oracle database 19c 软件已经安装完毕。
接下来我们看如何删除 Oracle database 19c 软件。
4. 清除 Oracle database 19c 安装
由于我们只是测试安装Oracle Database 19c软件的目录。不是正式使用,这里一并写出如何清除 Oracle database 19c 软件。
cd /u01/app/oracle/product/19.0.0/dbhome_2/deinstall
./deinstall
Specify the list of database names that are configured in this Oracle home []:
y
Oracle Home selected for deinstall is: /u01/app/oracle/product/19.0.0/dbhome_2
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Do you want to continue (y - yes, n - no)? [n]: y
Oracle Universal Installer cleanup was successful.
...
Oracle deinstall tool successfully cleaned up temporary directories.
############# ORACLE DEINSTALL TOOL END #############
至此,数据库软件成功清除。