系统:rhel6.5 server6 oracle11g
主机名解析 ip地址
因安转oracle需要图形故安装图形化
[
[email protected] ~]# yum groupinstall "X 窗口系统" "KDE 桌面" "桌面"
#根据自己系统是否是英文 yum grouplist 查看
[
[email protected] ~]# yum install pdksh-5.2.14-37.el5_8.1.x86_64.rpm
#系统不带需自行下载
[
[email protected] ~]# yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio liaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC unixODBC-devel pdksh
[
[email protected] ~]# vim /etc/sysctl.conf #初学保持默认即可
[
[email protected] ~]# groupadd -g 500 oinstall
[
[email protected] ~]# groupadd -g 501 dba
[
[email protected] ~]# useradd -g oinstall -G dba oracle
[
[email protected] ~]# echo "redhat" |passwd --stdin oracle
[
[email protected] ~]# mkdir /opt/oracle
[
[email protected] ~]# chown -R oracle:oinstall /opt/oracle/
[
[email protected] ~]# chmod -R 755 /opt/oracle/
[
[email protected] ~]# vim ~oracle/.bash_profile #注意是oracle用户变量
umask 022
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
[[email protected] ~]# source ~oracle/.bash_profile
[[email protected] ~]# vim /etc/security/limits.conf #末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 10240
[[email protected] ~]# vim /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
[[email protected] /]# unzip linux.x64_11gR2_database_1of2.zip
[[email protected] /]# unzip linux.x64_11gR2_database_2of2.zip
[[email protected] /]# cd database/
[[email protected] database]# ls
doc install response rpm runInstaller sshsetup stage welcome.html
进oracle 用户图形化界面:
点击 runlnstaller 进行安装
点击ignore all忽略所有就行
安装完成后,系统会提示你需要用root权限执行2个shell脚本。按照其提示的路径,打开一个新的客户端找到其所在的位置执行就行,记住是用root用户来执行的:
1在oracle用户的图形界面oracle用户中,新开启一个终端,输入命令dbca:
配置监听及本地网络服务:
在oracle用户的图形界面oracle用户中,新开启一个终端,输入命令netca:
创建监听服务(这里指充当oracle服务器,让别的oracle客户端连接本oracle服务器)
点击Change Login输入某个管理员密码点击Canel:
[[email protected] ~]$ sqlplus systemSQL> SQLcreate table student(name varchar(20),age number(3)); SQL> insert into student values(‘Tom‘, 18);SQL> select * from student;SQL> desc student;SQL> exit