DbaaS, but on metal: Rac on Oracle Cloud Infrastructure
Let’s skip some networking stuff first and do some fun tests on this Cloud infrastructure.
One of the things which caught my attention is the RAC database as a service.
I will split this in two separate blog posts. This one will tell you about how to create a RAC database as a service and the next one will tell you about how it performs.
Let’s get started!
General
First step is of course log into your portal and make sure the networking is already installed too. If necessary, run through my first blogpost to set it up.
Think back about the “good old days” where it took some effort to create the infrastructure for a clustered database, set up the servers and all those fun things. Cool thing, the Oracle cloud does this for you. This is how.
DB-systems
In the DBaaS, they call it database systems and they control about them can be found here:
Just click the db systems link and in the next screen, at the left down select your own compartment and it’s easy as clicking on “launch db system”.
The “wizard”, basically it’s actually a one pager is very simple to use. The first part is some general database information.
General
The shape is interesting, you can choose different kinds of database shapes like:
So in this particular case we go for the RAC with local storage.
I chose only 4 cores as the first test will focus on storage tests, so not too much needed.
This is a test system, so I chose to use normal redundancy. I personally don’t think it’s an advanced choice, but it’s easy to find, so no big deal for me.
Networking
This is also very self-explanatory, easy to select what you want and give it a name. Make sure that for the client subnet, you select a public subnet.
DB information
Easy again and the choices of versions are these:
Cool that you also can select 11.2.0.4. Maybe that’s something for later to play with.
So basically, that’s it folks, click on “Launch DB system” and it starts provisioning.
This will take around 90 minutes and then you have a fully operational rac database in the cloud.
This was not hard to do!
Sanity checks
A wise man and my teamlead (you can follow him on twitter on handle @geertdepaep) always taught me “Only trust what you see for yourself”. Thanks Geert for this advice.
So let’s verify if all went well. Sometimes I’m a bit stubborn, this is such a moment. I start verifying at the second node. Yes, I’m kind of a rebel 😉
First things first, do we really have a cluster?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
[grid@exiracbm2 ~]$ crsctl status resource -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.DATA.COMMONSTORE.advm ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.DATA.dg ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.LISTENER.lsnr ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.RECO.dg ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.REDO.dg ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.data.commonstore.acfs ONLINE ONLINE exiracbm1 mounted on /opt/orac le/dcs/commonstore,S TABLE ONLINE ONLINE exiracbm2 mounted on /opt/orac le/dcs/commonstore,S TABLE ora.net1.network ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.ons ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE ora.proxy_advm ONLINE ONLINE exiracbm1 STABLE ONLINE ONLINE exiracbm2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE exiracbm1 STABLE ora.asm 1 ONLINE ONLINE exiracbm1 Started,STABLE 2 ONLINE ONLINE exiracbm2 Started,STABLE ora.cvu 1 ONLINE ONLINE exiracbm1 STABLE ora.exiracbm1.vip 1 ONLINE ONLINE exiracbm1 STABLE ora.exiracbm2.vip 1 ONLINE ONLINE exiracbm2 STABLE ora.exiracdb_phx2br.db 1 ONLINE ONLINE exiracbm1 Open,HOME=/u01/app/o racle/product/12.2.0 .1/dbhome_1,STABLE ora.qosmserver 1 OFFLINE OFFLINE STABLE ora.scan1.vip 1 ONLINE ONLINE exiracbm1 STABLE -------------------------------------------------------------------------------- [grid@exiracbm2 ~]$ |
This looks like a cluster to me. But do you see what I see? I see only one instance of my database. So let’s verify.
UPDATE2: (6-Oct-2017):
I was deploying a new db to do the failover/performance tests and I noticed that the DB is immediately a rac-db. I leave this post in place to show if it happens, what you can do, but for now the workaround is not necessary anymore.
1 2 3 4 5 |
[grid@exiracbm2 ~]$ ps -ef|grep -i pmon grid 3339 1 0 Sep20 ? 00:00:02 asm_pmon_+ASM2 grid 21742 1 0 Sep20 ? 00:00:01 apx_pmon_+APX2 grid 88886 81799 0 17:08 pts/0 00:00:00 grep -i pmon [grid@exiracbm2 ~]$ |
Oops? Indeed, cluster doesn’t lie, I do have only one instance. Verify on node 1:
1 2 3 4 5 6 |
[root@exiracbm1 ~]# ps -ef |grep -i pmon grid 31092 1 0 Sep20 ? 00:00:02 asm_pmon_+ASM1 root 38476 47041 0 17:09 pts/0 00:00:00 grep -i pmon oracle 48858 1 0 Sep20 ? 00:00:01 ora_pmon_exiracdb grid 60262 1 0 Sep20 ? 00:00:02 apx_pmon_+APX1 [root@exiracbm1 ~]# |
Ok … at least there is one. Let’s have a closer look.
The database is actually build as a single instance database:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
[oracle@exiracbm1 ~]$ srvctl config database -db exiracdb_phx2br Database unique name: exiracdb_phx2br Database name: exiracdb Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1 Oracle user: oracle Spfile: +DATA/EXIRACDB_PHX2BR/PARAMETERFILE/spfile.268.955237293 Password file: Domain: sub09180919091.exiracvcn.oraclevcn.com Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: DATA,REDO,RECO Mount point paths: Services: Type: SINGLE OSDBA group: dba OSOPER group: dbaoper Database instance: exiracdb Configured nodes: exiracbm1 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed [oracle@exiracbm1 ~]$ |
So basically, that explains. I told Oracle that I was a bit surprised that it created only a single instance for me.
Anyhow, the cluster is a flex cluster:
1 2 3 |
[grid@exiracbm1 ~]$ crsctl get cluster type CRS-6539: The cluster type is 'flex'. [grid@exiracbm1 ~]$ |
And serverpools are configured:
1 2 3 4 5 6 |
[grid@exiracbm1 ~]$ srvctl status serverpool Server pool name: Free Active servers count: 0 Server pool name: Generic Active servers count: 2 [grid@exiracbm1 ~]$ |
but they’re both nicely in the Generic pool and nobody moved to “Free”. So this was a wrong track. Nice to know this *spoiler alert* appliance runs a flex cluster though.
In the meantime (yes they answer pretty quick! Thanks for that, it’s really helpful) Oracle answered with apologies that they have seen this behaviour and it will be fixed soon. In the meantime we can work around it using this link. Hang on … dbcli? odacli? really? Is this running on an ODA?
1 2 3 4 5 |
[root@exiracbm1 ~]# odaadmcli show env_hw BM IAAS ODA X5-2 [root@exiracbm1 ~]# odaadmcli show storage Unable to connect to oakd. [root@exiracbm1 ~]# |
Definitely yes! But oakd is not running. This explains also one of the questions I had. I was wondering on how to extend the diskgroups if they become full:
1 2 3 4 5 6 |
[grid@exiracbm2 ~]$ 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 NORMAL N 512 512 4096 4194304 18319360 18301820 915968 8692926 0 Y DATA/ MOUNTED NORMAL N 512 512 4096 4194304 4572160 4570788 228608 2171090 0 N RECO/ MOUNTED NORMAL N 512 512 4096 4194304 762880 756148 190720 282714 0 N REDO/ [grid@exiracbm2 ~]$ |
This looks also very ODA. So I think we can conclude the RAC on Oracle Cloud Infrastructure runs on a Database Appliance. This is not wrong, just a nice to know on how it behaves.
Anyhow! The workaround is basically creating a new database. I think it must be possible to reconfigure the one created to RAC as well, but I might want to play with that first.
If you’re used to the odacli, the move to dbcli will be small and will feel very familiar.
1 |
dbcli create-database -dh <db_home_id> -cl {OLTP|DSS|IMDB} -n <db_name> -u <unique_name> -bi <bkup_config_id> -m -s <db_shape> -r {ACFS|ASM} -y {SI|RAC|RACOne} -io -d <pdb_admin_user> -p <pdb> -g n -ns <nlcharset> -cs <charset> -l <language> -dt<territory> -v <version> [-co|-no-co] [-h] [-j] |
Sounds familiar, isn’t it? To get the id’s from the running home and database you can use following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@exiracbm1 ~]# dbcli list-databases ID DB Name DB Type DB Version CDB Class Shape Storage Status ---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ---------- 0b66c904-ac25-4750-afda-a81ad17eb5a3 exiracdb Si 12.2.0.1 true OLTP odb2 ASM Configured [root@exiracbm1 ~]# dbcli list-dbhomes ID Name DB Version Home Location Status ---------------------------------------- -------------------- ---------------------------------------- --------------------------------------------- ---------- 6e65b84e-0564-47f7-894e-813ded84573f OraDB12201_home1 12.2.0.1.0 /u01/app/oracle/product/12.2.0.1/dbhome_1 Configured [root@exiracbm1 ~]# |
So I want a Odb4 then I do:
1 2 3 4 |
[root@exiracbm1 ~]# dbcli create-database -dh 6e65b84e-0564-47f7-894e-813ded84573f -cl OLTP -c -n clidb -u clidb -m -s Odb4 -r ASM -y RAC -d pdbadm -p amionoda -no-co Password for SYS,SYSTEM and PDB Admin: Applicable dbshapes for cpucores: 2 are: [Odb4,Odb6,Odb8,Odb10,Odb12,Odb16,Odb20,Odb24,Odb32,Odb36,OC5,OC6,OC7,OC3M,OC4M,OC5M] [root@exiracbm1 ~]# |
Until now I do not quite understand why -s Odb4 isn’t accepted, but I created a pretty default one then:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@exiracbm1 ~]# dbcli create-database -dh 6e65b84e-0564-47f7-894e-813ded84573f -cl OLTP -c -n clidb -u clidb -m -r ASM -y RAC -d pdbadm -p amionoda -no-co Password for SYS,SYSTEM and PDB Admin: Job details ---------------------------------------------------------------- ID: 7e30903f-a0be-4b40-ae26-15fdaa143807 Description: Database service creation with db name: clidb Status: Created Created: September 21, 2017 4:41:41 PM UTC Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- ----------------------------------- ---------- [root@exiracbm1 ~]# |
And this is definitely an ODA including derby repository and all 🙂 After a while it lists the database and you see that the db is ready to use:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@exiracbm1 ~]# dbcli list-databases ID DB Name DB Type DB Version CDB Class Shape Storage Status ---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ---------- 0b66c904-ac25-4750-afda-a81ad17eb5a3 exiracdb Si 12.2.0.1 true OLTP odb2 ASM Configured 34848d5a-bba1-4f06-a85a-bb77693e30e8 clidb Rac 12.2.0.1.0 true OLTP odb1 ASM Configured [root@exiracbm1 ~]# ps -ef |grep -i pmon grid 31092 1 0 Sep20 ? 00:00:02 asm_pmon_+ASM1 oracle 48858 1 0 Sep20 ? 00:00:01 ora_pmon_exiracdb grid 60262 1 0 Sep20 ? 00:00:02 apx_pmon_+APX1 oracle 68461 1 0 16:51 ? 00:00:00 ora_pmon_clidb1 root 76808 47041 0 16:52 pts/0 00:00:00 grep -i pmon [root@exiracbm1 ~]# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[oracle@exiracbm1 ~]$ export ORACLE_SID=clidb1 [oracle@exiracbm1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Thu Sep 21 16:53:16 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c EE Extreme Perf Release 12.2.0.1.0 - 64bit Production SQL> select * from gv$instance; INST_ID INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT LOGINS ---------- --------------- ---------------- ---------------------------------------------------------------- ----------------- --------- ------------ --- ---------- ------- --------------- ---------- SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO CON_ID INSTANCE_MO EDITION FAMILY DATABASE_TYPE --- ----------------- ------------------ --------- --- ---------- ----------- ------- -------------------------------------------------------------------------------- --------------- 2 2 clidb2 exiracbm2 12.2.0.1.0 21-SEP-17 OPEN YES 2 STARTED ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO 0 REGULAR XP RAC 1 1 clidb1 exiracbm1 12.2.0.1.0 21-SEP-17 OPEN YES 1 STARTED ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO 0 REGULAR XP RAC SQL> |
So now we have RAC-db. One thing I find a little pity is, that this db is not displayed in the portal. Maybe it needs time to refresh, but ok time will tell.
UPDATE: (24-Sep-2017)
When I checked the portal, the database showed up as well. So it does reflect the changes. That’s great!
UPDATE2: (6-Oct-2017):
I was deploying a new db to do the failover/performance tests and I noticed that the DB is immediately a rac-db. I leave this post in place to show if it happens, what you can do, but for now the workaround is not necessary anymore.
So that’s it for now.
As always, questions, remarks? find me on twitter @vanpupi