Solved

commands

Posted on 2014-02-24
14
194 Views
Last Modified: 2014-12-06
SYS@spserv>

How will see the previously used command in a console in sunsolaris box?
0
Comment
Question by:thomasliju
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
14 Comments
 
LVL 35

Expert Comment

by:johnsone
ID: 39883985
I don't see what this is doing in the Oracle zone.

If it is set up correctly, then the history command should give you some number of previous commands.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39884003
Since it's Solaris I assume that your shell is ksh.

Issue

set -o emacs

and hit <Ctrl><P>

(press and hold the <Ctrl> key, then hit the letter "p".)

to see the previous command.

Hit that key combinaton several times to scroll up in the command history.

Add "st -o emacs" to ~/.profile to make this option permanent.
0
 
LVL 8

Expert Comment

by:Lee Ingalls
ID: 39884009
If you're looking for shell command logging...
Set theses variables into local environnement file.

For csh shell (.cshrc)
set history=100
set savehist=100

100 is the max of the command that will be logged

To see the history type history command at the user prompt and the history is also logged in ~/.history file after the user logs out the session.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:thomasliju
ID: 39884029
Slightv
I mean oracle sql commands in sunsolaris machine...
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 168 total points
ID: 39884037
For sqlplus try "/" (slash) followed by <ENTER> to repeat the last command.

"l" <ENTER> (the letter "l" followed by the ENTER key) will show the last command.

"edit" or "ed" opens the last command for editing. Save the changed command with <ESC>:wq! <ENTER>
then type / and hit <Enter> to execute it.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39884162
I believe sqlplus in Unix follows the OS settings.

If none of the previous suggestions work, try the 'standard' up arrow key.

I none of this works, I would suggest you spend a little time in the online SQLPlus documentation?
0
 
LVL 22

Assisted Solution

by:Steve Wales
Steve Wales earned 166 total points
ID: 39884168
It does not appear to be built in to sqlplus in Unix.

However I did find reference in a couple of blog posts to a utility called rlwrap that worked on Linux (no idea if it will work on Solaris):

Try it out, let us know if it works :)   (although probably not in a production environment!)

The two links below talk about rlwrap, and how to configure and use it.

http://sysdba.wordpress.com/2006/10/08/how-to-use-rlwrap-to-get-a-command-history-in-sqlplus/
http://www.adp-gmbh.ch/ora/sqlplus/index.html

I did follow the link and the utility does still seem to be available (since the original blog post was from 2006).
0
 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 166 total points
ID: 39885276
SQL*Plus on the Unix side doesn't do command history.  You only have access to the last command as mentioned.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39885532
>>SQL*Plus on the Unix side doesn't do command history

You mean the DOS version does something Unix doesn't?  WOW.
0
 
LVL 35

Expert Comment

by:johnsone
ID: 39885544
Yes, kind of amazing isn't it.  It has always been that way.  No idea why they never had that feature on the UNIX version.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question