Solved

commands

Posted on 2014-02-24
14
189 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
Comment Utility
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
Comment Utility
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 7

Expert Comment

by:Lee Ingalls
Comment Utility
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
 

Author Comment

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

Accepted Solution

by:
woolmilkporc earned 168 total points
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
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
Comment Utility
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
Comment Utility
SQL*Plus on the Unix side doesn't do command history.  You only have access to the last command as mentioned.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
>>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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now