Solved

Sqlplus - saving environment options from session to session

Posted on 2004-10-20
7
727 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 76

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 76

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

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.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

707 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