做一名精致的DBA之glogin.sql-创新互联

对于一个成熟的dba必须要熟悉glogin.sql这个文件,然后利用它,更好的规避一些操作风险。

1、查看glogin.sql内容

成都创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:做网站、网站制作、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的西安网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
<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
--

实际上就是登陆数据库可以自动执行的一个脚本,简单可以这样理解。

2、添加内容
以下内容是我们可以添加的,我们根据我们的需要添加。

SQL> define
DEFINE _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 Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options" (CHAR)
DEFINE _O_RELEASE      = "1102000400" (CHAR)
SQL>

这里我添加几个常用的,也是我在生产环境上添加的。

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

添加的文件内容

<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 50
set sqlprompt "_user'@'_connect_identifier> "
define_editor=vi

3、大家看一下结果:

<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin>$sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 13 21:13:40 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@orcl>

小结:
当我们管理多套数据库的时候,可能同时登陆到几套数据库,为了防止出现操作失误的情况,建议大家配置一下glogin.sql,可以时刻提示我们在那套数据库上进行操作,对数据库的操作多谨慎都不为过。

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

本文题目:做一名精致的DBA之glogin.sql-创新互联
文章出自:https://www.cdcxhl.com/article32/cspppc.html

成都网站建设公司_创新互联,为您提供网站维护品牌网站制作网站导航营销型网站建设电子商务App开发

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都seo排名网站优化