Solved

Sqlplus - saving environment options from session to session

Posted on 2004-10-20
7
730 Views
Last Modified: 2008-01-09
I want to be able to set the linesize and set the wordwrap and then have the settings saved from session to session.

When I set the environment options, the setting reverts back after I close SQLPLUS and open a new SQLPLUS window.

How do I save my settings from session to session.  OR how do I open the SQLPLUS with my preferred options (command line options?).

Thanks.
0
Comment
Question by:booksplus
  • 4
  • 2
7 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 12360793
Place these in either your login.sql or glogin.sql file.

They will be active each time you log in.  The only gotcha is that depending on your O/S, you may have to execute your login.sql file each time you connect as another user in the same sqlplus session.
0
 
LVL 23

Accepted Solution

by:
paquicuba earned 125 total points
ID: 12361149
Open an SQLPLUS session and type EDIT COMMANDS, click yes, enter your commands, close it, click yes, close your session, right click on your SQLPLUS icon, in Target you should see C:\oracle\ora92\bin\sqlplusw.exe ,add the following at the end <your_user_id>/<your_password>@<database> @commands.txt
0
 
LVL 23

Expert Comment

by:paquicuba
ID: 12361164
Target should look like: C:\oracle\ora92\bin\sqlplus.exe <your_user_id>/<your_password>@<database> @commands.txt
Hope this helps!
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.

 
LVL 23

Assisted Solution

by:paquicuba
paquicuba earned 125 total points
ID: 12361188
actually Target should look like: C:\oracle\ora92\bin\sqlplus.exe <your_user_id>/<your_password>@<database> @commands.sql
0
 

Author Comment

by:booksplus
ID: 12361338
How do I enter the commands in the file -
I want linesize to be 130 and word wrap turned off.

0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 12361362
exactly as you would enter it from the 'SQL>' prompt.  Place each entry on its own line.

i.e./

contents of login.sql
============================
set lines 130
set pages 100
...

0
 
LVL 23

Assisted Solution

by:paquicuba
paquicuba earned 125 total points
ID: 12361505
in SQLPLUS when you type EDIT COMMANDS, and click YES, you can type the commands in notepad like this:
set wrap off
set linesize 130
Then, close notepad and click YES to save it. What you do is creating an .sql file in your bin directory.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
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 syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

828 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