我使用操作系統 , 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
數據庫 安裝好了