Be a fine DBA Glogin.sql

Source: Internet
Author: User
Tags dba sqlplus

For a mature DBA to be familiar with the Glogin.sql file, then use it to better circumvent some operational risks.

1. View Glogin.sql Content

<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin>$more glogin.sql---- Copyright (c) 1988, 2011, Oracle and/or its affiliates. -- All rights reserved. ---- NAME       ##文件名--   glogin.sql---- DESCRIPTION    ##描述--   SQL*Plus global login "site profile" file----   Add any SQL*Plus commands here that are to be executed when a--   user starts SQL*Plus, or uses the SQL*Plus CONNECT command.---- USAGE   ##用法--   This script is automatically run--

is actually a login database can be executed automatically a script, simple can understand.

2. Add Content
The following is something we can add, which we add according to our needs.

SQL> defineDEFINE _DATE           = "13-FEB-2018 21:05:01" (CHAR)DEFINE _CONNECT_IDENTIFIER = "orcl" (CHAR)DEFINE _USER           = "SYS" (CHAR)DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)DEFINE _SQLPLUS_RELEASE = "1102000400" (CHAR)DEFINE _EDITOR         = "ed" (CHAR)DEFINE _O_VERSION      = "Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options" (CHAR)DEFINE _O_RELEASE      = "1102000400" (CHAR)SQL>                  

Here I add a few common, also I added in the production environment.

set linesize 200 pagesize 50set sqlprompt "_user‘@‘_connect_identifier> "define_editor=vi

Added file contents

<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin>$vi glogin.sql ---- Copyright (c) 1988, 2011, Oracle and/or its affiliates. -- All rights reserved. ---- NAME--   glogin.sql---- DESCRIPTION--   SQL*Plus global login "site profile" file----   Add any SQL*Plus commands here that are to be executed when a--   user starts SQL*Plus, or uses the SQL*Plus CONNECT command.---- USAGE--   This script is automatically run--set linesize 132 pagesize 50set sqlprompt "_user‘@‘_connect_identifier> "define_editor=vi

3, we look at the results:

<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin>$sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 13 21:13:40 2018Copyright (c) 1982, 2013, Oracle.  

Summary:
When we manage multiple sets of databases, may be logged into several sets of databases at the same time, in order to prevent the occurrence of operational errors, we recommend that you configure Glogin.sql, you can always prompt us to operate on that set of databases, the operation of the database is not too cautious.

Be a fine DBA Glogin.sql

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.