您好,登錄后才能下訂單哦!
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
--
實際上就是登陸數據庫可以自動執(zhí)行的一個腳本,簡單可以這樣理解。
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>
這里我添加幾個常用的,也是我在生產環(huán)境上添加的。
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>
小結:
當我們管理多套數據庫的時候,可能同時登陸到幾套數據庫,為了防止出現(xiàn)操作失誤的情況,建議大家配置一下glogin.sql,可以時刻提示我們在那套數據庫上進行操作,對數據庫的操作多謹慎都不為過。
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。