centos8安装部署Oracle Database Free

news/2024/7/5 3:28:30

前言

centos8安装部署Oracle Database Free

安装部署

服务器安装
  1. 下载centos8镜像(选择镜像:CentOS-Stream-8-20230523.0-x86_64-dvd1.iso)并安装系统,具体细节不再赘述
  2. 关闭centos8服务器的防火墙与selinux,并配置ip
部署oracle
  • 注:先下载文件Oracle Linux==>oracle-database-free-23c-1.0-1.el8.x86_64.rpm并放置到服务器的家目录下
[root@localhost ~]# cd ~
[root@localhost ~]# sudo -s
[root@localhost ~]# curl -L -o oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/developer/x86_64/getPackage/oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
[root@localhost ~]# dnf -y localinstall oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
[root@localhost ~]# dnf -y localinstall oracle-database-free*
[root@localhost ~]# /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:   devops
Confirm the password:   Data2023

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: localhost.localdomain/FREEPDB1
     Multitenant container database: localhost.localdomain
设置 Oracle 数据库自由环境变量
[root@localhost /]#export ORACLE_SID=FREE 
[root@localhost /]#export ORAENV_ASK=NO 
[root@localhost /]#. /opt/oracle/product/23c/dbhomeFree/bin/oraenv
The Oracle base has been set to /opt/oracle     

连接oracle数据库

使用操作系统身份验证在本地连接
[root@localhost /]# cd /opt/oracle/product/23c/dbhomeFree/bin/
[root@localhost bin]# ./sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Sat Jun 3 12:13:57 2023
Version 23.2.0.0.0

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

ERROR:
ORA-01017: invalid credential or not authorized; logon denied


Enter user-name: SYSTEM	# 输入账户
Enter password: 		# 输入密码
Last Successful login time: Sat Jun 03 2023 11:45:39 +08:00

Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
  • 注:类似于以上内容的输出确认您现在已连接到数据库
使用账户登录本地数据库
[root@localhost bin]# export ORACLE_SID=FREE
[root@localhost bin]# export ORAENV_ASK=NO 
[root@localhost bin]# . /opt/oracle/product/23c/dbhomeFree/bin/oraenv
The Oracle base has been set to /opt/oracle
[root@localhost bin]# ./sqlplus system@127.0.0.1:1521/FREEPDB1

SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Sat Jun 3 12:24:06 2023
Version 23.2.0.0.0

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

Enter password: 
Last Successful login time: Sat Jun 03 2023 12:14:56 +08:00

Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0

oracle服务设置开机自启动

[root@localhost /]# systemctl daemon-reload
[root@localhost /]# systemctl enable oracle-free-23c
oracle-free-23c.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable oracle-free-23c
[root@localhost /]# systemctl start oracle-free-23c
[root@localhost /]# systemctl status oracle-free-23c
● oracle-free-23c.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services.
   Loaded: loaded (/etc/rc.d/init.d/oracle-free-23c; generated)
   Active: active (exited) since Sat 2023-06-03 12:28:09 CST; 2s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 8178 ExecStart=/etc/rc.d/init.d/oracle-free-23c start (code=exited, status=0/SUCCESS)

Jun 03 12:28:09 localhost.localdomain systemd[1]: Starting SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services....
Jun 03 12:28:09 localhost.localdomain oracle-free-23c[8178]: The Oracle Database instance FREE is already started.
Jun 03 12:28:09 localhost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services..

结语

Oracle Database 23c 免费版——开发者版
Oracle Database Free Download
Python python-oracledb Driver


http://lihuaxi.xjx100.cn/news/1202213.html

相关文章

用于ECharts的全国省市区县乡镇街道级的行政区划边界数据(GeoJSON格式)

https://map.vanbyte.com 提供了免费的省市县3级行政边界数据(GeoJSON格式)、省市县乡4级联动数据。 至于行政区划边界数据的来源,网络上有各种教程。授人以鱼不如授人以渔,下面记录一下各类方法的具体步骤。 来源1:阿里云的数据可视化平台…

编程的未来 - 还有未来么?

缘起 唐门教主上个月某天深夜写了一篇博客 --《编程的未来》,要我谈谈感想。 这也是最近软件工程师们聊得比较多的问题,上周,在上海的 “关东小磨” 和十多位 CSDN 博主聚会的时候,大家也稍微谈了一下这个话题,但是谈…

华为OD机试 - 数据最节约的备份方法(Java JS Python)

题目描述 有若干个文件,使用刻录光盘的方式进行备份,假设每张光盘的容量是500MB,求使用光盘最少的文件分布方式 所有文件的大小都是整数的MB,且不超过500MB;文件不能分割、分卷打包 输入描述 一组文件大小的数据 输出描述 使用光盘的数量 备注 不用考虑输入数据不合法…

bat脚本代码,一键修改网卡的dns地址和恢复为DHCP获取的方式

echo off REM 指定为 Unicode 编码(65001)来解决中文乱码的问题 chcp 65001 >nul REM 脚本以管理员身份运行 %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","&quo…

Gradio的web界面演示与交互机器学习模型,Blocks的事件侦听《7》

在第一篇文章我们就熟悉了Blocks的用法,使用Blocks比Interface更加灵活,这节重点关注Blocks里面的相关操作。 1、Blocks标准例子 import gradio as grdef greet(name):return "你好 " name "!"with gr.Blocks() as demo:name g…

竞赛中常用的Python 标准库

对竞赛中常用得标准库进行解析和给出代码模板 目录 1.functools 1.1 cmp_to_key 1.2 lru_cache(记忆化存储,加快递归速度) 2.collections 2.1 deque 2.1.1 单调对列实现 2.1.2 BFS广搜 3.sys 3.1 sys.maxsize 3.2 sys.exit() 3.…

基于Hive的数据应用实践总结

百分位数(percentile)计算 百分位数含义:统计学术语,如果将一组数据从小到大排序,并计算相应的累计百分位,则某一百分位所对应数据的值就称为这一百分位的百分位数。可表示为:一组n个观测值按数值大小排列。如&#x…

milkV-duo的Linux的开发环境搭建

目录 写在前面 内核编译 烧录失败的示例(这种情况下就和插上空卡一样) 进入系统 串口进入 SSH接入 写在前面 基本上大部分的问题都能在开源社区上得到答案,记录下我遇到的问题. 附上开源社区 MilkV Community 这里的引脚图和板子的丝印有点对不上&#xff…