Red Hat Enterprise Linux6.4-64位 安装Oracle11.2.0.3-64位(六)
最新学讯:近期OCP认证正在报名中,因考试人员较多请尽快报名获取最近考试时间,报名费用请联系在线老师,甲骨文官方认证,报名从速!
我要咨询(六)建库后相关配置
操作系统:Red Hat Enterprise Linux6.4-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;
