Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, September 1, 2016

Oracle 11g portable client


Sometimes it is handy to have an Oracle client on your USB stick immediately ready to use without prior installation. Oracle has a solution - the instant client. But what if you need more than just SQLPlus, for example exp/imp or tnsping... I've found simple aswer for this - Oracle XE.

Oracle home of Windows 64bit XE installation is just little bit more than 400Mb and when you remove bin\oracle.exe (140Mb) and rdbms\admin folder (54Mb), you'll have 11G Oracle client with sqlplus, tnsping, exp/imp, datapump and other tools all together around 200Mb. Not bad, i think. Put it on your usb stick, for example in F:\XP_CLIENT folder.

Plug in it to the computer with no Oracle software, open cmd:
[pre class="brush:text" title="cmd.exe"]
set ORACLE_HOME=F:\XP_CLIENT
set PATH=%ORACLE_HOME%\bin;%PATH%[/pre]and enjoy your exp/imp/sqlplus/tnsping/whatever

Links:

Update: imp/exp and impdp/expdp are included in the Oracle Instant Client 12.2 tools package.

Friday, May 13, 2016

How to keep images inside Oracle SQL Developer explain plan HTML export file


If you need to share SQL statement explain plan output created by Oracle SQL Developer, you can export it to html file. You need to press F10 to create Explain Plan tab, then RMB click on it and choose "Export HTML".


Oracle SQL Developer creates html file and saves all icons into "images" subfolder nearby. Therefore if you decide to copy or share this html file you will need to keep those images with it, or they will be replaced with ugly "broken image" icons:


To target this huge problem I've created small windows cmd script. It appends necessary images as CSS resources to html file and change internal <IMG> references accordingly. It also changes font style to "small sans-serif" since i think that it looks better :). For this script to run you'll need a SED utility from unxutils. Script expects html file with explain plan as a 1st parameter. Optional 2nd parameter "noimg" removes all image references from html. Result (all images are inside HTML, images subfolder is not required to share your HTML):


Use it at your own risk! Have fun. :)

References: