CentOS7安装Oracle-19c
admin
2024-03-18 23:52:43

本文目标

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 ResolutionDependencies 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 GTransaction Summary
===============================================================================================================================================
Install  1 PackageTotal 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 sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:55:24 2022
Version 19.3.0.0.0Copyright (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/orclcdbSQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:59:57 2022
Version 19.3.0.0.0Copyright (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.0SQL> 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/orclpdb1SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 4 21:59:49 2022
Version 19.3.0.0.0Copyright (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.0SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

最后使用Navicat连接

相关内容

热门资讯

山水皆有情!丽江两山一江的千年... 去过丽江、走过虎跳峡的人,大概率都听过哈巴雪山和金沙江的传说。很多人站在峡谷之下,望着奔腾不息的金沙...
活力中国调研行丨“殷”你而来 ... 9月12日,游客在殷墟博物馆“甲骨文展厅”内参观。位于河南省安阳市的殷墟博物馆新馆是首个全景式展现商...
浦江之夜赴美好相逢,第37届上... 9月12日晚,黄浦江畔灯火璀璨,第37届上海旅游节大巡游在外滩中山东一路上演。不少观众早早便来到外滩...
美丽中国丨秋韵紫鹊界 梯田入画... 这是9月11日拍摄的紫鹊界梯田(无人机照片)。 金秋九月,湖南省娄底市新化县紫鹊界梯田稻谷渐次成熟。...
中国之巅奏响《共同的节日》,千... 千吨阻尼器,“迎世赛、游上海旅游节”。9月13日,由上海市文化和旅游局指导推出上海旅游·会客│巅峰之...