SQLcl – the SQL*Plus plus a plus …

"euphoric: intensely happy or confident", @thatjeffsmith, https://youtu.be/ecgijS76jvw ...

Just watched the video from @thatjeffsmith about SQLcl - and it is, indeed, worth the time. After looking that video, I'm pretty sure that SQLcl will replace SQL*Plus within months (if some more people 'spread the word').

Just a few keywords to make you curious:

  • SQLcl is available as 'standalone' download, but it is also already part of the latest SQLDeveloper 17.2. (more...)

How to exit of ed in SQL*Plus

I from time to time get stuck in ‘ed‘ on SQL*Plus because the editor not defined like this:

SQL> select * from duall;
select * from duall
 *
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> ed
Wrote file afiedt.buf
22
^C
?
^Z
?

The Ctrl-C and Ctrl-Z, wouldn’t get you out.

The solution is simple, type ‘q‘ and press ‘Enter‘, then set editor using (more...)

Role of # in SQL*Plus

Uncategorized
| Jul 13, 2017
The # character is for commenting in SQL*Plus, right?

The character # has been mostly used for comments in many languages, such as shell scripts and python. Interestingly # is legal syntax in SQL scripting as well; but is it considered a comment? The answer is no; it's not. The purpose of # in SQL scripts is very different. and you should be very careful using it.

Entering # tells SQL*Plus to temporarily pauses what (more...)

Enough with AFIEDT.BUF

Uncategorized
| Jul 10, 2017
You are in SQL*Plus. You entered a command and urgh, there was a typo. No worries, you bring up the command in an editor by typing:

SQL> ed

This opens up an editor, such as notepad.exe in Windows or vi in Unix, etc. And it puts the last SQL you entered in a file, oddly named, afiedt.buf. You don't like it and you want a name easier to type. Is it possible? Of (more...)

How to fix ‚PLAN_TABLE‘ is old version

During a lot of SQL Performance activities I saw all the time the following message but why?


Note
-----
- 'PLAN_TABLE' is old version

Yes, I did a few days before an Upgrade from 11.2.0.4 -> 12.1.0.2. Now I start to check out some important SQL Queries but I the „old version“ message


sqlplus

set autotrace traceonly explain

select * from dual;

and again

Note ------

'PLAN_TABLE' is old  (more...)

Password Expire

If a user forgets his password, he may ask you to reset it for him. You will then know his new password, which you may see as a security issue. By including the password expire clause in the alter user command, you can force the user to change his password the next time he logs in. After this, you will no longer know his password. The examples which follow show a DBA changing a password (more...)

Using HISTORY in SQL*PLUS 12.2….

One of the biggest things that we couldn’t do in the previous versions of the oracle database was to use the back arrow button-to reexecute the old commands, without typing them. Of course, a workarouns is possible in the form of rlwrap but it’s not comparable to a natively available feature in the SQL*PLUS. Well, until now because now, we have HISTORY option available in 12.2 SQL*PLUS. Let’s take a look.

SQL> /

BANNER                         (more...)

The Oracle Database professional I admire most

Carlos Sierra spent 17 years in the SQL performance group of Oracle Support. He couldn’t move a mountain nor pull down a big oak tree. But Carlos Sierra became a mighty big man by putting all the knowledge he gained during that time into a wonderful tool called “SQLT.”(read more)

Developer Days VM Startup and Shutdown, SQLcl

Uncategorized
| Jun 16, 2016
If you're developing on a remote platform, chances are that you are using a Virtual Machine. (VM)  In Oracle, we release a virtual machine called the  "Oracle Developer Days".    This is available on the Oracle Technology Network and ala google.  Todays hack is setting up headless vm's, ports and aliases to speed up your day. (This post took a lot longer to write that the aliases we set up!)

For this (more...)

Bind Variables

This example, tested on Oracle 11, shows how you can define bind variables in SQL*Plus, assign values to them in PL/SQL then display those values afterwards back in SQL*Plus:

SQL> variable bv1 varchar2(3)
SQL> variable bv2 number
SQL> begin
  2  select 'ABC' into :bv1 from dual;
  3  select 123 into :bv2 from dual;
  4  end;
  5  /

PL/SQL procedure successfully completed.

SQL> print bv1

BV1
--------------------------------
ABC

SQL> print bv2

       (more...)

Using PRELIM Option Of SQL*PLUS….

A recent thread in the Database General Questions place was posted today. The original poster set some wrong values for the database memory related parameters and using those exceptionally large values, database got hung. Well, I don’t know whether that was the real issue or not as the original poster didn’t share the contents of the alert.log file of his database neither shared any other details. What he wanted to know that how he (more...)

SQLcl – Code editing on the console

Uncategorized
| May 1, 2015
We've been playing with our console drawing in SQLcl for a while now and this week, we hooked up some keys to make editing and running much easier.  The video will show the following keys for managing your buffer in the console.  This will make it into the next Early Access candidate soon.

  • up arrow - previous history (this will continue to show you the next history unless you move into the text to edit (more...)

SQLcl connections – Lazy mans SQL*Net completion

Uncategorized
| Apr 30, 2015
Turloch posted this today, which is like aliases for SQL*Net connection URL's which are used to connections like this:

connect <USERNAME>/<Password>@URL


This works great and you can simplify your connection strings that you use.  Vadim wired this into the code completion and we can now code complete via key, a connection string that you have used before or you can set up a new now using the net command.


Connections Types in SQLcl

Uncategorized
| Feb 20, 2015

We support many ways to connect in SQLcl, including lots from SQL*Plus which we need to support to make sure all your SQL*Plus scripts work exactly the same way using SQLcl as with SQL*Plus.

I've added several ways to show how to connect to SQLcl.  If there is one you want to see added that is not here, let me know and I'll add it to the list.  So far, We have below:

Code Insight on SQLcl

Uncategorized
| Feb 19, 2015
Here's a little preview of the code insight we have in SQLcl.  These changes are part of EA2 which are coming out very soon.  This also shows the buffer and cursor management which was introduced in SQLcl


This allows you to move around the buffer easily and add and change text as you would in a normal text editor, not a console window like this.

We're also adding hotkeys to run the buffer from anywhere (more...)

EZCONNECT without a password

After encountering this little annoyance for the nth time, I thought I should write it up once and for all, so it is committed to my electronic memory.

The EZCONNECT naming method is a handy way of connecting to an Oracle database by its service name, which avoids the need for aliases in the TNSNAMES file, or lengthy SQL*Net connection strings :

SQL> connect user/password@hostname:port/service_name
Connected.

However, one would expect that if you don’t want (more...)

SQLCl – LDAP anyone?

since  we released our first preview of SDSQL, we've made  a lot of changes to it and enhanced a lot of things too in there so it would be more useable.  One specific one was the use of LDAP which some customers on SQLDeveloper are using in their organisations as a standard and our first release precluded them from working with this.

Well, to add this, we wanted a way that we could specify the (more...)

SDSQL – Editing Anyone?

Since we dropped our beta out of SQLDeveloper 4.1 and announced SDSQL, we've been busy getting some of the new things out to users.  We support SQL*plus editing straight out of the box, but one thing that was always annoying was the time when you make a mistake and can't fix it to you have finished typing to go back and add a line like this.


This was always the way as console (more...)

12c: Sqlplus Displays Last Login Time For Non – Sys Users

Original Post can be viewed at 12c: Sqlplus Displays Last Login Time For Non – Sys Users

12c database has introduces a pretty nifty Security feature which allows you to check last login time for non-sys user. e.g If I connect to scott user as below, it displays that (more...)

Clickable SQL*Plus Errors

Running lots of scripts in SQL*Plus is nice when they are working correctly. But what about when they fail?  Its a pain to figure out what went wrong, unless you have a log file and even then, you have to hunt the errors down.

Well, I've had enough of that. (more...)