Oracle菜鸟学习之在RedHat 6.5上安装Oracle
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,Oracle菜鸟学习之在RedHat 6.5上安装Oracle 11G首发:http://www.arppinging.com/wordpress/?p=90安装前准备工作上传数据库软件至/tmp/下
千家信息网最后更新 2026年11月01日Oracle菜鸟学习之在RedHat 6.5上安装Oracle
Oracle菜鸟学习之在RedHat 6.5上安装Oracle 11G
首发:http://www.arppinging.com/wordpress/?p=90
安装前准备工作
上传数据库软件至/tmp/下,并修改文件权限
chmod -R 755 /tmp/database/创建用户和组
创建oracle用户,并将oracle用户加入oinstall和dba组,后面安装的时候需要用到
[root@localhost ~]# groupadd oinstall[root@localhost ~]# groupadd dba[root@localhost ~]# useradd -g oinstall -G dba oracle[root@localhost ~]# passwd oracleChanging password for user oracle.New password: BAD PASSWORD: it is based on a dictionary wordBAD PASSWORD: is too simpleRetype new password: passwd: all authentication tokens updated successfully.[root@localhost ~]# 创建目录并修改文件
创建数据库安装目录u01[root@localhost ~]# mkdir /home/u01为数据库安装目录做一个软链接[root@localhost ~]# ln -s /home/u01/ /u01[root@localhost ~]# mkdir -p /u01/app/oracle修改/u01目录的属主和属组信息[root@localhost ~]# chown -R oracle:oinstall /u01/修改u01的权限为755[root@localhost ~]# chmod -R 755 /u01/在oracle用户下的.bash_profile中添加以下行
[root@localhost ~]# vim /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.4/db_1export ORACLE_SID=testexport PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATHexport LANG="en_US.UTF-8"export NLS_LANG=american_AMERICA.UTF8export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"验证一下有没有问题,没有输出,则代表没有问题[root@localhost oracle]# source .bash_profile [root@localhost oracle]# 安装Oracle 依赖的软件
1.挂载光驱[root@localhost ~]# mount /dev/cdrom /mnt/mount: block device /dev/sr0 is write-protected, mounting read-only[root@localhost ~]#2.修改yum文件[root@localhost ~]# cd /etc/yum.repos.d/[root@localhost yum.repos.d]# lsrhel-source.repo[root@localhost yum.repos.d]# cp rhel-source.repo rhel-source.repo.bak[root@localhost yum.repos.d]# vim rhel-source.repo[rhel-source]name=Red Hat Enterprise Linux $releasever - $basearch - Sourcebaseurl=file:///mnt/enabled=1gpgcheck=03.清除yum源,并重新生成[root@localhost yum.repos.d]# yum claenall[root@localhost yum.repos.d]# yum makecache4.使用yum 安装软件[root@localhost yum.repos.d]# yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers pdksh cvuqdisk libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel -y安装Oracle数据库
切换用户(图形化注销再登陆)
安装Oracle
1.打开图形化桌面的终端
[oracle@localhost ~]$ cd /tmp/database/
[oracle@localhost database]$ ./runInstaller
2.去掉选项卡中的勾
3.选择YES
4.选择第二个,安装数据库软件
5.选择安装单节点
6.选择安装语言,默认就好(貌似没有中文)
7.选择默认的企业版
8.默认路径,路径准备阶段已经创建,不是按照上面创建目录的这里需要修改
9.目录和组,默认即可
10.用户组,默认即可
11.安装前检查,选中Ignore All即可下一步
12.点击finish即可开始安装
13.安装中可能出现提示,直接点击ok即可
14.安装完成点击close关闭窗口
创建数据库
[oracle@localhost database]$ dbca 1.选择下一步
2.选择创建数据库
3.选择数据库模板,默认即可
4.设置SID,这个SID需要跟oracle用户的.bash_profile中的SID相同,上面我们设置的是test
5.取消最上面的勾,下一步
6.为oracle数据库的两个用户设置密码,下面的选项是两个用户的密码都使用...,当然,也可以一个用户设置一个密码。
7.下面的选项都选择下一步即可
8.点击完成
9.点击ok
10.点击exit完成安装
使用Oracle
开启监听器
[oracle@localhost /]$ lsnrctl startLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-OCT-2018 11:51:04Copyright (c) 1991, 2009, Oracle. All rights reserved.Starting /u01/app/oracle/product/11.2.4/db_1/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionLog messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date 02-OCT-2018 11:51:05Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))The listener supports no servicesThe command completed successfully[oracle@localhost /]$ 进入数据库
[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 2 11:53:31 2018Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options开启数据库,出现以下信息则说明数据库已经启动了SQL> startup ORA-01081: cannot start already-running ORACLE - shut it down firstSQL>顺便查询一张表,又数据输出则代表没有问题。SQL> select * from user_tables;优化输入,方向键
1.下载rlwrap软件
[root@localhost /]# wget http://mirrors.aliyun.com/epel/6/x86_64/Packages/r/rlwrap-0.42-1.el6.x86_64.rpm 2.安装
[root@localhost /]# rpm -ivh rlwrap-0.42-1.el6.x86_64.rpm warning: rlwrap-0.42-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEYPreparing... ########################################### [100%] 1:rlwrap ########################################### [100%][root@localhost /]# 3.修改配置文件
[oracle@localhost ~]$ vi .bash_profile
alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'4.重新登陆或者切换一下即可
完。
数据
数据库
用户
选择
目录
软件
文件
密码
问题
面的
两个
代表
信息
图形
权限
路径
准备
切换
登陆
输出
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
深圳市人人互联网科技有限公司
互联网科技股票
唐信互联网科技
壹账通互联网科技
伴你行互联网科技有限公司
新华互联网科技校企合作
互联网和高科技公司
创业天下互联网科技有限公司
字节跳动和互联网科技
互联网科技产业特征
链环科技传统企业怎么转型互联网
燊美集互联网科技有限公司
中和天地互联网科技有限公司
沐思想互联网科技有限公司
皮皮虾互联网科技有限公司
张召忠谈中国互联网科技
江苏互联网科技小贷
易企秀互联网科技是做什么的
北京天晋互联网科技有限公司
互联网时代高科技布局
互联网科技战争
狮子座互联网科技有限公司
互联网科技上市公司
米客互联网科技
互联网科技大会
中正互联网科技招聘
承德科技产业互联网发展
和信科技工业互联网
版纳互联网科技选哪家
互联网科技大佬云集