Centos 6 Oracle 11G 超详细安装

Desktop Environment is not neccessary for Server usage, though. But Sometimes installation or using an application requires Desktop Environment, then build Desktop Environment as follwos.

[[email protected] ~]#yum -y groupinstall "X Window System"

[[email protected] ~]#yum -y groupinstall "Desktop"

[[email protected] ~]#yum -y groupinstall "General Purpose Desktop"

  Input a command like below after finishing installation of new packages.

[[email protected] ~]#startx

[2] Install some packages first.

[[email protected] ~]# yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 ksh elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libstdc++ libstdc++.i686 libstdc++-devel
libstdc++-devel.i686 make sysstat unixODBC unixODBC-devel

[3] Edit Kernel parameters.

[[email protected] ~]#vi /etc/sysctl.conf

# comment out

#

net.bridge.bridge-nf-call-ip6tables = 0

#

net.bridge.bridge-nf-call-iptables = 0

#

net.bridge.bridge-nf-call-arptables = 0

# add follows to the end

net.ipv4.ip_local_port_range = 9000 65500

fs.file-max = 6815744

kernel.shmall = 10523004

kernel.shmmax = 6465333657

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=4194304

net.core.wmem_max=1048576

fs.aio-max-nr = 1048576

[[email protected] ~]# sysctl -pnet.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

net.ipv4.ip_local_port_range = 9000 65500

fs.file-max = 65536

kernel.shmall = 10523004

kernel.shmmax = 6465333657

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576

[4] Create user and groups for Oracle Database.
[[email protected] ~]# groupadd -g 200 oinstall

[[email protected] ~]# groupadd -g 201 dba

[[email protected] ~]# useradd -u 440 -g oinstall -G dba -d /usr/oracle oracle

[[email protected] ~]# passwd oracle

Changing password for user oracle.

New password:

Retype new password:

passwd: all authentication tokens updated successfully.

[[email protected] ~]#vi /etc/pam.d/login

# near line 14: add

session    required     pam_selinux.so open
session    required     pam_namespace.so
session    required     pam_limits.so
session    optional     pam_keyinit.so force revoke
session    include      system-auth
-session   optional     pam_ck_connector.so

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

# add follows to the end

oracle   soft   nproc   2047

oracle   hard   nproc   16384

oracle   soft   nofile   1024

oracle   hard   nofile   65536

[[email protected] ~]# vi /etc/profile

# add follows to the end

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

[5] Switch to a user "Oracle" and configure some settings.

db01 login:

oracle

Password:

[[email protected] ~]$ chmod 755 /usr/oracle

[[email protected] ~]$mkdir /usr/oracle/app

[[email protected] ~]$chmod 775 /usr/oracle/app

[[email protected] ~]$mkdir /usr/oracle/oradata

[[email protected] ~]$chmod 775 /usr/oracle/oradata

[[email protected] ~]$vi ~/.bash_profile

# add follows to the end

umask 022

export ORACLE_BASE=/usr/oracle/app

# create a temporary directory for installation

[[email protected] ~]$mkdir tmp

 
Install Oracle Database 11g R2.
[1] Login and work with "oracle" user which you create in previous section.
[2]
Download Oracle Databse 11g R2 for Linux and upload on your server.

http://www.oracle.com/technology/software/products/database/index.html

[3] After uploading Oracle files, move to a tmp directory and run an Installer like follows.
[[email protected] ~]$ cd tmp

[[email protected] tmp]$ unzip linux.x64_11gR2_database_1of2.zip

[[email protected] tmp]$ unzip linux.x64_11gR2_database_2of2.zip

[[email protected] tmp]$ ./database/runInstaller

[4] Oracle Installer starts like follows. First, Set your email address and password for receiving some infomation from Oracle like security issues and so on.
[5] On this example, Select "Install database software only".
[6] On this example, Select "Single Instance Database ***".
[7] Select your language.
[8] Select which edition you install.
[9] Specify the base directory and files for Oracle. On this example, keep default and proceed to next.
[10] Specify the installed directory. On this example, keep default and proceed to next.
[11] Specify the priviledged group. On this example, keep default and proceed to next.
[12] Checking settings runs automatically for requirements of installing Oracle. Generally, some packages requirements failed like follows, but it‘s noplobmen because most of them are higher version packages than requirements. Ignore them if the result is the
same to the follows. (For only "pdksh", it‘s not a big ploblem if it is not installed. )
[13] The summary is shown for configuration. Click "Finish" if it‘s OK all.
[14] Installation starts.
[15] Following screen is shown, then open a terminal and execute follwong commands with the root user.
[[email protected] ~]# /usr/oracle/oraInventory/orainstRoot.sh

Changing permissions of /usr/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /usr/oracle/oraInventory to oinstall.
The execution of the script is complete.
[[email protected] ~]#

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

Running Oracle 11g root.sh script...

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /usr/oracle/app/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:

# Enter

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.

Finished product-specific root actions.

[16] Installation completed. Click "Close" button.
[17] Configure some settings for Oracle user.

[[email protected] ~]$vi ~/.bash_profile

# add follows to the end

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export PATH=$PATH:$ORACLE_HOME/bin

[[email protected] ~]$

source ~/.bash_profile

[[email protected] ~]$rm -rf tmp


Create Oracle Net Listener that is a network service on Oracle.
[1]Login with the "oracle" user and input a command "netca" like follows.  
[[email protected] ~]$ netca
[2] Check a box "Listener Configuration" and go next.
[3] Go next.
[4] Set Listner‘s name. Input any one you like.
[5] This example goes next with keeping default "TCP".
[6] Set a port. This example goes next with keeping default.
[7] If you‘d like to create more Listeners, Answer "Yes". This example selects "No".
[8] Configuration completed.
[9] Click "Finish" to quit. After finishing, Confirm the status by "netstat" comand. Then you‘ll see "tnslsnr" listens 1521 port.

 
Create a Database.
[1] Login with the "oracle" user and input a command "dbca" like follows.
[[email protected] ~]$ dbca
[2] Click "Next" to proceed.
[3] Select "Create Database" and go next.
[4] This example selects "General Purpose ***" and go next.
[5] Set Grobal Database name and SID like follows. Input any one you like.
[6] This example goes next with keeping default.
[7] Set passwords. Please set a password for a user for security.
[8] This example goes next with keeping default "File System".
[9] Configure recovery settings. If you‘d like to change it, Set it.
[10] Configure sample schema and scripts. If you‘d like to add them, Set them.
[11] Configure memory settings. After setting, go to next tab.
[12] Specify max processes.
[13] Set Character setting.
[14] Select a connection mode. If your server does not have many clients, Select Dedicated server mode. If your server has many clients, Select Shared server mode.
[15] Confirm parameters for Storage settings. If you‘d like to change, set them.
[16] Configuration completed. Click "Finish" button to finish.
[17] Confirm settings and Click "OK" if all are OK.
[18] Database creation starts.
[19] After completing to create a database, Click "Exit" to finish.
[20] Access to the URL that is shown on finished screen above with web browser, then follwing screen is shown. Input a user name and password that you configured on the section [6].
[21] Just logined. It‘s possible to manage the database on here.

 
Create an init Script to make Oracle start automatically on system booting.
[1] Set environment variables for "oracle" user like follows.

[[email protected] ~]$vi /etc/oratab

# end line: change

db01:/usr/oracle/app/product/11.2.0/dbhome_1:

Y

[[email protected] ~]$vi ~/.bash_profile

# add follows to the end

export ORACLE_SID=db01

[2] Create an init Script with the root user.

[[email protected] ~]#vi /etc/rc.d/init.d/oracle

# it‘s an example, edit it you like.

#!/bin/bash

# oracle: Start/Stop Oracle Database 11g R2
#
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
#
# processname: oracle

. /etc/rc.d/init.d/functions

LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1
ORACLE_USER=oracle

case "$1" in
‘start‘)
    if [ -f $LOCKFILE ]; then
        echo $0 already running.
        exit 1
    fi
    echo -n $"Starting Oracle Database:"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
    touch $LOCKFILE
    ;;
‘stop‘)
    if [ ! -f $LOCKFILE ]; then
        echo $0 already stopping.
        exit 1
    fi
    echo -n $"Stopping Oracle Database:"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
    rm -f $LOCKFILE
    ;;
‘restart‘)
    $0 stop
    $0 start
    ;;
‘status‘)
    if [ -f $LOCKFILE ]; then
        echo $0 started.
    else
        echo $0 stopped.
    fi
    ;;
*)
    echo "Usage: $0 [start|stop|status]"
    exit 1
esac

exit 0

[[email protected] ~]#chmod 755 /etc/rc.d/init.d/oracle

[[email protected] ~]#chkconfig --add oracle

[[email protected] ~]#chkconfig oracle on

时间: 2024-10-10 02:05:45

Centos 6 Oracle 11G 超详细安装的相关文章

Centos 5 Oracle 11G 超详细安装

  Install Oracle Database 11g R2. Desktop Environment is required because installation proceeds on GUI. Before Installing, Change some settings for requirement of installing Oracle. [1] Install some packages [[email protected] ~]# yum -y install binu

Centos 7 Oracle 12C 超详细安装

[1] 先决环境Install Desktop Environment, refer to here. [2] Install required packages. [[email protected] ~]# yum -y install binutils compat-libcap1 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686

Oracle 11g超详细安装步骤

一.首先是Oracle的安装 软件请自行到网上下载 18.等待,出现选择项时点击next 二.打开服务 三.验证数据库是否安装成功 原文地址:https://www.cnblogs.com/zhanzhuang/p/9100802.html

Centos 6 Oracle 12C 超详细安装

  Install Oracle Database 12c. Before Installing, Change some settings for requirements of installing Oracle database. [1] Install Desktop Environment, refer to here. [2] Install some packages first. [[email protected] ~]# yum -y install binutils com

RHEL 5下oracle 11g的详细安装

在linux下安装oracle数据库是一个比较复杂的过程,那么在详细的安装操作之前,我首先将整个的环境描述一下 1.oracle数据库的安装环境 oracle数据库是一个软件,所以必须依赖操作系统,这里我选择的操作系统是red hat enterprise linux 5,安装环境是vmware下的虚拟机,给的物理内存是2GB,而给的虚拟内存是4GB 2.安装oracle 11g大致的步骤 环境准备 数据库安装 接下来就开始具体的操作了 一.环境准备 1.划分区 /   15000M /tmp 

Oracle 11g数据库详细安装步骤图解

1.先到Oracle官网上下载11g oracle Database 11g 第 2 版 (11.2.0.1.0) 标准版.标准版 1 以及企业版 适用于 Microsoft Windows (x64) 的 Oracle Database 11g 第 2 版 (11.2.0.1.0) 下载地址: http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_database_1of2.zip http://download.orac

CentOS上oracle 11g R2数据库安装折腾记

1.虚拟机上centos镜像的获取.这里推荐网易镜像站中的CentOS7版本(其他开源镜像站亦可).这里给出链接: http://mirrors.163.com/centos/7.3.1611/isos/x86_64/CentOS-7-x86_64-DVD-1611.iso ps:这是64位的,现在也很少人使用32位系统了吧.安装CentOS系统(网上教程很多,这里不再赘述) ps:最好留着10G左右的空留空间(安装包就有2G,再加上最后安装的体积,多留点,笔者安装时就不够用了,到时候虚拟机中扩

安装64位Oracle 10g超详细教程

安装64位Oracle 10g超详细教程 1. 安装准备阶段 1.1 安装Oracle环境 经过上一篇博文的过程,已经完成了对Linux系统的安装,本例使用X-Manager来实现与Linux系统的连接,本例使用的所有命令和操作都是在X-Manager下进行.X-Manager安装完成后的配置方法如下: 1.  打开X-Manager的X-Shell 2. 点击New,新建一个连接地址,设置完成后,点击OK3.  使用用户名,密码进行登录,登录完成后,进入如下图所示画面即成功连接到Linux系统

Oracle11超详细安装教程和配置

这篇博客主要是介绍一下Oracle数据的安装过程和简单的配置,帮助大家可以简单的让Oracle运行起来,只是一个基础的教程. 准备工作: 如果你以前装过Oracle数据库,而且安装目录要改变请先打开注册表编辑器里的: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\和HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Oracle11和它下面的几个.如果你没安装过Oracle产品的话在注册表里面的与Oracle有关的注册