Solved

commands

Posted on 2014-02-24
14
193 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
  • 3
  • 2
  • 2
  • +3
14 Comments
 
LVL 34

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 34

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 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't Access My Database 57 77
how to find out the count of records based on the subfolders paths 11 32
oracle collections 2 22
join actual table rows based on the column 25 22
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to recover a database from a user managed backup
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

820 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