SQL*Plus on Windows (Part 1)

Welcome to Part 1 in a series of articles on running SQL*Plus on the Windows platform.

Did you know that SQL*Plus under Windows is often preferred to its Unix equivalent?
There are many ways to configure SQL*Plus to suit your individual needs but today I’ll just cover one option that makes life that little bit easier (at least in my opinion).

Many beginner DBA’s (and some senior ones too!) often overlook the usefulness of a login.sql script.

We all have our favorite editors, I personally still float between Sublime Text and emacs, but the choice is truly down to personal preference. SQL*Plus on Windows defaults to notepad, as do most applications that use a text editor in the Windows environment, and we all know how useful that is; but its old and there are much better editors out there these days.

With a few choice commands and a bit of technical know-how you can change the default editor for SQL*Plus to something more DBA/Developer friendly.

Launch SQL*Plus on Windows from either the gui or a command prompt.

C:\>sqlplus /nolog

This will launch sqlplus.

Type:

ed login

By default This will launch you into notepad.exe and you will be editing a new file named “login.sql”, this file will be located in the directory you launched SQL*Plus from so remember where that was (the easiest way to do this is to create a shortcut to launch SQL*Plus which starts in the same directory every time, but this is something for another article).

Now this is where we define your preferred editor, so in my case, I like Sublime Text, therefore the line for setting my default SQL*Plus editor is as follows:

def _editor = “C:\Program Files\Sublime Text 3\subl.exe”

Editor

Save and close your file, then restart SQL*Plus.

Now when you type “ed” within SQL*Plus you will be thrown into your preferred editor.

This is just one of the changes that can be made in the login.sql; there are lots of others documented in the SQL*Plus reference documentation but this is my favorite change to make when first working on a new Windows environment.

Keep an eye out for further articles in my series on running SQL*Plus on a Windows platform.

Blogging101

Blogging101

So, I’ve joined another online course, this time specifically for improving my blogging, yeah right! “I’ve heard it all before” you say….. “join this course an in thirty days you’ll be a better person than you are now”

But I’m told this course is different, using a community of like minder bloggers to comment and encourage on each others blogs I hope to get some good tips and tricks, and a kick up the backside to blog more frequently.

Its not that I don’t want to write, it’s the time factor (excuses, excuses I hear you cry!!!), but only time will tell.

My first task / assignment for this course is to re-introduce myself and my blog, so without further delay, here we go!!!

Who am I and why am I here

My nickname is l1dge (pronounced li-dge ), I am and have been an Oracle dba for the past twenty something years, with a few deviations to dabble in other areas. I’ve been using SQL Server for the last 8 years alongside Oracle. I’m certified (or is that certifiable) in both disciplines, Oracle 10 and 11G OCP, MS SQL Server MCITP DBA 2005. I’m an “old skool” hacker at heart in the traditional sense, pulling apart bits of kit to see how they work, mainly with the intention of fixing it, mostly with the outcome of breaking it! I like toying with hardware, software and new technologies and love Linux, although Windows 10 is looking pretty slick too. I have a keen interest in reading / writing and electronics. And if I can help you I will.

And now for the disclaimer:

Anything I write here is my own opinion and does not represent the view of any company I work for now or have worked for in the past.

First Post from within emacs using org2blog/wp

So its been a long while since my last post, but I’ve decided to start posting more regularly to my blog (hopefully!)

I’ve been playing around with various editors recently to try and streamline my workflow, improve my productivity. To that end I think I’ve finally settled on emacs, and although its a steep learning curve I’ve finally started to make headway thanks to various web sources and a lot of help from my great friend Mickey over at masteringemacs.org (who incidentally is about to publish a great book on emacs!!).

One of the great plugins I’ve found is org2blog/wp and a great blog post that help me set it up at Gabriel Saldaña’s blog.

I also found some useful information that helped to create this post at Pablumfication which I’ve taken the liberty of copying below:

Creating Your First Post

Creating your post really could not be simpler

  • M-x org2blog/wp-login – To Login to your blog.
  • M-x org2blog/wp-new-post – To create a new post.
  • Make your changes in the file.
  • C-x C-s – To save the changes
  • C-c d – To run the command org2blog/wp-post-buffer which if everything has worked successfully will post your post to your blog as a draft. You’ll notice that POSTID (‘#+POSTID: 00000′) will have been prepended to the file.
  • You’ll also be prompted asking if you want to open you’ll new post in the browser. Pressing ‘y’ will do this and if everything has gone well you should see your post.
  • Make changes till your happy with your post.
  • C-c p – To publish your post to be visible to all.

Thats it your done.

Conclusion

So it seems very simple to me once the initial setup is done, that regular blog posting can now occur from directly within emacs, but only time will tell!!