教学文章
Technology Exchange
热门课程
400电话

免费咨询热线
400-090-9964

教学文章

Red Hat Enterprise Linux6.4-64位 安装Oracle11.2.0.3-64位(六)

时间:2018-11-14 来源:

  (六)建库后相关配置

  操作系统:Red Hat Enterprise Linux6.4-64位

  数据库: Oracle11.2.0.3-64位

  软件及安装包:

  VirtualBox-4.3.12-93733-Win.exe

  SecureCRT

  xmanagerenterprise3.0/4.0/5.0

  p13390677_112040_Linux-x86-64_1of7.zip

  p13390677_112040_Linux-x86-64_2of7.zip

  pdksh-5.2.14-36.el5.x86_64.rpm

  rhel-server-6.4-x86_64-dvd.iso

  rlwrap-0.37.tar.gz


  1.6 建库后相关配置

  1.6.1 sqlplus命令提示符

  [Oracle@rhel64 ~]$ cd $ORACLE_HOME/sqlplus/admin


  [Oracle@rhel64 admin]$ vi glogin.sql

  define _editor=vi

  set linesize 100

  set pagesize 9999

  set sqlprompt "_user'@'_connect_identifier>"


  [Oracle@rhel64 ~]$ sqlplus / as sysDBA


  1.6.2 sqlplus历史命令

  xftp 上传软件包rlwrap 源代码包

  yum安装readline gcc

  [root@rhel64 ~]# yum install readline*

  [root@rhel64 ~]# yum install gcc*

  验证gcc make 命令可用

  [root@rhel64 ~]# which make

  [root@rhel64 ~]# which gcc


  解包

  [root@rhel64 db]# tar -zxvf rlwrap-0.37.tar.gz


  配置

  [root@rhel64 db]# cd rlwrap-0.37

  [root@rhel64 rlwrap-0.37]# ./configure


  编译 安装

  [root@rhel64 rlwrap-0.37]# make

  [root@rhel64 rlwrap-0.37]# make install


  [root@rhel64 rlwrap-0.37]# which rlwrap


  编辑Oracle用户.bash_profile文件 追加两行配置

  [Oracle@rhel64 ~]$ vi .bash_profile

  alias sqlplus='/usr/local/bin/rlwrap sqlplus'

  alias rman='/usr/local/bin/rlwrap rman'


  [Oracle@rhel64 ~]$ source .bash_profile


  sqlplus 登录测试 上下方向键可查看历史命令

  [Oracle@rhel64 ~]$ sqlplus / as sysDBA

  1.6.3 scott用户

  SYS@PROD>conn scott/tiger

  SCOTT@PROD>show user


  SCOTT@PROD>select * from emp;

  SCOTT@PROD>select * from dept;


  1.6.4 正常关闭数据库

  关闭操作系统之前,必须先使用sys用户正常关闭数据库实例。

  SCOTT@PROD>conn / as sysDBA

  SYS@PROD>show user

  SYS@PROD>shutdown immediate;


  相关进程已不存在


  1.6.5 启动数据库命令

  [Oracle@rhel64 ~]$ sqlplus / as sysDBA


  idle instance 说明数据库实例没有启动

  SYS@PROD>startup


  SYS@PROD>select status from v$instance;


版权所有@北京神脑资讯技术有限公司(CUUG,中国UNIX用户协会) Copyright ALL Rights Reserved 京ICP备11008061号-1

CUUG旗下网站:www.cuug.com.cn www.cuug.com oracle.cuug.com bbs.cuug.com www.cuug.net

电话:010-59426307 010-59426319 邮政编码:100089

地址:北京市海淀区北清路164号28-38号院