Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 2011_07.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: July 2011 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/2010_09.html" title="September 2010" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/2011_10.html" title="October 2011" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/2010_09.html">&laquo; September 2010</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/2011_10.html">October 2011 &raquo;</a>
38                      </p>
39                      
40                      
41                      <!--
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44          xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <rdf:Description
46     rdf:about="http://defaria.com/blogs/Status/archives/2011_07.html#entry-000747"
47     trackback:ping="http://defaria.com/mt/mt-tb.cgi/111"
48     dc:title="rlwrap and sqlplus"
49     dc:identifier="http://defaria.com/blogs/Status/archives/2011_07.html#entry-000747"
50     dc:subject="Tellabs"
51     dc:description="As you know I&apos;m a fan of the CLI in many (but not all) instances, especially ones who are engineered to work well for CLI&apos;ers. I prefer mysql over Oracle and sqlplus over the heavy handed SQL Developer. The SQL..."
52     dc:creator=""
53     dc:date="2011-07-14T01:25:34-06:00" />
54 </rdf:RDF>
55 -->
56
57
58                      <h2 class="date-header">July 14, 2011</h2>
59                      <a id="a000747"></a>
60                      <div class="entry" id="entry-747">
61                         <h3 class="entry-header">rlwrap and sqlplus</h3>
62                         <div class="entry-content">
63                            <div class="entry-body">
64                               <p>As you know I'm a fan of the CLI in many (but not all) instances, especially ones who are engineered to work well for CLI'ers. I prefer mysql over Oracle and sqlplus over the heavy handed SQL Developer. The SQL Developer weighs in at over 181 Meg and while it has a nice GUI and extensive set of trees and widgets to explore every innard of Oracle's SQL implementation it's slow, slow, slow to load and run and ended up taking > 250 Meg of my memory when running. Suffice it say it was not very workable and definitely overkill for the simple selects and the like that I wanted to do.</p>
65
66 <p>Oracle's sqlplus weighs in at 700K or so, is light and quick to load and quick to execute commands. However it has a horrid CLI interface, not history, no re-editing of previous commands, etc. I'm surprised that backspace works honestly. However I could not continue to have SQL Developer bogging down my system and get any meaningful work done. My problems were twofold: 1) how to connect to the database (Oracle makes this so hard) and 2) how to improve on sqlplus' horrid CLI.</p>
67
68 <p>We actually have sqlplus at /data/tools/OraInstantClient_10_2 but when I run it it prompts for username and password then complains "ORA-12162: TNS:net service name is incorrectly specified". Trying sqlplus <username>/<password>@<SID> was no better. I have no clue what's defined in tsnnames.ora on the server and can't even log into it to check if there's one at all. I've always detested Oracles tsnnames.ora approach anyway. Finally I figured out the following will work:</p>
69
70 <div class=code>
71 $ &lt;path_to&gt;/sqlplus -L &lt;username&gt;/&lt;password&gt;@&lt;server&gt;/&lt;sid&gt;<br>
72 $ # or<br>
73 $ /data/tools/OraInstantClient_10_2/sqlplus qcread/******@pdbgen02/pettd1p<br>
74 </div>
75
76 <p>However it still has a crummy CLI so it's rlwrap to the rescue! rlwrap is a little program that wraps a CLI with ReadLine giving you most of ReadLine's functionality. So now I have a simple alias of:</p>
77
78 <div class=code>
79 alias sqlplus='rlwrap /data/tools/OraInstantClient_10_2/sqlplus -L &lt;username&gt;/&lt;password&gt;@&lt;server&gt;/&lt;sid&gt;'
80 </div>
81                               
82                               <p class="entry-footer">
83                                  <span class="post-footers">Posted by  at  1:25 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000747.html">Permalink</a>
84                                  
85                                  | <a href="http://defaria.com/blogs/Status/archives/000747.html#trackback">TrackBacks (0)</a>
86                               </p>
87                            </div>
88                         </div>
89                      </div>
90                      
91                   </div>
92                </div>
93             </div>
94          </div>
95       </div>
96    </div>
97 </body>
98 </html>