Sqlplus login. SQL settings

Source: Internet
Author: User


Sqlplus login. SQL setting [SQL] define_editor = vi set serveroutput on size 100000 set trimspool on set long 5000 www.2cto.com set linesize 120 set pagesize 9999 column plan_plus_exp format a80 column global_name new_value gname set termout off define gname = idle column global_name new_value gname select lower (user) | '@' | substr (global_name, 1, decode (dot, 0, length (global_name), dot-1) global_name from (sel Ect global_name, instr (global_name ,'. ') dot from global_name); set sqlprompt' & gname> 'set termout on: Save the above Code as a file login. SQL is placed under the $ ORACLE_HOME/sqlplus/admin directory, and then sqlplus is opened. It is found that SQL * PLUS automatically runs two scripts at startup: glogin. SQL, login. SQL. The glogin. SQL file is a default SQLPLUS setting created by ORACLE for All database users. It is stored in the $ ORACLE_HOME/sqlplus/admin/directory. You can put your favorite common settings in the login. SQL file, which is automatically loaded every time sqlplus is started. Run the glogin. SQL file before running the login. SQL file at the startup of www.2cto.com SQL * PLUS. Find glogin. SQL in the default path. The order for searching login. SQL files is as follows: search in the current path first. If yes, run the command and stop searching. If no environment variable is found, check whether the SQLPATH environment variable is set. If the environment variable is already set, search for it in the corresponding path of the variable. If yes, run, stop searching after running. If it is not found, it will stop searching and will not continue searching. If the SQLPATH environment variable is not set, the search will not be continued. Set the SQLPATH environment variable: vi ~ /. Add bash_profile: SQLPATH =/home/oracle/admin/SQL: $ ORACLE_HOME/sqlplus/admin; Add the export SQLPATH to the environment variable and re-open the terminal.

Related Article

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.