Chinaunix

标题: SQL*Plus for Instant Client. 怎么用的 [打印本页]

作者: majia_520    时间: 2011-07-28 11:07
标题: SQL*Plus for Instant Client. 怎么用的
SQL*Plus for Instant Client. [root@ftpsvr tmp]# rpm -qi oracle-instantclient11.2-sqlplus-11.2.0.2.0-1 Name : oracle-instantclient11.2-sqlplus Relocations: (not relocatable) Version : 11.2.0.2.0 Vendor: Oracle Corporation Release : 1 Build Date: Sun 05 Sep 2010 12:49:58 PM CST Install Date: Thu 28 Jul 2011 09:56:39 AM CST Build Host: dadvfg0706.us.oracle.com Group : Applications/File Source RPM: oracle-instantclient11.2-sqlplus-11.2.0.2.0-1.src.rpm Size : 2980443 License: Oracle Signature : (none) Packager : Nobody <nobody@oracle.com> URL : http://www.oracle.com/ Summary : SQL*Plus for Instant Client. Description : Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME. OCI, OCCI, ODBC, and JDBC applications work without modification, while using significantly less disk space than before. No recompile, no hassle. This package provides SQL*Plus for Instant Client. [root@ftpsvr tmp]#
作者: tacsoft    时间: 2011-07-28 11:22
[i=s] 本帖最后由 tacsoft 于 2011-07-28 11:29 编辑 [/i]

Installing SQL*Plus Instant Client on UNIX or Linux
To install SQL*Plus Instant Client using the Basic OCI package on UNIX and Linux, copy the following files:

$ORACLE_HOME/instantclient/libociei.so
$ORACLE_HOME/lib/libclntsh.so.10.1
$ORACLE_HOME/lib/libnnz10.so
$ORACLE_HOME/lib/libsqlplus.so
$ORACLE_HOME/lib/libsqlplusic.so
$ORACLE_HOME/bin/sqlplus
$ORACLE_HOME/sqlplus/admin/glogin.sql
To install SQL*Plus Instant Client using the lightweight OCI package on UNIX and Linux, copy the following files:

$ORACLE_HOME/instantclient/light/libociicus.so
$ORACLE_HOME/lib/libclntsh.so.10.1
$ORACLE_HOME/lib/libnnz10.so
$ORACLE_HOME/lib/libsqlplus.so
$ORACLE_HOME/lib/libsqlplusic.so
$ORACLE_HOME/bin/sqlplus
$ORACLE_HOME/sqlplus/admin/glogin.sql
Installing SQL*Plus Instant Client on Windows
To install SQL*Plus Instant Client using the Basic OCI package on Windows, copy the following files:

%ORACLE_HOME%\instantclient\oraociei10.dll
%ORACLE_HOME%\bin\oci.dll
%ORACLE_HOME%\bin\orannzsbb10.dll
%ORACLE_HOME%\bin\orasqlplusic10.dll
%ORACLE_HOME%\bin\sqlplus.exe
%ORACLE_HOME%\sqlplus\admin\glogin.sql
To install SQL*Plus Instant Client using the lightweight OCI package on Windows, copy the following files:

%ORACLE_HOME%\instantclient\light\oraociicus10.dll
%ORACLE_HOME%\bin\oci.dll
%ORACLE_HOME%\bin\orannzsbb10.dll
%ORACLE_HOME%\bin\orasqlplusic10.dll
%ORACLE_HOME%\bin\sqlplus.exe
%ORACLE_HOME%\sqlplus\admin\glogin.sql
Configuring SQL*Plus Instant Client
The SQL*Plus Instant Client executable should only be used with the matching version of the OCI Instant Client.

Note that no ORACLE_HOME or ORACLE_SID environment variables need to be set.

Configuring SQL*Plus Instant Client on Linux (from RPMs)
The RPMs downloaded from OTN install into Oracle specific sub-directories in the /usr file system. The sub-directory structure enables multiple versions of Instant Client to be available.

1.Add the name of the directory containing the Instant Client libraries to LD_LIBRARY_PATH. Remove any other Oracle directories.

For example, to set LD_LIBRARY_PATH on Solaris in the Bourne or Korn shells:

LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib :${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
2.Make sure the sqlplus executable installed from the RPM is the first found in your PATH. To test, enter which sqlplus which should return /usr/bin/sqlplus. If not, remove any other Oracle directories from PATH, or put /usr/bin before other SQL*Plus executables in PATH, or use an absolute or relative path to start SQL*Plus.

For example, to set PATH in the bash shell:

PATH=/usr/bin:${PATH}
export PATH
If you install multiple versions of SQL*Plus, you may need to change the symbolic link /usr/bin/sqlplus to the version of SQL*Plus matching the libraries in LD_LIBRARY_PATH. For 10.2.0.1, /usr/bin/sqlplus is a symbolic link to the SQL*Plus binary at /usr/lib/oracle/10.2.0.1/client/bin/sqlplus.

3.Set SQLPATH to the directory containing glogin.sql. For example:

SQLPATH=/usr/lib/oracle/10.2.0.1/client/lib:${SQLPATH}
export SQLPATH
4.Set Oracle globalization variables required for your locale. A default locale will be assumed if no variables are set. See the Oracle Database Globalization Support Guide for more information.

For example:

NLS_LANG=AMERICAN_AMERICA.UTF8
export NLS_LANG
Configuring SQL*Plus Instant Client on Linux (from Client Media or Zip File) and UNIX
1.Add the name of the directory containing the Instant Client files to the appropriate shared library path LD_LIBRARY_PATH, LIBPATH or SHLIB_PATH. Remove any other Oracle directories.

For example on Solaris in the Bourne or Korn shells:

LD_LIBRARY_PATH=/home/instantclient10_1:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
2.Add the directory containing the Instant Client files to the PATH environment variable. If it is not set, then an absolute or relative path must be used to start SQL*Plus. Remove any other Oracle directories from PATH. For example:

PATH=/home/instantclient10_1:${PATH}
export PATH
3.Set SQLPATH to the directory containing the Instant Client files so glogin.sql can be found. For example:

SQLPATH=/home/instantclient10_1:${SQLPATH}
export SQLPATH
4.Set Oracle globalization variables required for your locale. A default locale will be assumed if no variables are set. See the Oracle Database Globalization Support Guide for more information.

For example:

NLS_LANG=AMERICAN_AMERICA.UTF8
export NLS_LANG
Configuring SQL*Plus Instant Client on Windows
The environment may be configured using SET commands in a Windows command prompt or made permanent by setting Environment Variables in System Properties.

For example, to set environment variables in Windows 2000 using System Properties, open System from the Control Panel, click the Advanced tab and then click Environment Variables.

1.Add the directory containing the Instant Client files to the PATH system environment variable. Remove any other Oracle directories from PATH.

For example, add c:\instantclient10_2 to the beginning of PATH.

2.Set the user environment variable SQLPATH to the directory containing the Instant Client files so glogin.sql is found.

For example, create a user variable SQLPATH set to c:\instantclient.

3.Set Oracle globalization variables required for your locale. A default locale will be assumed if no variables are set. See the Oracle Database Globalization Support Guide for more information. For example, to set NLS_LANG for a Japanese environment, create a user environment variable NLS_LANG set to JAPANESE_JAPAN.JA16EUC.

If you have installed the lightweight Instant Client, see Lightweight Instant Client for information about supported NLS_LANG settings.

Connecting to a Database with SQL*Plus Instant Client
SQL*Plus Instant Client is always 'remote' from any database server. To connect to a database you must specify the database using an Oracle Net connection identifier.

An example using an Easy Connection identifier to connect to the HR schema in the MYDB database running on mymachine is:

sqlplus hr/your_password@//mymachine.mydomain:port/MYDB
Alternatively you can use a Net Service Name:

sqlplus hr/your_password@MYDB
Net Service Names can be stored in a number of places, including LDAP. The use of LDAP is recommended to take advantage of the new features of Oracle Database 10g. See the Oracle Database Net Services Reference for more information.


AS SYSDBA or AS SYSOPER Connections with SQL*Plus Instant Client
To connect AS SYSDBA or AS SYSOPER to perform DBA tasks, you need to set up an Oracle password file on the database server using the database's orapwd utility. Once this is configured, your SQL*Plus Instant Client connection string might look something like:

sqlplus sys@MYDB AS SYSDBA
作者: tacsoft    时间: 2011-07-28 11:26
原文在这个链接
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ape.htm
作者: renxiao2003    时间: 2011-07-28 12:01
看来应该用oracle用户安装吧。
作者: majia_520    时间: 2011-07-28 12:24
嗯,可以了。谢谢!
1. 用rpm方式安装那三个rpm包。


2. Installing SQL*Plus Instant Client on UNIX or Linux

To install SQL*Plus Instant Client using the Basic OCI package on UNIX and Linux, copy the following files:

$ORACLE_HOME/instantclient/libociei.so
$ORACLE_HOME/lib/libclntsh.so.10.1
$ORACLE_HOME/lib/libnnz10.so
$ORACLE_HOME/lib/libsqlplus.so
$ORACLE_HOME/lib/libsqlplusic.so
$ORACLE_HOME/bin/sqlplus
$ORACLE_HOME/sqlplus/admin/glogin.sql

3.
Configuring SQL*Plus Instant Client

The SQL*Plus Instant Client executable should only be used with the matching version of the OCI Instant Client.

Note that no ORACLE_HOME or ORACLE_SID environment variables need to be set.

Configuring SQL*Plus Instant Client on Linux (from RPMs)

The RPMs downloaded from OTN install into Oracle specific sub-directories in the /usr file system. The sub-directory structure enables multiple versions of Instant Client to be available.

Add the name of the directory containing the Instant Client libraries to LD_LIBRARY_PATH. Remove any other Oracle directories.

For example, to set LD_LIBRARY_PATH on Solaris in the Bourne or Korn shells:

LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
Make sure the sqlplus executable installed from the RPM is the first found in your PATH. To test, enter which sqlplus which should return /usr/bin/sqlplus. If not, remove any other Oracle directories from PATH, or put /usr/bin before other SQL*Plus executables in PATH, or use an absolute or relative path to start SQL*Plus.

For example, to set PATH in the bash shell:

PATH=/usr/bin:${PATH}
export PATH
If you install multiple versions of SQL*Plus, you may need to change the symbolic link /usr/bin/sqlplus to the version of SQL*Plus matching the libraries in LD_LIBRARY_PATH. For 10.2.0.1, /usr/bin/sqlplus is a symbolic link to the SQL*Plus binary at /usr/lib/oracle/10.2.0.1/client/bin/sqlplus.

Set SQLPATH to the directory containing glogin.sql. For example:

SQLPATH=/usr/lib/oracle/10.2.0.1/client/lib:${SQLPATH}
export SQLPATH
Set Oracle globalization variables required for your locale. A default locale will be assumed if no variables are set. See the Oracle Database Globalization Support Guide for more information.

For example:

NLS_LANG=AMERICAN_AMERICA.UTF8
export NLS_LANG

4. 退出,重新登录,执行sqlplus
作者: majia_520    时间: 2011-07-28 12:25
回复 4# renxiao2003


    rpm包用root安装的。

配置的时候在oracle用户下配置的。
作者: renxiao2003    时间: 2011-07-28 15:59
没错。普通用户一半安装不了rpm




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2