1.1 安装前准备
1.1.1 关闭防火墙、SELINUX
[root@vast ~]# service iptables stop
[root@vast ~]# setenforce 0
[root@vast ~]# chkconfig iptables off
[root@vast ~]# chkconfig --list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@vast ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
1.1.2 修改hosts文件
[root@vast ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.80.121 vast.vastdata
1.1.3 配置网卡
[root@vast ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:9E:65:FE
IPADDR=192.168.80.121
NETMASK=255.255.255.0
GATEWAY=192.168.80.1
ONBOOT=yes
1.1.4 修改机器版本号
[root@vast ~]# vi /etc/redhat-release
Red Hat Enterprise Linux Server release 4.11 (Tikanga)
修改5.11为4.11
1.1.5 安装rpm包
[root@vast ~]# cd /misc/cd
[root@vast cd]# ls
blafdoc.css EULA GPL README-en RELEASE-NOTES-en.html Server VT
Cluster eula.en_US images README-en.html RPM-GPG-KEY supportinfo
ClusterStorage eula.py isolinux RELEASE-NOTES-en RPM-GPG-KEY-oracle TRANS.TBL
[root@vast cd]# cd Server/
安装如下rpm包(以下为oracle10g官方文档标注要求安装的rpm包)
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
1.1.6 创建组、用户
[root@vast ~]# groupadd oinstall
[root@vast ~]# groupadd dba
[root@vast ~]# groupadd oper
[root@vast ~]# useradd -g oinstall -G dba,oper oracle
[root@vast ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
1.1.7 添加内核参数
[root@vast ~]# vim /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
保存退出执行sysctl –p 使参数生效
[root@vast ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.default.accept_source_route = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmax = 65536
kernel.shmall = 4294967296
fs.file-max = 6815744
kernel.msgmni = 2878
kernel.msgmnb = 65536
kernel.sem = 250 32000 100 142
kernel.shmmni = 4096
kernel.shmmax = 4398046511104
kernel.sysrq = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 3145728
net.ipv4.ip_local_port_range = 9000 65500
vm.min_free_kbytes = 51200
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vm.hugetlb_shm_group = 54322
执行后,会返回所有参数
1.1.8 修改用户限制
[root@oracle ~]# vim /etc/security/limits.conf
添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
1.1.9 权限控制
[root@oracle ~]# vim /etc/pam.d/login
添加如下内容
session required /lib/security/pam_limits.so
session required pam_limits.so
1.1.10 修改概要文件
[root@oracle ~]# vim /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
1.1.11 创建目录与赋权
[root@vast ~]# mkdir /u01/app/oracle -p
[root@vast ~]# chmod 775 /u01 -R
[root@vast ~]# chown oracle:oinstall /u01 -R
1.1.12 添加oracle用户环境变量
[root@vast ~]# su - oracle
[oracle@vast ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
保存退出
使环境变量生效
[oracle@vast ~]$ source .bash_profile
1.1.13 解压安装包
这里我的安装包放在了/tmp下,进入到/tmp下
[root@vast ~]$ cd /tmp/
[root@vast tmp]$ ls
10201_database_linux_x86_64.cpio.gz p8202632_10205_Linux-x86-64.zip
gconfd-root rpm.txt
keyring-KqS6j0 ssh-TPBNPv3831
mapping-root virtual-root.KGIV2G
orbit-root
解压这个压缩包
[root@vast tmp]# gunzip 10201_database_linux_x86_64.cpio.gz
[root@vast tmp]# ls
10201_database_linux_x86_64.cpio p8202632_10205_Linux-x86-64.zip
gconfd-root rpm.txt
keyring-KqS6j0 ssh-TPBNPv3831
mapping-root virtual-root.KGIV2G
orbit-root
[root@vast tmp]# cpio -idmv < 10201_database_linux_x86_64.cpio
database/stage/prereq/db/refhost_Custom.xml
database/stage/prereq/db/refhost.xml
database/stage/prereq/db/db_prereq.xml
.
.
.
database/doc/server.102/b15658/toc.htm
database/doc/server.102/b15658/tuning.htm
database/doc/server.102/b15658
database/doc/server.102/b15658.pdf
database/doc/server.102
database/doc
database/welcome.html
database
1565626 blocks
[root@vast tmp]# ls
10201_database_linux_x86_64.cpio orbit-root
database p8202632_10205_Linux-x86-64.zip
gconfd-root rpm.txt
keyring-KqS6j0 ssh-TPBNPv3831
mapping-root virtual-root.KGIV2G
1.2 安装数据库软件
进入到oracle用户下开始安装
[root@vast tmp]# su - oracle
[oracle@vast ~]$ cd /tmp/database/
[oracle@vast database]$ ls
doc install response runInstaller stage welcome.html
[oracle@vast database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from
/tmp/OraInstall2016-09-12_06-48-28PM. Please wait ...[oracle@vast database]$ Starting Installer in advanced mode ...
Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.
(一) 选择高级安装“Advanced Installation”
(二) Oracle产品目录路径
(三)选择安装版本(安装企业版)
(四)Oracle家目录
(五)环境预检查
(六)只安装数据库软件
(1.安装数据库并安装数据库 2.配置ASM 3.只安装数据库软件)
(七)点击“Install”开始安装
(八)安装进度
(九)执行两个脚本
[root@vast ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@vast ~]# /u01/app/oracle/product/10.2.0/dbhome_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.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.sh script.
Now product-specific root actions will be performed.
[root@vast ~]#
(十) 返回安装信息
1.3 安装数据库
[oracle@vast database]$ dbca
(一)选择“Next”
(二)选择“Create a Database”
(三)选择创建数据库的类型
(四)设定数据库名和SID
(五)配置EM(这一步可选也可不选,EM也可在之后创建)
(六)设定用户密码
(七)选择文件系统
(八)选择“Use Database File Locations from Template”
(九)配置快速恢复区路径以及大小
(十)选择是否需要样例(可选可不选)
(十一)Oracle内存大小设定,默认是40,但是也可以自己设定
(十二)查看配置信息,点击“Finish”开始安装
(十三 )查看安装信息
( 十四)安装完成,点击“Exit”
1.4 验证是否安装成功
[oracle@vast database]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 12 19:22:42 2016
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 901775360 bytes
Fixed Size 2024944 bytes
Variable Size 230689296 bytes
Database Buffers 666894336 bytes
Redo Buffers 2166784 bytes
Database mounted.
Database opened.
SQL>
Disconnected from Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30820196/viewspace-2126428/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30820196/viewspace-2126428/