oracle(环境搭建一)

简介: 图形化安装Oracle11gR2环境: verify: CentOS release 6.5 (Final) release:CentOS release 6.7 (Final)1、登录到root用户下: 2、安装相关软件依赖包灰色部分存在问题,不执行切换到yum.

图形化安装Oracle11gR2

环境:

 verify: CentOS release 6.5 (Final)

 release:CentOS release 6.7 (Final)

1、登录到root用户下:

 

2、安装相关软件依赖包

灰色部分存在问题,不执行

切换到yum.repos.d目录下:

cd /etc/yum.repos.d

使用wget下载oracle提供的yum库:

wget https://public-yum.oracle.com/public-yum-ol6.repo

下载yum源

       执行yum语句安装所有的oracle所需的先决条件:

yum install oracle-rdbms-server-11gR2-preinstall

       如果出现” GPG key retrieval failed “的错误:

              wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

       如果以上步骤不成功则依次检查安装以下包:

       检查:rpm -q package-name

       安装:yum install -y package-name

binutils-2.20.51.0.2-5.11.el6 (x86_64)

compat-libcap1-1.10-1 (x86_64)

compat-libstdc++-33-3.2.3-69.el6 (x86_64)

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

glibc-2.12-1.7.el6 (i686)

glibc-2.12-1.7.el6 (x86_64)

glibc-devel-2.12-1.7.el6 (x86_64)

glibc-devel-2.12-1.7.el6.i686

gcc-4.4.4-13.el6 (x86_64)

gcc-c++-4.4.4-13.el6 (x86_64)

ksh

libgcc-4.4.4-13.el6 (i686)

libgcc-4.4.4-13.el6 (x86_64)

libstdc++-4.4.4-13.el6 (x86_64)

libstdc++-4.4.4-13.el6.i686

libstdc++-devel-4.4.4-13.el6 (x86_64)

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

libaio-0.3.107-10.el6 (x86_64)

libaio-0.3.107-10.el6.i686

libaio-devel-0.3.107-10.el6 (x86_64)

libaio-devel-0.3.107-10.el6.i686

make-3.81-19.el6

sysstat-9.0.4-11.el6 (x86_64)

3、创建oracle用户,组

创建Oracle安装组oinstall,数据库管理员组dba,及oracle用户

# /usr/sbin/groupadd oinstall

# /usr/sbin/groupadd dba

# /usr/sbin/useradd -g oinstall -G dba oracle(主组oinstall,其它组:dba)

# passwd oracle

4、修改操作系统参数

 配置内核参数:

可以直接在/etc/sysctl.conf文件中添加以下参数:

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 4294967295

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

然后使用/sbin/sysctl -p   --使内核参数实时生效

5、为Oracle用户设置Shell限制

使用命令vim /etc/security/limits.conf添加以下内容

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

oracle              soft    stack   10240

6、建立oracle安装目录和环境变量配置:

建立安装目录

创建oracle用户目录: mkdir -p /u01/app/oracle

指定所有者、组和权限

chown -R oracle:oinstall /u01/app/

chmod -R 775 /u01/app/

 

在/etc/profile末尾增加oracle相关限制

vim /etc/profile

#Oracle判断

if [ \$USER = "oracle" ]; then

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

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022 

fi

 

 

设置Oracle用户环境变量

[root@qiao oracle]# su - oracle    --切换到Oracle用户下,接下来的步骤都是oracle用户下操作

vim ~/.bash_profile          --编辑Oracle环境变量配置文件

添加以下内容:

export ORACLE_BASE=/u01/app

export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=ocp  --默认实例名

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK/UTF8  ---数据库编码

export NLS_DATE_FORMAT=YYYY/MM/DD ----数据库时间格式

----以下两个设置是用来设置rlwrap插件的环境

alias sqlplus="rlwrap sqlplus"

alias rman="rlwrap rman"

 

source /home/oracle/.bash_profile  --使配置生效

 

5、安装数据库软件

5.1、准备Oracle11g安装文件并解压

unzip p13390677_112040_Linux-x86-64_1of7.zip -d /u01/app/

unzip p13390677_112040_Linux-x86-64_2of7.zip -d /u01/app/

5.2、静默安装

       cd /u01/app/database/response

       cd /u01/app/database/response

       mv db_install.rsp db_install.rsp.bak

       vim db_install.rsp

       添加压缩包下的db_install.rsp的内容

      

       文件中ORACLE_HOSTNAME,要与主机名一致

      

chmod 640 db_install.rsp

 

灰色部分手动建库时会做

vim dbca.rsp

修改以下内容:

GDBNAME = "upcrm"

SID = "upcrm"

SYSPASSWORD = "upcrm"

SYSTEMPASSWORD = "upcrm"

EMCONFIGURATION = "LOCAL"

SYSMANPASSWORD = "upcrm"

DBSNMPPASSWORD = "upcrm"

 

vim netca.rsp

修改以下内容:

INSTALL_TYPE=""custom""

 

cd ..

./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp

 

 

安装失败,返回检查配置

 

最后会提示成功

在此过程中的安装都会记录到:

/u01/app/oracle/oraInventory/logs/installActions2016-08-25_06-31-10AM.log

 

灰色部分建库时会执行

cd /u01/app/database/response

dbca -silent -cloneTemplate -responseFile ./dbca.rsp

 

netca /silent /responseFile /u01/app/database/response/netca.rsp

 

切换到root用户下

vim /etc/hosts  查看是否有hostname显示的主机名称

如果没有就添加上

 

灰色部分建库时会执行

切换回oracle用户下:

lsnrctl start

 

sqlplus / as sysdba

SQL> create spfile from pfile='/u01/app/admin/upcrm/pfile/init.ora';

SQL> startup nomount;

6、安装rlwrap实现sqlplus的回显功能

[oracle@localhost home]$ rpm -ivh rlwrap-0.37-1.el6.x86_64.rpm

遇上的一些错误:

1.    PRVF-0002 : Could not retrieve local nodename

信息:

 

[oracle@QYSD-Test database]$ ./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp

Starting Oracle Universal Installer...

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

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

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-14_08-25-10PM. Please wait ...[oracle@QYSD-Test database]$ [FATAL] PRVF-0002 : Could not retrieve local nodename

A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-25-10PM/installActions2016-11-14_08-25-10PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.

解决方式:

修改/etc/hosts文件,添加主机名称。

例如:

127.0.0.1   QYSD-Test localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         QYSD-Test localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.115 QYSD-Test

2.    Finding the most appropriate exit status for the current application

 信息:

 

[oracle@QYSD-Test database]$ ./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp

Starting Oracle Universal Installer...

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

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

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-14_08-32-42PM. Please wait ...[oracle@QYSD-Test database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.

   CAUSE: The Central Inventory is located in the Oracle base.

   ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.

[FATAL] [INS-13013] Target environment do not meet some mandatory requirements.

   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log

   ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.

A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.

日志信息:

WARNING: A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.

INFO: Finding the most appropriate exit status for the current application

INFO: Exit Status is -3

INFO: Shutdown Oracle Database 11g Release 2 Installer

INFO: Unloading Setup Driver

解决方式:

将db_install.rsp中的DECLINE_SECURITY_UPDATES修改为:DECLINE_SECURITY_UPDATES=true

然后使用:./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /u01/app/database/response/db_install.rsp

目录
相关文章
|
SQL Oracle 网络协议
|
Oracle 关系型数据库 Ruby
|
Oracle 关系型数据库 数据库
oracle(环境搭建二)
Configuration oracle database Password file(非必要)        cd $ORACLE_HOME/dbs/          ls 查看是否有init.ora        创建密码文件: orapwd file=orapwSID password=v...
922 0
|
Web App开发 Java 关系型数据库
SpringMVC,MyBatis项目中兼容Oracle和MySql的解决方案及其项目环境搭建配置、web项目中的单元测试写法、HttpClient调用post请求等案例
 要搭建的项目的项目结构如下(使用的框架为:Spring、SpingMVC、MyBatis): 2.pom.xml中的配置如下(注意,本工程分为几个小的子工程,另外两个工程最终是jar包): 其中pom.xml中的内容如下,其中${ip}为ip地址: <?xml version="1.0" encoding="UTF-8"?> <project
2915 0
|
Oracle 关系型数据库 中间件
SOA_环境安装系列2_Oracle RCU安装和环境搭建(案例)
2015-01-02 Created By BaoXinjian 一、摘要 Oracle Repository Creation Utility 1. RCU 概念 RCU(Repository Creation Utility,存储库创建工具)就可以正确地创建这些模式,它是一个独立的工具,可以独立于每个Fusion Middleware产品下载。
1452 0
|
Oracle Java 中间件
SOA_环境安装系列3_Oracle Weblogic安装和环境搭建(案例)
2014-01-03 Created By BaoXinjian 一、摘要 本文介绍如何安装Weblogic和启动Server 1. 下载JDK和安装 http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.
1439 0
|
Web App开发 监控 Oracle
SOA_环境安装系列4_Oracle SOA安装和环境搭建(案例)
2015-01-02 Created By BaoXinjian 一、摘要 Oracle SOA套件由Oracle备受欢迎的单项最佳技术组成,包括: 1. Oracle JDeveloper 10g:一个全面的SOA 集成开发环境,用于创建应用和组合应用,它也作为Oracle SOA 套件中所有组件的统一工具集。
1570 0
|
Oracle 关系型数据库 Ruby
Metasploit攻击Oracle的环境搭建
  Metasploit中关于Oracle的攻击模块默认并不完全,需要自己做一些工作。本文主要记录在搭建环境的中的一些错误(操作系统Backtrack 5)。
933 0
|
2月前
|
存储 Oracle 关系型数据库
Oracle数据库的应用场景有哪些?
【10月更文挑战第15天】Oracle数据库的应用场景有哪些?
200 64