码迷,mamicode.com
首页 > 数据库 > 详细

ORACLE RAC 11.2.0.4 CentOS release 6.9 静默安装1.0版本

时间:2018-06-14 01:10:26      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:11.2   real   在线   网络配置   note   mem   mirror   exec   数据库类型   

RAC11.2.0.4静默安装 1.0版本,20180613

#本文档IP地址使用X隐藏,个人可按照自己的当前环境IP进行适当修改

1. 清除原环境中的单实例软件

#清除原环境:

删除/etc/ora*

删除 /usr/local/bin/oraenv

删除 /usr/local/bin/dbhome

删除 /usr/local/bin/coraenv

删除 $ORACLE_BASE/*

删除 cd /picclife/app  rm -rf *

 

#解释说明:

/etc/oratab ?数据库实例创建,会添加一条记录

/etc/oraInst.loc 软件Oracle用户组及BASE

/etc/oracle-release 安装软件的系统版本

 

Root.sh 安装Oracle软件,生成三个文件:

/usr/local/bin/xxx

 

#删除用户:

*id oracle --查询用户信息

*

userdel -r oracle     userdel -r grid --删除用户

* --查询 Oracle有什么属组,就删除什么属组

groupdel oinstall    

groupdel dba  

 

 

2. 服务器信息:

 

#服务器IP

新团单查询服务器

XX tdcxnewrac1

XX tdcxnewrac2

 

#介质IP

#安装11.2.0.4版本RAC

#介质IP 1X.135.100.1X2 zabbixhost

 

#系统版本

[oracle@tdcxnewrac1 ~]$ uname -a

Linux tdcxnewrac1 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 26 17:51:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[oracle@tdcxnewrac1 ~]$ cat /etc/redhat-release

CentOS release 6.9 (Final)

#内存大小

15G

 

 

#shmall,shmmax

#操作系统内存叶块数量

kernel.shmall = 3932160

kernel.shmmax = 16106127300

 

#磁盘统计

#节点一

/dev/sdc: 10.7 GB

[root@tdcxnewrac1 by-id]#

 /sbin/scsi_id -g -u -d /dev/sdc

36000c29c40b342cf6dde5496e79d3dbe

 

/dev/sdd: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdd

36000c29062b2dea2c6ba2028f5184cc9

 

/dev/sde: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sde

36000c29c3118e52fc151da74ef4f2de4

 

/dev/sdf: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdf

36000c2982addc3cbbe00db7a2ce6697a

 

/dev/sdg: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdg

36000c29b30215943ba7f78541bd690cd

 

/dev/sdh: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdh

36000c29826ab6587fa0bcbe32823bd98

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdi

36000c292a788cab0db5ed264bc6eb237

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdj

36000c298fb1bb8790a7ba9e5e8af2a04

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdk

36000c290853ca69606b6ab1263291d0e

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdl

36000c2908a2d241fa80d5596fa2ce44b

 

/dev/sdm: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdm

36000c29032ea6e7bab4b31a395cf74c6

/dev/sdn: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdn

36000c2907d3adc0c0985840bf2a17846

/dev/sdo: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdo

36000c29d1fa9f5a28afd05c29efc88fe

/dev/sdp: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdp

36000c29f9d77097f15bb416cc3d82091

/dev/sdq: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdq

36000c296ba98670c114a838ed7f199a6

/dev/sdr: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdr

36000c296cd25dd53c5db933f5db65e13

/dev/sds: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sds

36000c2963953aa01ba71b11f4c034577

/dev/sdt: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdt

36000c296a3ed9e1bbfb1ddcc2bd85313

 

/dev/sdu: 322.1 GB

[root@tdcxnewrac1 ~]# /sbin/scsi_id -g -u -d /dev/sdu

36000c293d79c8a6cd9862d798043c966

 

 

#网络配置

#节点一

1X.111.20.1X1

17X.16.250.1X1

#节点二

1X.111.20.1X2

17X.16.250.1X2

 

#防火墙

/usr/sbin/sestatus -v

 

 

#YUM源检查

[root@tdcxnewrac1 ~]# yum list *vnc*

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

Available Packages

gtk-vnc.i686                           0.3.10-3.el6                          base

 

 

 

#RPM包

Oracle软件  #通过官方文档查询对应的系统,Oracle版本查询安装的rpm软件包

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)

 

 

rpm -q --qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n‘ binutils \

binutils \

compat-libcap1 \

compat-libstdc++ \

gcc \

glibc \

glibc-devel \

ksh \

libgcc \

libstdc++ \

libstdc++-devel \

libaio \

libaio-devel \

make \

sysstat

 

yum install -y binutils* compat-libcap1* compat-libstdc++-33* gcc* glibc* glibc-devel* ksh* libgcc* libstdc++* libstdc++-devel* libaio* libaio-devel* make* sysstat*

 

#集群GRID 软件

 

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)

 

 

#互信配置

A:如下区域:两个节点的oracle或grid 都需要执行

mkdir ~/.ssh

chmod 700 ~/.ssh

ssh-keygen -t rsa -P ‘‘ -f ~/.ssh/id_rsa

ssh-keygen -t rsa -P ‘‘ -f ~/.ssh/id_dsa

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

--以上所有节点执行:目的创建公钥+私钥:

 

B:如下区域:一般在主节点:执行:rac2是:第二个节点的IP地址主机名

ssh tdcxdb2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys  

scp ~/.ssh/authorized_keys tdcxdb2:~/.ssh/authorized_keys  

 

ssh tdcxdb1 date;ssh tdcxdb2 date;ssh tdcxdb1-priv date;ssh tdcxdb2-priv date

 

#共享存储

#通过UDEV 绑定ASM磁盘,设备持久化及 磁盘的权限绑定

/dev/sdc: 10.7 GB

/dev/sdd: 322.1 GB

[root@tdcxnewrac1 by-id]# /sbin/scsi_id -g -u -d /dev/sdd

36000c29062b2dea2c6ba2028f5184cc9

/dev/sdu: 322.1 GB

[root@tdcxnewrac1 ~]# /sbin/scsi_id -g -u -d /dev/sdu

36000c293d79c8a6cd9862d798043c966

 

19块磁盘

 

Linux6-udev配置方式

 

 

for i in c d e f g h i j k l m n o p q r s t u;

do

echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-sd$i\", OWNER=\"grid\", GROUP=\"asmdba\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules

done

[root@tdcxnewrac1 rules.d]# start_udev

[root@tdcxnewrac1 rules.d]# ll /dev/asm*

brw-rw---- 1 grid asmdba  8,  32 Jun 11 11:52 /dev/asm-sdc

 

[root@tdcxnewrac1 rules.d]# cat 99-oracle-asmdevices.rules

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29c40b342cf6dde5496e79d3dbe", NAME="asm-sdc", OWNER="grid", GROUP="asmdba", MODE="0660"

 

#对比OCR磁盘:SCSI 磁盘设备号

/dev/sdc: 10.7 GB

[root@tdcxnewrac1 by-id]#

 /sbin/scsi_id -g -u -d /dev/sdc

36000c29c40b342cf6dde5496e79d3dbe OK

 

 

#另一个节点相同配置

 

#解压安装包

 

tdcxdb1:/picclife/software$ cd /picclife/software/grid/rpm/

tdcxdb1:/picclife/software/grid/rpm$ ls

cvuqdisk-1.0.9-1.rpm  pdksh-5.2.14-30.x86_64.rpm

 

#执行检测脚本

./runcluvfy.sh stage -pre crsinst -n tdcxdb1,tdcxdb2 -verbose

#关闭Link时间同步NTP服务(确认节点date相差时间几秒内):

chkconfig ntpd off

mv /etc/ntp.conf /etc/ntp.conf.bak

 

 

#不启用DNS前提下

mv /etc/resolv.conf /etc/resolv.conf.bak【不启用DNS服务的前提下】

 

3. GI集群软件静默安装

#配置集群脚本

#系统主机名称,NULL则寻找系统的第一个主机名

ORACLE_HOSTNAME=tdcxdb1

#Oracle软件清单目录

INVENTORY_LOCATION=/picclife/app/grid/oraInventory

#操作系统语言

SELECTED_LANGUAGES=en

#安装集群类型

# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY

#   - CRS_CONFIG : To configure Grid Infrastructure for cluster

#   - HA_CONFIG  : To configure Grid Infrastructure for stand alone server

#   - UPGRADE    : To upgrade clusterware software of earlier release

#   - CRS_SWONLY : To install clusterware files only (can be configured for cluster

#选择安装集群软件

oracle.install.option=CRS_CONFIG

#GI软件主目录

ORACLE_BASE=/picclife/app/grid

#GI软件产品目录

ORACLE_HOME=/picclife/app/11.2.0/grid

#Oracle软件ASM 操作系统管理属组asmdba

oracle.install.asm.OSDBA=asmdba

#Oracle软件ASM 操作系统管理组可选

oracle.install.asm.OSOPER=asmoper

#Oracle软件ASM OS管理用户,与其它两个组名称不同

oracle.install.asm.OSASM=asmadmin

#SCAN名称

oracle.install.crs.config.gpnp.scanName=tdcxdb-scan

#SCAN 端口

oracle.install.crs.config.gpnp.scanPort=1521

#集群名称

oracle.install.crs.config.clusterName=tdcxdb-cluster

#是否使用GNS配置,否

oracle.install.crs.config.gpnp.configureGNS=false

#仅配置GNS才使用:域名、虚拟主机名、选择VIP是否自动配置

oracle.install.crs.config.gpnp.gnsSubDomain=

oracle.install.crs.config.gpnp.gnsVIPAddress=

oracle.install.crs.config.autoConfigureClusterNodeVIP=

#public1 hostname : Vip1虚拟IP hostname ,public2 hostname:VIP2

oracle.install.crs.config.clusterNodes=tdcxdb1:tdcxdb1-vip,tdcxdb2:tdcxdb2-vip

#集群网卡:public:1,private:2,3集群中不使用的网卡:ifconfig网卡名称,网段

oracle.install.crs.config.networkInterfaceList=eth0:1x.111.20.0:1,eth1:1x2.16.250.0:2

#OCR磁盘类型:文件系统,ASM存储

oracle.install.crs.config.storageOption=ASM_STORAGE

#   - ASM_STORAGE

#   - FILE_SYSTEM_STORAGE

#Windows才有此选项:

oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=

# For example: 1:2:P:DATA,1:3:Q:SOFTWARE,1:4:R:DATA,1:5:S:DATA

#磁盘号:分区号:驱动器号:格式选项

 

#对于使用File_SYSTEM_STORAGE,指定OCR和votingDISK位置和冗余策略

oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=

oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL

oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=

oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL

 

#智能电源管理接口,需指定true,否则默认false

oracle.install.crs.config.useIPMI=false

#配置IPMI才使用 --忽略

oracle.install.crs.config.ipmi.bmcUsername=

oracle.install.crs.config.ipmi.bmcPassword=

 

#ASM管理sys密码

oracle.install.asm.SYSASMPassword=picclife

#磁盘组名称

oracle.install.asm.diskGroup.name=CRS

#磁盘组冗余策略

oracle.install.asm.diskGroup.redundancy=NORMAL

#   - NORMAL

#   - HIGH

#   - EXTERNAL

#ASM磁盘分配的最小单元AU:默认1m

oracle.install.asm.diskGroup.AUSize=1

#   - 1

#   - 2

#   - 4

#   - 8

#   - 16

#   - 32

#   - 64

#ASM磁盘组创建:选择ASM磁盘路径

# List of disks to create a ASM DiskGroup

oracle.install.asm.diskGroup.disks=/dev/asm-sdc

#发现磁盘路径

oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*

#监控用户密码

oracle.install.asm.monitorPassword=picclife

#需要升级的节点名称

oracle.install.crs.upgrade.clusterNodes=

#是否升级

oracle.install.asm.upgradeASM=false

#当参数=true选择升级选项

oracle.installer.autoupdates.option=SKIP_UPDATES

#   - MYORACLESUPPORT_DOWNLOAD 支持下载

#   - OFFLINE_UPDATES 在线升级

#   - SKIP_UPDATES 跳过升级

 

 

#当使用Offline升级选项,需要指定路径

oracle.installer.autoupdates.downloadUpdatesLoc=

#自动更新用户

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

#密码

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

#代理服务器名称

PROXY_HOST=

#代理用户

PROXY_USER=

#代理用户密码

PROXY_PWD=

#域名链接

PROXY_REALM=

 

#执行脚本:

./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -responseFile /picclife/software/grid/response/grid_install.rsp -showProgress

 

 

#执行脚本输出

tdcxdb1:/picclife/software/grid$

tdcxdb1:/picclife/software/grid$ [WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.

   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

   ACTION: Provide a password that conforms to the Oracle recommended standards.

[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.

   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

   ACTION: Provide a password that conforms to the Oracle recommended standards.

[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.

You can find the log of this install session at:

 /picclife/app/grid/oraInventory/logs/installActions2018-06-11_05-29-24PM.log

 

Prepare in progress.

..................................................   9% Done.

Copy files in progress.

..................................................   15% Done.

..................................................   20% Done.

..................................................   45% Done.

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

Copy files successful. 复制文件成功

 

Link binaries in progress. 链接二进制文件正在进行中

 

Link binaries successful. 链接二进制文件成功

..................................................   62% Done.

 

Setup files in progress. 正在进行安装文件

 

Setup files successful.  安装文件成功

..................................................   76% Done.

timed out waiting for input: auto-logout  超时等待输入:自动注销

[root@tdcxdb1 response]#

Perform remote operations in progress.  

..................................................   89% Done.#

 

Perform remote operations successful. 执行远程操作成功

#OracleOCR11G安装成功

The installation of Oracle Grid Infrastructure 11g was successful.

Please check ‘/picclife/app/grid/oraInventory/logs/silentInstall2018-06-11_05-29-24PM.log‘ for more details.

..................................................   94% Done.

正在执行root脚本

Execute Root Scripts in progress.

 

As a root user, execute the following script(s):

        1. /picclife/app/grid/oraInventory/orainstRoot.sh

        2. /picclife/app/11.2.0/grid/root.sh

 

#

Execute /picclife/app/grid/oraInventory/orainstRoot.sh on the following nodes:

[tdcxdb1, tdcxdb2]

Execute /picclife/app/11.2.0/grid/root.sh on the following nodes:

[tdcxdb1, tdcxdb2]

 

..................................................   100% Done.

 

Execute Root Scripts successful.

As install user, execute the following script to complete the configuration.

        1. /picclife/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file>

 

        Note:

        1. This script must be run on the same host from where installer was run.

        2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).

Successfully Setup Software. 成功安装软件

timed out waiting for input: auto-logout

 

#两个节点先后执行两个sh脚本

        1. /picclife/app/grid/oraInventory/orainstRoot.sh

        2. /picclife/app/11.2.0/grid/root.sh

        #

Configure Oracle Grid Infrastructure for a Cluster ... succeeded

 

 

#集群软件安装完毕后:检查

crs_stat -t

除了ora.gsd

    ora.rac1.gsd  全是online状态

    

crsctl stat res -t

ora.CRS.dg                  online  

ora.LISTENER.lsnr           online  

ora.asm                     online  

ora.gsd                     offline

ora.net1.network            online  

ora.ons                     online  

ora.registry.acfs           online  

ora.LISTENER_SCAN1.lsnr     online

ora.LISTENER_SCAN2.lsnr     online

ora.cvu                     online

ora.oc4j                    online

ora.rac1.vip                online  

ora.rac2.vip                online

ora.scan1.vip               online

ora.scan2.vip               online

 

check cluster -all

 

 

 

 

 

4. 静默安装监听

#执行

tdcxdb1:/picclife/app/grid$ netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp

#输出

Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /picclife/app/11.2.0/grid/assistants/netca/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Profile configuration complete.

tdcxdb1...

tdcxdb2...

Oracle Net Listener Startup:

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

#查看文件

admin$ cat listener.ora

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))  

 # line added by Agent

LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON               

 # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON             

 # line added by Agent

 

5. 静默安装Oracle软件

#响应文件配置

这次我使用database目录下的db_install.rsp

[oracle@rac1 response]$ vi db_install.rsp

#编辑之后

 cat db_install.rsp | grep -v ^# | grep -v ^$ > /tmp/db_install.rsp

 cat /tmp/db_install.rsp

 

#只安装数据库软件

oracle.install.option=INSTALL_DB_SWONLY

#   - INSTALL_DB_SWONLY 仅安装软件

#   - INSTALL_DB_AND_CONFIG  #安装软件+数据库

#   - UPGRADE_DB   升级数据库

INSTALL_DB_AND_CONFIG

#操作系统主机名称

ORACLE_HOSTNAME=tdcxdb1

#操作系统管理组

UNIX_GROUP_NAME=oinstall

#Oracle产品清单目录

#上述是GI参数

/picclife/app/grid/oraInventory

[root@tdcxdb1 oraInventory]# ls

ContentsXML  logs  oraInst.loc  orainstRoot.sh  oui

INVENTORY_LOCATION= NULL

 

#语言 默认 env查询环境变量,英语默认

SELECTED_LANGUAGES=en

#Oracle软件安装目录

ORACLE_HOME=/picclife/app/oracle/product/11.2.0/db_1

#Oracle安装总目录

ORACLE_BASE=/picclife/app/oracle

#安装版本:企业版,标准版,个人版本

oracle.install.db.InstallEdition=EE

#选择企业版安装默认

oracle.install.db.EEOptionsSelection=false

#企业版组件列表默认

oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle

.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0

#OSDBA权限

oracle.install.db.DBA_GROUP=dba

#OSOPER权限

oracle.install.db.OPER_GROUP=oinstall

#安装节点

oracle.install.db.CLUSTER_NODES=tdcxdb1,tdcxdb2

#是否启用或禁用RAC 一个节点的安装

oracle.install.db.isRACOneInstall=false ||NUll

#如果上述参数true则此参数生效:指定单节点服务名称

oracle.install.db.racOneServiceName=

#创建的数据库类型 一般、事务处理、数据仓库

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

#   - GENERAL_PURPOSE/TRANSACTION_PROCESSING

#   - DATA_WAREHOUSE

#globalname名称

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

#指定数据库SID

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

#指定数据库字符集

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

#内存自动管理则为true

oracle.install.db.config.starterdb.memoryOption=true

#数据库的总内存大小:最少256M

oracle.install.db.config.starterdb.memoryLimit=10240 10g

#变量控制模板数据HR/scott是否加载数据库

oracle.install.db.config.starterdb.installExampleSchemas=false

#是否启用审计设置,配置密码配置文件

oracle.install.db.config.starterdb.enableSecuritySettings=true

#为四个用户指定不同的密码或者指定相同的密码

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

oracle.install.db.config.starterdb.password.SYS=

oracle.install.db.config.starterdb.password.SYSTEM=

oracle.install.db.config.starterdb.password.SYSMAN=

oracle.install.db.config.starterdb.password.DBSNMP=

#数据库管理选项

oracle.install.db.config.starterdb.control=DB_CONTROL

#如果选择grid_control则指定需要使用集群管理 启动数据库

oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

#指定备份和恢复选项

oracle.install.db.config.starterdb.automatedBackup.enable=false

#自动备份启用,变量指定用户

oracle.install.db.config.starterdb.automatedBackup.osuid=

#自动备份启用,变量指定系统用户密码

oracle.install.db.config.starterdb.automatedBackup.ospwd=

#数据库存储类型

oracle.install.db.config.starterdb.storageType=ASM_STORAGE

#指定数据库文件位置:数据文件、控制文件、日志文件

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

#指定备份和恢复的目录:recover区

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#指定存储的ASM磁盘组 【由于本次只安装软件,未安装软件+数据库,因此很多参数本质是不使用的】

oracle.install.db.config.asm.diskGroup=MYDATA  null

#当使用ASM_STORAGE存储时,需填写ASM实例的ASMSNMP用户密码

oracle.install.db.config.asm.ASMSNMPPassword=picclife

#我的Oracle服务用户、密码

MYORACLESUPPORT_USERNAME=

MYORACLESUPPORT_PASSWORD=

#指定是否允许用户设置密码

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#指定用户是否配置安全更新

DECLINE_SECURITY_UPDATES=true

#代理服务器名称

PROXY_HOST=

#代理服务器端口号

PROXY_PORT=

#代理服务器用户名,密码

PROXY_USER=

PROXY_PWD=

#是否自动更新

PROXY_REALM=

#OracleURL

COLLECTOR_SUPPORTHUB_URL=

#指定自动更新选项

oracle.installer.autoupdates.option=SKIP_UPDATES

#选择自动更新下载选项

oracle.installer.autoupdates.downloadUpdatesLoc=

#自动下载权限用户、密码

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

 

 

#静默安装软件检查

./runcluvfy.sh stage -pre dbinst -n  tdcxdb1,tdcxdb2 -verbose -fixup > db_check.log

 

#解释说明[SCAN ip未配置 GNS/DNS服务器解析】

如果主机文件用于解析SCAN主机名,则安装结束时将收到Cluster Verification Utility故障

ERROR:

PRVG-1101 : SCAN name "tdcxdb-scan" failed to resolve

  SCAN Name     IP Address                Status                    Comment   

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

  tdcxdb-scan   10.111.20.105             failed                    NIS Entry

ERROR:

PRVF-4657 : Name resolution setup check for "tdcxdb-scan" (IP address: 10.111.20.105) failed

ERROR:

PRVF-4664 : Found inconsistent name resolution entries for SCAN name "tdcxdb-scan"

 

 

#安装软件:DB install

./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -responseFile /picclife/software/database/response/db_install.rsp

 

#报错

遇到INS-35354,cat /picclife/app/grid/oraInventory/ContentsXML/inventory.xml===>CRS="true"

#Please wait ...tdcxdb1:/picclife/software/database$ [FATAL] [INS-35354] The system on which you are attempting to install Oracle RAC is not part of a valid cluster.

#截取部分

<HOME NAME="Ora11g_gridinfrahome1" LOC="/picclife/app/11.2.0/grid" TYPE="O" IDX="1">

#修改后

<HOME NAME="Ora11g_gridinfrahome1" LOC="/picclife/app/11.2.0/grid" TYPE="O" IDX="1" CRS="true">

#两个节点都修改

 

 

 

6. create diskgroup DATA

 

#创建磁盘组

#本次创建对比生产环境

#查询ASM磁盘格式

SQL> select inst_id,group_number,disk_number,name,path from gv$asm_disk where rownum<3

 

INST_ID GROUP_NUMBER DISK_NUMBER NAME       PATH

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

      1            1           0 DATA_0000  /dev/asm-diskd

      1            1           1 DATA_0001  /dev/asm-diske

#查询磁盘组冗余策略,及磁盘组名称

SQL> select inst_id,group_number,name,type,total_mb,state from gv$asm_diskgroup where rownum<3;

 

INST_ID GROUP_NUMBER NAME       TYPE     TOTAL_MB STATE

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

      2            1 DATA       EXTERN    5345280 CONNECTED

      1            1 DATA       EXTERN    5345280 CONNECTED

 

#创建ASM磁盘组

MOS ID 1068788.1

grid: oracleasm listdisks

[grid@rac1 ~]$ asmca -silent -configureASM -sysAsmPassword Oracle_12345-asmsnmpPassword Oracle_12345-diskString ‘/dev/oracleasm/disks/*‘-diskGroupName MYDATA -disk ‘/dev/oracleasm/disks/MYDATA‘-redundancy EXTERNAL

 

SQL> create diskgroup DATA external redundancy disk ‘/dev/asm-sdd‘;

Diskgroup created.

 

in c d e f g h i j k l m n o p q r s t u;

 --/dev/asm-sdc 磁盘名称      c  -  u

ERROR at line 1:

ORA-15260: permission denied on ASM disk group

 

SQL> show user

USER is "SYS"

SQL> conn / as sysasm

Connected.

SQL>  create diskgroup DATA external redundancy disk ‘/dev/asm-sdd‘;

#添加磁盘

alter diskgroup data add disk ‘/dev/asm-sde‘;

alter diskgroup data add disk ‘/dev/asm-sdf‘;

alter diskgroup data add disk ‘/dev/asm-sdg‘;

alter diskgroup data add disk ‘/dev/asm-sdh‘;

alter diskgroup data add disk ‘/dev/asm-sdi‘;

alter diskgroup data add disk ‘/dev/asm-sdj‘;

alter diskgroup data add disk ‘/dev/asm-sdk‘;

alter diskgroup data add disk ‘/dev/asm-sdl‘;

alter diskgroup data add disk ‘/dev/asm-sdm‘;

alter diskgroup data add disk ‘/dev/asm-sdn‘;

alter diskgroup data add disk ‘/dev/asm-sdo‘;

alter diskgroup data add disk ‘/dev/asm-sdp‘;

alter diskgroup data add disk ‘/dev/asm-sdq‘;

alter diskgroup data add disk ‘/dev/asm-sdr‘;

alter diskgroup data add disk ‘/dev/asm-sds‘;

alter diskgroup data add disk ‘/dev/asm-sdt‘;

alter diskgroup data add disk ‘/dev/asm-sdu‘;

 

#创建过程中,随时查询ASM磁盘是否被创建使用

SQL> select inst_id,group_number,disk_number,name,path from gv$asm_disk where inst_id=1 and name is null;

17 rows selected. --继续添加磁盘直到查询为null

 

#查询磁盘状态及mount另一个节点

SQL>select name,type,state,total_mb,free_mb from gv$asm_diskgroup;

 

NAME                 TYPE         STATE                    TOTAL_MB    FREE_MB

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

OCRVOTE              EXTERN       MOUNTED                      1012580

MYDATA               EXTERN       MOUNTED                      59625912

OCRVOTE              EXTERN       MOUNTED                      1012580

MYDATA                            DISMOUNTED                      00--第二个节点MYDATE磁盘组状态为DISMOUNTED。节点2:[root@rac2 ~]# su - grid[grid@rac2 ~]$ sqlplus /as sysasm

 

SQL> alter diskgroup data mount;

Diskgroup altered.节点1:

 

删除磁盘组

drop diskgroup dg2 including contents;

磁盘组中删除磁盘

alter diskgroup dg2 drop disk ‘a1‘;

 

7. 静默DBCA

 

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname life770  -sid life770 -sysPassword picclife -systemPassword picclife -datafileDestination ‘DATA/‘ -redoLogFileSize 50 -recoveryAreaDestination ‘DATA/‘ -storageType ASM -asmsnmpPassword picclife  -diskGroupName ‘DATA‘ -responseFile NO_VALUE -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema true -automaticMemoryManagement true -totalMemory 2048 -databaseType OLTP -emConfiguration NONE   -nodeinfo rac11g770a,rac11g770b

 

[oracle@rac1 ~]$ $ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc  -gdbName www.luocs.com -sid luocs -sysPassword oracle_12345 -systemPassword  oracle_12345 -storageType ASM -diskGroupName MYDATA -datafileJarLocation $ORACLE_HOME/assistants/dbca/templates -nodeinfo rac1,rac2 -characterset AL32UTF8 -obfuscatedPasswords false-sampleSchema false-asmSysPassword Oracle_12345Copying database files

 

 

 

########本次操作:修改数据库名称,字符集,节点名称

$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname tdcxdb -sid tdcxdb -sysPassword picclife -systemPassword picclife -datafileDestination ‘DATA/‘ -redoLogFileSize 50 -recoveryAreaDestination ‘DATA/‘ -storageType ASM -asmsnmpPassword picclife  -diskGroupName ‘DATA‘ -responseFile NO_VALUE -characterset AL32UTF8 -nationalCharacterSet AL16UTF16 -sampleSchema true -automaticMemoryManagement true -totalMemory 2048 -databaseType OLTP -emConfiguration NONE   -nodeinfo tdcxdb1,tdcxdb2

 

#2g

409M   PGA

1648M  SGA

#删除DBCA命令

$ORACLE_HOME/bin/dbca -silent -deleteDatabase -sourcedb tdcxdb

 

https://www.cnblogs.com/woxing/articles/3682114.html

ORACLE RAC 11.2.0.4 CentOS release 6.9 静默安装1.0版本

标签:11.2   real   在线   网络配置   note   mem   mirror   exec   数据库类型   

原文地址:https://www.cnblogs.com/lvcha001/p/9180707.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!