Ubuntu 22.04 安装Oracle 11g Express Edition

2024-04-29 11:44

本文主要是介绍Ubuntu 22.04 安装Oracle 11g Express Edition,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

一、系统环境

二、预安装软件

三、安装Oracle

四、登录数据库


Ubuntu 22.04上安装Oracle 11g Express Edition的过程。

一、系统环境

操作系统:Ubuntu 22.04.4 LTS

数据库版本:Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

二、预安装软件

1.先通过unzip命令解压

如果没有命令,请通过apt install unzip安装

unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

2.安装预先安装的包和依赖程序

sudo apt-get install alien libaio1 unixodbc

3.将RPM安装包转换成DEB格式

这里正常的rpm文件路径在DISK下面

cd ./oracle-xe-11.2.0-1.0.x86_64.rpm/Disk1/
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm

4.创建管理服务chkconfig的脚本

sudo vim /sbin/chkconfig

添加下面的内容并保存

 
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

4.修改chkconfig文件权限

sudo chmod 755 /sbin/chkconfig  

5.设置内核kernel参数

(这是oracle 11g R2 XE安装要求)

sudo vim /etc/sysctl.d/60-oracle.conf

添加下面的内容并保存

# Oracle 11g XE kernel parameters  
fs.file-max=6815744  
net.ipv4.ip_local_port_range=9000 65000  
kernel.sem=250 32000 100 128 
kernel.shmmax=536870912 

使用下面命令通过加载内核餐宿

sudo service procps start

检查新的参数是否加载成功

sudo sysctl -q fs.file-max

6.设置/dev/shm挂载点

sudo vim /etc/rc2.d/S01shm_load

添加下面的内容并保存

#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/nulltouch /var/lock/subsys/listenerrm /dev/shm 2>/dev/nullmkdir /dev/shm 2>/dev/nullmount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo errorexit 1 ;;
esac 

添加文件权限

sudo chmod 755 /etc/rc2.d/S01shm_load

9.重启服务器

reboot
三、安装Oracle

1.使用下面命令安装oracle

sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb

2.使用下面命令开始配置oracle

sudo /etc/init.d/oracle-xe configure

 中途会询问你下面的问题

Specify the HTTP port that will be used for Oracle Application Express [8080]:# 定义HTTP网站管理的端口,默认直接回车Specify a port that will be used for the database listener [1521]:# 定义数据库监听的端口,默认直接回车Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of 
different passwords for each database account.  This can be done after 
initial configuration:
Confirm the password:# 要求你设置系统账号SYS的SYSTEM的密码Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y# 询问是否设置数据库开机启动启动,默认是开机启动,直接回车

正常安装成功的过程日志

root@oracle_01:/# sudo /etc/init.d/oracle-xe configureOracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express 
Edition.  The following questions will determine whether the database should 
be starting upon system boot, the ports it will use, and the passwords that 
will be used for database accounts.  Press <Enter> to accept the defaults. 
Ctrl-C will abort.Specify the HTTP port that will be used for Oracle Application Express [8080]:Specify a port that will be used for the database listener [1521]:Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of 
different passwords for each database account.  This can be done after 
initial configuration:
Confirm the password:Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:yStarting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
root@oracle_01:/

3.设置系统环境变量

sudo vim /etc/profile

在最末尾添加下面的内容并保存

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATHif [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fi
fi

使用下面命令刷新使其生效

sudo source /etc/profile

4.启动oracle服务

sudo systemctl start oracle-xe

5.查看oracle运行状态

sudo systemctl status oracle-xe

下面是正常运行的结果

root@oracle_01:/# sudo systemctl status oracle-xe
● oracle-xe.service - LSB: Oracle 11g Express EditionLoaded: loaded (/etc/init.d/oracle-xe; generated)Active: active (exited) since Sun 2024-04-28 16:02:02 CST; 27min agoDocs: man:systemd-sysv-generator(8)Process: 803 ExecStart=/etc/init.d/oracle-xe start (code=exited, status=0/SUCCESS)CPU: 61msApr 28 16:01:52 oracle_01 systemd[1]: Starting LSB: Oracle 11g Express Edition...
Apr 28 16:01:53 oracle_01 oracle-xe[803]: Starting Oracle Net Listener.
Apr 28 16:01:53 oracle_01 su[899]: (to oracle) root on none
Apr 28 16:01:53 oracle_01 su[899]: pam_unix(su:session): session opened for user oracle(uid=1002) by (uid=0)
Apr 28 16:01:55 oracle_01 oracle-xe[803]: Starting Oracle Database 11g Express Edition instance.
Apr 28 16:01:55 oracle_01 su[940]: (to oracle) root on none
Apr 28 16:01:55 oracle_01 su[940]: pam_unix(su:session): session opened for user oracle(uid=1002) by (uid=0)
Apr 28 16:02:02 oracle_01 systemd[1]: Started LSB: Oracle 11g Express Edition.
root@oracle_01:/# 
四、登录数据库

1.使用下面命令用system账号登录

sqlplus system/123456Ab as sysdba;

2.登录后执行SQL语句查询数据库版本

select * from v$version;

下面是完整登录操作记录

root@oracle_01:/# sqlplus sys/123456Ab as sysdba;SQL*Plus: Release 11.2.0.2.0 Production on Sun Apr 28 15:59:18 2024Copyright (c) 1982, 2011, Oracle.  All rights reserved.Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit ProductionSQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE	11.2.0.2.0	Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionSQL> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

这篇关于Ubuntu 22.04 安装Oracle 11g Express Edition的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/945994

相关文章

SQL server数据库如何下载和安装

《SQLserver数据库如何下载和安装》本文指导如何下载安装SQLServer2022评估版及SSMS工具,涵盖安装配置、连接字符串设置、C#连接数据库方法和安全注意事项,如混合验证、参数化查... 目录第一步:打开官网下载对应文件第二步:程序安装配置第三部:安装工具SQL Server Manageme

如何在Ubuntu 24.04上部署Zabbix 7.0对服务器进行监控

《如何在Ubuntu24.04上部署Zabbix7.0对服务器进行监控》在Ubuntu24.04上部署Zabbix7.0监控阿里云ECS服务器,需配置MariaDB数据库、开放10050/1005... 目录软硬件信息部署步骤步骤 1:安装并配置mariadb步骤 2:安装Zabbix 7.0 Server

Ubuntu如何分配​​未使用的空间

《Ubuntu如何分配​​未使用的空间》Ubuntu磁盘空间不足,实际未分配空间8.2G因LVM卷组名称格式差异(双破折号误写)导致无法扩展,确认正确卷组名后,使用lvextend和resize2fs... 目录1:原因2:操作3:报错5:解决问题:确认卷组名称​6:再次操作7:验证扩展是否成功8:问题已解

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

Oracle 数据库数据操作如何精通 INSERT, UPDATE, DELETE

《Oracle数据库数据操作如何精通INSERT,UPDATE,DELETE》在Oracle数据库中,对表内数据进行增加、修改和删除操作是通过数据操作语言来完成的,下面给大家介绍Oracle数... 目录思维导图一、插入数据 (INSERT)1.1 插入单行数据,指定所有列的值语法:1.2 插入单行数据,指

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根