作者 | JiekeXu
来源 |公众号 JiekeXu DBA之路(ID: JiekeXu_IT)
如需转载请联系授权 | (个人微信 ID:JiekeXu_DBA)
大家好,我是 JiekeXu,很高兴又和大家见面了,今天和大家一起来看看 Oracle 主流版本不同架构下的静默安装指南,欢迎点击上方蓝字“JiekeXu DBA之路”关注我的公众号,标星或置顶,更多干货第一时间到达!
这里先为大家附上 Oracle 各版本支持的生命周期及发布时间线,当前较为常用的主流版本则为 Oracle 11g 和 Oracle 19c 以及明年发布的 Oracle 23c 等版本,12c 和 18c 以及 21c 版本非长期支持版本,不建议在生产环境中使用。本文是对 11g 和 19c 两个主流版本的单机文件系统、单机 ASM 和 RAC 三种架构的静默安装简要步骤,并不包含所有操作步骤,仅供参考。另外第四章节是半年前对 Oracle 23c free 版本的安装,感兴趣的朋友也可参考安装最新版本的安装包。
下面一图是 Oracle 19c 安装注意事项,可以先看看和你安装时有何不同点,接下来直接进入命令行静默安装演示:
目 录
一、单机文件系统静默安装
1)Linux x86-64 11g 环境
0.上传文件到 /u01/soft
1.编辑响应文件进行静默安装
2.使用如下命令静默安装
3.执行 root.sh 脚本
4.创建监听
5.打补丁
6.dbca 建库
7.删除数据库
2)Linux x86-64 19c 环境
1.安装 RAC 时需要的用户和组创建
2.Oracle 19c 静默响应文件位置及说明
3.编辑 DB 响应文件
4.静默安装软件的同时打补丁
5.创建 19c 默认监听
6.装完软件打补丁
7.dbca 创建实例
二、单机 ASM 静默安装
一)Linux x86-64 Oracle 11g 单机 ASM 安装
0.创建目录和用户
1.修改 GI 响应文件
2.查看响应文件并安装 GI
3.执行 root 脚本
4.配置 GI 更新节点信息
5.创建新的磁盘组
6.创建监听
7. 仅安装 DB 软件
8.查看响应文件并执行
9.dbca 创建实例
二)Linux x86-64 Oracle 19c 单机 ASM 安装
0.创建目录和用户
1.编辑 GI 响应文件
2. 安装前 precheck
3.静默安装 GI
4.执行 root 脚本
5.配置集群
6.创建 ARCH 磁盘组
7.编辑响应文件
8.仅安装 DB 软件
9.DBCA建库打补丁
三、RAC 静默安装
一)Linux x86-64 Oracle 11g RAC 安装
1.互信配置
2.GI 集群件安装前检查
3.GI 集群件静默安装
4.创建 ASM 磁盘组
5.仅安装 DB 软件
6.DBCA 静默建库
7.静默删除
二)Linux x86-64 Oracle 19c RAC 安装
1.响应文件位置
2.GI 静默安装
3.两节点分别执行 root 脚本
4.创建 ASM 磁盘组
5.DB 软件安装
6.静默创建实例
四、Oracle 23c free 开发版安装指南
1.基础信息配置
2.安装数据库
2.1执行预安装
2.2使用 rpm 安装时需要依赖包
2.3 Oracle Linux 8 上传 iso 文件配置 yum 源
2.4 配置 yum 源
3.安装 Oracle 23c free 版
4.创建和配置 Oracle 数据库服务实例
5.配置环境变量登录数据库
另外本文已经生成 PDF 文件,可在公众号后台回复【静默安装指南】获取文件以及惠星星老师的一键安装脚本。
一、单机文件系统静默安装
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
在 /u01/soft 下面得到 database 文件夹,修改属主,属组,权限
chown -R oracle:oinstall database/
chmod -R +x database/
cd /u01/soft/database/response
dbca.rsp db_install.rsp netca.rsp
cp db_install.rsp db_install.rsp.210708
cat /u01/soft/database/response/db_install.rsp | grep -v ^# | grep -v ^$ > /home/oracle/db_install.rsp
需要修改以下内容
vi /home/oracle/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY // 安装类型
ORACLE_HOSTNAME=test // 主机名称(hostname查询)
UNIX_GROUP_NAME=oinstall // 安装组
INVENTORY_LOCATION=/u01/app/oraInventory //INVENTORY目录(不填就是默认值)
SELECTED_LANGUAGES=en,zh_CN,zh_TW // 选择语言,默认英文,可用逗号分割选择其他语言
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 //oracle_home
ORACLE_BASE=/u01/app/oracle //oracle_base
oracle.install.db.InstallEdition=EE // oracle版本
oracle.install.db.EEOptionsSelection=false //自定义安装,默认 否,使用默认组件
oracle.install.db.DBA_GROUP=dba // dba用户组
oracle.install.db.OPER_GROUP=oinstall // oper用户组
DECLINE_SECURITY_UPDATES=true //设置安全更新(貌似是有bug,这个一定要选true,否则会无限提醒邮件地址有问题,终止安装。PS:不管地址对不对
/u01/soft/database/runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /home/oracle/db_install.rsp
3.执行 root.sh 脚本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
$ netca /silent /responsefile /u01/soft/database/response/netca.rsp
5.打补丁
补丁为 11.0.2.0.4.190416 可参考 https://mp.weixin.qq.com/s/zS4aE3TfhbMwDk37nIEGfg。
$ unzip p6880880_112000_Linux-x86-64.zip
$ unzip p29255947_112040_Linux-x86-64.zip
准备数据存放目录,归档存放目录
# mkdir -p /oracle/data/app/oracle/oradata
# mkdir -p /oracle/data/app/oracle/fast_recovery_area
# chmod -R 775 /oracle
# chown -R oracle:oinstall /oracle
主要配置以下参数:
vi /u01/soft/database/response/dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "jiekexu"
SID = "jiekexu"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle11g"
SYSMANPASSWORD = "oracle11g"
DBSNMPPASSWORD = "oracle11g"
DATAFILEDESTINATION = /oracle/data/app/oracle/oradata #上面创建的路径存放数据
RECOVERYAREADESTINATION=/oracle/data/app/oracle/fast_recovery_area ##存放闪回日志
STORAGETYPE=FS
CHARACTERSET = "AL32UTF8" # 字符集,根据需求设置,建议前期确定好需要什么字符集,后期不建议更改
TOTALMEMORY = "4096" # 分配给Oracle的内存总量(单位为:M),根据服务器内存总量进行分配
执行静默创建数据库实例
$ORACLE_HOME/bin/dbca -silent -redoLogFileSize 500 -responseFile /u01/soft/database/response/dbca.rsp
7.删除数据库
当刚创建的数据库有问题时,例如字符集错误,可删除重建。
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
$ dbca -silent -deleteDatabase -sourcedb jiekexu -sysDBAUserName SYS -sysDBAPassword oracle
2)Linux x86-64 19c 环境
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
###/usr/sbin/useradd -u 54331 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba grid
-- echo 'oracle' | passwd --stdin oracle
2.Oracle 19c 静默响应文件位置及说明
对于 Oracle 数据库,响应文件模板位于 $ORACLE_HOME/install/response 目录中。对于 Oracle Grid Infrastructure,响应文件模板位于 $GRID_HOME/install/response 目录中。
所有响应文件模板都包含注释、示例格式、示例和其他有用的说明。阅读响应文件说明以了解如何为响应文件变量指定值,以便您可以自定义安装。
GI 软件模板 /u01/app/19.0.0/grid/install/response/gridsetup.rsp
DB 软件模板 /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
监听模板 /u01/app/oracle/product/19.0.0/dbhome_1/assistants/netca/netca.rsp
建库模板 /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/dbca.rsp
3.编辑 DB 响应文件
cd /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
cat $ORACLE_HOME/install/response/db_install.rsp | grep -v ^# | grep -v ^$ > /home/oracle/db_install.rsp
需要修改以下内容
vi /home/oracle/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY // 安装类型
UNIX_GROUP_NAME=oinstall // 安装组
INVENTORY_LOCATION=/u01/app/oraInventory //INVENTORY目录(不填就是默认值)
SELECTED_LANGUAGES=en,zh_CN,zh_TW // 选择语言,默认英文,可用逗号分割选择其他语言,可不用修改
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 //oracle_home
ORACLE_BASE=/u01/app/oracle //oracle_base
oracle.install.db.InstallEdition=EE // oracle版本
oracle.install.db.DBA_GROUP=dba // dba用户组
oracle.install.db.OSOPER_GROUP=oinstall // oper用户组
oracle.install.db.OSBACKUPDBA_GROUP=backupdba //备份用户组
oracle.install.db.OSDGDBA_GROUP=dgdba //
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=false //自动执行 root 脚本设置为 true 或者 false 手动执行脚本
4.静默安装软件的同时打补丁
$ORACLE_HOME/runInstaller -ignorePrereq -waitforcompletion -silent -applyRU /u01/soft/33859214/33803476/33806152 -responseFile /home/oracle/db_install.rsp
使用如下命令静默安装软件,后期打补丁。
$ORACLE_HOME/runInstaller --help
$ORACLE_HOME/runInstaller -silent -responseFile /home/oracle/db_install.rsp
5.创建 19c 默认监听
$ netca /silent /responsefile /u01/app/oracle/product/19.0.0/dbhome_1/assistants/netca/netca.rsp
6.装完软件打补丁
打补丁看这个就够了 https://mp.weixin.qq.com/s/VGyb-UjbI1IFo1llEfVduQ
准备数据存放目录,闪回存放目录
# mkdir -p /u01/app/oracle/oradata
# mkdir -p /u01/app/oracle/fast_recovery_area
--本次不使用静默文件直接通过命令行的方式创建实例,非容器数据库(8G 内存)。
dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
-gdbname testogg -sid test \
-createAsContainerDatabase false \
-sysPassword Oracle -systemPassword Oracle \
-datafileDestination '/u01/app/oracle/oradata' \
-recoveryAreaDestination '/u01/app/oracle/flash_recovery_area' \
-redoLogFileSize 1024 \
-storageType FS \
-characterset AL32UTF8 -nationalCharacterSet AL16UTF16 \
-sampleSchema true \
-totalMemory 8192 \
-databaseType MULTIPURPOSE \
-emConfiguration NONE
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname CCIDE -responseFile NO_VALUE -characterSet AL32UTF8 -sysPassword Oracle -systemPassword Oracle -createAsContainerDatabase true -numberOfPDBs 1 -pdbName INTPDB1 -pdbAdminPassword Oracle -databaseType MULTIPURPOSE -automaticMemoryManagement false -datafileDestination '/data/CCIDE/oradata/CCIDE' -totalMemory 20480 -redoLogFileSize 1024 -emConfiguration NONE -ignorePreReqs -storageType FS -recoveryAreaDestination NONE
另外本文已经生成 PDF 文件,可在公众号后台回复【静默安装指南】获取文件以及惠星星老师的一键安装脚本。
二、单机 ASM 静默安装
# /usr/sbin/groupadd -g 1000 oinstall
# /usr/sbin/groupadd -g 1020 asmadmin
# /usr/sbin/groupadd -g 1021 asmdba
# /usr/sbin/groupadd -g 1022 asmoper
# /usr/sbin/groupadd -g 1031 dba
# /usr/sbin/groupadd -g 1032 oper
# /usr/sbin/useradd -u 1100 -g oinstall -G asmadmin,asmdba grid
# /usr/sbin/useradd -u 1101 -g oinstall -G dba,asmdba oracle
# mkdir -p /u01/app/11.2.0/grid
# mkdir -p /u01/app/grid
# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
# chown grid:oinstall /u01/app/11.2.0/grid
# chown grid:oinstall /u01/app/grid
# chown oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/
# chown -R grid:oinstall /u01
## https://docs.oracle.com/cd/E11882_01/install.112/e41961/prelinux.htm#CWLIN205
1.修改 GI 响应文件
cp /soft/grid/response/grid_install.rsp /soft/grid/response/grid_install.rsp.bak
–-响应文件配置如下:
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=RAC
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=HA_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=
oracle.install.crs.config.gpnp.scanPort=
oracle.install.crs.config.clusterName=
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=
oracle.install.crs.config.clusterNodes=
oracle.install.crs.config.networkInterfaceList=
oracle.install.crs.config.storageOption=
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=oracle
oracle.install.asm.diskGroup.name=DATADG
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/asm-diskb,/dev/asm-diskc
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.monitorPassword=oracle
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=0
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
2.查看响应文件并安装 GI
cat /soft/grid/response/grid_install.rsp | grep -v ^# | grep -v ^$
/soft/grid/runInstaller -silent -showProgress -ignoreSysPrereqs -ignorePrereq -responseFile /soft/grid/response/grid_install.rsp
3.执行 root 脚本
打开新的窗口用 root 用户执行下面两个脚本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/11.2.0/grid/root.sh
在 grid 用户下面执行
vi /home/grid/cfgrsp.properties
oracle.assistants.asm|S_ASMPASSWORD=oracle
oracle.assistants.asm|S_ASMMONITORPASSWORD=oracle
/u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties
crsctl status res -t
5.创建新的磁盘组
asmca -silent -configureASM -sysAsmPassword oracle -asmsnmpPassword oracle -diskGroupName ARCH -diskList /dev/asm-diske,/dev/asm-diskd -redundancy NORMAL
6.创建监听
test-adg:/home/grid(+ASM1)$ netca -silent -responsefile /u01/app/11.2.0/grid/assistants/netca/netca.rsp
7. 仅安装 DB 软件
下面在 Oracle 用户下执行
/u01/soft/database/response/db_install.rsp 文件配置如下
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=test-adg
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle
.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=900
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=ASM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=DATADG
oracle.install.db.config.asm.ASMSNMPPassword=oracle
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
cat /u01/soft/database/response/db_install.rsp | grep -v ^# | grep -v ^$
/u01/soft/database/runInstaller -silent -showProgress -ignoreSysPrereqs -ignorePrereq -responseFile /u01/soft/database/response/db_install.rsp
9.dbca 创建实例
dbca -silent
-createDatabase
-asmsnmpPassword oracle
-characterSet AL32UTF8
-continueOnNonFatalErrors false
-disableSecurityConfiguration ALL
-diskGroupName DATADG
-emConfiguration NONE
-gdbName jiekeadg
-listeners LISTENER
-memoryPercentage 50
-recoveryAreaDestination ARCH
-sid jiekeadg
-sysPassword oracle
-systemPassword oracle
-storageType ASM
-sampleSchema true
-templateName General_Purpose.dbc
mkdir -p /u01/app/19.0.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u01/app/oraInventory
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
/usr/sbin/useradd -u 54331 -g oinstall -G dba,asmdba,backupdba,asmoper,asmadmin,dgdba,kmdba,racdba grid
--设密码
passwd grid
passwd oracle
--如果组有问题,用如下命令修改
/usr/sbin/usermod -G oinstall,dba,oper,asmdba,asmadmin,asmoper grid
$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),
54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)
$ id grid
uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),
54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)
# chown -R oracle:oinstall /u01/app/oracle
# chown -R grid:oinstall /u01/app/oraInventory
# chown -R grid:oinstall /u01
# chmod -R 775 /u01/
## https://docs.oracle.com/en/database/oracle/oracle-database/19/cwlin/identifying-an-oracle-software-owner-user-account.html#GUID-0A95F4B1-1045-455D-9897-A23012E4E27F
1.编辑 GI 响应文件
模板 /u01/app/19.0.0/grid/inventory/response/grid_install.rsp
cat /u01/app/19.0.0/grid/inventory/response/grid_install.rsp | grep -v ^# | grep -v ^$ > /home/grid/grid_install.rsp
--vim grid_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=HA_CONFIG
ORACLE_BASE=/u01/app/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=false
oracle.install.crs.config.useIPMI=false
oracle.install.asm.SYSASMPassword=Password123!
oracle.install.asm.diskGroup.name=DATA
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=4
oracle.install.asm.diskGroup.disks=/dev/asm-diskb,/dev/asm-diskc,/dev/asm-diskd
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.monitorPassword=Password123!
oracle.install.asm.configureAFD=false
oracle.install.crs.configureRHPS=false
oracle.install.crs.config.ignoreDownNodes=false
oracle.install.config.managementOption=NONE
oracle.install.config.omsPort=0
oracle.install.crs.rootconfig.executeRootScript=false
# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster
# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server
# - UPGRADE : To register home and upgrade clusterware software of earlier release
# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster
# or stand alone server later)
# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand
# alone server later. This is only supported on Windows.)
# Configure AFD - ASM Filter Driver
# Applicable only for FLEX_ASM_STORAGE option
# Specify 'true' if you want to configure AFD, else specify 'false'
2. 安装前 precheck
--检查结果如果有问题按提示调整
/u01/app/19.0.0/grid/runcluvfy.sh stage -pre crsinst -n jiekeadg -fixup -verbose
3.静默安装 GI
$ORACLE_HOME/gridSetup.sh -silent -responseFile /home/grid/grid_install.rsp
4.执行 root 脚本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/19.0.0/grid/root.sh
执行完 root.sh 脚本后,执行 executeConfigTools 配置,更新节点信息。
--配置命令
/u01/app/19.0.0/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid_install.rsp -silent
6.创建 ARCH 磁盘组
su - grid
sqlplus / as sysasm
create diskgroup ARCH EXTERNAL redundancy disk '/dev/asmdisks/asm-arch01','/dev/asmdisks/asm-arch02' attribute 'compatible.rdbms'='19.0','compatible.asm'='19.0','au_size'='4M';
7.编辑响应文件
安装包:LINUX.X64_193000_db_home.zip
模板路径:/u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
su - oracle
cd $ORACLE_HOME
unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
cat $ORACLE_HOME/install/response/db_install.rsp | grep -v ^# | grep -v ^$ > /home/oracle/db_install.rsp
vi /home/oracle/db_install.rsp
--需要修改以下内容
oracle.install.option=INSTALL_DB_SWONLY // 安装类型
UNIX_GROUP_NAME=oinstall // 安装组
INVENTORY_LOCATION=/u01/app/oraInventory //INVENTORY目录(不填就是默认值)
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 //oracle_home
ORACLE_BASE=/u01/app/oracle //oracle_base
oracle.install.db.InstallEdition=EE // oracle版本
oracle.install.db.DBA_GROUP=dba // dba用户组
oracle.install.db.OSOPER_GROUP=oinstall // oper用户组
oracle.install.db.OSBACKUPDBA_GROUP=backupdba //备份用户组
oracle.install.db.OSDGDBA_GROUP=dgdba //
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.CLUSTER_NODES=jiekeadg
oracle.install.db.rootconfig.executeRootScript=false //自动执行 root 脚本设置为 true 或者 false 手动执行脚本
8.仅安装 DB 软件
使用上面响应文件安装仅软件,参考命令如下:
$ORACLE_HOME/runInstaller -silent -responseFile /home/oracle/db_install.rsp
执行 root 脚本
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
模板 /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/dbca.rsp
如果是搭建 ADG 备库,那么这一步不需要做,直接进行 ADG 搭建操作,如果是安装单机主库可以参考前面单机建库步骤,打补丁也是参考前面单机步骤。
$ cd $ORACLE_HOME/oui/prov/resources/scripts
$ ./sshUserSetup.sh -user grid -hosts "jieke1 jieke2" -advanced -confirm -noPromptPassphrase
$ ./sshUserSetup.sh -user oracle -hosts "jieke1 jieke2" -advanced -confirm -noPromptPassphrase
分别使用 grid 和 oracle 用户验证 SSH connectivity:
$ for h in jieke1 jieke1-priv jieke2 jieke2-priv;do
ssh -l grid -o StrictHostKeyChecking=no $h date;
done
$ for h in jieke1 jieke1-priv jieke2 jieke2-priv;do
ssh -l oracle -o StrictHostKeyChecking=no $h date;
done
./runcluvfy.sh stage -pre crsinst -n host01,host02 -verbose -fixup
3.GI 集群件静默安装
安装 GI
./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \
INVENTORY_LOCATION=/app/oraInventory \
SELECTED_LANGUAGES=en \
ORACLE_BASE=/app/grid \
ORACLE_HOME=/app/product/11.2.0/grid \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSOPER=asmoper \
oracle.install.asm.OSASM=asmadmin \
oracle.install.crs.config.storageOption=ASM_STORAGE \
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=EXTERNAL \
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL \
oracle.install.crs.config.useIPMI=false \
oracle.install.asm.diskGroup.name=OCR \
oracle.install.asm.diskGroup.redundancy=EXTERNAL \
oracle.installer.autoupdates.option=SKIP_UPDATES \
oracle.install.crs.config.gpnp.scanPort=1521 \
oracle.install.crs.config.gpnp.configureGNS=false \
oracle.install.option=CRS_CONFIG \
oracle.install.asm.SYSASMPassword=oracle11g \
oracle.install.asm.monitorPassword=oracle11g \
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/rhdisk* \
oracle.install.asm.diskGroup.disks=/dev/rhdisk5,/dev/rhdisk6,/dev/rhdisk7 \
oracle.install.crs.config.gpnp.scanName=db-cluster-scan \
oracle.install.crs.config.clusterName=db-cluster-scan \
oracle.install.crs.config.autoConfigureClusterNodeVIP=false \
oracle.install.crs.config.clusterNodes=idc_jieker1:idc_jieker1-vip,idc_jieker2:idc_jieker2-vip \
oracle.install.crs.config.networkInterfaceList=eth0:192.16.18.0:1,eth1:172.16.0.0:2 \
ORACLE_HOSTNAME=idc_jieker1
ORACLE_HOSTNAME 当前安装节点的计算机名称.
oracle.install.option=CRS_CONFIG
#4 个选项提供,表示要做的操作
# - CRS_CONFIG : To configure Grid Infrastructure for cluster
# - HA_CONFIG : To configure Grid Infrastructure for stand alone server
# - UPGRADE : To upgrade clusterware software of earlier release
# - CRS_SWONLY : To install clusterware files only (can be configured for cluster
# or stand alone server later)
# scan 名称,和 /etc/hosts 对应
oracle.install.crs.config.gpnp.scanName=db-cluster-scan
# 集群监听端口号
oracle.install.crs.config.gpnp.scanPort=1521
# cluster 名称,也可以和 scan 一样,也可以保持默认
oracle.install.crs.config.clusterName=db-cluster-scan
#configureGNS 为 false,表示不配置 GNS
oracle.install.crs.config.gpnp.configureGNS=false
#autoConfigureClusterNodeVIP 这个参数为配置 GNS 后续参数之一,如果不开启GNS,这里指定 false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
# 节点信息,跟 /etc/hosts 对应
oracle.install.crs.config.clusterNodes=idc_jieker1:idc_jieker1-vip,idc_jieker2:idc_jieker2-vip
# 网卡信息和网段,对应 ifconfig 结果(两个节点的网卡名称需要一致),1 代表public,2 代表 private,3 代表在群集中不使用该网卡
oracle.install.crs.config.networkInterfaceList=eth0:192.16.18.0:1,eth1:172.16.0.0:2
# 存储形式,使用 ASM 的话保持默认即可(可以不修改),2 个值提供
# - ASM_STORAGE
# - FILE_SYSTEM_STORAGE
oracle.install.crs.config.storageOption=ASM_STORAGE
# 表决盘名称(可以不修改)默认为 OCR
oracle.install.asm.diskGroup.name=OCR
# 表决盘冗余选项(接受以下 3 个选项)
# HIGH 高冗余:最少 5 块磁盘,Oracle ASM 默认提供三重镜像。可以容忍在不同故障组中丢失两个 Oracle ASM 磁盘。
# NORMAL 正常冗余:最少 3 块磁盘,Oracle ASM 默认提供双向镜像,这意味着镜像所有文件,以便每个范围有两个副本。容许丢失一个磁盘。
# EXTERNAL 外部冗余:最少 1 块盘,由外部 RAID 提供冗余。
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
# 表决盘所使用的裸盘,根据需要修改
oracle.install.asm.diskGroup.disks=/dev/rhdisk5,/dev/rhdisk6,/dev/rhdisk7
4.创建 ASM 磁盘组
asmca -silent -configureASM -sysAsmPassword oracle -asmsnmpPassword oracle -diskGroupName ARCH -diskList /dev/asm-diske,/dev/asm-diskd -redundancy NORMAL
su - grid
sqlplus / as sysasm
Connected.
SQL> create diskgroup data external redundancy disk '/dev/asm-diske';
Diskgroup created.
select name from v$parameter where isdefault='FALSE' union select name from v$system_parameter where ismodified='MODIFIED';
----19c 创建 ASM 磁盘组
CREATE DISKGROUP DATA EXTERNAL REDUNDANCY DISK '/dev/asm_data01' SIZE 10240M DISK '/dev/asm_data02' SIZE 10240M ATTRIBUTE 'compatible.asm'='19.0.0.0.0','compatible.advm'='19.0.0.0','au_size'='4M';
5.仅安装 DB 软件
安装如果出现 INS-35354 则在/app/oraInventory/ContentsXML/inventory.xml 文件里 这一行”与 > 之间加入 CRS=”true”
./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \
oracle.install.option=INSTALL_DB_SWONLY \
DECLINE_SECURITY_UPDATES=true \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/app/oraInventory \
SELECTED_LANGUAGES=en \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.EEOptionsSelection=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=asmoper \
oracle.install.db.isRACOneInstall=false \
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
oracle.installer.autoupdates.option=SKIP_UPDATES \
ORACLE_HOME=/app/product/11.2.0/db \
ORACLE_BASE=/app/oracle \
ORACLE_HOSTNAME=idc_jieker1 \
oracle.install.db.CLUSTER_NODES=idc_jieker1,idc_jieker2 \
oracle.install.db.isRACOneInstall=false
#安装选项,3个值可选
# - INSTALL_DB_SWONLY #只安装rdbms
# - INSTALL_DB_AND_CONFIG #安装rdbms和instance
# - UPGRADE_DB #升级安装
oracle.install.option=INSTALL_DB_SWONLY
#指定当前安装节点的主机名
ORACLE_HOSTNAME=idc_jieker1
#指定日志路径
INVENTORY_LOCATION=/app/oracle/oraInventory
#指定语言,en: English,zh_CN: Simplified Chinese。多个语言用逗号分隔
SELECTED_LANGUAGES=en
#指定安装的版本,4个值可选
# - EE : Enterprise Edition
# - SE : Standard Edition
# - SEONE : Standard Edition One
# - PE : Personal Edition (WINDOWS ONLY)
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=
#指定组权限
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
#指定节点名称,一般使用主机名
oracle.install.db.CLUSTER_NODES=idc_jieker1,idc_jieker2
#是否安装 rac 一个节点
# - true : Value of RAC One Node service name is used.
# - false : Value of RAC One Node service name is not used.
oracle.install.db.isRACOneInstall=false
dbca -silent \
-createDatabase \
-responseFile NO_VALUE \
-templateName General_Purpose.dbc \
-sid piccyx \
-gdbname jieke \
-NODELIST jieker1,jieker2 \
-characterSet AL32UTF8 \
-sysPassword oracle11g \
-systemPassword oracle11g \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement FALSE \
-totalMemory 102400 \
-storageType ASM \
-datafileDestination +DATA \
-recoveryAreaDestination +ARCH \
-redoLogFileSize 1024 \
-emConfiguration NONE \
-sampleSchema FALSE
补丁安装
AIX 操作系统下 11G RAC 执行补丁190716 简要步骤
https://www.modb.pro/doc/4638
移除 oracle home
如果是正常删除节点,需要在被删除节点上执行以下操作,如果是损坏则不需要
su - oracle
cd $ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={db01(代表要删除的节点)}" -local
静默删库
dbca -silent -deleteDatabase -sourcedb prod
DB 软件静默卸载
$ORACLE_HOME/deinstall/deinstall -local
GI 静默卸载
$ORACLE_HOME/deinstall/deinstall -local
Deinstall卸载Oracle软件及数据库+GI集群软件
19c RAC 安装之前已经写过两篇文章了,从零到一超级详细,感兴趣的可以点此查看。下面简单提提重要的部分:
GI 响应文件
/u01/app/19.0.0/grid/install/response
${ORACLE_HOME}/install/response/gridsetup.rsp
DB 响应文件位置 $ORACLE_HOME/install/response/db_install.rsp
参数说明:
oracle.install.crs.config.clusterNodes=网卡名:公网IP地址段:1,私网网卡名:私网IP地址段:5
这里的 1 代表 PUBLIC,5 代表 ASM & PRIVATE
#############################################################################
oracle.install.crs.config.clusterNodes=
#############################################################################
The value should be a comma separated strings where each string is as shown below
InterfaceName:SubnetAddress:InterfaceType
where InterfaceType can be either "1", "2", "3", "4", or "5"
InterfaceType stand for the following values
1 : PUBLIC
2 : PRIVATE
3 : DO NOT USE
4 : ASM
5 : ASM & PRIVATE
#
For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3
#############################################################################
12.2:Post upgrade steps for Grid infrastructure reports INS-32601 error (Doc ID 2380863.1)
2.GI 静默安装
$ORACLE_HOME/gridSetup.sh -silent -applyRU /home/soft/32900083/32895426 -force -noconfig -ignorePrereq -waitforcompletion \
-responseFile ${ORACLE_HOME}/install/response/gridsetup.rsp \
INVENTORY_LOCATION=/u01/app/oraInventory \
ORACLE_BASE=/u01/app/grid \
ORACLE_HOME=/u01/app/19.0.0/grid \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSOPER=asmoper \
oracle.install.asm.OSASM=asmadmin \
oracle.install.crs.config.storageOption=ASM \
oracle.install.crs.config.useIPMI=false \
oracle.install.asm.diskGroup.name=OCR \
oracle.install.asm.diskGroup.AUSize=4 \
oracle.install.asm.diskGroup.redundancy=NORMAL \
oracle.install.crs.config.ClusterConfiguration=STANDALONE \
oracle.install.crs.config.configureAsExtendedCluster=false \
oracle.install.crs.config.gpnp.scanPort=1521 \
oracle.install.crs.config.gpnp.configureGNS=false \
oracle.install.option=CRS_CONFIG \
oracle.install.asm.SYSASMPassword=Oracle19C \
oracle.install.asm.monitorPassword=Oracle19C \
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm_* \
oracle.install.asm.diskGroup.disks=/dev/asm_ocr01,/dev/asm_ocr02,/dev/asm_ocr03 \
oracle.install.crs.config.gpnp.scanName=jiekexu-racscan \
oracle.install.crs.config.clusterName=jiekexu-racscan \
oracle.install.crs.config.autoConfigureClusterNodeVIP=false \
oracle.install.crs.config.clusterNodes=jiekexu-r1:jiekexu-r1-vip,jiekexu-r2:jiekexu-r2-vip \
oracle.install.crs.config.networkInterfaceList=ens32:192.168.75.0:1,ens33:10.10.10.0:5 \
oracle.install.asm.configureGIMRDataDG=false \
oracle.install.crs.configureRHPS=false \
oracle.install.crs.config.ignoreDownNodes=false \
oracle.install.config.managementOption=NONE \
oracle.install.config.omsPort=0 \
oracle.install.crs.rootconfig.executeRootScript=false
--root 脚本执行
/u01/app/oraInventory/orainstRoot.sh
/u01/app/19.0.0/grid/root.sh
asmca -silent -createDiskGroup -sysAsmPassword Oracle_19c -asmsnmpPassword Oracle_19c -oui_internal -diskString '/dev/asm_*' -diskGroupName ARCH -diskList /dev/asm_arch01 -redundancy EXTERNAL -au_size 4 -compatible.asm 19.0.0.0.0
--或者直接在 ASM 实例执行
su - grid
sqlplus / as sysasm
CREATE DISKGROUP DATA EXTERNAL REDUNDANCY DISK '/dev/asm_data01' SIZE 102400M DISK '/dev/asm_data01' SIZE 102400M ATTRIBUTE 'compatible.asm'='19.0.0.0.0','compatible.advm'='19.0.0.0','au_size'='4M';
5.DB 软件安装
$ORACLE_HOME/runInstaller -ignorePrereq -waitforcompletion -silent -applyRU /home/soft/32900083/32895426 \
-responseFile $ORACLE_HOME/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=/u01/app/oraInventory \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSOPER_GROUP=oper \
oracle.install.db.OSBACKUPDBA_GROUP=backupdba \
oracle.install.db.OSDGDBA_GROUP=dgdba \
oracle.install.db.OSKMDBA_GROUP=kmdba \
oracle.install.db.OSRACDBA_GROUP=racdba \
oracle.install.db.CLUSTER_NODES=jiekexu-r1,jiekexu-r2
字符集为 32UTF8
DBCA 建库
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname JiekeXu -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword Oracle19c \
-systemPassword Oracle19c \
-createAsContainerDatabase false \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 8192 \
-redoLogFileSize 1024 \
-emConfiguration NONE \
-ignorePreReqs \
-nodelist jiekexu-r1,jiekexu-r2 \
-storageType ASM \
-diskGroupName +DATA \
-asmsnmpPassword Oracle19c \
-recoveryAreaDestination NONE
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname JiekeXu -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword Oracle_19C \
-systemPassword Oracle_19C \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName JiekeXupdb1 \
-pdbAdminPassword Oracle_19C \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 1500 \
-redoLogFileSize 1024 \
-emConfiguration NONE \
-ignorePreReqs \
-nodelist jiekexu-r1,jiekexu-r2 \
-storageType ASM \
-diskGroupName +DATA \
-asmsnmpPassword Oracle_19C \
-recoveryAreaDestination NONE
Linux RPM:https://www.oracle.com/database/technologies/free-downloads.html
在线文档:https://docs.oracle.com/en/database/oracle/oracle-database/23/index.html
服务器规格:8C16G 要求 2c4g
主机名: jiekexu
主机 IP: 192.168.75.15
OS 版本:Oracle Linux 8.7
--修改主机名和配置hosts
[root@jiekexu etc]# cat /etc/oracle-release
Oracle Linux Server release 8.7
[root@jiekexu etc]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.7"
设置主机名
hostnamectl set-hostname jiekexu # 设置
hostname # 查看
关闭防火墙与 Selinux
防火墙和selinux按照需求关闭,检查时区
关闭防火墙
systemctl stop firewalld.service #停止 firewall
systemctl disable firewalld.service #禁止 firewall开机启动
systemctl status firewalld.service #检查
时区检查
东八区"Asia/Shanghai"
timedatectl status # Time zone: Asia/Shanghai (CST, +0800)
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
setenforce 0 # 输入 getenforce 返回 Permissive 则是临时关闭状态,# 重启后是 Disabled ,完全关闭状态。
getenforce
sestatus
sed -i.bak '/SELINUX/s/enforcing/disabled/' /etc/sysconfig/selinux
echo "SELINUX=disabled" > /etc/selinux/config
echo "#SELINUXTYPE=targeted " >> /etc/selinux/config
getenforce
setenforce 0
[root@jiekexu etc]# cd /soft
[root@jiekexu soft]# ll
total 1717588
-rw-r--r--. 1 root root 1758776440 Apr 20 15:37 oracle-database-free-23c-1.0-1.el8.x86_64.rpm
-rw-r--r--. 1 root root 30688 Apr 20 15:24 oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
2.2使用 rpm 安装时需要依赖包
[root@jiekexu soft]# rpm -ivh oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
warning: oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
error: Failed dependencies:
compat-openssl10 is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
glibc-devel is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
ksh is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
libnsl is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
make is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
sysstat is needed by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
那就配置一个本地 yum 源在安装吧,这里简单演示如下。
上传 OracleLinux-R8-U7-x86_64-dvd.iso 到 /root 然后创建挂载目录 /iso 进行挂载。
# mkdir /iso
# mount /root/OracleLinux-R8-U7-x86_64-dvd.iso /iso
# cd /etc/yum.repos.d/
# mv oracle-linux-ol8.repo oracle-linux-ol8.repo_bak
# mv uek-ol8.repo uek-ol8.repo_bak
# vi oracle-linux-ol8.repo
[ol8_app]
name=Oracle Linux 8
baseurl=file:///iso/BaseOS
gpgcheck=0
enabled=1
[ol8_AppStream]
name=Oracle Linux 8 AppStream
baseurl=file:///iso/AppStream
gpgcheck=0
enabled=1
[root@jiekexu yum.repos.d]# yum list | grep zsh
zsh.x86_64 5.5.1-10.el8 ol8_app
zsh-html.noarch 5.5.1-10.el8 ol8_AppStream
[root@jiekexu soft]# dnf -y install oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
[root@jiekexu soft]# dnf -y install oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
Last metadata expiration check: 0:08:55 ago on Tue 16 May 2023 11:18:13 AM CST.
Dependencies resolved.
=============================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================
Installing:
oracle-database-preinstall-23c x86_64 1.0-0.5.el8 @commandline 30 k
Installing dependencies:
compat-openssl10 x86_64 1:1.0.2o-4.el8_6 ol8_AppStream 1.1 M
glibc-devel x86_64 2.28-211.0.1.el8 ol8_app 83 k
ksh x86_64 20120801-257.0.1.el8 ol8_AppStream 929 k
libnsl x86_64 2.28-211.0.1.el8 ol8_app 105 k
libxcrypt-devel x86_64 4.1.1-6.el8 ol8_app 25 k
lm_sensors-libs x86_64 3.4.0-23.20180522git70f7e08.el8 ol8_app 59 k
make x86_64 1:4.2.1-11.el8 ol8_app 498 k
sysstat x86_64 11.7.3-7.0.1.el8 ol8_AppStream 426 k
Transaction Summary
=============================================================================================================================================================================================
Install 9 Packages
Total size: 3.2 M
Installed size: 9.4 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libxcrypt-devel-4.1.1-6.el8.x86_64 1/9
Installing : glibc-devel-2.28-211.0.1.el8.x86_64 2/9
Running scriptlet: glibc-devel-2.28-211.0.1.el8.x86_64 2/9
Installing : make-1:4.2.1-11.el8.x86_64 3/9
Running scriptlet: make-1:4.2.1-11.el8.x86_64 3/9
Installing : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 4/9
Running scriptlet: compat-openssl10-1:1.0.2o-4.el8_6.x86_64 4/9
Installing : ksh-20120801-257.0.1.el8.x86_64 5/9
Running scriptlet: ksh-20120801-257.0.1.el8.x86_64 5/9
Installing : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/9
Running scriptlet: lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/9
Installing : sysstat-11.7.3-7.0.1.el8.x86_64 7/9
Running scriptlet: sysstat-11.7.3-7.0.1.el8.x86_64 7/9
Installing : libnsl-2.28-211.0.1.el8.x86_64 8/9
Installing : oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 9/9
Running scriptlet: oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 9/9
Verifying : glibc-devel-2.28-211.0.1.el8.x86_64 1/9
Verifying : libnsl-2.28-211.0.1.el8.x86_64 2/9
Verifying : libxcrypt-devel-4.1.1-6.el8.x86_64 3/9
Verifying : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 4/9
Verifying : make-1:4.2.1-11.el8.x86_64 5/9
Verifying : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 6/9
Verifying : ksh-20120801-257.0.1.el8.x86_64 7/9
Verifying : sysstat-11.7.3-7.0.1.el8.x86_64 8/9
Verifying : oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 9/9
Installed:
compat-openssl10-1:1.0.2o-4.el8_6.x86_64 glibc-devel-2.28-211.0.1.el8.x86_64 ksh-20120801-257.0.1.el8.x86_64 libnsl-2.28-211.0.1.el8.x86_64
libxcrypt-devel-4.1.1-6.el8.x86_64 lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 make-1:4.2.1-11.el8.x86_64 oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
sysstat-11.7.3-7.0.1.el8.x86_64
Complete!
执行完 preinstall rpm包,相关 rpm 已经安装上了,并且也创建好了 Oracle 用户和相关组,关闭了透明大页和 numa,并且修改了所需要的内核参数。
[root@jiekexu soft]# cat /etc/passwd | grep oracle
oracle:x:54321:54321::/home/oracle:/bin/bash
[root@jiekexu soft]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
使用安装命令:
dnf -y install oracle-database-free-23c-1.0-1.el8.x86_64.rpm
Last metadata expiration check: 1:53:13 ago on Tue 16 May 2023 12:32:40 PM CST.
Dependencies resolved.
=============================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================
Installing:
oracle-database-free-23c x86_64 1.0-1 @commandline 1.6 G
Transaction Summary
=============================================================================================================================================================================================
Install 1 Package
Total size: 1.6 G
Installed size: 5.2 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
Installing : oracle-database-free-23c-1.0-1.x86_64 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database Free, optionally modify the parameters in '/etc/sysconfig/oracle-free-23c.conf' and then run '/etc/init.d/oracle-free-23c configure' as root.
Verifying : oracle-database-free-23c-1.0-1.x86_64 1/1
Installed:
oracle-database-free-23c-1.0-1.x86_64
Complete!
‘/etc/sysconfig/oracle-free-23c.conf’ 和 '/etc/init.d/oracle-free-23c’ 是配置实例的文件,假如想修改实例名、ORACLE_HOME家目录、DBFILE_DEST 等可以自行修改,可参考我以前 19c rpm 安装的过程 https://www.modb.pro/db/26584。
本次为了方便直接运行脚本:
/etc/init.d/oracle-free-23c configure
[root@jiekexu soft]# /etc/init.d/oracle-free-23c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
************
Enter SYSTEM user password:
********
Enter PDBADMIN User Password:
***********
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
36% complete
39% complete
43% complete
Completing Database Creation
47% complete
49% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.
Connect to Oracle Database using one of the connect strings:
Pluggable database: jiekexu/FREEPDB1
Multitenant container database: jiekexu
su - oracle
vi .bash_profile
export ORACLE_HOME=/opt/oracle/product/23c/dbhomeFree
export ORACLE_SID=FREE
export PDB_NAME=FREEPDB1
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib
export PATH=${ORACLE_HOME}/bin:${ORACLE_HOME}/OPatch:$OGG_HOME:${PATH}
export HOST=`hostname | cut -f1 -d"."`
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$OGG_HOME:/lib/usr/lib:/usr/local/lib
#export PS1='${HOST}:$PWD(${ORACLE_SID})$ '
# General exports and vars
export PATH=$ORACLE_HOME/bin:$PATH
LSNR=$ORACLE_HOME/bin/lsnrctl
SQLPLUS=$ORACLE_HOME/bin/sqlplus
alias sys='sqlplus / as sysdba'
stty erase ^H
--source .bash_profile
全文完,希望可以帮到正在阅读的你,如果觉得此文对你有帮助,可以分享给你身边的朋友,同事,你关心谁就分享给谁,一起学习共同进步~~~
欢迎关注我公众号【JiekeXu DBA之路】,第一时间一起学习新知识!以下三个地址可以找到我,其他地址均属于盗版侵权爬取我的文章,而且代码格式、图片等均有错乱,不方便阅读,欢迎来我公众号或者墨天轮地址关注我,第一时间收获最新消息。
——————————————————————————
公众号:JiekeXu DBA之路
CSDN :https://blog.csdn.net/JiekeXu
墨天轮:https://www.modb.pro/u/4347
腾讯云:https://cloud.tencent.com/developer/user/5645107
——————————————————————————
OGG|Oracle GoldenGate 基础2022 年公众号历史文章合集整理
OGG|Oracle 数据迁移后比对一致性
Linux 环境搭建 MySQL8.0.28 主从同步环境