NFSv4 on Oracle Exadata

I suppose that this document will match more NFS clients, not only Oracle Exadata.
I’m using the Exadata name case in all the document’s I found on support, the information is WRONG:

      Oracle ZFS Storage: FAQ: Exadata RMAN Backup with The Oracle ZFS Storage Appliance(Doc ID 1354980.1)
      Sun ZFS Storage Appliance: Oracle Database 11g R2 NFS Mount Point Recommendations (Doc ID 1567137.1)
      Step by Step – Configure Direct NFS Client (DNFS) on Linux (11g) (Doc ID 762374.1)

All this documents has the following ops when mounting a NFS share:

<myIP>:/export/myshare /myshare nfs rw,bg,hard,nointr,rsize=1048576,wsize=1048576,tcp,vers=3,actimeo=0,timeo=600 0 0

I found that trying to mount with this options on the Exadata (RH6.6) will show you the wonderful message:

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

As you can see in Doc ID 1354980.1, their instructions for mounting NFSv3 or NFSv3 are:

dcli -l root -g /home/oracle/dbs_group chmod 644 /etc/hosts.allow
dcli -l root -g /home/oracle/dbs_group chmod 644 /etc/hosts.deny
dcli -l root -g /home/oracle/dbs_group chkconfig rpcbind on
dcli -l root -g /home/oracle/dbs_group service rpcbind start
dcli -l root -g /home/oracle/dbs_group chkconfig nfslock on
dcli -l root -g /home/oracle/dbs_group service nfslock start
dcli -l root -g /home/oracle/dbs_group chkconfig nfs on
dcli -l root -g /home/oracle/dbs_group service nfs start

Which will show an error like:

~ # service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas: Cannot register service: RPC: Authentication error; why = Client credential too weak
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
                                                           [FAILED]
Starting NFS mountd:                                       [  OK  ]
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 13 (Permission denied)
rpc.nfsd: unable to set any sockets for nfsd
                                                           [FAILED]

So why don’t use NFSv4 which has portmapping IN the protocol?

<myIP>:/export/myshare /myshare nfs rw,bg,hard,nointr,rsize=1048576,wsize=1048576,tcp,vers=4,actimeo=0,timeo=600 0 0

That’s all, Enjoy!!!

Oracle: object user grants

Oracle is Oracle… It has good and bad things.
The bad of course… it’s closed and you’ll be crazy before getting info about how to do things.
And the good is that everythings is inside!! just at 1 query distance ;-)

Some days ago I was trying to look for grants given to a user by another user (WITH ADMIN OPTION).
I was logged with sys and I used “my” 2 wonderful querys for obtaining that info (copy/pasted from the internet),

  • Direct grants:
  • SELECT owner, table_name, select_priv, insert_priv, delete_priv, update_priv, references_priv, alter_priv, index_priv 
      FROM table_privileges
     WHERE grantee = '&theUser'
     ORDER BY owner, table_name;
    
  • INdirect grants:
  • SELECT DISTINCT owner, table_name, PRIVILEGE 
      FROM dba_role_privs rp JOIN role_tab_privs rtp ON (rp.granted_role = rtp.role)
     WHERE rp.grantee = '&theUser'
     ORDER BY owner, table_name;
    

Ressult? 0 rows! WTF!
I know there’s a plenty of it!!!

Continue reading “Oracle: object user grants”

Script to check Oracle remotely (nagios or whatever)

For all of you that are not the lucky owner of an Enterprise Manager license or you simply want to use nagios or another monitoring engine to get status and graphs of oracle, probably you’ll be using the “check_remote_oracle” plugin.

If you’re a scripter/developer maybe you’ll understand me when you open an script and see an COMPLETELY UNREADABLE code, with no functions, no indentation… etc
And then you’ll have to change anything stupid inside the script and then f**k it does not work!

This is the story of that script, I installed it, then I have to do some changes… and then I decided to rewrite it completely…
I’m not the best scripter of the world, but I know how to use functions, indentation and that useless shit :-P

You can read the whole documentation on its wiki page.

Enjoy!

PS: updated the instructions, I forgot the information about the unprivileged user for connecting to Oracle instance.
PS2: Updated again, new control!

Oracle Metadata Generator (and svn uploader)

UPDATED!!
(See comments)

My first (public) script for Oracle :-) [beers]
This script will (hopefully) do:

  • List all the objects on the database for each SID/SCHEMA given
  • Dump the metadata of each object in a different file
  • Upload everything to the svn

If you’re asking why? you must deal more with programmers :-P
This will add a second line of defense to the expdp CONTENT=METADATA_ONLY classic script.
Continue reading “Oracle Metadata Generator (and svn uploader)”