Oracle 11g 数据库单机安装文档
1.配置Linux Kernel
在sysctl.conf文件添加一下内容
kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmni = 4096
kernel.sem = 250 32000 100 142 fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 1048576 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 2097152 vm.swappiness=40
vm.vfs_cache_pressure=200 vm.min_free_kbytes=409600 fs.aio-max-nr=3145728
[root@ORACLEDB data]# sysctl -p net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0
kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1
error: \"net.bridge.bridge-nf-call-ip6tables\" is an unknown key error: \"net.bridge.bridge-nf-call-iptables\" is an unknown key error: \"net.bridge.bridge-nf-call-arptables\" is an unknown key kernel.msgmnb = 65536 kernel.msgmax = 65536
kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmni = 4096
kernel.sem = 250 32000 100 142 fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 1048576 net.core.rmem_max = 4194304 net.core.wmem_default = 262144
net.core.wmem_max = 2097152 vm.swappiness = 40
vm.vfs_cache_pressure = 200 vm.min_free_kbytes = 409600 fs.aio-max-nr = 3145728
2.为oracle用户配置Resource Limit 参数
在/etc/security/limits.conf文件末尾添加如下内容
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
3.检查防火墙、SElinux配置
[root@ORACLEDB ~]# iptables -L Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination [root@ORACLEDB ~]#
[root@ORACLEDB ~]# /usr/sbin/sestatus -v SELinux status: disabled
4.创建oracle用户及其用户组
[root@ORACLEDB ~]# groupaddoinstall [root@ORACLEDB ~]# groupadddba [root@ORACLEDB ~]# groupaddoper [root@ORACLEDB ~]#
[root@ORACLEDB ~]# useradd -g oinstall -G dba,oper oracle
[root@ORACLEDB ~]# passwd oracle Changing password for user oracle. New password:
Retype new password:
passwd: all authentication tokens updated successfully.
5.创建oracle software安装目录及赋予相应权限
[root@ORACLEDB ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1 [root@ORACLEDB ~]# chown -R oracle:oinstall /u01/app [root@ORACLEDB ~]#
[root@ORACLEDB ~]# chmod -R 775 /u01/app
6.安装相应软件包
yum install compat-libcap1
yum install compat-libstdc++-33 yum install libstdc++-devel yum install gcc yum install gcc-c++ yum install ksh
yum install glibc-devel yum install libaio-devel
7.配置用户环境变量
[oracle@ORACLEDB ~]$ vim .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
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 ORACLE_SID=bjbd
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
[oracle@ORACLEDB ~]$
[oracle@ORACLEDB ~]$ . .bash_profile
8.通过xmanager连接oracle用户安装,步骤如下:
使用root用户执行此处两个脚本:
[root@ORACLEDB ~]# /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@ORACLEDB ~]# /u01/app/oracle/product/11.2.0/db_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/db_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.
Now product-specific root actions will be performed. Finished product-specific root actions.
9.配置监听服务
检查监听服务
[oracle@ORACLEDB ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-DEC-2015 13:15:25
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLEDB)(PORT=1521))) STATUS of the LISTENER ------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 15-DEC-2015 13:14:35 Uptime 0 days 0 hr. 0 min. 51 sec Trace Level off
Security ON: Local OS Authentication SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/ORACLEDB/listener/alert/log.xml Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORACLEDB)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services
The command completed successfully
10.使用DBCA建库