Red Hat Enterprise Linux6.4-64位 安裝Oracle11.2.0.3-64位(六)
最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!
我要咨詢(六)建庫后相關配置
操作系統: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;
