我使用操作系统 , CentOS 6.0 安装的环境是SecureCRT远程连接安装在Oracle VM VirtualBox 上的centos 6 借助Xmanager Enterprise 3
在字符界面下启动图形界面
======================================
检查相关的开发工具和一些包
The following or later version of packages for Asianux 3, Oracle Enterprise Linux 5, and Red Hat Enterprise Linux 5 should be installed:
检查命令格式如下:
rpm -qa | grep 名字
binutils-2.17.50.0.6 ok
compat-libstdc++-33-3.2.3 ok
elfutils-libelf-0.125 ok
elfutils-libelf-devel-0.125 ok
elfutils-libelf-devel-static-0.125 ok
gcc-4.1.2 ok
gcc-c++-4.1.2 ok
glibc-2.5-24 ok
glibc-common-2.5 ok
glibc-devel-2.5 ok
glibc-headers-2.5 ok
kernel-headers-2.6.18 ok
ksh-20060214 ok
libaio-0.3.106 ok
libaio-devel-0.3.106 --
libgcc-4.1.2 ok
libgomp-4.1.2 ok
libstdc++-4.1.2 ok
libstdc++-devel-4.1.2 ok
make-3.81 ok
numactl-devel-0.9.8.i386 --
sysstat-7.0.2 --
unixODBC-2.2.11 --
unixODBC-devel-2.2.11 --
pcre-devel-6.6-2.el5_1.7 --
发现缺少以下包
从CentOS-6.0-i386-bin-DVD.iso\CentOS 文件找到缺少的包, 用FTP上传到 linux 上去,
再rpm -ivh * 安装
[root@centos6 /]#groupadd oinstall
[root@centos6 /]#groupadd dba
[root@centos6 /]#mkdir -p /u01/oracle
[root@centos6 /]#useradd -g oinstall -G dba -d /u01/oracle oracle
添加一个oracle用户, 根目录是 /u01/oracle, 主的组是 oinstall 副的组是dba
[root@centos6 /]#cp /etc/skel/.bash_profile /u01/oracle
[root@centos6 /]#cp /etc/skel/.bashrc /u01/oracle
[root@centos6 /]#cp /etc/skel/.bashrc /u01/oracle
为oracle用户设置密码
passwd oracle
[root@centos6 /]#chown -R oracle:oinstall u01
[root@centos6 /]#id nobody
缺省存在的。如果不存在 # /usr/sbin/useradd -g nobody
[root@centos6 /]#vi /etc/sysctl.conf
修改/etc/sysctl.conf
kernel.core_uses_pid = 1
kernel.shmall = 2097152
kernel.shmmax = 536870912
fs.suid_dumpable = 1
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
以上参数为最小值需求,如果实际值大于最小值,则以实际值为准。
运行命令使参数生效
/sbin/sysctl –p
[root@centos6 /]#vi /etc/security/limits.conf
添加以下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@centos6 /]#vi /etc/pam.d/login
添加以下内容
session required pam_limits.so
设置oracle 用户环境变量
[root@centos6 /]#su - oracle
[oracle@centos6 ~]$ vi .bash_profile
添加以下内容:
ORACLE_SID=leixian
ORACLE_BASE=/u01
ORACLE_HOME=/u01/oracle
PATH=$ORACLE_HOME/bin:$PATH
LD_ASSUME_KERNEL=2.4.19
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
DISPLAY=192.168.1.103:0.0
//上面的ip地址是你物理机的ip 也是你安装Xmanager Enterprise 3的ip地址
export ORACLE_SID ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH PATH DISPLAY
stty erase ^h
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
保存 退出
[oracle@centos6 ~]$ exit
logout
[root@centos6 /]# su - oracle
[oracle@centos6 ~]$ env |grep ORA
ORACLE_SID=leixian
ORACLE_BASE=/u01
ORACLE_HOME=/u01/oracle
[oracle@centos6 ~]$ env |grep DIS
DISPLAY=192.168.1.103:0.0
使用命令:unzip ...........(这一步在此就不多做介绍了)
解压完以后会有名为database的目录
[root@centos6 home]# unzip linux_11gR2_database_1of1.zip
[root@centos6 home]# unzip linux_11gR2_database_1of2.zip
[root@centos6 home]#mv database /u01/
[root@centos6 home]# su - oracle
[oracle@centos6 ~]$ export DISPLAY
[oracle@centos6 ~]$ xhost +
access control disabled, clients can connect from any host
[oracle@centos6 ~]$ cd /u01/database/
[oracle@centos6 database]$ ./runInstaller //出现乱码 我安装的是centos 6 中文版
[oracle@centos6 database]$ export LANG=en //设置语言为英语
[oracle@centos6 database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 3643 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-07-22_09-56-20PM. Please wait ...[oracle@centos6 database]$ You can find the log of this install session at:
/u01/oraInventory/logs/installActions2011-07-22_09-56-20PM.log
Next
Yes
Next
Next
数据库中文支持
next
Yes
next
在/oraInventory前加/u01
Next
Yes
Next
Netx
Finish
开始安装数据库 需要等一会
安装完成 需root 用户运行这两个脚本
[root@centos6 home]# cd /u01/oraInventory/
[root@centos6 oraInventory]# ./orainstRoot.sh
[root@centos6 oraInventory]# cd /u01/oracle/
[root@centos6 oracle]# ./root.sh
[oracle@centos6 database]$ netca
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/oracle/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
Next
Next
Next
Next
Next
Next
Next
Finish
[oracle@centos6 database]$dbca
Next
Next
Next
填写你的SID
我这里的SID是leixian
不知道可以 env | grep ORA
查看
Next
Next
口令管理
自己设个密码
Next
说我设置的密码不符oracle规定 不管了 点
Yes
Next
Next
把enable Archiving 勾上
会出来说配额不足 我不管点继续
Next
点Character sets
Next
Next
Finish
点OK
开始安装数据库
大概需要10来分钟
点exit
数据库 安装好了