<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評論 :: 0 Trackbacks
    關于login.sql
    ?
    ??? 最近遇到一個問題,在sqlplus首次登錄時,會調用login.sql,顯示指定的SQLPROMPT,但是當再次使用connect命令連接其他用戶時,顯示的SQLPROMPT一直無法改變,而且重新connect之后所有在login.sql中設置的屬性也全部丟失。找了很久原因之后才發現原來是因為Oracle的版本問題,9i中只能在初次登錄sqlplus時才會去調用login.sql,而在10g之后,每次connect都會調用該腳本。
    ?
    ??? 下面看一個轉載的文章,說的比較清楚:注意紅色粗體部分。
    ?
    ---------------------------------------------------------------------------------------------------------
    ?
    Storing settings for SQL*PLUS (login.sql and glogin.sql)
    ?
    glogin.sql

    ??? Whenever SQL*PLUS starts up, it looks for a file namedglogin.sql under the directory $ORACLE_HOME/sqlplus/admin. If such a file is found, it is read and the containing statements executed. This allows to store settings (such as linesize) accross SQL*PLUS sessions.
    ?
    ??? New in Oracle 10g: Oracle also reads glogin.sql and login.sql at a connect in sql*plus.

    ?
    login.sql

    ??? Additionally, after reading glogin.sql, sql*plus also looks for a file named login.sql in the directory from where SQL*PLUS was and in the directory that the environment variable SQLPATHpoints to and reads it and executes it. Settings from the login.sql take precedence over settings from glogin.sql
    ?
    ??? If the restriction level is set to 3, the login.sql is not read.

    ?
    A common login.sql file
    ??? set pagesize 0
    ??? set linesize 190
    ??? define _editor=gvim
    ?
    ??? 10g
    ??? Since Oracle 10g, the login.sql is executed after a connect.
    ??? This allows to have a prompt that displays the username.
    ??? For that, the following line must be in the login.sql:
    ??? set sqlprompt "&_user> "
    ?
    ------------------------------------------------------------------------------------------------------------
    ?
    ??? 同時在10g官方文檔《SQLPlus User's Guide and Reference》里也有記載,設置SQLPLUSCOMPATIBILITY可以改變sqlplus某些屬性,其中就包括glogin/login的讀取:
    ?
    ?
    SET SQLPLUSCOMPATIBILITY {x.y[.z]}
    ?
    Value ?? Consequence ???????????????????????????????????????????????? ?????? When available
    >=10.1 ? SHOW ERRORS sorts PL/SQL error messages using new?????????????????? 10.1
    ???????? columns only available in Oracle Database 10g.
    >=10.1 ? SPOOL Options CREATE, REPLACE, SAVE were added which??????????????? 10.1
    ???????? may affect filename parsing on some platforms.
    >=10.1 ? SET SQLPROMPT ???????????????????????????????????????? ???????????? 10.1
    >=10.1 ? Whitespace characters are allowed in Windows file names that??????? 10.1
    ???????? are enclosed in quotes. Some other special punctuation characters
    ???????? are now disallowed in Windows.
    >=10.1 ? Glogin/login files are called for each reconnect. ????????????????? 10.1
    ?<10.1 ? Uses the obsolete DOC> prompt when echoing /* comments. ??????????? 10.1
    ?>=9.2 ? A wide column defined FOLD_AFTER may be displayed at the??????????? 9.2.
    ???????? start of a new line. Otherwise it is incorrectly put at the end
    ???????? of thepreceding line with a smaller width than expected.
    ?>=9.0 ? Whitespace before a slash ("/") in a SQL statement is ignored and?? 9.0.1.4.
    ???????? the slash is taken to mean execute the statement. Otherwise the
    ???????? slash is treated as part of the statement, for example, as a
    ???????? divisionsign.
    ?>=9.0 ? The length specified for NCHAR and NVARCHAR2 types is?????????????? 9.0.1
    ???????? characters. Otherwise the length may represent bytes or
    ???????? characters depending on the character set.
    ?
    ?
    posted on 2009-03-11 23:49 decode360 閱讀(208) 評論(0)  編輯  收藏 所屬分類: 05.SQL
    主站蜘蛛池模板: 亚洲资源在线视频| 亚洲成年人免费网站| 亚洲AV无码XXX麻豆艾秋| 永久免费的网站在线观看| 亚洲国产片在线观看| AV大片在线无码永久免费| 亚洲制服丝袜精品久久| 一个人免费观看视频www| 亚洲国产日韩综合久久精品| 一个人免费观看在线视频www| 亚洲Av高清一区二区三区| 无码一区二区三区AV免费| 国产亚洲精品影视在线| 国产高清免费的视频| 免费夜色污私人影院网站电影| 亚洲AV无码成H人在线观看| 一级**爱片免费视频| 亚洲色爱图小说专区| 久久ww精品w免费人成| 亚洲伊人精品综合在合线| 成人免费视频88| 无码 免费 国产在线观看91| 亚洲无人区一区二区三区| 久久国产色AV免费观看| 亚洲日本VA午夜在线影院| 亚洲AV无码之日韩精品| 高清永久免费观看| 亚洲酒色1314狠狠做| 好爽好紧好大的免费视频国产| 国产免费人成视频在线播放播| 亚洲日本va午夜中文字幕一区| 免费看国产精品3a黄的视频| 成人免费夜片在线观看| 亚洲国产精品人久久| 美女被免费视频网站a国产| jyzzjyzz国产免费观看| 亚洲性69影院在线观看| 亚洲国产综合精品中文字幕| 99热精品在线免费观看| 国产精品亚洲а∨无码播放不卡| 国产av无码专区亚洲av桃花庵|