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

相关文章

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系统根

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

Oracle修改端口号之后无法启动的解决方案

《Oracle修改端口号之后无法启动的解决方案》Oracle数据库更改端口后出现监听器无法启动的问题确实较为常见,但并非必然发生,这一问题通常源于​​配置错误或环境冲突​​,而非端口修改本身,以下是系... 目录一、问题根源分析​​​二、保姆级解决方案​​​​步骤1:修正监听器配置文件 (listener.

安装centos8设置基础软件仓库时出错的解决方案

《安装centos8设置基础软件仓库时出错的解决方案》:本文主要介绍安装centos8设置基础软件仓库时出错的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录安装Centos8设置基础软件仓库时出错版本 8版本 8.2.200android4版本 javas

Ubuntu设置程序开机自启动的操作步骤

《Ubuntu设置程序开机自启动的操作步骤》在部署程序到边缘端时,我们总希望可以通电即启动我们写好的程序,本篇博客用以记录如何在ubuntu开机执行某条命令或者某个可执行程序,需要的朋友可以参考下... 目录1、概述2、图形界面设置3、设置为Systemd服务1、概述测试环境:Ubuntu22.04 带图

Pytorch介绍与安装过程

《Pytorch介绍与安装过程》PyTorch因其直观的设计、卓越的灵活性以及强大的动态计算图功能,迅速在学术界和工业界获得了广泛认可,成为当前深度学习研究和开发的主流工具之一,本文给大家介绍Pyto... 目录1、Pytorch介绍1.1、核心理念1.2、核心组件与功能1.3、适用场景与优势总结1.4、优