利用Vagrant安装Oracle RAC(默认为non-CDB模式),生成2台虚机,耗时约1小时。
node1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:25:54: Make create database commandnode1: -----------------------------------------------------------------node1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:25:54: Create databasenode1: -----------------------------------------------------------------node1: [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,048 MB) is less than the recommended value.node1: CAUSE: Fast Recovery Area size should at least be three times the database size (692 MB).node1: ACTION: Specify Fast Recovery Area Size to be at least three times the database size.node1: [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.node1: CAUSE:node1: a. 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].node1: b.The password entered is a keyword that Oracle does not recommend to be used as passwordnode1: ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.node1: [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.node1: CAUSE:node1: a. 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].node1: b.The password entered is a keyword that Oracle does not recommend to be used as passwordnode1: ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.node1: [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,048 MB) is less than the recommended value.node1: CAUSE: Fast Recovery Area size should at least be three times the database size (2,377 MB).node1: ACTION: Specify Fast Recovery Area Size to be at least three times the database size.node1: Prepare for db operationnode1: 8% completenode1: Copying database filesnode1: 33% completenode1: Creating and starting Oracle instancenode1: 34% completenode1: 35% completenode1: 39% completenode1: 42% completenode1: 45% completenode1: 50% completenode1: Creating cluster database viewsnode1: 52% completenode1: 67% completenode1: Completing Database Creationnode1: 71% completenode1: 73% completenode1: 75% completenode1: Executing Post Configuration Actionsnode1: 100% completenode1: Database creation complete. For details check the logfiles at:node1: /u01/app/oracle/cfgtoollogs/dbca/DB193H1.node1: Database Information:node1: Global Database Name:DB193H1node1: System Identifier(SID) Prefix:DB193H1node1: Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/DB193H1/DB193H1.log" for further details.node1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:40:27: Check databasenode1: -----------------------------------------------------------------node1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:40:27: Config databasenode1: -----------------------------------------------------------------node1: Database unique name: DB193H1node1: Database name: DB193H1node1: Oracle home: /u01/app/oracle/product/19.3.0.0/dbhome_1node1: Oracle user: oraclenode1: Spfile: +DATA/DB193H1/PARAMETERFILE/spfile.270.1157999845node1: Password file: +DATA/DB193H1/PASSWORD/pwddb193h1.258.1157999243node1: Domain:node1: Start options: opennode1: Stop options: immediatenode1: Database role: PRIMARYnode1: Management policy: AUTOMATICnode1: Server pools:node1: Disk Groups: RECO,DATAnode1: Mount point paths:node1: Services:node1: Type: RACnode1: Start concurrency:node1: Stop concurrency:node1: OSDBA group: dbanode1: OSOPER group: opernode1: Database instances: DB193H11,DB193H12node1: Configured nodes: node1,node2node1: CSS critical: nonode1: CPU count: 0node1: Memory target: 0node1: Maximum memory: 0node1: Default network number for database services:node1: Database is administrator managednode1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:40:32: Database Statusnode1: -----------------------------------------------------------------node1: Instance DB193H11 is running on node node1node1: Instance DB193H12 is running on node node2node1: -----------------------------------------------------------------------------------node1: SUCCESS: 2024-01-11 18:40:35: Oracle RAC on Vagrant has been created successfully!node1: -----------------------------------------------------------------------------------node1: -----------------------------------------------------------------node1: INFO: 2024-01-11 18:40:35: Running user-defined post-setup scriptsnode1: -----------------------------------------------------------------real 60m10.215s
user 0m0.000s
sys 0m0.031s
可以看到vagrant生成了node1和node2两台虚机:
$ vagrant status│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│Oracle RAC (Real Application Cluster) Vagrant box for KVM/libVirt or VirtualBoxCopyright (c) 1982-2020 Oracle and/or its affiliates
----------------------------------------------------------------------------------Author: Ruggero Citton <ruggero.citton@oracle.com>RAC Pack, Cloud Innovation and Solution Engineering Team
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│--------------------
Detected virtualbox
--------------------
getting Proxy Configuration from Host...
Current machine states:node2 running (virtualbox)
node1 running (virtualbox)This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
两台虚机启动后,32G的电脑内存占用由29%升至69%,消耗内存约13G。
空间方面,两台虚机刚生成时,新增空间占用为vagrant目录下的113G(共享存储)加虚机目录下的6.13G(各自的操作系统),总共约120G。
存储使用了ASM:
[grid@node1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 65520 63012 0 63012 0 Y DATA/
MOUNTED NORMAL N 512 512 4096 4194304 16368 15364 4092 5636 0 N RECO/
如果要使用SQL Developer管理此两RAC示例,则需要连接此两主机的公共IP或SCAN IP,例如192.168.56.111和192.168.56.121。他们定义在文件vagrant.yml中:
$ pwd
.../vagrant-projects/OracleRAC/OL7/config$ ls
setup.env vagrant.yml$ cat vagrant.yml
# -----------------------------------------------
# vagrant.yml for VirtualBox
# -----------------------------------------------
node1:vm_name: node1mem_size: 8192cpus: 2public_ip: 192.168.56.111vip_ip: 192.168.56.112private_ip: 192.168.200.111u01_disk: ./node1_u01.vdinode2:vm_name: node2mem_size: 8192cpus: 2public_ip: 192.168.56.121vip_ip: 192.168.56.122private_ip: 192.168.200.122u01_disk: ./node2_u01.vdishared:prefix_name: vgtol7-rac# ---------------------------------------------domain : localdomainscan_ip1: 192.168.56.115scan_ip2: 192.168.56.116scan_ip3: 192.168.56.117# ---------------------------------------------non_rotational: 'on'asm_disk_path:asm_disk_num: 4asm_disk_size: 20p1_ratio: 80asm_lib_type: 'ASMLIB'# ---------------------------------------------env:provider: virtualbox# ---------------------------------------------gi_software: LINUX.X64_193000_grid_home.zipdb_software: LINUX.X64_193000_db_home.zip# ---------------------------------------------root_password: welcome1grid_password: welcome1oracle_password: welcome1sys_password: welcome1pdb_password: welcome1# ---------------------------------------------ora_languages: en,en_GB# ---------------------------------------------nomgmtdb: trueorestart: false# ---------------------------------------------db_name: DB193H1pdb_name: PDB1db_type: RACcdb: false# ---------------------------------------------...
有几个地方可以表明其为RAC。见下图,RAC #1表明其为集群中的节点1:
然后就是“数据库状态”中,可以看到有2个实例,即DB193H11和DB193H12:
以及“状态”中的“Oracle主机”标签页: