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