centos8安装部署Oracle Database Free

news/2024/6/18 7:08:49 标签: 数据库, oracle, 服务器

前言

centos8安装部署Oracle Database Free

安装部署

服务器安装
  1. 下载centos8镜像(选择镜像:CentOS-Stream-8-20230523.0-x86_64-dvd1.iso)并安装系统,具体细节不再赘述
  2. 关闭centos8服务器的防火墙与selinux,并配置ip
oracle_9">部署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_71">连接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_117">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://www.niftyadmin.cn/n/391511.html

相关文章

Sqoop ---- Sqoop的简单使用案例

Sqoop ---- Sqoop的简单使用案例 1. 导入数据1. RDBMS到HDFS2. RDBMS到Hive3. RDBMS到Hbase 2. 导出数据1. HIVE/HDFS到RDBMS 3. 脚本打包 1. 导入数据 在Sqoop中,“导入”概念指:从非大数据集群(RDBMS)向大数据集群(…

测试开发基础|一文搞定计算机网络(一)

【摘要】 计算机网络知识对测试人员来说是非常重要的基础技能。无论是在平时测试工作中(比如接口测试),还是测试技术面试时,都会经常涉猎。很多基础薄弱的同学靠临时抱佛脚突击搜索学习,对系统知识和重点难点的理解总是…

Java网络编程-Ping监测

实现一个用于执行 Ping 命令并监测主机可达性的线程类。它的作用是通过执行 Ping 命令来检查指定 IP 地址的主机是否可达,并获取相关的响应时间和丢包率信息。 代码中的 PingThread 类同样继承自 Thread,意味着它可以在单独的线程中执行。 在 run 方法…

Python中logger模块的使用教程

参考模块: https://www.digitalocean.com/community/tutorials/how-to-use-logging-in-python-3 logger是python的内置模块,用以输出代码运行过程中的运行情况,极大的方便了我们的debug过程。参考资料中列出了使用logger相比于print优越的地方…

使用VS2019如何创建Win32的项目?

闲来无事,想学习一下Win32的开发,使用VS2019如何创建Win32的项目?费了老大的劲儿,终于捣鼓出来,现在记录一下。 1 创建新项目,在筛选栏选择C Windows 桌面,如下图,选择第一个“Windo…

单例模式8种写法

0. 为什么需要单例模式? 节省内存和计算保证结果正确方便管理 使用场景: 1. 饿汉式(静态常量)—推荐指数:★★☆☆☆ 优点:不会有线程安全问题。 缺点:在类加载的时候就创建对象,…

Linux CGroup 原理

Linux CGroup 原理 1、CGroup简介 cgroups是Linux下控制一个(或一组)进程的资源限制机制,全称是control groups,可以对cpu、内存等资源做精细化控制。 开发者可以直接基于cgroups来进行进程资源控制,比如8核的机器上…

在 Python 中实现最小堆

树是一种非线性数据结构,其中元素排列在多个级别。 堆是一种基于树的数据结构。 它是一棵完全二叉树,即每个父节点都有两个子节点。 堆实现不同的算法,对其他结构进行排序,对队列进行优先排序等。 堆有两种类型 - 最大和最小。 …