X

Oracle Linux, virtualization , Enterprise and Cloud Management Cloud technology musings

  • February 24, 2015

Oracle Linux and Database Smart Flash Cache

One, sometimes overlooked, cool feature of the Oracle Database running on Oracle Linux is called Database Smart Flash Cache.

You can find an overview of the feature in the Oracle Database Administrator's Guide. Basically, if you have flash devices attached to your server, you can use this flash memory to increase the size of the buffer cache. So instead of aging blocks out of the buffer cache and having to go back to reading them from disk, they move to the much, much faster flash storage as a secondary fast buffer cache (for reads, not writes).

Some scenarios where this is very useful : you have huge tables and huge amounts of data, a very, very large database with tons of query activity (let's say many TB) and your server is limited to a relatively small amount of main RAM - (let's say 128 or 256G). In this case, if you were to purchase and add a flash storage device of 256G or 512G (example), you can attach this device to the database with the Database Smart Flash Cache feature and increase the buffercache of your database from like 100G or 200G to 300-700G on that same server. In a good number of cases this will give you a significant performance improvement without having to purchase a new server that handles more memory or purchase flash storage that can handle your many TB of storage to live in flash instead of rotational storage.

It is also incredibly easy to configure.

-1 install Oracle Linux (I installed Oracle Linux 6 with UEK3)


-2 install Oracle Database 12c (this would also work with 11g - I installed 12.1.0.2.0 EE)


-3 add a flash device to your system (for the example I just added a 1GB device showing up as /dev/sdb)


-4 attach the storage to the database in sqlplus


Done.

$ ls /dev/sdb
/dev/sdb
$ sqlplus '/ as sysdba'
SQL*Plus: Release 12.1.0.2.0 Production on Tue Feb 24 05:46:08 2015
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, OLAP, Advanced Analytics and Real Application Testing options
SQL> alter system set db_flash_cache_file='/dev/sdb' scope=spfile;
System altered.
SQL> alter system set db_flash_cache_size=1G scope=spfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 4932501504 bytes
Fixed Size

2934456 bytes
Variable Size

1023412552 bytes
Database Buffers

3892314112 bytes
Redo Buffers

13840384 bytes
Database mounted.
Database opened.
SQL> show parameters flash
NAME

TYPE

VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_file

string

/dev/sdb
db_flash_cache_size

big integer 1G
db_flashback_retention_target

integer

1440
SQL> select * from v$flashfilestat;
FLASHFILE#
----------
NAME
--------------------------------------------------------------------------------
BYTES ENABLED SINGLEBLKRDS SINGLEBLKRDTIM_MICRO CON_ID
---------- ---------- ------------ -------------------- ----------

1
/dev/sdb
1073741824

1

0

0

0

You can get more information on configuration and guidelines/tuning here.
If you want selective control of which tables can use or will use the Database Smart Flash Cache, you can use the ALTER TABLE command. See here. Specifically the STORAGE clause. By default, the tables are aged out into the flash cache but if you don't want certain tables to be cached you can use the NONE option.

alter table foo storage (flash_cache none);

This feature can really make a big difference in a number of database environments and I highly recommend taking a look at how Oracle Linux and Oracle Database 12c can help you enhance your setup. It's included with the database running on Oracle Linux.

Here is a link to a white paper that gives a bit of a performance overview.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services