Introduction to Glogin.sql and Login.sql

Source: Internet
Author: User

When using Sqlplus, we can set the default behavior of Sqlplus by two profiles: Glogin.sql and Login.sql.

Glogin.sql called Global SITE Profile, located in the $oracle_home/sqlplus/admin directory, Login.sql called user profile, is located in the current path of the users, or under the path specified by the SQLPATH environment variable.

When the user starts Sqlplus or executes the conn command under Sqlplus, Sqlplus first calls the Glogin.sql file, then looks for the Login.sql file under the current path, and if Login.sql is not found, looks for the SQLPath file under the path and subpath specified by Login.sql.

For example, you can use the Login.sql file to configure Sqlprompt values.

[Oracle@oadata ~]$ ls-l | grep login.sql  
-rw-r--r--1 Oracle oinstall   134 09-17 14:16 login.sql  
[oracle@oadata ~]$ cat Login.sql  
Set Termout off
column user_name new_value username  
Select lower (user) user_name from dual;  
Set sqlprompt ' &username> '
set termout on
[oracle@oadata ~]$ sqlplus easy/easy  
      
sql*plus:release 11.2.0.3.0 Production on Tue Sep 14:18:53 2013  
      
Copyright (c) 1982, Oracle.  All rights reserved.  
      
      
Connected to:  
Oracle Database 11g Enterprise Edition release 11.2.0.3.0-64bit Production with the  
partitioning , OLAP, Data Mining and real application testing options  
      
Easy>select user from dual;  
      
USER
------------------------------  
Easy  
      
easy>

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.