Home Database Mysql Tutorial CentOS 6.3 32位静默安装Oracle 11g r2详细教程

CentOS 6.3 32位静默安装Oracle 11g r2详细教程

Jun 07, 2016 pm 03:02 PM
32 bit centos oracle Install

CentOS6.332位静默安装Oracle11gr2详细教程 一、安装依赖包 binutils 2.17.50.0.6 compat-libstdc++-33 3.2.3 elfutils-libelf 0.125 elfutils-libelf-devel 0.125 elfutils-libelf-devel-static 0.125 gcc 4.1.2 gcc-c++ 4.1.2 glibc 2.5-24 glibc-common 2

CentOS 6.3 32位静默安装Oracle 11g r2详细教程

 

一、安装依赖包

binutils2.17.50.0.6

compat-libstdc++-33              3.2.3

elfutils-libelf0.125

elfutils-libelf-devel0.125

elfutils-libelf-devel-static0.125

gcc4.1.2

gcc-c++4.1.2

glibc2.5-24

glibc-common2.5

glibc-devel2.5

glibc-headers2.5

kernel-headers2.6.18

ksh20060214

libaio0.3.106

libaio-devel0.3.106 

libgcc4.1.2

libgomp4.1.2

libstdc++4.1.2 

libstdc++-devel4.1.2

make3.81

sysstat7.0.2

unixODBC2.2.11

unixODBC-devel2.2.11

 

yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel

 

二、修改内核参数

1、修改/etc/sysctl.conf文件

(1)、以root身份登录

(2)、编辑文件 #vim /etc/sysctl.conf,修改以下参数,如果没有可以自己添加,如果默认值比参考值大,则不需要修改。

 

kernel.shmall = 2097152    //表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改

kernel.shmmax = 2147483648    //定义了共享内存段的最大尺寸(以字节为单位)。缺省为32M,对于oracle来说,该缺省值太低了,通常将其设置为2G=2147483648/1024/1024/1024

 

kernel.shmmni = 4096    //用于设置系统范围内共享内存段的最大数量。该参数的默认值是 4096 。通常不需要更改

kernel.sem = 250 32000 100 128    //表示设置的信号量

fs.file-max = 65536    //表示文件句柄的最大数量。文件句柄表示在Linux系统中可以打开的文件数量。其实是由"fs.file-max = 512 * PROCESSES"得到的,我们指定PROCESSES的值为128,即为"fs.file-max =512 *128"。

fs.aio-max-nr = 1048576    //同时可以拥有的的异步IO请求数目。

net.ipv4.ip_local_port_range = 1024 65000    //应用程序可使用的Ipv4端口范围。

 

net.core.rmem_default = 262144    //默认的接收窗口大小

net.core.rmem_max = 4194304    //接收窗口的最大大小

net.core.wmem_default = 262144    //默认的发送窗口大小

net.core.wmem_max = 1048586    //发送窗口的最大大小

 

fs.aio-max-nr = 1048576

fs.file-max = 6815744

 

kernel.shmall = 2097152

kernel.shmmax = 536870912

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 = 1048586

 

 

(3)、运行#sysctl -p ,即可马上生效。

(4)、运行 #sysctl  -p 命令报错

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

 

解决方法,执行如下命令:

#modprobe  bridge

#lsmod|grep  bridge

 

 

2、为oracle用户设置Shell限制

    (1)、编辑文件 #vim /etc/security/limits.conf ,添加如下行:

 

oracle           soft    nproc   2047

oracle           hard    nproc   16384

oracle           soft    nofile  1024

oracle           hard    nofile  65536

 

    (2)、编辑文件 #vim /etc/pam.d/login    ,添加如下行:

 

        session    required     pam_limits.so

 

    (3)、查看/etc/selinux/config 文件,确保SELINUX 为disabled状态

 

            SELINUX=disabled

 

 

查看SELinux状态:getenforce

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0  ##设置SELinux 成为permissive模式

        ##setenforce 1 设置SELinux 成为enforcing模式

 

3、编辑/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

 

4、编辑 /etc/csh.login ,添加如下配置:

 

if ( $USER == "oracle" ) then

        limit maxproc 16384

        limit descriptors 65536

endif

 

3、注:内核参数并非必须修改,可以根据自己实际情况而定。

 

三、创建用户和组及安装目录

1、创建Oracle用户与组

  在这里只讨论单主机环境,不考虑RAC环境的配置。

  执行以下指令以新增oracle安装时所需要的使用者与群组。

  (1) 建立群组oinstall

# groupadd oinstall

  (2) 建立群组dba

# groupadd oradba

  (3) 新增使用者oracle并将其加入oinstall和dba群组

# useradd -g oinstall -G oradba oracle

  (4) 测试oracle账号是否建立完成

# id oracle

  (5) 建立oracle的新密码

# passwd oracle

  (6)将oracle使用者加入到sudo群组中

# vim /etc/sudoers

  找到

  root ALL=(ALL) ALL

  这行,并且在底下再加入

oracle ALL=(ALL) ALL

  输入wq!或者x!(由于这是一份只读文档所以需要再加上!)并且按下Enter

 

 

2、创建oracle安装时的目标目录

 

(1) 以root身份登录

(2) 创建Oracle系统目录:# mkdir -p /app/oracle

(3) 创建Oracle服务器主目录:# mkdir /app/oracle/11g

(4) 将该目录的所有者设置为oracle:# chown -R oracle:oinstall /app/oracle 

(5) 编辑 /etc/profile,在后面追加以下内容

 

export ORACLE_BASE=/app/oracle

export ORACLE_HOME=/app/oracle/11g

export ORACLE_SID=ora11g

export PATH=$PATH:$ORACLE_HOME/bin

 

运行# source /etc/profile 使其立即生效

(6) 注: 安装Oracle的目标目录可以任意指定, 但是安装和运行Oracle的用户必须有完全修改该目录的权限

 

四、编辑安装需要的应答文件

(1) 以root身份登录

(2) 静默模式(Silent)安装必须指定一个应答文件db_install.rsp来完成安装过程所须的各类参数。

(3) 编辑db_install.rsp,修改以下这些项目的值。

 

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=localhost

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/app/oracle/oraInventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/app/oracle/11g

ORACLE_BASE=/app/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.DBA_GROUP=oradba

oracle.install.db.OPER_GROUP=oinstall

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=oracle11g

oracle.install.db.config.starterdb.SID=ora11g

oracle.install.db.config.starterdb.characterSet=AL32UTF8

oracle.install.db.config.starterdb.password.ALL=manager

DECLINE_SECURITY_UPDATES=true

 

其它项目用默认值即可,也可以根据自己的须要进行修改

 

(4) 注:如果Oracle从光盘安装,必须先将应答文件复制到硬盘上,才能修改

 

五、开始安装

(1) 用oracle用户登录,然后在Oracle安装目录里执行

    $ ./runInstaller -ignoreSysPrereqs -silent -noconfig -responseFile 

(2) 接下来就是等待安装结束了。

各安装参数的含义如下:

-ignoreSysPrereqs 让Oracle忽略系统检查,因为Oracle官方声明只支持Linux服务器产品,所以要在非服务器产品的Linux上安装就必须指定此参数。

-silent 表示以静默方式安装,不会有任何提示

-force 允许安装到一个非空目录

-noconfig 表示不运行配置助手netca

-responseFile 表示使用哪个响应文件,必需使用绝对路径

 

在这里我输入:

$ ./runInstaller -ignoreSysPrereqs -silent -noconfig -responseFile /mnt/hgfs/tmp/oracle11g/response/db_install.rsp

当前目录为安装目录系统反应为:

    Starting Oracle Universal Installer...

    Checking installer requirements...

 

六、系统初始化

(1) 以root用户登录

(2) 运行以下两个脚本:

$ORACLE_BASE/oraInventory/orainstRoot.sh

$ORACLE_HOME/root.sh

 

七、安装网络监听器

(1) 以oracle登陆

(2) 没有网络监听器,客户端就无法通过网络连接Oralce服务器。要在命令行安装网络监听器,也只能使用静默模式。

(3) 运行:

    $ORACLE_HOME/bin/netca /silent /responseFile 

这里我输入的命令为:

$ORACLE_HOME/bin/netca /silent /responseFile /mnt/hgfs/tmp/oracle11g/response/netca.rsp

 

系统反应:

Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /mnt/hgfs/tmp/oracle11g/response/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control: 

      /app/oracle/11g/bin/lsnrctl start LISTENER

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

 

(4) 查看监听器状态

 

    $ORACLE_HOME/bin/lsnrctl status

 

八、修改dbstart

(1) 以oracle身份登录

(2) 打开 $ORACLE_HOME/bin/dbstart,将

    ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

 改为

    ORACLE_HOME_LISTNER=$ORACLE_HOME

 否则网络监听器可能无法自动启动。

 

九、安装数据库实例

(1) 以root身份登录   

(2) 编辑Oracle安装目录里response子目录下的应答文件 dbca.rsp,修改以下项目:

 

RESPONSEFILE_VERSION = "11.2.0"  //不能更改

OPERATION_TYPE = "createDatabase"

GDBNAME="oracle11g" 全局数据库的名字=SID+主机域名,这里我设置为:oracle11g

SID="ora11g" 数据库的SID,这个比较重要,我第一次安装时就是因为这个问题无法使用,这里我修改为:ora11g

TEMPLATENAME = "General_Purpose.dbc" //建库用的模板文件

SYSPASSWORD="manager"    SYS用户的初始密码,我设置为manager

SYSTEMPASSWORD="manager"    SYSTEM用户的初始密码,我设置为manager

DATAFILEDESTINATION = /app/oracle/oradata //数据文件存放目录

RECOVERYAREADESTINATION=/app/oracle/oradata_back //恢复数据存放目录

CHARACTERSET="ZHS16GBK" 数据库字符集,重要!!!! 建库后一般不能更改(中文为 ZHS16GBK

TOTALMEMORY = "800"  //oracle内存800MB

 

(3)然后登陆oracle运行

    $ORACLE_HOME/bin/dbca -silent -responseFile  -cloneTemplate

这里我输入的命令为:

$ORACLE_HOME/bin/dbca -silent responseFile /mnt/hgfs/tmp/oracle11g/response/dbca.rsp -cloneTemplate

(4) 系统反应:

 

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

50% complete

55% complete

56% complete

60% complete

62% complete

Completing Database Creation

66% complete

70% complete

73% complete

85% complete

96% complete

100% complete

Look at the log file "/app/oracle/cfgtoollogs/dbca/oracle11g/oracle11.log" for further details.

 

十、修改Oracle启动配置文件:/etc/oratab

(1) 以oracle用户登录

(2) 然后编辑 /etc/oratab

    将::N

    修改为ora11g:/app/oracle/11g:Y

    使数据库实例能够自动启动。

 

十一、启动和关闭Oracle

oracle用户登录

(1) 检查看看监听器是否有启动

        $ORACLE_HOME/bin/lsnrctl status

如果没有启动,可以输入:

    $ORACLE_HOME/bin/lsnrctl start

 

(2) 启动Oracle实例

以sysdba身份登入数据库,输入:

        $ sqlplus sys as sysdba

输入密码。(显示SQL>)

接着请输入

SQL> startup

就可以正常的启动数据库了。

备注:也可以用$ORACLE_HOME/bin/dbstart启动数据库实例

 

(3) 关闭数据库实例

SQL> shutdown immediate

备注:也可以用 $ORACLE_HOME/bin/dbstart 启动数据库实例

 

(4) 关闭监听

lsnrctl stop  

 

十二、让Oracle运行为服务

(1) 以root身份登录

(2) 创建文件 /etc/init.d/oracle,输入下列内容

 

#!/bin/sh

# chkconfig: 35 80 10

# description: Oracle auto start-stop script.

 

#

# Set ORACLE_HOME to be equivalent to the $ORACLE_HOME

# from which you wish to execute dbstart and dbshut;

#

# Set ORACLE_OWNER to the user id of the owner of the

# Oracle database in ORACLE_HOME.

ORACLE_HOME=/app/oracle/11g

ORACLE_OWNER=oracle

if [ ! -f $ORACLE_HOME/bin/dbstart ]

then

    echo "Oracle startup: cannot start"

    exit

fi

case "$1" in

'start')

# Start the Oracle databases:

echo "Starting Oracle Databases ... "

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart" >>/var/log/oracle

echo "Done"

 

# Start the Listener:

echo "Starting Oracle Listeners ... "

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" >>/var/log/oracle

echo "Done."

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Finished." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

touch /var/lock/subsys/oracle

;;

 

'stop')

# Stop the Oracle Listener:

echo "Stoping Oracle Listeners ... "

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Stoping Oracle Listener as part of system down." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" >>/var/log/oracle

echo "Done."

rm -f /var/lock/subsys/oracle

 

# Stop the Oracle Database:

echo "Stoping Oracle Databases ... "

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Stoping Oracle Databases as part of system down." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut" >>/var/log/oracle

echo "Done."

echo ""

echo "-------------------------------------------------" >> /var/log/oracle

date +" %T %a %D : Finished." >> /var/log/oracle

echo "-------------------------------------------------" >> /var/log/oracle

;;

 

'restart')

$0 stop

$0 start

;;

esac

 

(3) 然后将这个文件赋予可执行的权限,运行

    chmod a+x /etc/init.d/oracle

(4) 添加Oracle服务并设置在Linux启动时自动运行

 

chkconfig --level 35 oracle on #添加Oracle服务,并设置3、5启动级别自动启动oracle

chkconfig --list oracle #查看服务信息

 

这样就可以用service oracle start|stop|restart来启动、停止和重启Oracle了

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to optimize CentOS HDFS configuration How to optimize CentOS HDFS configuration Apr 14, 2025 pm 07:15 PM

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

Centos stops maintenance 2024 Centos stops maintenance 2024 Apr 14, 2025 pm 08:39 PM

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

How to check CentOS HDFS configuration How to check CentOS HDFS configuration Apr 14, 2025 pm 07:21 PM

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

Centos shutdown command line Centos shutdown command line Apr 14, 2025 pm 09:12 PM

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

Tips for using HDFS file system on CentOS Tips for using HDFS file system on CentOS Apr 14, 2025 pm 07:30 PM

The Installation, Configuration and Optimization Guide for HDFS File System under CentOS System This article will guide you how to install, configure and optimize Hadoop Distributed File System (HDFS) on CentOS System. HDFS installation and configuration Java environment installation: First, make sure that the appropriate Java environment is installed. Edit /etc/profile file, add the following, and replace /usr/lib/java-1.8.0/jdk1.8.0_144 with your actual Java installation path: exportJAVA_HOME=/usr/lib/java-1.8.0/jdk1.8.0_144exportPATH=$J

Difference between centos and ubuntu Difference between centos and ubuntu Apr 14, 2025 pm 09:09 PM

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

What files do you need to modify in HDFS configuration CentOS? What files do you need to modify in HDFS configuration CentOS? Apr 14, 2025 pm 07:27 PM

When configuring Hadoop Distributed File System (HDFS) on CentOS, the following key configuration files need to be modified: core-site.xml: fs.defaultFS: Specifies the default file system address of HDFS, such as hdfs://localhost:9000. hadoop.tmp.dir: Specifies the storage directory for Hadoop temporary files. hadoop.proxyuser.root.hosts and hadoop.proxyuser.ro

What are the backup methods for GitLab on CentOS What are the backup methods for GitLab on CentOS Apr 14, 2025 pm 05:33 PM

Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

See all articles