ansible-oracle, the RAC edition

First off, I’ll be setting up page, where I intend to have a complete list of parameters used in all roles and a description of what they actually do. Up until now I’ve kept it in a file in the github repo, but I think it will be easier to maintain this way. The page is empty at the moment but I’ll try add to it as soon as possible

Now, this is the 3rd post on how to get started with ansible-oracle. You can find the other 2 posts here and here.

This time we will perform a RAC installation, and we will also introduce a few other options we haven’t explored before (mostly because they got added recently).
We will be introducing a concept known as GI role separation which means that the user grid will own the Grid Installation including ASM, and the user oracle will own the database installation.
The default is false, meaning the user oracle will own/run everything (well, except for the parts that run as root then).

We will be creating a container database including 2 pluggable databases

The installation will be performed over nfs this time, using a central repository where all the media is located, instead of copying the files to the installation hosts.

So in summary, this is what we will try to accomplish:

  • Use group_vars & host_vars to alter the default values.
  • Do the installation over nfs
  • Setup RAC using role separation
  • Create a container database with 2 pluggable databases

Adding a group to the inventory

This time the hostgroup will be called mygrouprac and the 2 hosts will be called orarac03/04

[miksan@blergh ansible-oracle]$ vi inventory/hosts 
[miksan@blergh ansible-oracle]$ cat inventory/hosts 
[mygroup]
oradb03

[mygroupasm]
oradb01
oradb02

[mygrouprac]
orarac03
orarac04

Installing from nfs share

There are a few parameters to set if you want to install from a nfs share.

  • install_from_nfs: true/false. Whether the installation should be performed over nfs. If set to true, shortcuts the copy/unpack actions that are usually performed and also mounts the directory exported on the nfs-server on the install-hosts.
  • nfs_server_sw: nfs-server where installation media is available
  • nfs_server_sw_path: /path/to/unpackedfiles/on-nfs-server
  • oracle_stage_remote: /mountpoint/on-install-host.

When doing the installation over nfs, you need to make sure that the media is unpacked and structured in the same way as they will be if copying to and unpacking the files on the installation hosts i.e:
/some/path/<version>/<type>, so in my case the structure on the host containing installation media is:

  • /dump/orasw/12.1.0.2/grid
  • /dump/orasw/12.1.0.2/database
  • /dump/orasw/11.2.0.4/grid
  • /dump/orasw/11.2.0.4/database
  • /dump/orasw/12.1.0.4/em
  • etc

A little something about priorities

When dealing with parameters in Ansible, they can be placed in a number of places, all with different priorities. We’ve used them before, but I haven’t really explained how they work.
So, here’s a list of places where they can be placed (lowest priority first):

  1. <role_name>/defaults/main.yml
  2. group_vars/all
  3. group_vars/<hostgroup>
  4. host_vars/<hostname>
  5. Passed in as ‘–extra-vars’ on the command line.

Parameters can also be placed in the inventory, and then has the same priority as host_vars

group_vars

Variables that you put in the  ‘all’ (group_vars/all) entry are valid for all hosts in your inventory. Since I’d like to do all my installations over nfs I’d rather just add the variables to the ‘all’ entry instead of adding it to each and every hostgroup.

[miksan@ponderstibbons ansible-oracle]$ cat group_vars/all 
---
 install_from_nfs: true
 nfs_server_sw: oladmin
 nfs_server_sw_path: /dump/orasw
 oracle_stage_remote: /mnt/orasw

And this is what it looks like after the nfs share has been mounted by Ansible. It will be mounted/unmounted during the installation of GI (oraswgi-install) and again during the DB installation (oraswdb-install)

[miksan@ponderstibbons ansible-oracle]$ ansible mygrouprac -a "df -h /mnt" -i inventory/hosts 

orarac04 | success | rc=0 >>
Filesystem Size Used Avail Use% Mounted on
oladmin:/dump/orasw 99G 84G 11G 89% /mnt/orasw

orarac03 | success | rc=0 >>
Filesystem Size Used Avail Use% Mounted on
oladmin:/dump/orasw 99G 84G 11G 89% /mnt/orasw
[miksan@ponderstibbons ansible-oracle]$

Then we move on to parameters specific for this particular hostgroup.
Some of the variables below have their default values, but I’m showing them anyway to make you aware of them.

[miksan@ponderstibbons ansible-oracle]$  cat group_vars/mygrouprac

--- 
 hostgroup: mygrouprac 
 role_separation: true      # The GI/DB responsibility will be split between grid/oracle
 
 
 configure_interconnect: true    # Ansible will set the ip's for the Interconnect network
 configure_ssh: true           # Set up passwordless ssh between the nodes 
 configure_host_disks: true
 configure_cluster: true 

################ Grid Infrastructure specifics ################
 oracle_install_option_gi: CRS_CONFIG 
 oracle_install_version_gi: 12.1.0.2 
 oracle_password: Oracle123
 oracle_scan: orarac-scan-dc2.discworld.lab
 oracle_vip: -vip
 oracle_scan_port: 1521
 oracle_asm_init_dg: crs 
 oracle_gi_nic_pub: eth0   # NIC for the 'public' network. Can also be a bonded interface
 oracle_gi_nic_priv: eth1   # NIC for the private/interconnect network. Can also be a bonded interface
 
 oracle_sw_image_db:
   - { filename: linuxamd64_12102_database_1of2.zip, version: 12.1.0.2, download: false }
   - { filename: linuxamd64_12102_database_2of2.zip, version: 12.1.0.2, download: false }
  # - { filename: linuxamd64_12c_database_1of2.zip, version: 12.1.0.1, download: false }
  # - { filename: linuxamd64_12c_database_2of2.zip, version: 12.1.0.1, download: false }
  # - { filename: p13390677_112040_Linux-x86-64_1of7.zip, version: 11.2.0.4, download: false } 
  # - { filename: p13390677_112040_Linux-x86-64_2of7.zip, version: 11.2.0.4, download: false } 
 oracle_databases: 
   racdb: 
     oracle_version_db: 12.1.0.2
     oracle_edition: EE
     oracle_db_name: racdb
     oracle_db_passwd: Oracle123
     oracle_db_type: RAC
     is_container: "true"
     pdb_prefix: racpdb
     num_pdbs: 2
     is_racone: "false"
     storage_type: ASM 
     service_name: racdb_serv 
     oracle_init_params: "open_cursors=300,processes=700"
     oracle_db_mem_percent: 20 
     oracle_database_type: MULTIPURPOSE 
     redolog_size_in_mb: 100
     delete_db: false 

 oracle_dbf_dir_asm: "DATA" 
 oracle_reco_dir_asm: "FRA" 

 host_fs_layout: 
   u01:
    {mntp: /u01, device: /dev/sdb, vgname: vgora, pvname: /dev/sdb1, lvname: lvora}
 
 asm_diskgroups: 
   - crs
   - data
   - fra
 
 asm_storage_layout: 
   crs:
     - {device: /dev/sdc, asmlabel: CRS01}
   data:
     - {device: /dev/sdd, asmlabel: DATA01}
     - {device: /dev/sde, asmlabel: DATA02}
   fra:
     - {device: /dev/sdf, asmlabel: FRA01}
     - {device: /dev/sdg, asmlabel: FRA02}
     - {device: /dev/sdh, asmlabel: FRA03}

host_vars

These values are specific to each host.
Note how one node is a ‘master_node’ and the other(s) are not. This is important when creating a cluster (oracle_install_option_gi: crs_config), since some of the tasks only have to performed on one node (e.g partitioning shared storage, creating asmlabels), and some have to performed on one node first and on the other nodes later (e.g GI root.sh)

[miksan@ponderstibbons ansible-oracle]$ cat host_vars/orarac03
---
 master_node: true
 oracle_ic_net: 172.16.100.243
[miksan@ponderstibbons ansible-oracle]$ cat host_vars/orarac04
---
 master_node: false
 oracle_ic_net: 172.16.100.244
[miksan@ponderstibbons ansible-oracle]$

And this is what the network looks like after the interfaces have been configured.

[miksan@ponderstibbons ansible-oracle]$ ansible mygrouprac -m raw -a "ifconfig eth1" -i inventory/hosts -s
orarac04 | success | rc=0 >>
eth1 Link encap:Ethernet HWaddr 00:50:56:9E:54:62 
 inet addr:172.16.100.244 Bcast:172.16.100.255 Mask:255.255.255.0
 inet6 addr: fe80::250:56ff:fe9e:5462/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:24587 errors:0 dropped:30 overruns:0 frame:0
 TX packets:18937 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:14347631 (13.6 MiB) TX bytes:21286820 (20.3 MiB)

orarac03 | success | rc=0 >>
eth1 Link encap:Ethernet HWaddr 00:50:56:9E:07:9A 
 inet addr:172.16.100.243 Bcast:172.16.100.255 Mask:255.255.255.0
 inet6 addr: fe80::250:56ff:fe9e:79a/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:24816 errors:0 dropped:24 overruns:0 frame:0
 TX packets:19663 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:21783996 (20.7 MiB) TX bytes:14010170 (13.3 MiB)
[miksan@ponderstibbons ansible-oracle]$

Ok, all done. Let’s run the playbook.

[miksan@ponderstibbons ansible-oracle]$ time ansible-playbook my-rac-install.yml -i inventory/hosts 

PLAY [Host configuration] ***************************************************** 

GATHERING FACTS *************************************************************** 
The authenticity of host 'orarac03 (192.168.0.60)' can't be established.
RSA key fingerprint is 91:05:63:ee:59:9a:ce:f6:b6:50:2d:8a:9d:ec:99:e4.
Are you sure you want to continue connecting (yes/no)? yes
The authenticity of host 'orarac04 (192.168.0.61)' can't be established.
RSA key fingerprint is fb:ea:c0:57:1c:f4:7b:8d:0c:52:a9:ca:cb:8e:af:6e.
Are you sure you want to continue connecting (yes/no)? yes
ok: [orarac03]
ok: [orarac04]
.
. SKIP
.
TASK: [orahost | User | Add Oracle user] ************************************** 
changed: [orarac03] => (item={'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'})
changed: [orarac04] => (item={'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'})

TASK: [orahost | User | Add Grid user] **************************************** 
changed: [orarac03] => (item={'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'})
changed: [orarac04] => (item={'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}
.
. SKIP
.
TASK: [orahost | ssh-keys | Generate SSH keys] ******************************** 
skipping: [orarac04 -> 127.0.0.1]
changed: [orarac03 -> 127.0.0.1]

TASK: [orahost | ssh-keys | Add ssh-keys & authorized_keys to oracle user] **** 
changed: [orarac04] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/id_rsa'])
changed: [orarac03] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/id_rsa'])
changed: [orarac03] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/id_rsa.pub'])
changed: [orarac04] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/id_rsa.pub'])
changed: [orarac03] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/authorized_keys'])
changed: [orarac04] => (item=[{'username': 'oracle', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11000, 'othergroups': 'dba,asmdba,backupdba,dgdba,kmdba,oper'}, '/tmp/authorized_keys'])

TASK: [orahost | ssh-keys | Add ssh-keys & authorized_keys to grid user] ****** 
changed: [orarac04] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/id_rsa'])
changed: [orarac03] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/id_rsa'])
changed: [orarac04] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/id_rsa.pub'])
changed: [orarac03] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/id_rsa.pub'])
changed: [orarac04] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/authorized_keys'])
changed: [orarac03] => (item=[{'username': 'grid', 'primgroup': 'oinstall', 'passwd': '$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0', 'uid': 11001, 'othergroups': 'asmadmin,asmdba,asmoper,dba'}, '/tmp/authorized_keys'])
.
. SKIP
.
PLAY [Oracle Grid Infrastructure installation & ASM Configuration] ************ 
GATHERING FACTS *************************************************************** 
ok: [orarac03]
ok: [orarac04]
TASK: [oraswgi-install | Check if GI is already installed] ******************** 
changed: [orarac04]
changed: [orarac03]
.
.
. SKIP
.
.
TASK: [oraswgi-install | Mount nfs share with installation media] ************* 
ok: [orarac03]
ok: [orarac04]
.
. SKIP
.
TASK: [oraswgi-install | Copy oracle installfiles to server (GI) (web)] ******* 
skipping: [orarac03] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
skipping: [orarac04] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
.. SNIP

TASK: [oraswgi-install | Copy oracle installfiles to server (GI) (local)] ***** 
skipping: [orarac03] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
skipping: [orarac04] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})


TASK: [oraswgi-install | Extract files to stage-area (GI)] ******************** 
skipping: [orarac04] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
skipping: [orarac03] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
.. SNIP

TASK: [oraswgi-install | Extract files to stage-area (GI) (from remote location)] *** 
skipping: [orarac03] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
skipping: [orarac04] => (item={'version': '12.1.0.2', 'filename': 'linuxamd64_12102_grid_1of2.zip'})
.. SNIP

TASK: [oraswgi-install | Setup response file for install (GI)] **************** 
skipping: [orarac04]
changed: [orarac03]

TASK: [oraswgi-install | Install Grid Infrastructure] ************************* 
skipping: [orarac04]
changed: [orarac03]
.
.
.... SKIP A BUNCH OF LINES
.
.
.
 }
 ], 
 "rc": 0, 
 "start": "2014-10-12 12:20:22.675285", 
 "stderr": "\nreal\t11m34.136s\nuser\t0m28.294s\nsys\t0m5.249s", 
 "stdout": "Copying database files\n1% complete\n2% complete\n6% complete\n11% complete\n16% complete\n20% complete\n23% complete\nCreating and starting Oracle instance\n24% complete\n27% complete\n28% complete\n29% complete\n32% complete\n35% complete\n36% complete\n38% complete\nCreating cluster database views\n40% complete\n54% complete\nCompleting Database Creation\n56% complete\n58% complete\n65% complete\n72% complete\n77% complete\nCreating Pluggable Databases\n81% complete\n86% complete\n100% complete\nLook at the log file \"/u01/app/oracle/cfgtoollogs/dbca/racdb/racdb.log\" for further details."
 }, 
 "oradbcreate.stdout_lines": "{{ oradbcreate.stdout_lines }}"
}

PLAY RECAP ******************************************************************** 
orarac03 : ok=114 changed=65 unreachable=0 failed=0 
orarac04 : ok=108 changed=45 unreachable=0 failed=0 

real 44m6.330s
user 0m8.822s
sys 0m5.771s
[miksan@ponderstibbons ansible-oracle]$

Lets see if everything is running:

[miksan@ponderstibbons ansible-oracle]$ ansible mygrouprac -m shell -a "source /home/grid/.profile_grid; /u01/app/12.1.0.2/grid/bin/crsctl stat res -t" -s -i inventory/hosts --limit orarac03
orarac03 | success | rc=0 >>
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.CRS.dg
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.DATA.dg
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.FRA.dg
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.LISTENER.lsnr
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.net1.network
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
ora.ons
 ONLINE ONLINE orarac03 STABLE
 ONLINE ONLINE orarac04 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
 1 ONLINE ONLINE orarac04 STABLE
ora.LISTENER_SCAN2.lsnr
 1 ONLINE ONLINE orarac03 STABLE
ora.MGMTLSNR
 1 ONLINE ONLINE orarac03 169.254.156.62 172.1
 6.100.243,STABLE
ora.asm
 1 ONLINE ONLINE orarac03 Started,STABLE
 2 ONLINE ONLINE orarac04 Started,STABLE
 3 OFFLINE OFFLINE STABLE
ora.cvu
 1 ONLINE ONLINE orarac03 STABLE
ora.mgmtdb
 1 ONLINE ONLINE orarac03 Open,STABLE
ora.oc4j
 1 ONLINE ONLINE orarac03 STABLE
ora.orarac03.vip
 1 ONLINE ONLINE orarac03 STABLE
ora.orarac04.vip
 1 ONLINE ONLINE orarac04 STABLE
ora.racdb.db
 1 ONLINE ONLINE orarac03 Open,STABLE
 2 ONLINE ONLINE orarac04 Open,STABLE
ora.scan1.vip
 1 ONLINE ONLINE orarac04 STABLE
ora.scan2.vip
 1 ONLINE ONLINE orarac03 STABLE
--------------------------------------------------------------------------------
[miksan@ponderstibbons ansible-oracle]$

Then lets see if role separation is really in use

[miksan@ponderstibbons ansible-oracle]$ ansible mygrouprac -m raw -a "ps -ef |grep pmon |grep -v grep" -i inventory/hosts 
orarac04 | success | rc=0 >>
grid 32058 1 0 10:05 ? 00:00:00 asm_pmon_+ASM2
oracle 57162 1 0 10:36 ? 00:00:00 ora_pmon_racdb2

orarac03 | success | rc=0 >>
oracle 15277 1 0 10:36 ? 00:00:00 ora_pmon_racdb1
grid 39161 1 0 09:59 ? 00:00:00 asm_pmon_+ASM1
grid 50500 1 0 10:11 ? 00:00:00 mdb_pmon_-MGMTDB
[miksan@ponderstibbons ansible-oracle]$

There you go, the user ‘grid’ owns the ASM & MGMTDB processes while the user ‘oracle’ owns the normal database processes

And finally, let’s verify that we got our 2 pluggable databases.

[miksan@ponderstibbons ansible-oracle]$ ssh orarac03
Last login: Sun Oct 12 13:22:14 2014 from 192.168.0.7
-------------------------------------------------
Welcome to orarac03
OracleLinux 6.5 x86_64

FQDN: orarac03.discworld.lab
IP: 192.168.0.60

Processor: Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
#CPU's: 2 
Memory: 7.79 GB

Uptime: 1:01 hours
-------------------------------------------------
[miksan@orarac03 ~]$ sudo su - oracle
[oracle@orarac03 ~]$ . .profile_racdb 
[oracle@racdb oracle]$sqlplus system/Oracle123@racdb
SQL*Plus: Release 12.1.0.2.0 Production on Sun Oct 12 13:27:25 2014

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

13:27:25 SYSTEM @ racdb:>select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
RACPDB1 READ WRITE
RACPDB2 READ WRITE
13:27:40 SYSTEM @ racdb:>

Looks like everything is ok, sweet! Job done.

If anyone actually attempts this, I’d love to get some feedback. And if  you have questions, let me know.

Advertisements

2 thoughts on “ansible-oracle, the RAC edition

  1. Nice work Mikael! Currently I am working on the inside of the databases, users, roles, grants, profiles, tablespaces etc. Also, finding my way around. Keep up the good work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s