CentOS 6 安装Oracle11g

简介:

原创作品。从 “深蓝blog” 博客,欢迎转载,请务必注明转载如下源。否则追究其版权责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/40181661

1. 主机配置

[root@hyltest /]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.61 hyltest

~

~

[root@hyltest /]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"

NM_CONTROLLED="yes"

ONBOOT="yes"

HWADDR=08:00:27:97:CF:CA

TYPE=Ethernet

BOOTPROTO=none

IPADDR=192.168.56.61

PREFIX=24

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"

UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03

~

~

 

[root@hyltest /]# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hyltest

~

~

#vi serverstop.sh

--编写关闭服务脚本

chkconfig iptables off
chkconfig ip6tables off
chkconfig cups off
chkconfig firstboot off
chkconfig wpa_supplicant off
chkconfig postfix off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
#sh serverstop.sh

--运行关闭服务脚本 

2. 安装包等

官方文档要求安装的包:

The following packages (or later versions) must be installed:

binutils-2.20.51.0.2-5.11.el6.i686

compat-libcap1-1.10-1.i686

compat-libstdc++-33-3.2.3-69.el6.i686

gcc-4.4.4-13.el6.i686

gcc-c++-4.4.4-13.el6.i686

glibc-2.12-1.7.el6.i686

glibc-devel-2.12-1.7.el6.i686

ksh

libgcc-4.4.4-13.el6.i686

libstdc++-4.4.4-13.el6.i686

libstdc++-devel-4.4.4-13.el6.i686

libaio-0.3.107-10.el6.i686

libaio-devel-0.3.107-10.el6.i686

make-3.81-19.el6.i686

sysstat-9.0.4-11.el6.i686

依据官方文档要求,上传对应的包,例如以下:

#vi rpm.sh

--编写安装rpm包脚本

rpm -ivh binutils-2.20.51.0.2-5.28.el6.x86_64.rpm
rpm -ivh binutils-devel-2.20.51.0.2-5.28.el6.i686.rpm
rpm -ivh binutils-devel-2.20.51.0.2-5.28.el6.x86_64.rpm
rpm -ivh compat-libcap1-1.10-1.i686.rpm
rpm -ivh compat-libcap1-1.10-1.x86_64.rpm
rpm -ivh compat-libstdc++-296-2.96-144.el6.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-3.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-3.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.47.el6.i686.rpm
rpm -ivh glibc-2.12-1.47.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.47.el6.i686.rpm
rpm -ivh glibc-devel-2.12-1.47.el6.x86_64.rpm
rpm -ivh ksh-20100621-12.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
rpm -ivh libgcc-4.4.6-3.el6.i686.rpm
rpm -ivh libgcc-4.4.6-3.el6.x86_64.rpm
rpm -ivh libstdc++-4.4.6-3.el6.i686.rpm
rpm -ivh libstdc++-4.4.6-3.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.6-3.el6.i686.rpm
rpm -ivh libstdc++-devel-4.4.6-3.el6.x86_64.rpm
rpm -ivh make-3.81-19.el6.x86_64.rpm
rpm -ivh sysstat-9.0.4-18.el6.x86_64.rpm
#sh rpm.sh

--运行安装rpm包脚本

 配置yum

參考其他文章,訪问地址例如以下:

http://blog.csdn.net/huangyanlong/article/details/38614971

#vi yum.sh

--编写yum安装脚本。脚本里使用yum安装的与rpm包单独安装的有反复的,但没关系遇到已安装过的包时会自己主动检查版本号跳过安装

yum -y install autoconf
yum -y install automake
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-db
yum -y install compat-db42
yum -y install compat-db43
yum -y install compat-gcc-34
yum -y install compat-gcc-34-c++
yum -y install compatlibstdc++-33
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXp.so.6
yum -y install libXt.so.6
yum -y install libXtst.so.6
yum -y install libgcc_s.so.1
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install unixODBC
yum -y install unixODBC-devel
#sh yum.sh

--运行yum安装脚本

3. 加入用户、组、文件夹

[root@hyltest /]# groupadd oinstall

--加入oinstall

[root@hyltest /]# groupadd dba

--加入dba

[root@hyltest /]# useradd -g oinstall -G dba oracle

--加入oracle用户,主组为oinstall,属组为dba

[root@hyltest /]# passwd oracle

--oracle用户创建password

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.

[root@hyltest /]# id oracle

--查看oracleid

uid=501(oracle) gid=602(oinstall) groups=602(oinstall),603(dba)

[root@hyltest /]# mkdir -p /u01/app/oracle

--创建oracle相关文件夹

[root@hyltest /]# mkdir -p /u01/app/oraInventory

[root@hyltest /]# chown -R oracle:oinstall /u01/app

--将文件夹归属于oracle及其相关组

[root@hyltest /]# chmod -R 775 /u01/app

--赋予oracle对相关文件夹的訪问权限

4. 配置内核參数等

[root@hyltest /]# vi /etc/sysctl.conf

--改动内核參数

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65500

net.core.rmem_default = 4194304

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 262144

~

[root@hyltest /]# 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

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

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

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

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 68719476736

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65500

net.core.rmem_default = 4194304

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 262144

[oracle@hyltest ~]$ vi .bash_profile

--改动oracle环境变量

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

ORACLE_SID=xcky

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH

~

~

[root@hyltest ~]# vi /etc/security/limits.conf

--改动系统限制

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

~

[root@hyltest ~]# vi /etc/pam.d/login

session    required     /lib/security/pam_limits.so

session    required     pam_limits.so

 

~

~

# vi /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 

5. 解压安装包

解压

例:解压.zip

# unzip p13390677_112040_Linux-x86-64_1of7.zip

# unzip p13390677_112040_Linux-x86-64_2of7.zip 

6. 图形化安装oracle11g

使用X-manager远程调用图形化界面。例如以下图中指令:

操作例如以下:

[root@hyltest ~]# xhost +

--开启图形化功能

access control disabled, clients can connect from any host

[root@hyltest ~]# su - oracle

[oracle@hyltest ~]$ cd /soft

[oracle@hyltest soft]$ ls

database  rpm11  rpm11odbc  rpm.sh  serverstop.sh  yum.sh

[oracle@hyltest soft]$ cd database

[oracle@hyltest database]$ ls

install      response  runInstaller  stage

readme.html  rpm       sshsetup      welcome.html

[oracle@hyltest database]$ ./runInstaller

--运行安装程序

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 15998 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-10-15_08-33-36PM. Please wait ...[oracle@hyltest database]$ You can find the log of this install session at:

 /u01/app/oraInventory/logs/installActions2014-10-15_08-33-36PM.log

进入到图形化后,依照提示逐步进行就可以,參考步骤例如以下:

[root@hyltest ~]# /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@hyltest ~]# /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@hyltest ~]# /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.

 

7. dbca建库

[oracle@hyltest database]$ dbca

8. netca配置监听

[oracle@hyltest database]$ netca

9. 配置开机实例自启动

[root@hyltest ~]# vi /etc/rc.d/rc.local

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

 

touch /var/lock/subsys/local

su - oracle -c "/u01/app/oracle/product/11.2.0/db_1/bin/dbstart start"

su - oracle -c "/u01/app/oracle/product/11.2.0/db_1/bin/lsnrctl start"

~

~

~

~

 

[root@hyltest ~]# vi /etc/oratab

# This file is used by ORACLE utilities.  It is created by root.sh

# and updated by either Database Configuration Assistant while creating

# a database or ASM Configuration Assistant while creating ASM instance.

 

# A colon, ':', is used as the field terminator.  A new line terminates

# the entry.  Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively.  The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

xcky:/u01/app/oracle/product/11.2.0/db_1:Y

~

"/etc/oratab" 23L, 784C written

 

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明下面出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/40181661  







本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/5030868.html,如需转载请自行联系原作者


相关文章
|
2月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第16天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括配置系统源、安装 SQL Server 2019 软件包以及数据库初始化,确保 SQL Server 正常运行。
|
2月前
|
Oracle 关系型数据库 MySQL
Centos7下图形化部署单点KFS同步工具并将Oracle增量同步到KES
Centos7下图形化部署单点KFS同步工具并将Oracle增量同步到KES
Centos7下图形化部署单点KFS同步工具并将Oracle增量同步到KES
|
2月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第8天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括系统准备、配置安装源、安装 SQL Server 软件包、运行安装程序、初始化数据库以及配置远程连接。通过这些步骤,您可以顺利地在 CentOS 系统上部署和使用 SQL Server 2019。
109 1
|
2月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第7天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括系统要求检查与准备、配置安装源、安装 SQL Server 2019、配置 SQL Server 以及数据库初始化(可选)。通过这些步骤,你可以成功安装并初步配置 SQL Server 2019,进行简单的数据库操作。
|
2月前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。通过具体案例,读者可以了解如何准备环境、下载源码、编译安装、配置服务及登录 MySQL。编译源码安装虽然复杂,但提供了更高的定制性和灵活性,适用于需要高度定制的场景。
135 3
|
2月前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。
本文介绍了在 CentOS 7 中通过编译源码安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。内容涵盖准备工作、下载源码、编译安装、配置服务、登录设置及实践心得,帮助读者根据需求选择最适合的安装方法。
137 2
|
2月前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据需求选择最合适的方法。通过具体案例,展示了编译源码安装的灵活性和定制性。
198 2
|
3月前
|
Linux 知识图谱
Centos7安装killall,fuser, killall,pstree和pstree.x11
通过上述步骤,您已在CentOS 7系统中成功部署了killall、fuser、pstree以及pstree.x11,为高效管理系统进程打下了坚实基础。更多关于服务器管理与优化的知识,获取全面技术支持与解决方案。
116 1
|
3月前
|
监控 安全 Linux
CentOS7下安装配置ntp服务的方法教程
通过以上步骤,您不仅能在CentOS 7系统中成功部署NTP服务,还能确保其配置合理、运行稳定,为系统时间的精确性提供保障。欲了解更多高级配置或遇到特定问题,提供了丰富的服务器管理和优化资源,可作为进一步学习和求助的平台。
276 1
|
2月前
|
存储 安全 Linux
VMware安装CentOS7
【11月更文挑战第11天】本文详细介绍了在 VMware 中安装 CentOS 7 的步骤,包括准备工作、创建虚拟机、配置虚拟机硬件和安装 CentOS 7。具体步骤涵盖下载 CentOS 7 镜像文件、安装 VMware 软件、创建和配置虚拟机硬件、启动虚拟机并进行安装设置,最终完成 CentOS 7 的安装。在安装过程中,需注意合理设置磁盘分区、软件选择和网络配置,以确保系统的性能和功能满足需求。
274 0