DevOps Series: Setup Oracle ACFS(ASM Cluster File System) on Oracle 19c RAC Database with Ansible
Authors: Nassyam Basha (Oracle ACE Director, OCM), Monowar Mukul (OCM)
GITHUB Link: https://github.com/asiandevs/racdb_createacfs
Introduction
In this article, we will go through for setting up Oracle ACFS (Automatic Storage Management cluster file system) with Ansible playbook in Oracle Database 19.3 cluster environment.
ACFS (ASM cluster file system) is a storage management technology on top of ASM (Automatic Storage Management) to manage general-purpose files. Starting from 12C release 1 this known as Oracle Cloud File System. In summary, this relates to creating a file called a volume under ASM storage which can be visible to the operating system and then make it acfs file system into that mount point which visible to the OS (Operating System). Then it allows access to the ASM storage.
Oracle ACFS snapshot is a point in time copy of file system, which can be read-only, read-write, space-efficient, and it is available immediately to users for testing. From 12c Cloud FS supports to create a database (database version 11.2.0.4 and up), Snaps-of-Snaps a new snapshot from an existing snapshot which will allow us to duplicate or create another database very quickly. Cloud file system also allows other features like security, replication, encryption, tagging, compression, auditing, etc. Oracle ACFS Snapshots may serve as point-in-time backups of the database that to use for online recovery while having its files stored on Oracle Cloud file system.
Setup for this article:
In this article, we are using one control server for Ansible to execute playbook to setup ACFS and two managed servers with 2-node Oracle RAC cluster.
Control Server: oel75
Managed Servers: two hosts ora-x1 (Primary node) and ora-x2 (second node) in a RAC setup.
Before setup let’s verify the Clusterware version and also the ACFS driver configuration.
[root@ora-x1 ~]# crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [19.0.0.0.0]
[root@ora-x1 ~]# acfsdriverstate -orahome /u02/app/19.3.0/grid version
ACFS-9325: Driver OS kernel version = 4.1.12–112.16.4.el7uek.x86_64.
ACFS-9326: Driver build number = 190222.
ACFS-9212: Driver build version = 19.0.0.0.0 (19.3.0.0.0).
ACFS-9547: Driver available build number = 190222.
ACFS-9548: Driver available build version = 19.0.0.0.0 (19.3.0.0.0).[root@ora-x1 ~]# olsnodes -n
ora-x1 1
ora-x2 2[root@ora-x1 ~]# sudo su — grid
Last login: Sun Aug 25 15:40:26 AEST 2019
$ . oraenv
ORACLE_SID = [grid] ? +ASM1
The Oracle base has been set to /u02/app/grid
$ srvctl status asm
ASM is running on ora-x2,ora-x1
The same information updated into the host's file as below. Remember this is not the traditional /etc/hosts but this file is under /etc/ansible/hosts. In the hosts, we may mention a group that consists of one or more target server hostnames/ip addresses depends on our requirement.
To install the Oracle ACFS, the very first step is to create master playbook in our case “rac_acfs.yml”, in this file we are going to mention the hosts, user and roles.
In the roles file, we will have sub playbooks for each task. Below is the Ansible tree structure to setup ACFS, in this case, is as below:
Throughout the setup below are the variables will be considered and configured by Ansible from vars/main.yml
Below are the high-level steps we are going to do, in order to setup ACFS on Oracle RAC database.
i. Create a separate diskgroup for ACFS
ii. Create a Cloud file system
a) Create an Oracle ADVM volume in a mounted disk group with the ASMCMD volcreate command.
b) Create a file system with the Oracle ACFS mkfs command
c) Register the file system
d) Mount or start the file system
iii. Create a snap shot and test that
The main playbook code is in tasks/main.yml, and now we are going to execute the playbook using the command “ansible-playbook” as below. When using this command, we have various options in terms of debugging, validation, etc. It is always recommended to use verbose “-v[v][v]” option and “ — check” for debugging or troubleshooting the script to ensure there are no errors in terms of syntax or execution. To list out examples, could be directory structure in the target is unavailable then ansible able to list out the issues in debug mode. Execute playbook from ansible home directory as below.
$ cd /etc/ansible
[root@oel75 ansible]# ansible-playbook rac_acfs.yml
PLAY [ora-x1,ora-x2] *********************************************************************************************************************
TASK [Gathering Facts] *******************************************************************************************************************
ok: [192.168.56.103]
ok: [192.168.56.102]TASK [racdb_createacfs : Setup ACFS | display pre setup message before setting up ACFS Filesystem] ***************************************
ok: [192.168.56.102] => {
“msg”: [
“This playbook is for setting up a ACFS Filesystem to 19c at 2019–08–24T21:01:13Z:”
]
}— — — — — — — —
TASK [racdb_createacfs : Remove stage directory] *****************************************************************************************
changed: [192.168.56.102]
changed: [192.168.56.103]TASK [racdb_createacfs : display ACFS Filesystem setup post install message] *************************************************************
ok: [192.168.56.102] => {
“msg”: [
“ACFS Filesystem setup completed successfully 2019–08–24T21:01:13Z:”,
“- END OF ALL: git repository \”ACFS Filesystem created successfully\” will be shared”
]
}PLAY RECAP *******************************************************************************************************************************
192.168.56.102 : ok=27 changed=17 unreachable=0 failed=0
192.168.56.103 : ok=10 changed=6 unreachable=0 failed=0
You can get the full logs for this article from the below video -
Pre Check
In this step, we are going to verify the installation and loading status of ACFS/ADVM module. If not then we need to install and load that. This also includes the proposed ACFS disk group if not present then to create that disk group.
Validation of ACFS status
We have finished the ansible playbook to setup the ACFS file system. Let us connect to all the target servers or managed servers to verify the installation of ACFS was successful or not.
Conclusion
We have gone through to set up Oracle Cloud File System setup using Ansible. Ansible is making life much easier to make a repetitive task with one execution in compare to running a number of steps every time. We have also verified the ACFS snap, which is, has many features not only to the on-premise setup but also for the Oracle cloud and Exadata. This practice source files are uploaded and available in Github, and now it is time to play with it. By this, we only need to modify the variables as per the environment setup. Please make sure to modify variables accordingly and always test into development environment few times before implementing into QA or PROD systems.
Enjoy Automation :)
Reference :
Oracle ASM Cluster File System https://www.oracle.com/pt/database/technologies/rac/acfs.html
Oracle ACFS 19c ASM Cluster File System What is it and How to use https://www.oracle.com/technetwork/database/database-technologies/cloud-storage/acfs/overview/acfs-wp-18c-4395032.pdf
Other Articles on DevOps Series: To Automate Oracle DBA activities
Authors Bio
Monowar Mukul is currently working as a Principal Oracle Database Specialist. I am an Oracle Certified Master (Oracle 12c Certified Master Administration, Oracle 12c Certified Master MAA, and Oracle 11g Certified Master Administration). He has been working as an Oracle DBA consultant over 17 years with Oracle MAA space for both Exadata and non-Exadata Systems, Oracle Cloud Space and SOA Middleware. He worked across various business sectors including tertiary education, energy, government, mining and transport in Australia. He demonstrated highly developed critical thinking and analytical skills working as a Principal Oracle Database Specialist. You can find more details about him and his work achievements at https://www.linkedin.com/in/monowarmukul/
Nassyam Basha is a Database Administrator. He has around ten years of experience as a Production Oracle DBA, currently working as Database Expert with eProseed KSA. He holds a master’s degree in Computer Applications from the University of Madras. He is an Oracle 11g Certified master an Oracle ACE Director. He actively participates in Oracle-related forums such as OTN with a status of Super Hero, Oracle support awarded as “Guru” and acting as OTN Moderator and written numerous articles with OTN and on Toad World. He maintains an Oracle technology-related blog, www.oracle-ckpt.com and can be reached at https://www.linkedin.com/in/nassyambasha/