30 May 2020

Oracle Database on Solaris ZFS done right

ZFS is the default filesystem on Oracle Solaris. It is
very easy to use with the two commands zpool and zfs.

Disk management
Expand existing LUNs or add additional LUNs if you
need more space. Since Solaris 11.4 you can remove LUNs if you
want to shrink your pool.

Features
No need for filesystem checks, because of the copy-on-write
implementation. You can create snapshots and clones,
use encryption and compression. Transfer data to other
systems using send/receive or sharing.
Move the pools using export/import to other systems.

ZFS builds the base for the Solaris BootEnvironment (beadm)
where you are able to update to and boot from different Solaris 11
Updates.

ZFS is my preferred filesystem and volume manager, but
is everything perfect? No. You need to carefully configure
ZFS to avoid and work around fragmentation.


Oracle Database

You can run Oracle Database very well on ZFS and profit
from snapshots, cloning and other features. Especially
for larger databases (many TB) with lots of data changes
you should setup carefully.

Following a few Best Practices based on own experiences
and Recommendations by Oracle:

- data pool with log device / 8KB recordsize for data / logbias=latency
- redo pool with log device / 1MB recordsize / logbias=latency
- archive pool / 1MB recordsize

Add multiple LUNs for striping. Use SSDs for highest performance.
If you are using SAN increase zfs:zfs_vdev_max_pending and ssd:ssd_max_throttle to 20.
Limit the ZFS Cache (zfs:zfs_arc_max)
Make sure there is around 20% free space on the zpools.
Use a Server with 'enough' Memory.

After many years of using ZFS it always hurts, if I have
to use other more complicated filesystem ....


Links

Pool Creation Practices for an Oracle Database (Solaris 11.4 ZFS Guide)

Configuring Oracle ZFS for an Oracle Database Whitepaper (2014)

Oracle DB erfolgreich betreiben auf SPARC/LDoms/Solaris/ZFS     (German Presentation)


4 comments:

  1. Hi Marcel, nice post. Do you have any recommendation about the ZFS cache reserve? Any ratio between ZFS cache and database SGA?

    ReplyDelete
  2. Thanks Lambert,
    Always set zfs:zfs_arc_max. Don't use user_reserve_hint_pct.
    Make sure there is the same amount of free Memory as the zfs_arc_max to avoid Memory Pressure.
    No Ratio between ZFS and SGA. It always depends on the Total and Free Memory.

    ReplyDelete
  3. Hi Marcel. Oracle Doc ID 1663862.1 says zfs_arc_max use is less preferable to the dynamic user_reserve_hint_pct parameter. Can you explain why you wouldn't use user_reserve_pct_hint?

    My preference would actually be to use both, one to reserve memory for the application and one to limit impact on system performance when resizing ARC down and help ensure that large memory pages stay available for the database.

    ReplyDelete
  4. zfs_arc_max is required in case of memory pressure.

    ReplyDelete