Share files between servers when user “oracle” has different UIDs

If you need to read and write files between servers where the UID of the oracle user is different, the easiest, working solution is with Samba. First, I have tried with NFSv4. After wasting a day with that, I found out it actually doesn’t work because of a lower layer, the RPC mapping. It still sends numeric UIDs instead of strings.

Samba can be configured easily to overcome this, so you will be able to read and write files as user “oracle”, even with different UIDs, on both server and client. I tested this on SUSE Enterprise Server 11, but the method is generic, for any Linux distribution. The configuration tokens that must be identical have the same colors in the next paragraphs.


  • install samba, if you don’t already have it. As root:
    zypper install samba
  • edit /etc/samba/smb.conf
            workgroup = WORKGROUP
            passdb backend = tdbsam
            printing = cups
            printcap name = cups
            printcap cache time = 750
            cups options = raw
            map to guest = Bad User
            include = /etc/samba/dhcp.conf
            logon path = \\%L\profiles\.msprofile
            logon home = \\%L\%U\.9xprofile
            logon drive = P:
            usershare allow guests = Yes
            comment = Oracle Share
            path = /opt/oracle/some/directoryname
            valid users = oracle
            hosts allow = clientIP1, clientIP2
            read only = no
  • add oracle user to Samba, note the password
    smbpasswd -a oracle
  • start the service and enable it
    /etc/init.d/smb start
    chkconfig --add smb
  • verify that it works
    smbclient -L //servername -W workgroup -U oracle%password

    Should display something like this:

    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64]
    Sharename Type Comment
    --------- ---- -------
    IPC$ IPC IPC Service (Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64)
    oracle_share Disk Oracle share
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64]
    Server Comment
    --------- -------
    Workgroup Master
    --------- -------


The nicest way is to configure it with automount.

  • make a directory
    mkdir -p /mnt/automount/servername
  • edit /etc/auto.master
    /mnt/automount/servername /etc/auto.servername
  • edit /etc/auto.servername
    oracle_share -fstype=cifs,username=oracle,password=password,uid=oracle,gid=oinstall ://servername/oracle_share
  • start the service and enable it
    /etc/init.d/autofs start
    chkconfig --add autofs
  • verify that it works. As user oracle:
    ls /mnt/automount/servername/oracle_share
    touch /mnt/automount/servername/oracle_share/testfile
  • make a symlink where you actually need the directory
    cd /opt/oracle/need/it/here
    ln -s /mnt/automount/servername/oracle_share/somename

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s