实验环境:mac,vmvare虚拟机,数据库11.2.0.4版本,linux oel 5.6版本
1.创建用户和组
[root@ENMO2 ~]# groupadd -g 1000 oinstall
groupadd -g 1001 dba
groupadd -g 1002 oper
useradd -u 1001 -d /home/oracle -g oinstall -Gdba,oper oracle
2.创建文件夹且更改用户组和权限(上传介质、解压并删除zip原文件)
[root@ENMO2 ~]# mkdir /soft
[root@ENMO2 ~]# mkdir /u01
bogon:~ shiheyuanfang$ cd desktop/new/database11glinux
上传安装介质并解压 :
[root@ENMO2 soft]# ls
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip
You have new mail in /var/spool/mail/root
[root@ENMO2 soft]# unzipp13390677_112040_Linux-x86-64_1of7.zip
[root@ENMO2 soft]# unzipp13390677_112040_Linux-x86-64_2of7.zip
[root@ENMO2 soft]# ls
database
[root@ENMO2 ~]# chown -R oracle.oinstall /soft
[root@ENMO2 ~]# chown -R oracle.oinstall /u01
[root@ENMO2 ~]# chmod -R 755 /soft
[root@ENMO2 ~]# chmod -R 755 /u01
3.修改用户的SHELL限制
[root@KS ~]# vi/etc/security/limits.conf
在文件
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
4.更改Linux内存参数vi /etc/sysctl.conf
在文件最后加上
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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 = 1048576
当前生效 执行/sbin/sysctl-p
6.设置oracle的环境变量
vi .bash_profile
在文档最后加上
exportORACLE_BASE=/u01/app/oracle
exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
exportORACLE_SID=PROD
exportPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
修改完成,使生效
[oracle@KS ~]$ . .bash_profile
//设置--》连接cd/dvd驱动器
//mount挂载//配置yum,用yum装置解决依赖包
[root@ENMO2 ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@ENMO2 ~]# cd /mnt
[root@ENMO2 mnt]# ls
blafdoc.css eula.py README-en.html Server
Cluster GPL RELEASE-NOTES-en supportinfo
ClusterStorage images RELEASE-NOTES-en.html TRANS.TBL
EULA isolinux RPM-GPG-KEY VT
eula.en_US README-en RPM-GPG-KEY-oracle
[root@ENMO2 mnt]# cd
[root@ENMO2 ~]# vi/etc/yum.repos.d/public-yum-el5.repo
添加下面信息:
[oel5]
name = Enterprise Linux 5.6 DVD
baseurl=file:///mnt/Server/
gpgcheck=0
enabled=1
[root@ENMO2 ~]# yum install oracle-validated
注意:这步执行时需要按y(yes),而非回车键。否则启动图形化后面检验时会检验不通过。
7.启动图形界面安装oracle数据库软件
[root@KS ~]# xhost +
access control disabled, clients canconnect from any host
[root@KS ~]# su - oracle
[oracle@KS ~]$ cd /soft/database
[oracle@KS database]$ ll
total 60
drwxr-xr-x 4 root root 4096 Aug 27 2013 install
-rw-r--r-- 1 root root 30016 Aug 27 2013 readme.html
drwxr-xr-x 2 root root 4096 Aug 27 2013 response
drwxr-xr-x 2 root root 4096 Aug 27 2013 rpm
-rwxr-xr-x 1 root root 3267 Aug 27 2013 runInstaller
drwxr-xr-x 2 root root 4096 Aug 27 2013 sshsetup
drwxr-xr-x 14 root root 4096 Aug 27 2013 stage
-rw-r--r-- 1 root root 500 Aug 27 2013 welcome.html
[oracle@KS database]$ ./runInstaller
9.不启用安全更新
10.将email邮箱关闭
11.跳过软件更新
12.选择只安装数据库软件
13.创建单用户数据库
14.选择语言
15.选择企业版
16.指定安装路径
17.创建产品清单目录
18.下一部
19.检验通过
20.开始安装
21.运行一下两个脚本
[root@KS ~]#/u01/app/oraInventory/orainstRoot.sh
Changing permissions of/u01/app/oraInventory.
Adding read,write permissions forgroup.
Removing read,write,executepermissions for world.
Changing groupname of/u01/app/oraInventory to oinstall.
The execution of the script iscomplete.
[root@KS ~]#/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation forOracle 11g
The following environment variablesare set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the localbin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the/etc/oratab file as needed by
Database Configuration Assistant whena database is created
Finished running generic part of rootscript.
22.安装完成
23.DBCA建库
[root@KS ~]# su - oracle
[oracle@KS ~]$ dbca
24.一般用途和事务处理
25.给数据库创建名字和SID
26.安装监听
su - oracle
netca
27.取消自动维护任务
28.给system/sys 创建密码(oracle)
29.忽略警告
30
31.取消快速回复区
32.安装简单Schema
33.配置SGA与PGA
34.
35.选用UTF8字符集
36.
37.查看三大文件
38.完成
39.启动数据库
切换到oracle用户
sqlplus / as sysdba
startup
成功!!!