In the last section, you have installed an oracle database version 220.127.116.11.7 on the linux machine. Now it’s time to setup hcc.
4.2. Setup Hybrid Columnar Compression
4.2.1 Start the SNMP daemon on the ZFS Appliance
Oracle uses snmp to check, if the nfs share actually resides on an ZFS Appliance. So before we can use hcc, we also have to enable snmp on the appliance.
Open the web interface of the ZFS Appliance and go to configuration –> Services
If you scroll almost to the bottom of the page, you will see the snmp-deamon, which is currently disabled.
Click on the power – icon at the outer right and the service should change its state to online.
4.2.2) Create and mount a new NFS share
First, we will have to create an nfs share on the ZFS Appliance. Fortunately, after lab2, we already know, how to do this.
Open your webbrowser and go to “https://192.168.56.100:215”. Go to shares and click on the “+” – Button next to filesystems
The project can be left to default. Name the share hcc (hybrid columnar compression) and change the user to 500. That’s the user id of the oracle user from your database machine. so we make sure, that the user will be allowed to access the share later on.
The share will be available under the mountpoint /share/hcc
Now, move to your database machine and login as user root with the password oracle.
Open a shell window and create a new folder inside the home directory of the oracle user:
[root@localhost ~]# mkdir /home/oracle/hcc [root@localhost ~]# chown oracle:oinstall /home/oracle/hcc
Next, create a persistend mountpoint for the nfs-share by editing the /etc/fstab and mount the share.
[root@localhost ~]# echo "192.168.56.100:/export/hcc /home/oracle/hcc nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=3" >> /etc/fstab [root@localhost ~]# mount /home/oracle/hcc/
4.2.3 Configure the database to use dNFS
To use hcc correctly, the Tablespace needs to be created on a filesystem, thats mounted via dNFS. So let's setup dNFS.
For the following steps, you need to become the user oracle:
[root@localhost ~]# su - oracle
To enable dNFS, you have to create the following config file:
[oracle@localhost ~]$ vi $ORACLE_HOME/dbs/oranfstab
Enter the following four lines and save the file:
export: /export/hcc mount: /home/oracle/hcc
Now, change the oracle ODM library to the ODM NFS library. The library is a filesystem link. So to change it, you just have to alter the link:
[oracle@localhost ~]$ cd $ORACLE_HOME/lib [oracle@localhost lib]$ ls -la libodm11.so lrwxrwxrwx 1 oracle oracle 12 Oct 2 2010 libodm11.so -> libodmd11.so [oracle@localhost lib]$ ln -sf libnfsodm11.so libodm11.so [oracle@localhost lib]$ ls -la libodm11.so lrwxrwxrwx 1 oracle oracle 14 Aug 22 05:40 libodm11.so -> libnfsodm11.so
Now, restart the database:
[oracle@localhost lib]$ sqlplus / as sysdba SQL> shutdown immediate SQL> startup
You can verify, that it worked by taking a quick look into the databases alertlog. You should see the following line:
[oracle@localhost ~]$ grep ODM /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0
4.2.4) Fix SNMP output from virtual ZFS Appliance
If you were using a real ZFS Storage, you now should be ready to use hcc in your database.
In this lab however, we are using a virtual Appliance. And for this one, we have to make another quick change.
The problem is the way oracle database determines, which NFS storage it is facing. Oracle uses snmp for that and accepts only some distinct values in return. On a real ZFS appliance, this particular value would read "Sun ZFS Storage 7420" - our virtual appliance however answers "Sun ZFS Storage VirtualBox". And so oracle does not recognize the storage correctly.
I don't know the reason for that behaviour of the virtual machine. But for this lab, we have to take another step and change the value to the correct one.
login to your ZFS Appliance using ssh:
[oracle@ps102 ~]$ ssh email@example.com
This will give you access to the CLI of the storage. This basically has the same capability, as the web interface, just not so colourful. Start the actual shell:
There will be a long warning message, that you should take very seriously. Never(!) do this on a real ZFS storage unless advised so by the oracle support. Don't even think about it. Not only will you risk doing irrepairable damage, you will also lose any kind of support immediately.
Please note, that this lab is intended for educational use only and is not intended for actual live systems. So, for this lab (and only there), we will ignore this warning anyway.
Now you have root access to the underlying solaris OS of the storage.
The filesystem is mounted read only, so the first step is to remount it with write permissions.
zfsapp1# mount -o remount,rw /
Edit the configuration file, the storage uses to generate the snmp-messages.
zfsapp1# vi /usr/lib/ak/metadata/appliance/SUNW,ankimo/product/product.xml
You will see a lign reading:
name='akmd_prod_product'><string value='Sun ZFS Storage VirtualBox'
Change it to:
name='akmd_prod_product'><string value='Sun ZFS Storage 7420'
Now, you have to restart the ZFS Appliance. You can do that from the web interface, where you will see two icons on the top left.
On the next page, you will finally work with hybrid columnar compression.