『ORACLE』安装oracle(11g)

一、操作系统安装,vmware下安装Linux (OEL5.6),用于数据库服务器

1.打开vmware,选择“创建新的虚拟机”

『ORACLE』安装oracle(11g)

2.选择自定义安装

『ORACLE』安装oracle(11g)

3.选择虚拟机硬件兼容性(默认设置)

 

『ORACLE』安装oracle(11g) 

4.选择安装程序光盘映像文件

 『ORACLE』安装oracle(11g)

5.给虚拟机命名(ML2)并且指定位置

『ORACLE』安装oracle(11g)

6.处理器配置(以物理cpu为准,这里设置没有效果)

『ORACLE』安装oracle(11g)

7.给虚拟机设置内存

『ORACLE』安装oracle(11g)

8.选择设置网络类型

『ORACLE』安装oracle(11g)

9.选择I/O控制器类型

『ORACLE』安装oracle(11g)

10.选择磁盘类型

 『ORACLE』安装oracle(11g)

11.选择磁盘(创建新的磁盘)

 『ORACLE』安装oracle(11g)

12.指定磁盘容量 (40G)

 『ORACLE』安装oracle(11g)

13.指定磁盘文件

『ORACLE』安装oracle(11g)

14.确认虚拟机配置

『ORACLE』安装oracle(11g)

15.选择忽略

『ORACLE』安装oracle(11g)

16.开始安装Linux

 『ORACLE』安装oracle(11g)

17.选择语言

『ORACLE』安装oracle(11g)

18.选择合适的键盘类型

『ORACLE』安装oracle(11g)

19.警告,抹除所有数据,选择是

『ORACLE』安装oracle(11g)

20.选择创建磁盘分区

『ORACLE』安装oracle(11g)

21.创建磁盘分区界面,点New创建

『ORACLE』安装oracle(11g)

22.创建boot引导分区(100M够用)

『ORACLE』安装oracle(11g)

23.创建swap分区,内存为4G

『ORACLE』安装oracle(11g)

24.创建/分区(将剩余磁盘都分给根分区)

『ORACLE』安装oracle(11g)

25.确认创建好的分区,点next

『ORACLE』安装oracle(11g)

26.默认GRUB引导程序安装在/dev/sda

『ORACLE』安装oracle(11g)

27.编辑网卡,点Edit

『ORACLE』安装oracle(11g)

28.设置地址,如图所示将三个IP地址设置在同一区段内

『ORACLE』安装oracle(11g)

29.编辑host名字;设置网关地址(可设可不设)

『ORACLE』安装oracle(11g)

30.选择continue,忽略DNS设置

『ORACLE』安装oracle(11g)

31.选择时区(选择上海)

『ORACLE』安装oracle(11g)

32.设置密码(帐号密码都为oracle)

 『ORACLE』安装oracle(11g)

33.选择现在定制安装软件,可以选择立刻安装(***方便的方式是选择稍后安装)

『ORACLE』安装oracle(11g)

34.

『ORACLE』安装oracle(11g)

35.

『ORACLE』安装oracle(11g)

36.定制开发插件

『ORACLE』安装oracle(11g)

37.关闭服务器

『ORACLE』安装oracle(11g)

38.

『ORACLE』安装oracle(11g)

39.

『ORACLE』安装oracle(11g)

40.下一步

『ORACLE』安装oracle(11g)

41.安装完成

『ORACLE』安装oracle(11g)

42.下一步

『ORACLE』安装oracle(11g)

43.安装完成后进入许可页面

『ORACLE』安装oracle(11g)

44.关闭防火墙

『ORACLE』安装oracle(11g)

45.关闭SELinux

 『ORACLE』安装oracle(11g)

46.确认

『ORACLE』安装oracle(11g)

47.不启用Kdump

『ORACLE』安装oracle(11g)

48.默认系统时间,点开网络时间同步协议

『ORACLE』安装oracle(11g)

 49.不安装网络时间同步协议

『ORACLE』安装oracle(11g)

50.现在不创建用户

『ORACLE』安装oracle(11g)

51.选择continue

『ORACLE』安装oracle(11g)

52.声卡

 『ORACLE』安装oracle(11g)

53.安装完成

 『ORACLE』安装oracle(11g)

54.确认重启

『ORACLE』安装oracle(11g)

55.挂载磁盘,打开虚拟机,点击设置

『ORACLE』安装oracle(11g)

56.点击浏览,选择已连接

『ORACLE』安装oracle(11g)

57.选择安装压缩包

『ORACLE』安装oracle(11g)

58.挂载成功后

『ORACLE』安装oracle(11g)

二、安装Oracle11.2.0.4数据库

1、创建用户和组

groupadd -g 1000 oinstall               

groupadd -g 1001 dba

groupadd -g 1002 oper

useradd -u 1001 -d /home/oracle -g oinstall -G dba,oper oracle    

(创建oracle用户,用户号1001,路径/home/oracle,基础组为oinstall,附加组为dba、oper)

2、创建文件夹且更改用户组和权限

mkdir /soft                                                        

mkdir /u01

chown -R oracle.oinstall /soft                 

chown -R oracle.oinstall /u01

chmod -R 755 /soft                                                                             

chmod -R 755 /u01

 

3、修改用户的SHELL限制  

[[email protected] ~]# vi /etc/security/limits.conf

在文件最后加上

oracle soft nproc 2047

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

5、挂盘、配置环境变量

[[email protected] ~]# mount /dev/cdrom /mnt

[[email protected] ~]# vi /etc/yum.repos.d/public-yum-e15.repo

[oe15]

name = Enterprise Linux 5.6 DVD

baseurl=file:///mnt/Server/

gpgcheck=0

enabled=1

[[email protected] ~]#  yum install oracle-validated

6、以oracle用户登录,配置环境变量(实例名自定义)

 

[[email protected] ~]# su - oracle
[[email protected] ~]$ vi .bash_profile

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export ORACLE_SID=Riven

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

[[email protected] ~]$ . .bash_profile

7、为oracle用户设置密码(方便后面用Xshell起图形时直接用oracle用户登录)

[[email protected] ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.

8、上传oracle安装压缩包并解压(在soft路径下用rz命令上传,用unzip解压)

[[email protected] ~]$ cd /soft

[[email protected] soft]$ rz
rz waiting to receive.
¿ªÊ¼ zmodem ´«Êä¡£ °´ Ctrl+C È¡Ïû¡£
100% 1362873 KB 7970 KB/s 00:02:51 0 Errorss..

[[email protected] soft]$ rz
rz waiting to receive.
¿ªÊ¼ zmodem ´«Êä¡£ °´ Ctrl+C È¡Ïû¡£
100% 1124320 KB 5621 KB/s 00:03:20 0 Errorss..

[[email protected] soft]$ ls
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip

[[email protected] soft]$ unzip p13390677_112040_Linux-x86-64_1of7.zip

[[email protected] soft]$ unzip p13390677_112040_Linux-x86-64_2of7.zip

9、用Xshell软件启动图形界面 安装oracle数据库

[[email protected] ~]$ cd /soft/database

[[email protected] 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

[[email protected] database]$ ./runInstaller 

10、不启用安全更新

『ORACLE』安装oracle(11g)

11、将email关闭

『ORACLE』安装oracle(11g)

12、跳过软件更新

『ORACLE』安装oracle(11g)

13、选择只安装数据软件

 『ORACLE』安装oracle(11g)

14、创建单用户数据库

『ORACLE』安装oracle(11g)

15、选择语言

『ORACLE』安装oracle(11g)

16、选择企业版

 『ORACLE』安装oracle(11g)

17、指定安装路径

『ORACLE』安装oracle(11g)

18、创建产品清单目录

『ORACLE』安装oracle(11g)

19、数据库管理组dba,数据库执行组oper

『ORACLE』安装oracle(11g)

20、检验通过(如果缺包可以用yum install 名)

『ORACLE』安装oracle(11g)

21、开始安装

『ORACLE』安装oracle(11g)

22、运行提示的两个脚本

『ORACLE』安装oracle(11g)

[[email protected] ~]#  /u01/app/oraInventory/orainstRoot.sh

[[email protected] ~]#  /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

23、安装完成

『ORACLE』安装oracle(11g)

24、安装监听

[[email protected] database]$ netca

『ORACLE』安装oracle(11g)

 

 『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

25、DBCA建库

[[email protected] ~]$ dbca

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

一般用途和事务处理

『ORACLE』安装oracle(11g)

给数据库创建名字和SID

『ORACLE』安装oracle(11g)

取消自动维护任务

『ORACLE』安装oracle(11g)

system/sys 创建密码(oracle

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

取消快速回复区

『ORACLE』安装oracle(11g)

安装简单Schemas

『ORACLE』安装oracle(11g)

配置SGAPGA

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

选用UTF8字符集

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

查看控制文件、数据文件、redo日志组文件

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

『ORACLE』安装oracle(11g)

启动数据库

切换到oracle用户

sqlplus / as sysdba

startup

成功!!!