Sqlplus聯機文檔:
http://download.oracle.com/docs/cd/E11882_01/server.112/e16604/ch_two.htm#CHDHAECG
配置Sqlplus
[原文]
Configuring SQL*PlusThis chapter explains how to configure your SQL*Plus command-line environment. It has the following topics:
-
SQL*Plus Environment Variables
-
SQL*Plus Configuration
[譯文]
配置Sqlplus
這部分章節解釋怎麼配置Sqlplus的命令行。主要兩個內容:
- Sqlplus環境變量
- Sqlplus配置
[原文]
SQL*Plus Environment VariablesThese environment variables specify the location or path of files used by SQL*Plus. For other environment variables that influence the behavior of SQL*Plus, see the Oracle Database Administrator's Reference.
Table 2-1 Parameters or Environment Variables influencing SQL*Plus
[譯文]
Sqlplus的環境變量
這些環境變量通常由Sqlplus指定被使用文件的本地位置或路徑,其它的環境變量對Sqlplus的操作方式有一定影響,具體參考Oracle數據庫管理員指南。
表2-1參數或環境變量影響Sqlplus
Parameter or Variable 參數或變量 | Description 描述 |
Environment variable to specify the path used to search for libraries on UNIX and Linux. The environment variable may have a different name on some operating systems, such as DYLD_LIBRARY_PATH on Apple Mac OS, LIBPATH on IBM/AIX-5L, and SHLIB_PATH on HP-UX. Not applicable to Windows operating systems. Example $ORACLE_HOME/lib 這個環境變量用來指定Sqlplus搜索函數庫的路徑,對使用Unix和Linux系統的用戶有影響。對不同的系統有不同的名稱。對Windows系統沒有影響。 例如 $ORACLE_HOME/lib |
|
Windows environment variable to specify a connection string. Performs the same function as TWO_TASK on UNIX. 這個環境變量是Windows系統的,用來指定連接一個字符串,像Unix系統上執行TWO_TASK命令函數一樣。 |
|
Environment variable to specify globalization behavior. Example american_america.utf8 這個環境變量用來指定語言選擇的執行情況。 例如 american_america.utf8 |
|
Environment variable to specify where SQL*Plus is installed. It is also used by SQL*Plus to specify where message files are located. Examples: d:\oracle\10g /u01/app/oracle/product/v10g 這個環境變量用來指定Sqlplus被安裝在哪裏,也用來指Sqlplus的一些信息文件存放的位置。 例如 d:\oracle\10g /u01/app/oracle/product/v10g |
|
Environment variable to specify the database edition to use. If you specify the edition with the CONNECT or SQLPLUS command option, edition=value, it is used instead of ORA_EDITION. If no edition is specified in either the CONNECT or SQLPLUS command option, or in ORA_EDITION, SQL*Plus connects to the default edition. 這個環境變量用來指定使用什麼工具來編輯數據庫。如果指定連接和Sqlplus命令運行的編輯器,需要設置edition=value,通過這個設置來啓動Oracle的編輯器,如果不指定,則Sqlplus使用默認的編輯器。 |
|
Environment variable to specify the locations of the NLS data and the user boot file in SQL*Plus 10.2. The default location is $ORACLE_HOME/nls/data. In a system with both Oracle9i and 10g, or a system under version upgrade, you should set ORA_NLS10 for Oracle 10g and set ORA_NLS33 for 9i. The default NLS location in 9i was $ORACLE_HOME/common/nls/admin/data. 這個環境變量設置主要做升級使用。9i設置ORA_NLS33,或者10g設置ORA_NLS10. 在9i中默認的文件存放位置在$ORACLE_HOME/common/nls/admin/data. |
|
Environment variable to specify the location of SQL scripts. If SQL*Plus cannot find the file in ORACLE_PATH, or if ORACLE_PATH is not set, it searches for the file in the current working directory. Not applicable to Windows 這個環境變量指定Sql腳本存放的位置。如果Sqlplus不能夠找到指定的ORACLE_PATH,或者ORACLE_PATH沒有設置,則只能在當前的工作目錄中尋找腳本文件。 這個環境變量對Windows系統沒有影響。 |
|
Environment variable to specify the database instance, optional 這個環境變量用來指定數據的實例。 |
|
Environment variable to specify the path to search for executables, and DLLs in Windows. Typically includes ORACLE_HOME/bin 這個環境變量指定將要查找的Windows系統中的可執行文件和動態鏈接庫位置,典型的位置在ORACLE_HOME/bin。 |
|
Environment variable or Windows registry entry to specify the location of SQL scripts. SQL*Plus searches for SQL scripts, including login.sql, in the current directory and then in the directories specified by SQLPATH, and in the subdirectories of SQLPATH directories. SQLPATH is a colon separated list of directories. There is no default value set in UNIX installations. In Windows, SQLPATH is defined in a registry entry during installation. For more information about the SQLPATH registry entry, see SQLPATH Registry Entry. 這個環境變量指定SQL腳本存放的位置,Sqlplus搜索SQL腳本,包括login.sql,在當前目錄和指定的SQLPATH目錄及其子目錄中。 在Windows系統中,SQLPATH在安裝過程中被定義爲一個註冊。 |
|
Environment variable to specify the location of the tnsnames.ora file. If not specified, $ORACLE_HOME/network/admin is used Example h:\network /var/opt/oracle 這個環境變量指定存儲文件tnsnames.ora,如果不指定,這個目錄$ORACLE_HOME/network/admin將被使用。 例如 h:\network /var/opt/oracle |
|
UNIX environment variable to specify a connection string. Connections that do not specify a database will connect to the database specified in TWO_TASK. Example TWO_TASK=MYDB export TWO_TASK sqlplus hris the same as: sqlplus hr@MYDB UNIX系統環境變量指定連接的字符串。 例如 TWO_TASK=MYDB export TWO_TASK sqlplus hris the same as: sqlplus hr@MYDB |
(待續……)