Infrastructure at your Service

Marc Wagner

Nutanix Era with oracle databases : Part 6 – Refresh an oracle clone database

By September 29, 2021 Oracle No Comments

Now that we have cloned our ORATEST source database into a clone database named ORATCL1 (see Nutanix Era Blog part 5), we will see how we can refresh it and see the impacts on the oracle database itself.

For more information on Nutanix products, I would encourage you to visit Nutanix website.

Create a test table on the ORATEST source database

In blog part 5, we have been creating the clone with point in time 10:04:07 from September the 29th.

I just created a new table in ORATEST database. This is the source database of our clone database, ORATCL1.

SQL> select host_name, instance_name from v$instance;

HOST_NAME                                                        INSTANCE_NAME
---------------------------------------------------------------- ----------------
test1-VM                                                         ORATEST

SQL> create table REFRESHCLONE as select * from dba_users;

Table created.


Let’s take a new log catch up

I took a new Log Catch Up :




Refresh the ORATCL1 clone

From the “Databases” Menu, in the “Clones” list, we will select the name of the clone we would like to refresh. Here ORATCL1. Then we will click the “Refresh” button :




We will use the last point in Time which correspond to our last Log Catch Up :












Note the warning Nutanix Era is providing : “All active user sessions to the database will be disconnected before the operation.”

These are the steps that have been be performed :




We can see this on the system.

The clone database has been shutdown, as we can see in the alert log :

[email protected]:/home/oracle/ [ORATCL1] taa
  Current log# 2 seq# 2 mem# 1: /u02/app/oracle/oradata/fra_ORATEST_ORATCL1/ORATCL1/onlinelog/o1_mf_2_jo8czv9n_.log
2021-09-29T10:31:39.459563+00:00
NET  (PID:55416): Archived Log entry 1 added for T-1.S-1 ID 0xcbd23736 LAD:1
2021-09-29T12:07:03.119723+00:00
create tablespace TSTCLONE datafile size 10M autoextend on next 100M maxsize 1G
Completed: create tablespace TSTCLONE datafile size 10M autoextend on next 100M maxsize 1G
2021-09-29T14:15:55.260063+00:00
TABLE SYS.WRP$_REPORTS: ADDED INTERVAL PARTITION SYS_P526 (4290) VALUES LESS THAN (TO_DATE(' 2021-09-30 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED INTERVAL PARTITION SYS_P527 (4290) VALUES LESS THAN (TO_DATE(' 2021-09-30 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED INTERVAL PARTITION SYS_P530 (4289) VALUES LESS THAN (TO_DATE(' 2021-09-29 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
2021-09-29T14:16:31.607250+00:00
Shutting down ORACLE instance (abort) (OS id: 108686)
2021-09-29T14:16:31.607362+00:00
Shutdown is initiated by [email protected] (TNS V1-V3).
License high water mark = 3
USER (ospid: 108686): terminating the instance
2021-09-29T14:16:32.629626+00:00
Instance terminated by USER, pid = 108686
2021-09-29T14:16:32.631772+00:00
Instance shutdown complete (OS id: 108686)


We can see that the database file systems (/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1 and /u02/app/oracle/oradata/fra_ORATEST_ORATCL1) have been unmounted :

[email protected]:/home/oracle/ [ORATCL1] df -h
Filesystem                                                                                                                      Size  Used Avail Use% Mounted on
devtmpfs                                                                                                                        7.7G     0  7.7G   0% /dev
tmpfs                                                                                                                            12G  168K   12G   1% /dev/shm
tmpfs                                                                                                                           7.7G   25M  7.7G   1% /run
tmpfs                                                                                                                           7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/mapper/vgroot--lv-root                                                                                                     6.0G  118M  5.9G   2% /
/dev/mapper/vgroot--lv-usr                                                                                                      3.0G  1.6G  1.5G  53% /usr
/dev/mapper/vgroot--lv-var                                                                                                      3.0G  456M  2.6G  15% /var
/dev/mapper/vgroot--lv-home                                                                                                     4.0G   74M  4.0G   2% /home
/dev/mapper/vgroot--lv-opt                                                                                                      4.0G   69M  4.0G   2% /opt
/dev/mapper/vgroot--lv-tmp                                                                                                      3.0G  981M  2.1G  33% /tmp
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_software_ff05dbb5a2084503b80ccc72156b5383  2.9G  668M  2.1G  25% /opt/era_base/era_engine
/dev/sda1                                                                                                                       496M  224M  273M  46% /boot
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_logs_ff05dbb5a2084503b80ccc72156b5383      7.7G   62M  7.2G   1% /opt/era_base/logs
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_config_ff05dbb5a2084503b80ccc72156b5383     93M  1.6M   85M   2% /opt/era_base/cfg
/dev/sda2                                                                                                                      1022M   12K 1022M   1% /boot/efi
tmpfs                                                                                                                           1.6G     0  1.6G   0% /run/user/54321
/dev/sdb                                                                                                                         50G  9.8G   38G  21% /u02


And the exact next steps done during a database clone are performed (see Nutanix Era blog part 5) :

[email protected]:/home/oracle/ [ORATCL1] df -h
Filesystem                                                                                                                      Size  Used Avail Use% Mounted on
devtmpfs                                                                                                                        7.7G     0  7.7G   0% /dev
tmpfs                                                                                                                            12G  176K   12G   1% /dev/shm
tmpfs                                                                                                                           7.7G   25M  7.7G   1% /run
tmpfs                                                                                                                           7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/mapper/vgroot--lv-root                                                                                                     6.0G  118M  5.9G   2% /
/dev/mapper/vgroot--lv-usr                                                                                                      3.0G  1.6G  1.5G  53% /usr
/dev/mapper/vgroot--lv-var                                                                                                      3.0G  457M  2.6G  15% /var
/dev/mapper/vgroot--lv-home                                                                                                     4.0G   75M  4.0G   2% /home
/dev/mapper/vgroot--lv-opt                                                                                                      4.0G   69M  4.0G   2% /opt
/dev/mapper/vgroot--lv-tmp                                                                                                      3.0G  981M  2.1G  33% /tmp
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_software_ff05dbb5a2084503b80ccc72156b5383  2.9G  668M  2.1G  25% /opt/era_base/era_engine
/dev/sda1                                                                                                                       496M  224M  273M  46% /boot
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_logs_ff05dbb5a2084503b80ccc72156b5383      7.7G   64M  7.2G   1% /opt/era_base/logs
/dev/mapper/ntnx_era_agent_vg_ff05dbb5a2084503b80ccc72156b5383-ntnx_era_agent_lv_era_config_ff05dbb5a2084503b80ccc72156b5383     93M  1.6M   85M   2% /opt/era_base/cfg
/dev/sda2                                                                                                                      1022M   12K 1022M   1% /boot/efi
tmpfs                                                                                                                           1.6G     0  1.6G   0% /run/user/54321
/dev/sdb                                                                                                                         50G  9.8G   38G  21% /u02
/dev/mapper/ntnx_era_dg_log_vg_47aab96bac4343b2a4a73453130a22fd-ntnx_era_agent_lv_47aab96bac4343b2a4a73453130a22fd              197G  9.0G  178G   5% /tmp/era_recovery_staging_area_ORATCL1
/dev/mapper/oradata_ORATEST_vg_ORATCL1-oradata_ORATEST_lv                                                                        20G  3.4G   16G  18% /u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1
/dev/mapper/oradata_fra_ORATEST_vg_ORATCL1-oradata_fra_ORATEST_lv                                                               9.8G  3.5G  5.8G  38% /u02/app/oracle/oradata/fra_ORATEST_ORATCL1


We can see the temporary File System, /tmp/era_recovery_staging_area_ORATCL1, containing the Log Catch Up has been temporary mounted again.
Both clone database’s File System have been mounted back after the snapshot has been restored.

We can already see that the clone has been refreshed with source database version dated from 16:04:39. We can even use the word rebuild. 🙂 Why? Because we can see that the file from the tablespace TSTSOURCE we created in Nutanix Era blog part 5, on the source database ORATEST after the clone creation is now present in the ORACTL1 clone database :

[email protected]:/home/oracle/ [ORATCL1] du -ha /u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/
1001M	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/o1_mf_system_jk7qywmo_.dbf
11M	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/o1_mf_tstsourc_jo8ok0yn_.dbf
5.1M	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/o1_mf_users_jk7r05t2_.dbf
513M	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/o1_mf_undotbsp_jk7rk221_.dbf
1.2G	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/o1_mf_sysaux_jk7qzopd_.dbf
2.7G	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATEST/datafile/

[email protected]:/home/oracle/ [ORATCL1] du -ha /u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATCL1/datafile/
1.0M	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATCL1/datafile/o1_mf_temptbs__jo8xm38x_.tmp
1.1G	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATCL1/datafile/o1_mf_undotbs__jo8xnb70_.dbf
1.1G	/u02/app/oracle/oradata/datafiles_ORATEST_ORATCL1/ORATCL1/datafile/
[email protected]:/home/oracle/ [ORATCL1]


This is confirmed querying the dictionary on the ORATCL1 clone database we have just refreshed. We can now see this TSTSOURCE tablespace. And we will highlight that we lost the TSTCLONE tablespace we created on the previous clone version (See Nutanix Era blog part 5).

SQL> select host_name, instance_name from v$instance;

HOST_NAME							 INSTANCE_NAME
---------------------------------------------------------------- ----------------
ORADEMO1-VM-clo 						 ORATCL1

SQL> select tablespace_name from dba_tablespaces where tablespace_name like '%TST%';

TABLESPACE_NAME
------------------------------
TSTSOURCE

SQL>


Do we have our REFRESHCLONE table we created previously at the beginning of the blog?

SQL> select host_name, instance_name from v$instance;

HOST_NAME							 INSTANCE_NAME
---------------------------------------------------------------- ----------------
ORADEMO1-VM-clo 						 ORATCL1

SQL> select table_name from dba_tables where upper(table_name) like 'REFRESH%';

TABLE_NAME
---------------
REFRESHCLONE

SQL>


Yes we have!

Conclusion

Refreshing a clone with Nutanix Era is also something very easy to achieve. The clone is in fact created from fresh in a couple of minutes.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Marc Wagner
Marc Wagner

Consultant