转载:Static Version of rlwrap for sqlplus

Quick Summary

If you don’t have root access to a machine, it can be challenging to compile rlwrap (a nice companion to sqlplus). You can compile it on another machine / VM, then use a utility calledstatifier to produce one binary that includes all of the required dependencies. If you want to just cut to the chase, you can download the version I compiled for OEL 5.6 x64 here.

How to Compile

If you don’t trust what I’ve compiled (and you probably shouldn’t if you care about security), here are the steps to compile your own version.

On a machine or VM that you control running a comparable Linux distribution:

  1. Download and compile rlwrap.
  2. Download and compile statifier.
  3. Compile your static version of rlwrap:
    # statifier /usr/local/bin/rlwrap /tmp/rlwrap_static_x64
Copy the file to your locked-down server (where you don’t have root), then:
  1. Put it in some logical directory such as ~/local/bin
  2. chmod +x ~/local/bin/*
  3. I create a symlink for it (but you could just rename it if you want):
    ln -s ~/local/bin/rlwrap_static_x64 ~/local/bin/rlwrap
  4. Edit ~/.bashrc and add it to your path:
    export PATH=$PATH:~/local/bin
    alias sqlplus='rlwrap sqlplus'
  5. source ~/.bashrc

posted on 2012-09-25 20:41  wait4friend  阅读(221)  评论(0编辑  收藏  举报