【DBCA -SILENT】静默安装之rac数据库安装

【DBCA -SILENT】静默安装之rac数据库安装

 

BLOG文档结构图

 

 

 

 

之前的相关文章连接:

 

 

之前的文章中介绍了单实例的数据库静默安装方式,今天我们来看看rac数据库的静默安装方式。

 

 

查看集群环境是否准备好:

[root@node2 ~]# crsctl check cluster -all

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

node1:

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

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

node2:

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

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

[root@node2 ~]#

 

 

查看磁盘组空间:

SQL> select name,state,free_mb,required_mirror_free_mb,usable_file_mb,a.group_number  from v$asm_diskgroup a;

 

NAME                           STATE          FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB GROUP_NUMBER

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

ARCH                           MOUNTED           9142                       0           9142            1

DATA                           MOUNTED          18242                       0          18242            2

OVDISK                         MOUNTED           2703                       0           2703            3

TEST                           MOUNTED            929                       0            929            4

 

查看节点列表:

 

[root@node2 ~]# olsnodes

node1

node2

[root@node2 ~]#

 

 

修改General_Purpose.dbc 文件,让生成的rac库在归档模式:

[oracle@node1 dbca]$ strings $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc | grep -i arch

         true/archiveLogMode>

[oracle@node1 dbca]$

 

 

确保以上集群环境已经搭建好后,开始创建rac数据库,当然有2种方式可以搭建,个人觉得2种方式都挺方便的,下边我们分别介绍:

一、 方法一:利用模板文件来创建
sid:jmrac

文件磁盘组:data

闪回恢复区:arch

节点:node1,node2

 

 

 

[oracle@node1 dbca]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname jmrac  -sid jmrac -sysPassword lhr -systemPassword lhr -datafileDestination 'DATA/' -redoLogFileSize 50 -recoveryAreaDestination 'ARCH/' -storageType ASM -asmsnmpPassword lhr  -diskGroupName 'DATA' -responseFile NO_VALUE -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema true -automaticMemoryManagement true -totalMemory 500  -nodeinfo node1,node2

 

Copying database files

1% complete

3% complete

9% complete

15% complete

21% complete

27% complete

30% complete

Creating and starting Oracle instance

32% complete

36% complete

40% complete

44% complete

45% complete

48% complete

50% complete

Creating cluster database views

52% complete

70% complete

Completing Database Creation

73% complete

76% complete

85% complete

94% complete

100% complete

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/jmrac/jmrac.log" for further details.

[oracle@node1 jmrac]$ more /u01/app/oracle/cfgtoollogs/dbca/jmrac/jmrac.log

Copying database files

DBCA_PROGRESS : 1%

DBCA_PROGRESS : 3%

DBCA_PROGRESS : 9%

DBCA_PROGRESS : 15%

DBCA_PROGRESS : 21%

DBCA_PROGRESS : 27%

DBCA_PROGRESS : 30%

Creating and starting Oracle instance

DBCA_PROGRESS : 32%

DBCA_PROGRESS : 36%

DBCA_PROGRESS : 40%

DBCA_PROGRESS : 44%

DBCA_PROGRESS : 45%

DBCA_PROGRESS : 48%

DBCA_PROGRESS : 50%

Creating cluster database views

DBCA_PROGRESS : 52%

DBCA_PROGRESS : 70%

Completing Database Creation

DBCA_PROGRESS : 73%

DBCA_PROGRESS : 76%

DBCA_PROGRESS : 85%

DBCA_PROGRESS : 94%

DBCA_PROGRESS : 100%

Database creation complete. For details check the logfiles at:

/u01/app/oracle/cfgtoollogs/dbca/jmrac.

Database Information:

Global Database Name:jmrac

System Identifier(SID) Prefix:jmrac

[oracle@node1 jmrac]$

 

[oracle@node1 jmrac]$ ORACLE_SID=jmrac1

[oracle@node1 jmrac]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 19 22:00:18 2015

 

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, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> archive log list;

Database log mode             Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     4

Next log sequence to archive   5

Current log sequence           5

SQL>

 

SQL> set line 9999

SQL> col HOST_NAME format a10

SQL> select INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS,ACTIVE_STATE,INSTANCE_ROLE,DATABASE_STATUS from gv$INSTANCE;

 

INSTANCE_NAME    HOST_NAME  VERSION           STARTUP_T STATUS       ACTIVE_ST INSTANCE_ROLE      DATABASE_STATUS

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

jmrac1           node1      11.2.0.1.0        19-APR-15 OPEN         NORMAL    PRIMARY_INSTANCE   ACTIVE

jmrac2           node2      11.2.0.1.0        19-APR-15 OPEN         NORMAL    PRIMARY_INSTANCE   ACTIVE

 

SQL> select INST_ID,name , open_mode, log_mode,force_logging from gv$database;

 

   INST_ID NAME      OPEN_MODE            LOG_MODE     FOR

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

         1 JMRAC     READ WRITE           ARCHIVELOG   NO

         2 JMRAC     READ WRITE           ARCHIVELOG   NO

 

SQL> show parameter DB_RECOVERY_FILE_DEST

 

NAME                                 TYPE        VALUE

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

db_recovery_file_dest                string      +ARCH

db_recovery_file_dest_size           big integer 3882M

SQL>

 

 

 

---查看tns和listener信息

[oracle@node1 dbca]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/

[oracle@node1 admin]$ ll

total 12

drwxr-xr-x 2 oracle oinstall 4096 Feb 27  2012 samples

-rw-r--r-- 1 oracle oinstall  187 May  7  2007 shrept.lst

-rw-r----- 1 oracle oinstall  685 Apr 19 22:13 tnsnames.ora

[oracle@node1 admin]$ more tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

JMRAC =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = cluster-SCAN)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = jmrac)

    )

  )

 

[oracle@node1 dbca]$ srvctl status listener

Listener LISTENER is enabled

Listener LISTENER is running on node(s): node1,node2

[oracle@node1 dbca]$

 

说明tns已经自动添加,监听也已经启动

 

查看rac服务:

[root@node2 ~]#  crsctl status resource -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS      

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

Local Resources

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

ora.ARCH.dg

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.DATA.dg

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.LISTENER.lsnr

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.OVDISK.dg

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.TEST.dg

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.asm

               ONLINE  ONLINE       node1                    Started            

               ONLINE  ONLINE       node2                    Started            

ora.eons

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.gsd

               OFFLINE OFFLINE      node1                                       

               OFFLINE OFFLINE      node2                                       

ora.net1.network

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.ons

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

ora.registry.acfs

               ONLINE  ONLINE       node1                                       

               ONLINE  ONLINE       node2                                       

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       node1                                       

ora.db.db

      1        OFFLINE OFFLINE                               Instance Shutdown  

      2        OFFLINE OFFLINE                               Instance Shutdown  

ora.jmrac.db

      1        ONLINE  ONLINE       node1                    Open               

      2        ONLINE  ONLINE       node2                    Open               

ora.node1.vip

      1        ONLINE  ONLINE       node1                                       

ora.node2.vip

      1        ONLINE  ONLINE       node2                                       

ora.oc4j

      1        OFFLINE OFFLINE                                                  

ora.scan1.vip

      1        ONLINE  ONLINE       node1                                       

[root@node2 ~]# crs_stat -t

Name           Type           Target    State     Host       

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

ora.ARCH.dg    ora....up.type ONLINE    ONLINE    node1      

ora.DATA.dg    ora....up.type ONLINE    ONLINE    node1      

ora....ER.lsnr ora....er.type ONLINE    ONLINE    node1      

ora....N1.lsnr ora....er.type ONLINE    ONLINE    node1      

ora.OVDISK.dg  ora....up.type ONLINE    ONLINE    node1      

ora.TEST.dg    ora....up.type ONLINE    ONLINE    node1      

ora.asm        ora.asm.type   ONLINE    ONLINE    node1      

ora.db.db      ora....se.type OFFLINE   OFFLINE              

ora.eons       ora.eons.type  ONLINE    ONLINE    node1      

ora.gsd        ora.gsd.type   OFFLINE   OFFLINE              

ora.jmrac.db   ora....se.type ONLINE    ONLINE    node1      

ora....network ora....rk.type ONLINE    ONLINE    node1      

ora....SM1.asm application    ONLINE    ONLINE    node1      

ora....E1.lsnr application    ONLINE    ONLINE    node1      

ora.node1.gsd  application    OFFLINE   OFFLINE              

ora.node1.ons  application    ONLINE    ONLINE    node1      

ora.node1.vip  ora....t1.type ONLINE    ONLINE    node1      

ora....SM2.asm application    ONLINE    ONLINE    node2      

ora....E2.lsnr application    ONLINE    ONLINE    node2      

ora.node2.gsd  application    OFFLINE   OFFLINE              

ora.node2.ons  application    ONLINE    ONLINE    node2      

ora.node2.vip  ora....t1.type ONLINE    ONLINE    node2      

ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE              

ora.ons        ora.ons.type   ONLINE    ONLINE    node1      

ora....ry.acfs ora....fs.type ONLINE    ONLINE    node1      

ora.scan1.vip  ora....ip.type ONLINE    ONLINE    node1 

 

[root@node2 ~]# srvctl  status database -d jmrac

Instance jmrac1 is running on node node1

Instance jmrac2 is running on node node2

 

[root@node2 ~]# srvctl config database -d jmrac

Database unique name: jmrac

Database name: jmrac

Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1

Oracle user: oracle

Spfile: +DATA/jmrac/spfilejmrac.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: jmrac

Database instances: jmrac1,jmrac2

Disk Groups: DATA

Services:

Database is administrator managed

[root@node2 ~]#     

 

 

 

二、 方法二:编辑响应文件
添加文件$ORACLE_HOME/assistants/dbca/dbca_rac.rsp,内容如下:

[oracle@node1 dbca]$ more $ORACLE_HOME/assistants/dbca/dbca_rac.rsp

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

GDBNAME = "myrac"

SID = "myrac"

NODELIST=node1,node2

TEMPLATENAME = "General_Purpose.dbc"

SYSPASSWORD = "lhr"

SYSTEMPASSWORD = "lhr"

SYSMANPASSWORD = "lhr"

DBSNMPPASSWORD = "lhr"

STORAGETYPE=ASM

DISKGROUPNAME=DATA

ASMSNMP_PASSWORD="lhr"

RECOVERYGROUPNAME=ARCH

CHARACTERSET = "ZHS16GBK"

NATIONALCHARACTERSET= "UTF8"

 

利用响应文件来创建rac库:

[oracle@node1 dbca]$ dbca -silent -responseFile $ORACLE_HOME/assistants/dbca/dbca_rac.rsp

Copying database files

1% complete

3% complete

9% complete

15% complete

21% complete

27% complete

30% complete

Creating and starting Oracle instance

32% complete

36% complete

40% complete

44% complete

45% complete

48% complete

50% complete

Creating cluster database views

52% complete

70% complete

Completing Database Creation

73% complete

76% complete

85% complete

94% complete

100% complete

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/myrac/myrac.log" for further details.

[oracle@node1 dbca]$ more /u01/app/oracle/cfgtoollogs/dbca/myrac/myrac.log

Copying database files

DBCA_PROGRESS : 1%

DBCA_PROGRESS : 3%

DBCA_PROGRESS : 9%

DBCA_PROGRESS : 15%

DBCA_PROGRESS : 21%

DBCA_PROGRESS : 27%

DBCA_PROGRESS : 30%

Creating and starting Oracle instance

DBCA_PROGRESS : 32%

DBCA_PROGRESS : 36%

DBCA_PROGRESS : 40%

DBCA_PROGRESS : 44%

DBCA_PROGRESS : 45%

DBCA_PROGRESS : 48%

DBCA_PROGRESS : 50%

Creating cluster database views

DBCA_PROGRESS : 52%

DBCA_PROGRESS : 70%

Completing Database Creation

DBCA_PROGRESS : 73%

DBCA_PROGRESS : 76%

DBCA_PROGRESS : 85%

DBCA_PROGRESS : 94%

DBCA_PROGRESS : 100%

Database creation complete. For details check the logfiles at:

/u01/app/oracle/cfgtoollogs/dbca/myrac.

Database Information:

Global Database Name:myrac

System Identifier(SID) Prefix:myrac

[oracle@node1 dbca]$ ORACLE_SID=myrac1

[oracle@node1 admin]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 19 22:37:08 2015

 

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, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> set line 9999

SQL> col HOST_NAME format a10

SQL> select INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS,ACTIVE_STATE,INSTANCE_ROLE,DATABASE_STATUS from gv$INSTANCE;

 

INSTANCE_NAME    HOST_NAME  VERSION           STARTUP_T STATUS       ACTIVE_ST INSTANCE_ROLE      DATABASE_STATUS

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

myrac1           node1      11.2.0.1.0        19-APR-15 OPEN         NORMAL    PRIMARY_INSTANCE   ACTIVE

myrac2           node2      11.2.0.1.0        19-APR-15 OPEN         NORMAL    PRIMARY_INSTANCE   ACTIVE

 

SQL> select INST_ID,name , open_mode, log_mode,force_logging from gv$database;

 

   INST_ID NAME      OPEN_MODE            LOG_MODE     FOR

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

         1 MYRAC     READ WRITE           ARCHIVELOG   NO

         2 MYRAC     READ WRITE           ARCHIVELOG   NO

 

SQL>

 

 

 

三、 删除新建的rac库
[oracle@node1 dbca]$ dbca -silent -deleteDatabase -sourceDB  myrac -sysDBAUserName sys -sysDBAPassword lhr

Connecting to database

9% complete

14% complete

19% complete

23% complete

28% complete

33% complete

38% complete

47% complete

Updating network configuration files

48% complete

52% complete

Deleting instances and datafiles

66% complete

80% complete

95% complete

100% complete

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/myrac.log" for further details.

[oracle@node1 dbca]$

 

 

 

...........................................................................................................................................................................................

本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

ITPUB BLOG:http://blog.itpub.net/26736162

本文地址:http://blog.itpub.net/26736162/viewspace-1586352/

本文pdf版:http://yunpan.cn/QCwUAI9bn7g7w  提取码:af2d

QQ:642808185 注明:ITPUB的文章标题

...........................................................................................................................................................................................

 

时间: 2024-09-19 16:57:40

【DBCA -SILENT】静默安装之rac数据库安装的相关文章

安装Oracle RAC数据库(上)

Oracle RAC数据库的安装相对单机数据库复杂一些,因为整个安装过程涉及网络.操作系统.存储等方面,一个环节设置不当,都可能导致安装失败.本文将详细的讲述RAC数据库的安装过程. 1. 安装前的系统配置需求 安装Oracle Rac数据库需要的组件可以分为软硬件两部分,下面是一个软硬件推荐配置: 为了方便安装RAC数据库,在安装操作系统时,建议选择如下系统包: 桌面环境:xwindows system.GNOME desktop environment. 开发工具:development t

安装Oracle RAC数据库(中)

14:安装Oracle Clusterware (1)解压软件包 这里假定数据库所有软件放在了/rac目录下,首先需要解压Oracle的两个软件包,操作如下: [root@node-rac1 rac]#ls linux_11gR1_database_1013.zip linux_x86_11gR1_clusterware.zip [root@node-rac1 rac]#unzip linux_x86_11gR1_clusterware.zip [root@node-rac1 rac]#unzi

安装Oracle RAC数据库(下)

在Oracle ClusterWare安装成功后,开始进入Oracle数据库的安装,以oracle用户身份登录到任意一个集群节点,执行如下命令开始安装: [oracle@node-rac2 rac]$ /rac/database/runInstaller 接着就会弹出图形安装向导界面:

【DBCA -SILENT】静默方式安装11gR2 oracle数据库软件

[DBCA -SILENT]静默方式安装11gR2数据库软件单实例 BLOG文档结构图         相关文章链接:     DBCA静默方式建库 :http://blog.itpub.net/26736162/viewspace-1448220/ [DBCA -SILENT]静默安装如何启用归档模式:http://blog.itpub.net/26736162/viewspace-1585925/ [DBCA -SILENT]静默安装之rac数据库安装:http://blog.itpub.n

【RAC安装】 AIX下安装Oracle 11gR2 RAC

[RAC安装] AIX下安装Oracle 11gR2 RAC   1.1  BLOG文档结构图       1.2  前言部分   1.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 基于aix安装rac(重点) ② 静默安装rac软件 ③ dbca静默创建rac数据库     Tips:        ① 若文章代码格式有错乱,推荐使用QQ.搜狗或360浏览器,也可以下载pdf格式的文档来查看,pdf文档

【RAC】将单实例备份集恢复为rac数据库

[RAC]将单实例备份集恢复为rac数据库 一.1  BLOG文档结构图     一.2  前言部分   一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 单实例环境的备份集如何恢复到rac环境(重点) ② rman恢复数据库的一般步骤 ③ rac环境的简单操作   注意:本篇BLOG中代码部分需要特别关注的地方我都用黄色背景和红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread

【RAC】 RAC For W2K8R2 安装--RDBMS软件的安装(五)

[RAC] RAC For W2K8R2 安装--RDBMS软件的安装(五) 一.1  BLOG文档结构图       一.2  前言部分   一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① RAC for windows 2008R2 的安装 ② rac环境下共享存储的规划和搭建 ③ starwind软件的应用 ④ VMware workstation 如何做共享存储 ⑤ rac数据的静默安装和dbca静默建库

【DBCA -SILENT】静默安装如何启用归档模式

[DBCA -SILENT]静默安装如何启用归档模式   BLOG文档结构图           接着之前的一篇文章继续,DBCA静默方式建库 :http://blog.itpub.net/26736162/viewspace-1448220/ ,这里增加一句:采用dbca的静默方式安装数据,安装完成后tnsnames和listen都自动配置完成,不需要手动再创建了.     dbca的静默方式安装数据时是没有归档这个参数选项的,但是我们可以通过修改参数文件来启用归档,如下:   [oracle

VirtualBox+Oracle 11g R2 RAC的安装总结

昨天参照Oracle Base上的文档在VirtualBox虚拟机上完成Oracle 11G R2 RAC的安装和调试,安装文档已经很详细了,但是自己是第一次在OEL上安装RAC还是遇到不少波折,现在把一些主要的问题和解决方案记录下来以供后人参考. 第一是内存问题,最低要求是每台虚拟机1.5GB的内存,由于机器内存有限没办法,刚开始只给1GB想忽悠过去,结果安装Grid Control时等好几个小时都搞不定,只好取消重新分配1.5GB给RAC1,1.2GB给RAC2,最后勉强安装完成,但操作响应