做一名精致的DBA之glogin.sql-創(chuàng)新互聯(lián)

對于一個成熟的dba必須要熟悉glogin.sql這個文件,然后利用它,更好的規(guī)避一些操作風(fēng)險。

1、查看glogin.sql內(nèi)容

成都創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:做網(wǎng)站、網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的西安網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
<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
--

實際上就是登陸數(shù)據(jù)庫可以自動執(zhí)行的一個腳本,簡單可以這樣理解。

2、添加內(nèi)容
以下內(nèi)容是我們可以添加的,我們根據(jù)我們的需要添加。

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>

這里我添加幾個常用的,也是我在生產(chǎn)環(huán)境上添加的。

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

添加的文件內(nèi)容

<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、大家看一下結(jié)果:

<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>

小結(jié):
當(dāng)我們管理多套數(shù)據(jù)庫的時候,可能同時登陸到幾套數(shù)據(jù)庫,為了防止出現(xiàn)操作失誤的情況,建議大家配置一下glogin.sql,可以時刻提示我們在那套數(shù)據(jù)庫上進(jìn)行操作,對數(shù)據(jù)庫的操作多謹(jǐn)慎都不為過。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

本文題目:做一名精致的DBA之glogin.sql-創(chuàng)新互聯(lián)
文章出自:http://muchs.cn/article32/cspppc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、品牌網(wǎng)站制作網(wǎng)站導(dǎo)航、營銷型網(wǎng)站建設(shè)、電子商務(wù)、App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化