通过本文可以学习到如何使用vmware workstation 16配置共享磁盘以及使用静默方式部署Oracle 19c RAC。这里的asm磁盘组使用oracle的新特性AFD,有关说明请参考官方文档。
1、创建共享磁盘
共享磁盘需要使用命令行创建,这里使用MobaXterm作为终端,如下:
[jacky.lee.lee] ➤ export PATH=$PATH:/drives/c/Program\ Files\ \(x86\)/VMware/VMware\ Workstation/
[jacky.lee.lee] ➤ vmware-vdiskmanager.exe -c -s 100GB -t 4 sharedisk01.vmdk
[jacky.lee.lee] ➤ vmware-vdiskmanager.exe -c -s 100GB -t 4 sharedisk02.vmdk
[jacky.lee.lee] ➤ vmware-vdiskmanager.exe -c -s 100GB -t 4 sharedisk03.vmdk
[jacky.lee.lee] ➤ vmware-vdiskmanager.exe -c -s 100GB -t 4 sharedisk04.vmdk
[jacky.lee.lee] ➤ vmware-vdiskmanager.exe -c -s 100GB -t 4 sharedisk05.vmdk
其中的-t代表磁盘类型,如下图:
2、虚拟机添加共享磁盘
各虚拟机节点使用下面相同的方法添加共享磁盘。
编辑虚拟机->添加磁盘->使用现有虚拟磁盘->选择现有磁盘->保持现有格式
添加完成后,点击“高级 ”,设置虚拟设备节点并选中“独立”模式。
根据上述步骤完成其他磁盘的添加。
磁盘添加完成后,不要立即打开虚拟机,需要编辑虚拟机配置文件(比如:odb03.vmx),加入以下内容后,才可以正常打开虚拟机。
disk.locking = "false"
scsi1.shareBus = "VIRTUAL"
3、安装配置19c Grid
3.1 准备grid静默文件
静默配置文件内容如下:
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.gpnp.scanName=scan
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.clusterName=ORA19C-01
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=odb03:odb03-vip,odb04:odb04-vip
oracle.install.crs.config.networkInterfaceList=ens32:192.168.120.0:1,ens35:172.16.255.0:5
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=false
oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE
oracle.install.asm.SYSASMPassword=abcABC12
oracle.install.asm.diskGroup.name=DATA
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=4
oracle.install.asm.diskGroup.disks=/dev/sdb,/dev/sdc,/dev/sdd
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/sd*
oracle.install.asm.monitorPassword=abcABC12
oracle.install.asm.configureAFD=true
oracle.install.crs.configureRHPS=false
oracle.install.crs.config.ignoreDownNodes=false
oracle.install.config.managementOption=NONE
oracle.install.crs.rootconfig.executeRootScript=false
3.2 应用最新PSU
由于是新环境,所以在安装之前先打上PSU,然后进行安装。
--解压grid安装包到家目录
[grid@odb03 ~]$ cd $ORACLE_HOME;unzip LINUX.x64_193000_grid_home.zip
--解压最新的opatch到家目录
[grid@odb03 ~]$ cd $ORACLE_HOME;unzip /mnt/p6880880_190000_Linux-x86-64.zip
在解压过程中如果提示重复文件,选择覆盖即可(不要移动或者删除OPatch目录)。
这里19c的基础版本为19.3,打完最新版PSU后版本变更为19.10。
--解压grid的PSU
[grid@odb03 ~]$ cd /mnt/tmp; unzip p32226239_190000_Linux-x86-64.zip
[grid@odb03 ~]$ $ORACLE_HOME/gridSetup.sh -silent -applyRU /mnt/tmp/32226239/
Preparing the home to patch...
Applying the patch /mnt/tmp/32226239/...
Successfully applied the patch.
3.3 静默安装grid
[grid@odb03 ~]$ $ORACLE_HOME/gridSetup.sh -silent -ignorePrereq -responseFile /tmp/grid.rsp
Launching Oracle Grid Infrastructure Setup Wizard...
The response file for this session can be found at:
/u01/app/19.0.0/grid/install/response/grid_2021-01-22_04-05-52PM.rsp
You can find the log of this install session at:
/tmp/GridSetupActions2021-01-22_04-05-52PM/gridSetupActions2021-01-22_04-05-52PM.log
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/19.0.0/grid/root.sh
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[odb03, odb04]
Execute /u01/app/19.0.0/grid/root.sh on the following nodes:
[odb03, odb04]
Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.
Successfully Setup Software with warning(s).
As install user, execute the following command to complete the configuration.
/u01/app/19.0.0/grid/gridSetup.sh -executeConfigTools -responseFile /tmp/grid.rsp [-silent]
Moved the install session logs to:
/u01/app/oraInventory/logs/GridSetupActions2021-01-22_04-05-52PM
各个节点以root用户分别执行以下两个脚本:
[root@odb03 ~]# /u01/app/oraInventory/orainstRoot.sh
[root@odb03 ~]# /u01/app/19.0.0/grid/root.sh
以grid用户执行以下命令,完成最后的grid配置:
[grid@odb03 ~]$ $ORACLE_HOME/gridSetup.sh -silent -executeConfigTools -responseFile /tmp/grid.rsp
4、安装配置Oracle DB
4.1 安装静默文件
[oracle@odb03 ~]$ vi /tmp/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.CLUSTER_NODES=odb03,odb04
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.managementOption=DEFAULT
oracle.install.db.config.starterdb.enableRecovery=false
4.2 应用最新PSU
[oracle@odb03 db_1]$ unzip /mnt/p6880880_190000_Linux-x86-64.zip
Archive: /mnt/p6880880_190000_Linux-x86-64.zip
replace OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
......
[oracle@odb03 tmp]$ unzip p32218454_190000_Linux-x86-64.zip
[oracle@odb03 ~]$ $ORACLE_HOME/runInstaller -silent -applyRU /mnt/tmp/32218454
Preparing the home to patch...
Applying the patch /mnt/tmp/32218454...
Successfully applied the patch.
4.3 安装Oracle DB
[oracle@odb03 ~]$ $ORACLE_HOME/runInstaller -silent -ignorePrereq -responseFile /tmp/db_install.rsp
安装完成后,在各个节点执行以下脚本:
[root@odb03 ~]# /u01/app/oracle/product/19.0.0/db_1/root.sh
[root@odb04 ~]# /u01/app/oracle/product/19.0.0/db_1/root.sh
4.4 DBCA静默创建数据库
静默文件如下:
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=racdb
sid=racdb
databaseConfigType=RAC
policyManaged=false
createServerPool=false
force=false
createAsContainerDatabase=false
numberOfPDBs=0
useLocalUndoForPDBs=true
nodelist=odb03,odb04
templateName=/u01/app/oracle/product/19.0.0/db_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=abcABC12
systemPassword=abcABC12
serviceUserPassword=abcABC12
runCVUChecks=FALSE
dvConfiguration=false
olsConfiguration=false
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
datafileDestination=+DATA/{DB_UNIQUE_NAME}/
recoveryAreaDestination=+FRA
storageType=ASM
diskGroupName=+DATA/{DB_UNIQUE_NAME}/
asmsnmpPassword=abcABC12
recoveryGroupName=+FRA
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19.0.0/db_1,DB_UNIQUE_NAME=racdb,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=racdb,ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1,SID=racdb
initParams=racdb1.undo_tablespace=UNDOTBS1,racdb2.undo_tablespace=UNDOTBS2,sga_target=2312MB,db_block_size=8192BYTES,cluster_database=true,diagnostic_dest={ORACLE_BASE},remote_login_passwordfile=exclusive,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=1000,pga_aggregate_target=771MB,racdb1.thread=1,racdb2.thread=2,nls_territory=AMERICA,local_listener=-oraagent-dummy-,db_recovery_file_dest_size=50GB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=racdb,racdb1.instance_number=1,racdb2.instance_number=2,db_recovery_file_dest=+FRA,audit_trail=none
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=0
创建数据库:
[oracle@odb03 ~]$ dbca -silent -ignorePreReqs -createDatabase -responseFile /tmp/dbca.rsp -enableArchive true -redoLogFileSize 1024
Prepare for db operation
8% complete
Copying database files
33% complete
Creating and starting Oracle instance
34% complete
35% complete
39% complete
......
验证数据库状态:
[oracle@odb03 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node odb03
Instance racdb2 is running on node odb04
[oracle@odb03 ~]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/19.0.0/db_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.270.1062524351
Password file: +DATA/RACDB/PASSWORD/pwdracdb.258.1062523479
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: FRA,DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: racdb1,racdb2
Configured nodes: odb03,odb04
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
来源:oschina
链接:https://my.oschina.net/u/4321696/blog/4922322