#接着第二部分
19.创建ASM磁盘组
#在节点1运行
#su – grid
[grid@rac1 grid]$asmca -silent -createDiskGroup -sysAsmPassword Grid1234 -diskString '/dev/oracleasm/disks/*' -diskGroupName DATA -diskList '/dev/oracleasm/disks/VOLDATA01,/dev/oracleasm/disks/VOLDATA02,/dev/oracleasm/disks/VOLDATA03' -redundancy NORMAL -compatible.asm 11.2 -compatible.rdbms 11.2
DiskGroup DATA created successfully.
20. 安装oralce数据库
#解压文件
#su - oracle
[oracle@rac1 ~]$unzip linux.x64_11gR2_database_1of2.zip
[oracle@rac1 ~]$unzip linux.x64_11gR2_database_2of2.zip
#准备响应文件,响应文件有模板,在/home/oracle/database/response里面,我的响应文件如下
[oracle@rac1 database]$ pwd
/home/oracle/database
[oracle@rac1 database]$ grep -v \# db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=rac1
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=rac1,rac2
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=OAODZ
oracle.install.db.config.starterdb.SID=oaodz1
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=40960
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=Capgemini123
oracle.install.db.config.starterdb.password.SYS=Capgemini123
oracle.install.db.config.starterdb.password.SYSTEM=Capgemini123
oracle.install.db.config.starterdb.password.SYSMAN=Capgemini123
oracle.install.db.config.starterdb.password.DBSNMP=Capgemini123
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
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=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
#安装数据库
[oracle@rac1 database]$ ./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /home/oracle/database/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 37421 MB Passed
Checking swap space: must be greater than 150 MB. Actual 8095 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-07-19_12-07-28PM. Please wait ...
.........等待以下提示的出现......
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/u01/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
#两个节点都要执行
[root@rac1 oracle]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Check /u01/app/oracle/product/11.2.0/db_1/install/root_rac1_2018-07-19_12-58-03.log for the output of root script
#查看产品注册列表,grid和数据都注册在里面
[oracle@rac1 database]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml
11.2.0.1.0
2.1.0.6.0
21. 创建数据库
#准备相应文件,
[oracle@rac1 database]$ pwd
/home/oracle/database
#响应文件里面有几个部分,如果是新建数据库,就只关注[CREATEDATABASE]这一部分,响应文件里面的相关密码要和之前设置的一样,。
[oracle@rac1 database]$ grep -v \# dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "OAODZ"
SID = "oaodz1"
NODELIST=rac1,rac2
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "Capgemini123" #数据库sys用户密码
SYSTEMPASSWORD = "Capgemini123" 数据库system用户密码
STORAGETYPE=ASM #存储类型
DISKGROUPNAME=DATA #ASM磁盘组名字
ASMSNMP_PASSWORD="Grid1234" #ASMSNMP密码
RECOVERYGROUPNAME=DATA
CHARACTERSET = "UTF8"
NATIONALCHARACTERSET= "UTF8"
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl11.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
INSTANCENAME = "orcl11g"
SYSDBAUSERNAME = "sys"
#开启集群监听,用grid账号
[grid@rac1 grid]$ srvctl add listener
[grid@rac1 grid]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is not running
[grid@rac1 grid]$ srvctl start listener
[grid@rac1 grid]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
[grid@rac1 grid]$
#将oracle加入asmadmin 组,不然创建数据库的时候会提示 DiskGroup "DATA" does not exist or not mounted.
#两个节点都有执行
[root@rac1 oracle]# usermod -a -G asmadmin oracle
[root@rac2 app]# usermod -a -G asmadmin oracle
#给grid下面的oracle程序加入s标识,这样在调用这个程序的时候,就可以拥有grid用户的权限
#两个节点都要执行
[root@rac1 oracle]# su - grid
Last login: Thu Jul 19 13:10:26 CST 2018 on pts/5
[grid@rac1 ~]$ cd /u01/app/grid_home/bin/
[grid@rac1 bin]$ chmod +s oracle
[grid@rac1 bin]$
[root@rac2 u01]# su - grid
Last login: Thu Jul 19 11:38:41 CST 2018 on pts/4
[grid@rac2 ~]$ cd /u01/app/grid_home/bin/
[grid@rac2 bin]$ chmod +s oracle
[grid@rac2 bin]$
#创建数据库,在节点1执行
[oracle@rac1 database]$ dbca -silent -responseFile /home/oracle/database/dbca.rsp
Copying database files
1% complete
3% 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/OAODZ/OAODZ.log" for further details.
到此RAC集群以及数据库安装完成,接下来是查看,转下一篇文章