############################################################
#
# Purpose: about oracle sqlplus
#
# USER YYYY-MM-DD – ACTION
# Oldboy 2010-07-06 – Created
# QQ:49000448 老男孩 mail:49000448@qq.com
#转载请务必保留本文链接(http://blog.etiantian.org/?p=56)
############################################################
这么多年了,各类技术文档也写了不少了,不过实在懒得写博客,每次都是因为被学生问,被朋友问 才写出来总结下。
也许人都是这样子,自己鼓捣没劲,帮朋友,帮哥们了。再累都要搞出来。wordpress用的不顺手,是我没玩明白么?编辑器不好用。调个字体也费劲。还要改html代码。
安装rlwrap-0.37.tar.gz:
cd /home/rhy/tools/
wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.37.tar.gz
tar zxvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
./configure
make
make install
切换到oracle用户下
vi .bash_profile
加入别名sqlplus/rman配置
alias sqlplus=’rlwrap sqlplus’
alias rman=’rlwrap rman’
保存退出 source .bash_profile使生效或退出重登陆即可
这时执行sqlplus “/ as sysdba” 这个时候输入命令发现可以回调了。
也可以直接执行rlwrap sqlplus “/ as sysdba” 而不设置别名(麻烦点)。
=|= 添加oracle所需用户和组
--------------------------------------------
[root@oracle ~]# groupadd oinstall
[root@oracle ~]# groupadd dba
[root@oracle ~]# useradd -g oinstall -G dba oracle #添加oracle用户到oinstall组dba副组
[root@oracle ~]# passwd oracle #设置oracle用户的密码
[root@oracle ~]# mkdir /oracle #创建oracle要安装的目录
[root@oracle ~]# chown -R oracle:oinstall /oracle #设置目录权限
=|= 确认主机名和hosts中的主机名解析设置
--------------------------------------------
[root@oracle ~]# hostname
oracle.fei.cn
[root@oracle ~]#
[root@oracle ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
125.76.249.100 oracle.fei.cn oracle #主要是这一行
=|= 为oracle用户设置shell限制,添加如下内容
--------------------------------------------
[root@oracle ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@oracle ~]# vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
[root@oracle ~]# vi/etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
切换到oracle用户,注意要用 su - root命令(注 意,‘-’的左右都有空格!)这样才确保把环境带过去
完整安装文档 点击下载:oracle-install-doc.zip
安装oracle,执行 ./runInstaller,报错:
..../runInstaller: line 132: 3892 Segmentation fault $CMDDIR/install/.oui $* $_bootClassPath
原因:
空间不足,由于我是在虚拟机上安装,磁盘分配过小,加大磁盘,清理/tmp目录,重新执行,正常显示安装界面。