oracle数据库安装与打开,Oracle数据库在Linux 中的安装与启动动
到目前为止,Oracle数据库算是我在linux安装的众多软件中最难安装的一个。值得庆幸的是,就在刚刚我成功的把oracle database安装到了linux os。现在回想起来装个oracle也并非难事。或许自己将来还是安装oracle,下面就简要回忆一下我的安装过程,用来提示将来的自己和第一次要在linux上安装oracle的朋友。
首先看一下我的软件环境:
HOST:Ubuntu 10.04(lucid),呵呵,我并不是要把db装到这个里面,我喜欢把这些软件装到vm(virtual machine)中。这么做有很多好处,当然也有一点坏处就是系统资源会增加一点点,但是这些增加的消耗是完全值得的。vm software我选用的是vbox(一款很不错的open-soruce软件)
GUEST(vm):CentOS 5.5。众所周知,linux有很多发行版,我们必须要选择一个发行版去安装oracle,这个时候最好是选择oracle安装手册中提到那几个发行版,比如Asianux 、 Oracle Enterprise Linux 、Red Hat Enterprise Linux、 SUSE Linux Enterprise Server 等。因为这样安装会简单很多。
DATABASE:Oracle Database 11g Release 2
下面是安装steps:
Step1. 创建用户和组(#表示以root身份,$表示以普通用户身份)
下面是oracle 数据库文档中的一段话,依照下面的话去创建或修改DB所需的用户和组:
The following local operating system groups and users are required if you are installing Oracle Database:
*The Oracle Inventory group (typically, oinstall)
*The OSDBA group (typically, dba)
*The Oracle software owner (typically, oracle)
*The OSOPER group (optional. Typically, oper)
To determine whether these groups and users already exist, and if necessary, to create them, follow these steps:
1.To determine whether the oinstall group exists, enter the following command:
# more /etc/oraInst.loc
If the output of this command shows the oinstall group name, then the group already exists.
If the oraInst.loc file exists, then the output from this command is similar to the following:
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
The inst_group parameter shows the name of the Oracle Inventory group, oinstall.
2.To determine whether the dba group exists, enter the following command:
# grep dba /etc/group
If the output from this commands shows the dba group name, then the group already exists.
3.If necessary, enter the following commands to create the oinstall and dba groups:
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
4.
To determine whether the oracle user exists and belongs to the correct groups, enter the following command:
# id oracle
If the oracle user exists, then this command displays information about the groups to which the user belongs. The output should be similar to the following, indicating that oinstall is the primary group and dba is a secondary group:
uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)
5.If necessary, complete one of the following actions:
*If the oracle user exists, but its primary group is not oinstall or it is not a member of the dba group, then enter the following command:
# /usr/sbin/usermod -g oinstall -G dba oracle
*If the oracle user does not exist, enter the following command to create it:
# /usr/sbin/useradd -g oinstall -G dba oracle
This command creates the oracle user and specifies oinstall as the primary group and dba as the secondary group.
6.Enter the following command to set the password of the oracle user:
# passwd oracle
Step2. 进入db的解压目录执行runInstaller,下面是我当时的操作:
[oracle@DBServer ~]$ ls
Desktop linux_11gR2_database
[oracle@DBServer ~]$ cd linux_11gR2_database/
[oracle@DBServer linux_11gR2_database]$ ls
doc install response rpm runInstaller sshsetup stage welcome.html
[oracle@DBServer linux_11gR2_database]$ ./runInstaller
接下来就是完全的图形界面操作了,这里面就没什么好说的了。
Step3. 安装系统缺失软件与修改系统配置参数
关于这一步你可以按照安装文档里的要求那样做。但是有一个更简单的办法,安装程序会检查系统配置参数,当有参数不满足配置的时候,你要做的就是修复并重新检查,这个时候安装程序会生成一个修复脚本并提示你脚本所在的位置及你要如何操作。对于系统缺少的软件,修复脚本不会安装,需要自己手动安装。当所有的软件配置参数都满足的时候,你就可以一直next而不会再遇到什么困难了。
当初我安装的时候选择的是仅安装数据库软件,所以我现在需要创建一个监听和数据库。下面的ORACLE_HOME需要你在配置文件(~/.bash_profile)中手动设置,当然最好是把$ORACLE_HOME/bin加入到PATH中去,这样的话我们就可以在任何地方直接输入命令了
[oracle@DBServer ~]$ cd $ORACLE_HOME
[oracle@DBServer dbhome_1]$ pwd
/home/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@DBServer dbhome_1]$ cd bin/
[oracle@DBServer bin]$ netca
注:netca配置监听,图形界面
[oracle@DBServer bin]$ dbca
注:dbca 创建数据库,图形界面
上述step执行完后,数据库就可以使用了
下面讨论如何启动和关闭数据库,我们只讨论一种最简单的方法:
默认情况下,linux中的oracle是不会随系统启动而启动的。当我们reboot系统的时候,可以用如下steps启动我们的db:
[oracle@DBServer ~]$ lsnrctl start注:启动监听
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-DEC-2010 11:05:02
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/diag/tnslsnr/DBServer/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBServer)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=DBServer)(PORT=2484)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBServer)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 10-DEC-2010 11:05:02
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/DBServer/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBServer)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=DBServer)(PORT=2484)))
The listener supports no services
The command completed successfully
[oracle@DBServer ~]$ dbstart注:启动数据库
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /home/oracle/app/oracle/product/11.2.0/dbhome_1/startup.log
以下steps关闭db:
[oracle@DBServer ~]$ dbshut注:关闭数据库
ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener
Usage: /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbshut ORACLE_HOME
Processing Database instance "orcl": log file /home/oracle/app/oracle/product/11.2.0/dbhome_1/shutdown.log
[oracle@DBServer ~]$ lsnrctl stop注:关闭监听
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-DEC-2010 11:06:50
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBServer)(PORT=1521)))
The command completed successfully
[oracle@DBServer ~]$
不幸的是如果是第一次这么做,我们可能会失败,原因我们可以在dbstart脚本中发现。我把有用的内容摘录如下:
# This script will start all databases listed in the oratab file
# whose third field is a "Y". If the third field is set to "Y" and
# there is no ORACLE_SID for an entry (the first field is a *),
# then this script will ignore that entry.
看完这段内容我想你已经明白该如何做了,没错修改/etc/oratab中的内容:
orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:N
把其中的‘N’改为‘Y’
到此数据库启动的问题都解决了,以后我们可以放心使用我们的db了。GOOK LUCK
oracle数据库安装与打开,Oracle数据库在Linux 中的安装与启动动相关推荐
- linux安装mysql图解,linux中怎么安装mysql5.6.12版本图解
linux中怎么安装mysql5.6.12版本图解 更新时间:2019-08-10 07:16 最满意答案 首先检查环境: 输入命令:rpm -qa | grep -i mysql* 将查询到的包名: ...
- 在linux下怎么安装mysql,手把手教你在Linux系统下安装MySQL
在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB. 1. 下载并安装MySQL官方的 Yum R ...
- linux中怎么安装ded包_快速提示:如何在Linux中安装.deb和.tar文件 - push博客
在本快速教程中,我将解释如何使用终端命令在Linux中安装程序.本教程使用LinuxMint 18(肉桂64位),但是下面提供的命令对于其他版本的Linux是通用的,比如Ubuntu.对于那些刚接触l ...
- 紫光输入法linux,Linux中巧妙安装红旗紫光输入法(转)
Linux中巧妙安装红旗紫光输入法(转)[@more@] 可以下载标准版或者for Magic Linux的版本,实际上,for Magic Linux的版本也可以在RH 9下使用. 然后,运行 rp ...
- centos6.5 php5.2,Linux中PHP安装与配置(CentOS-6.5:php-5.2.13)
1 PHP简介 PHP(PHP: Hypertext Preprocessor的缩写,中文名:"超文本预处理器")是一种通用开源脚本语言.语法吸收了C语言.Java和Per ...
- Linux课程---11、Linux中软件安装和调试
Linux课程---11.Linux中软件安装和调试 一.总结 一句话总结: 启动过程:1.安装软件,2.修改配置文件,3.启动服务 查看过程:4.查看进程,5.查看端口 关闭过程:6.关闭软件,7. ...
- qt打包rpm时候先安装其他软件_云计算学习路线图素材课件,Linux中软件安装的方式...
很多初学者感觉云计算就是一个听起来比较高大上的名词,每次想要了解它的时候都像是雾里看花,迷迷糊糊看不真切,至于它是干什么的就更不了解了,其实云计算学起来在IT行业中还是比较容易上手的,接下来我给大家分 ...
- _云计算学习路线图素材课件,Linux中软件安装的方式
很多初学者感觉云计算就是一个听起来比较高大上的名词,每次想要了解它的时候都像是雾里看花,迷迷糊糊看不真切,至于它是干什么的就更不了解了,其实云计算学起来在IT行业中还是比较容易上手的,接下来我给大家分 ...
- KALI Linux中GURB安装失败如何处理
KALI Linux中GURB安装失败如何处理 # GRUB安装失败 # 无法将grub-pc软件包安装到/target/中,如果没有GRUB启动引导器,所安装的系统将无法启动. 解决办法: 点击返 ...
- Linux中nginx安装基础教程
Linux中nginx安装基础教程 1.安装所需的运行环境 (1) 需要安装gcc的环境. yum install gcc-c++ (2)第三方包. Perl库 PCRE(Perl Compati ...
最新文章
- Java泛型的类型擦除
- C++ opengl 使视野转头移动(站桩看世界)
- socket编程持续交流java_socket编程的简单问题
- 计算机通信基础ppt,计算机网络第2章 数据通信基础知识要点课件.ppt
- 无外网环境下CentOS 7安装MySQL 5.7.18
- golang 示例测试example_go语言从例子开始之Example37.Go 状态协程
- linux 安装与启动nginx
- verilog基础语法
- Cardhop for Mac(通讯录管理软件)
- 小程序中的image标签
- Java日历设计思路
- git 提交代码某个文件夹一直提交不上去
- STM32CubeMX入门使用一
- 2022-2028年全球与中国敞篷汽车座椅行业深度分析
- 信息系统安全实验——Week 10
- python 自动抢红包_基于Airtest实现python自动抢红包
- C语言入门 hello world
- c语言表达式的类型,C语言_类型、运算符与表达式
- 网络硬件工作笔记001---网闸
- 学好小学奥数必懂的解题思路 建议家长帮孩子收藏