CentOS7安装Oracle-19c

本文目标

CentOS7使用rpm安装Oracle19c企业版

安装前准备

yum update (可选)
yum install -y compat-libcap1 compat-libstdc+±33 gcc-c++ ksh libaio-devel libstdc+±devel elfutils-libelf-devel fontconfig-devel libXrender-devel libXtst

Oracle下载

pre安装包
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html
oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
企业版
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c
oracle-database-ee-19c-1.0-1.x86_64.rpm
客户端(Windows连接使用)
https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
instantclient-basic-windows.x64-19.17.0.0.0dbru.zip

安装pre

[root@hostyyx ~]# ll
total 2631536
-rw-------. 1 root root       1508 Dec  1 20:06 anaconda-ks.cfg
-rw-r--r--. 1 root root 2694664264 Dec  4 20:19 oracle-database-ee-19c-1.0-1.x86_64.rpm
-rw-r--r--. 1 root root      18204 Dec  4 18:08 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
[root@hostyyx ~]# yum localinstall ^C
[root@hostyyx ~]# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: oracle-database-preinstall-19c-1.0-1.el7.x86_64
Marking oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: bind-utils for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * centos-sclo-rh: ftp.sjtu.edu.cn
 * centos-sclo-sclo: ftp.sjtu.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: ftp.sjtu.edu.cn
--> Processing Dependency: nfs-utils for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: psmisc for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
....省略

安装Oracle

[root@hostyyx ~]# yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Loaded plugins: fastestmirror
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
 Package                               Arch                  Version                 Repository                                           Size
===============================================================================================================================================
Installing:
 oracle-database-ee-19c                x86_64                1.0-1                   /oracle-database-ee-19c-1.0-1.x86_64                6.9 G

Transaction Summary
===============================================================================================================================================
Install  1 Package

Total size: 6.9 G
Installed size: 6.9 G
...省略

初始化数据库

[root@hostyyx ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
。。。省略

/etc/profile

export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin 
export ORACLE_SID=ORCLCDB

配置数据库内容

[oracle@hostyyx ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:55:24 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
-- 创建容器用户
SQL> create user c##yinyx identified by yinyx;

User created.
-- 赋权
SQL> grant create user,drop user,alter user,create any view,connect,resource,dba,create session,create any sequence to c##yinyx;

Grant succeeded.
-- 切换到PDB实例
SQL> alter session set container=ORCLPDB1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
ORCLPDB1
-- 创建PDB内的用户
SQL> create user yinyx identified by yinyx;

User created.
-- 赋权
SQL> grant create user,drop user,alter user,create any view,connect,resource,dba,create session,create any sequence to yinyx;

Grant succeeded.

SQL> quit;

验证安装是否正确

-- 验证容器用户是否正常
[oracle@hostyyx ~]$ sqlplus c##yinyx/yinyx@192.168.31.224/orclcdb

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:59:57 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

-- 验证PDB用户是否正常
[oracle@hostyyx ~]$ sqlplus yinyx/yinyx@192.168.31.224/orclpdb1

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:59:49 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

重启操作系统后,手工启动数据库

[root@hostyyx ~]# su - oracle
Last login: Fri Dec 30 08:59:38 CST 2022 on pts/8
[oracle@hostyyx ~]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 29-JAN-2023 00:19:25

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/hostyyx/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostyyx)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostyyx)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                29-JAN-2023 00:19:27
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/hostyyx/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostyyx)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@hostyyx ~]$ sqlplus /nolog

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jan 29 00:19:51 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1593832664 bytes
Fixed Size		    9135320 bytes
Variable Size		 1241513984 bytes
Database Buffers	  335544320 bytes
Redo Buffers		    7639040 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> quit;
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@hostyyx ~]$ 

最后使用Navicat连接

工具->选型->环境,配置oci.dll路径到解压后的客户端,instantclient_19_17

静默安装Oracle 19c在CentOS 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、付费专栏及课程。

余额充值