操作系统安装
在vmware下安装Linux (OEL5.6),用于数据库服务器
1.打开vmware,选择“创建新的虚拟机”
2.选择自定义安装
3.选择虚拟机硬件兼容性(默认设置)
4.选择安装程序光盘映像文件
5.给虚拟机命名(KS)并且指定位置
6.处理器配置(以物理cpu为准,这里设置没有效果)
7.给虚拟机设置内存
8.选择设置网络类型
9.选择I/O控制器类型
10.选择磁盘类型
11.选择磁盘(创建新的磁盘)
12.指定磁盘容量 (40G)
13.指定磁盘文件
14.确认虚拟机配置
15.开始安装Linux
16.选择语言
17.选择合适的键盘类型
18.警告,抹除所有数据,选择是
、
19.选择创建磁盘分区
20.创建磁盘分区界面
21.创建boot引导分区(100M够用)
22.创建swap分区
23.创建/分区(将剩余磁盘都分给根分区)
24.确认创建好的分区
25.默认GRUB引导程序安装在/dev/sda
26.编辑网卡,设置地址
27.编辑host名字;设置网关地址
28.选择continue,忽略DNS设置
29.选择时区
30.设置密码
31.选择现在定制安装软件
32.
33.
34.定制开发插件
35.关闭服务器
36.
37.
38.下一步
39.开始安装
40.选择现在定制安装
42.关闭防火墙
43.关闭SELinux
44.确认SELinux
45.不启用Kdump
50.
51.不安装网络时间同步协议
52.现在不创建用户
53.选择continue
54.声卡
55.安装完成
56.确认重启
目标:
增加一块10g的磁盘,挂载点:/soft
要求:
1) 系统重启后,磁盘可自动挂载
2) Oracle数据库安装介质存放在此目录
1.增加磁盘前 执行fdisk -l命令,查看当前磁盘分区
[root@KS ~]# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 5221 37640295 83 Linux
2.设置里选择磁盘,点击添加
3.选择下一步
4.选择磁盘类型
5.指定磁盘容量
6.指定磁盘路径
7.最后检查,点击确定
8.再执行fdisk -l命令,发现磁盘sdb
[root@KS ~]# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 5221 37640295 83 Linux
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
9.格式化sdb磁盘
[root@KS ~]# mkfs /dev/sdb
mke2fs 1.39 (29-May-2006)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y 提示sdb是完整装置,不是一个分区,继续进行? YES!
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1310720 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
10.设置自动挂载
[root@KS ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/sdb /soft ext3 defaults 0 0
11.连接SouceCRT
执行zr命令 将oracle数据库安装介质上传至Linux(默认在/目录下)
12.将压缩包解压至soft文件夹下
unzip p............_1of7 -d /soft; unzip p............._2of7 -d /soft
安装Oracle11.2.0.4数据库
目标:
1) 数据库名称:PROD
2) SYS/SYSTEM ,口令:oracle
3) 不启用快速回复区
4) 安装时选择示例用户(scott、hr等)
5) 内存自动管理
6) 字符集:UTF8
7) 取消掉自动任务
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
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限制
[root@KS ~]# 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 内存参数
在文件最后加上
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
当前生效 执行sysctl -p
5.编辑/etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
6.设置oracle的环境变量
vi .bash_profile
在文档最后加上
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ORA11GR2
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
修改完成,使生效
[oracle@KS ~]$ . .bash_profile
7.安装Linux依赖包
[root@KS ~]# cd /mnt/Server/
[root@KS Server]# rpm -ivh binutils-2.17.50.0.6-14.el5.x86_64.rpm
warning: binutils-2.17.50.0.6-14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package binutils-2.17.50.0.6-14.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-61.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.x86_64 is already installed
[root@KS Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.i386 is already installed
[root@KS Server]# rpm -ivh elfutils-libelf-0.137-3.el5.x86_64.rpm
warning: elfutils-libelf-0.137-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package elfutils-libelf-0.137-3.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh elfutils-libelf-devel-0.137-3.el5.x86_64.rpm
warning: elfutils-libelf-devel-0.137-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package elfutils-libelf-devel-0.137-3.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh gcc-4.1.2-50.el5.x86_64.rpm
warning: gcc-4.1.2-50.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package gcc-4.1.2-50.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh gcc-c++-4.1.2-50.el5.x86_64.rpm
warning: gcc-c++-4.1.2-50.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package gcc-c++-4.1.2-50.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh glibc-2.5-58.i686.rpm
warning: glibc-2.5-58.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package glibc-2.5-58.i686 is already installed
[root@KS Server]# rpm -ivh glibc-2.5-58.x86_64.rpm
warning: glibc-2.5-58.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package glibc-2.5-58.x86_64 is already installed
[root@KS Server]# rpm -ivh glibc-devel-2.5-58.i386.rpm
warning: glibc-devel-2.5-58.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package glibc-devel-2.5-58.i386 is already installed
[root@KS Server]# rpm -ivh glibc-devel-2.5-58.x86_64.rpm
warning: glibc-devel-2.5-58.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package glibc-devel-2.5-58.x86_64 is already installed
[root@KS Server]# rpm -ivh glibc-headers-2.5-58.x86_64.rpm
warning: glibc-headers-2.5-58.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package glibc-headers-2.5-58.x86_64 is already installed
[root@KS Server]# rpm -ivh ksh-20100202-1.el5_5.1.x86_64.rpm
warning: ksh-20100202-1.el5_5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package ksh-20100202-1.el5_5.1.x86_64 is already installed
[root@KS Server]# rpm -ivh libaio-devel-0.3.106-5.i386.rpm
warning: libaio-devel-0.3.106-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@KS Server]# rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm
warning: libaio-devel-0.3.106-5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@KS Server]# rpm -ivh libgcc-4.1.2-50.el5.i386.rpm
warning: libgcc-4.1.2-50.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libgcc-4.1.2-50.el5.i386 is already installed
[root@KS Server]# rpm -ivh libgcc-4.1.2-50.el5.x86_64.rpm
warning: libgcc-4.1.2-50.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libgcc-4.1.2-50.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh libstdc++-4.1.2-50.el5.i386.rpm
warning: libstdc++-4.1.2-50.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libstdc++-4.1.2-50.el5.i386 is already installed
[root@KS Server]# rpm -ivh libstdc++-4.1.2-50.el5.x86_64.rpm
warning: libstdc++-4.1.2-50.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libstdc++-4.1.2-50.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh libstdc++-devel-4.1.2-50.el5.x86_64.rpm
warning: libstdc++-devel-4.1.2-50.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libstdc++-devel-4.1.2-50.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh make-3.81-3.el5.x86_64.rpm
warning: make-3.81-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package make-3.81-3.el5.x86_64 is already installed
[root@KS Server]# rpm -ivh sysstat-7.0.2-3.el5_5.1.x86_64.rpm
warning: sysstat-7.0.2-3.el5_5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:sysstat ########################################### [100%]
8.启动图形界面 安装oracle数据库
[root@KS ~]# xhost +
access control disabled, clients can connect 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 for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@KS ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin 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 when a database is created
Finished running generic part of root script.
22.安装完成
23.DBCA建库
[root@KS ~]# su - oracle
[oracle@KS ~]$ dbca
24.
25.一般用途和事务处理
26.给数据库创建名字和SID
27.安装监听(oracle下运行netca)
28.取消自动维护任务(EM这里没安装,稍后有单独安装文档)
29.给system/sys 创建密码(oracle)
30.忽略警告
31.
32.安装简单Schemas
33.配置SGA与PGA
34.
35.选用UTF8字符集
36.服务区开启专用模式
37.查看三大文件
38.完成
39.启动数据库
切换到oracle用户
sqlplus / as sysdba
startup
成功!!!