ITPub博客

首页 > 数据库 > Oracle > Oracle11g 图形化安装

Oracle11g 图形化安装

原创 Oracle 作者:fwinmachao 时间:2017-05-16 08:55:02 0 删除 编辑

1.       检查硬件需求

1.1 内存检查(memory).最小1G,建议2G或者更大内存

#grep MemTotal /proc/meminfo

1.2    交换分区检查(swap space). 内存在1-2G, 交换分区设为内存的1.5倍. 内存2-16G之间, 交换分区设为和内存相等.内存大于16G,交换分区设为16G.

#egrep SwapTotal /proc/meminfo

           -- #free 查看剩余内存和交换分区

           --df -h /dev/shm    --检查共享内存的大小

       1.3 存储空间检查.

           #df -h /tmp   -- 最少1G的临时空间

            数据库系统最小size:

           EE(企业版): 4.35G

                    SE(标准版):4.22G

           数据文件最小size:

           EE(企业版): 1.7G

                    SE(标准版):1.5G

2.       package检查.(oracle 11gR2 在redhat)

 

·       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

·       gcc-4.4.4-13.el6 (x86_64)

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

·       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

·       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)

for i in binutils compat-libcap1 compat-libstdc gcc gcc-c++ libgcc- libstdc libstdc++-devel libaio libaio-devel make sysstat

do

rpm -qa |grep ${i} >/dev/null

if [ $? -ne 0 ]

  then

  echo ${i}

fi

done

--输出的文件需要我们手动安装

       --配置yum源:

[root@localhost yum.repos.d]# mount -o loop /home/rhel-server-6.5-x86_64-dvd.iso /mnt/cdrom/

[root@localhost yum.repos.d]# vim /etc/yum.repos.d/yum.repo

 

[yum]

name=yum

baseurl=file:///mnt/cdrom

enabled=1

gpgcheck=0

 

[root@localhost yum.repos.d]# yum list

[root@localhost yum.repos.d]# yum install -y compat-libcap1.x86_64

--重新检查包的安装

3. 创建组, 用户, 安装目录

[root@localhost yum.repos.d]# groupadd oinstall

[root@localhost yum.repos.d]# groupadd dba

[root@localhost yum.repos.d]# useradd -g oinstall -G dba oracle

[root@localhost yum.repos.d]# passwd oracle

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@localhost yum.repos.d]# mkdir -p /app/oracle/production/11.2.0.1

[root@localhost yum.repos.d]# chown -R oracle.oinstall /app

 

4. 解压文件(oralce用户)

[root@localhost app]# chown oracle.oinstall linux.x64_11gR2_database_*

[oracle@localhost app]# unzip linux.x64_11gR2_database_1of2.zip

[oracle@localhost app]# unzip linux.x64_11gR2_database_2of2.zip

 

5. 添加参数到/etc/sysctl.conf

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 = 1048576fs.aio-max-nr = 1048576

[root@localhost ~]# sysctl -p

6. 设置环境变量

[oracle@localhost app]$ cat !$

cat ~/.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 ORACLE_BASE=/app/oracle

export ORACLE_HOME=${ORACLE_BASE}/production/11.2.0.1

export ORACLE_SID=orcl

export PATH=$PATH:$HOME/bin:${ORACLE_HOME}/bin

 

export PATH

 

[oracle@localhost app]$ . ~/.bash_profile

[oracle@localhost app]$ echo $ORACLE_HOME

/app/oracle/production/11.2.0.1

 

7. 安装数据库

[root@localhost Desktop]# xhost +

[oracle@localhost database]$ cd /app/database/

[oracle@localhost database]$ ./runInstaller

 

不用自动更新,直接下一步.

 

只安装数据库软件

安装单实例数据库

选择安装语言,推荐用英语

选择安装类型, 本次安装选择企业版

确认安装路径

产品清单路径

组的信息

忽略包的检查

summary 信息. 点击finish开始安装.

等待安装完成, 用root用户执行这2个脚本

[root@localhost ~]# /app/oraInventory/orainstRoot.sh

Changing permissions of /app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /app/oraInventory to oinstall.

The execution of the script is complete.

[root@localhost ~]# /app/oracle/production/11.2.0.1/root.sh

Running Oracle 11g root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /app/oracle/production/11.2.0.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.sh script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

--至此完成软件的安装.

8. 利用dbca安装数据库

[oracle@localhost database]$ dbca

下一步

创建一个数据库

选择一个一般用途的数据库

一般把这二个名字都写成$ORACLE_SID

是否安装EM, 先不安装EM

设置sys和system用户密码

设置文件类型.和路径,此次使用模板

是否开启闪回区

是否使用example database

设置SGA/PAG,processes, 字符集, 连接模式

[oracle@localhost database]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed May 10 15:25:54 2017

 

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select open_mode from v$database;

 

OPEN_MODE

--------------------

READ WRITE

 

数据库安装完成, 当前数据库状态为read write.

监听配置,

动态监听配置:

[oracle@localhost database]$ lsnrctl start

SQL> alter system register;  --注册实例到监听, 如果不手动注册,过一会SMON也会自动注册

[oracle@localhost app]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-MAY-2017 15:28:47

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                10-MAY-2017 15:27:32

Uptime                    0 days 0 hr. 1 min. 14 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Log File         /app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

Services Summary...

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

 

--配置静态监听

[oracle@localhost database]$ netca

增加一个新的监听

监听的名字

选择监听的协议

配置监听端口, 默认为1521

此时监听的目录下多了一个listener.ora的文件

 

 

配置静态监听,监听实例orcl

添加下面语句到listener.ora

SID_LIST_LISTENER=

   (SID_LIST=

        (SID_DESC=

          (GLOBAL_DBNAME=orcl)

          (SID_NAME=orcl)

          (ORACLE_HOME=/app/oracle/production/11.2.0.1)

         )

)

[oracle@localhost admin]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-MAY-2017 15:37:38

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                10-MAY-2017 15:36:16

Uptime                    0 days 0 hr. 1 min. 22 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /app/oracle/production/11.2.0.1/network/admin/listener.ora

Listener Log File         /app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

Services Summary...

Service "orcl" has 2 instance(s).

  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

 

--安装EM

[oracle@localhost admin]$ emca -config dbcontrol db -repos recreate

 

STARTED EMCA at May 10, 2017 3:38:53 PM

EM Configuration Assistant, Version 11.2.0.0.2 Production

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

 

Enter the following information:

Database SID: orcl

Listener port number: 1521

Listener ORACLE_HOME [ /app/oracle/production/11.2.0.1 ]:  --不用填写

Password for SYS user: 

Password for DBSNMP user: 

Password for SYSMAN user: 

Email address for notifications (optional):

Outgoing Mail (SMTP) server for notifications (optional):

-----------------------------------------------------------------

 

You have specified the following settings

 

Database ORACLE_HOME ................ /app/oracle/production/11.2.0.1

 

Local hostname ................ localhost

Listener ORACLE_HOME ................ /app/oracle/production/11.2.0.1

Listener port number ................ 1521

Database SID ................ orcl

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............

 

-----------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: y

May 10, 2017 3:39:17 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /app/oracle/cfgtoollogs/emca/orcl/emca_2017_05_10_15_38_53.log.

May 10, 2017 3:39:18 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Dropping the EM repository (this may take a while) ...

May 10, 2017 3:40:38 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully dropped

May 10, 2017 3:40:39 PM oracle.sysman.emcp.EMReposConfig createRepository

INFO: Creating the EM repository (this may take a while) ...

May 10, 2017 3:45:04 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully created

May 10, 2017 3:45:09 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository

INFO: Uploading configuration data to EM repository (this may take a while) ...

May 10, 2017 3:45:56 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Uploaded configuration data successfully

May 10, 2017 3:45:59 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib

INFO: Software library configured successfully.

May 10, 2017 3:45:59 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary

INFO: Deploying Provisioning archives ...

May 10, 2017 3:46:25 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary

INFO: Provisioning archives deployed successfully.

May 10, 2017 3:46:25 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Securing Database Control (this may take a while) ...

May 10, 2017 3:47:44 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control secured successfully.

May 10, 2017 3:47:44 PM oracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this may take a while) ...

May 10, 2017 3:48:36 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

May 10, 2017 3:48:37 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: >>>>>>>>>>> The Database Control URL is https://localhost:1158/em <<<<<<<<<<<

May 10, 2017 3:48:44 PM oracle.sysman.emcp.EMDBPostConfig invoke

WARNING:

************************  WARNING  ************************

 

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /app/oracle/production/11.2.0.1/localhost_orcl/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

 

***********************************************************

Enterprise Manager configuration completed successfully

FINISHED EMCA at May 10, 2017 3:48:44 PM

 

使用https://localhost:1158/em登录em, 如果连接不上, 检查一下防火墙和selinux是否启动.


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29654587/viewspace-2139106/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: OCI demo整理
请登录后发表评论 登录
全部评论

注册时间:2014-05-12

  • 博文量
    15
  • 访问量
    27841