Shyamkkhadka
Shyamkkhadka

Reputation: 1468

How to permanently save settings of SQL * Editor?

In Sql * Editor which is the default editor for Oracle 10g, when we change the settings like rownum,pagesize. The changes are only for current session. After we exit from SQL * Editor, all the settings get erased . Can we make the changes to be permanent ?

Upvotes: 1

Views: 2636

Answers (1)

Alex Poole
Alex Poole

Reputation: 191570

Assuming you mean SQL*Plus, then yes - you can use a personal login.sql, or a global glogin.sql, with a list of configuration statements. See the documentation for details; not sure I can add anything useful to what that says. Make sure they are in the right place though:

The Site Profile script is $ORACLE_HOME/sqlplus/admin/glogin.sql in UNIX, and ORACLE_HOME\sqlplus\admin\glogin.sql in Windows.

The User Profile script is generally named login.sql. SQL*Plus searches for the User Profile in your current directory, and then the directories you specify with the SQLPATH environment variable. SQL*Plus searches this colon-separated list of directories and their subdirectories in the order they are listed.

Additionally, I sometimes have sets of scripts which want similar formatting, but not necessarily what I'd want in an interactive session (like reports perhaps). For those I have a separate file with the relevant settings, and I include that at the top of each script with @format.sql, rather than having to add the whole list to each script file. Also makes it easier to make a change to all of them if it becomes necessary. That runs after the login.sql or glogin.sql so it sometimes needs to reverse things in those to get back to the default behaviour.

Upvotes: 5

Related Questions