系統:rhel6.5 server6 oracle11g
主機名解析 ip地址
因安轉oracle須要圖形故安裝圖形化
[root@server6 ~]# yum groupinstall "X 窗口系統" "KDE 桌面" "桌面"
#根據本身系統是不是英文 yum grouplist 查看
[root@server6 ~]# yum install pdksh-5.2.14-37.el5_8.1.x86_64.rpm
#系統不帶需自行下載
[root@server6 ~]# 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
[root@server6 ~]# vim /etc/sysctl.conf #初學保持默認便可
[root@server6 ~]# groupadd -g 500 oinstall
[root@server6 ~]# groupadd -g 501 dba
[root@server6 ~]# useradd -g oinstall -G dba oracle
[root@server6 ~]# echo "redhat" |passwd --stdin oracle
[root@server6 ~]# mkdir /opt/oracle
[root@server6 ~]# chown -R oracle:oinstall /opt/oracle/
[root@server6 ~]# chmod -R 755 /opt/oracle/
[root@server6 ~]# vim ~oracle/.bash_profile #注意是oracle用戶變量
umask 022html
export ORACLE_BASE=/opt/oraclelinux
export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1c++
export ORACLE_SID=orclsql
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/binshell
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/libvim
[root@server6 ~]# source ~oracle/.bash_profile
[root@server6 ~]# vim /etc/security/limits.conf #末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 10240bash
[root@server6 ~]# vim /etc/profile #末尾添加
if [ $USER = "oracle" ]; then服務器
if [ $SHELL = "/bin/ksh" ]; then網絡
ulimit -p 16384oracle
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
[root@server6 /]# unzip linux.x64_11gR2_database_1of2.zip
[root@server6 /]# unzip linux.x64_11gR2_database_2of2.zip
[root@server6 /]# cd database/
[root@server6 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:[oracle@server6 ~]$ 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