免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4023 | 回复: 6

SQL*Plus for Instant Client. 怎么用的 [复制链接]

论坛徽章:
0
发表于 2011-07-28 11:07 |显示全部楼层
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]#

论坛徽章:
0
发表于 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

论坛徽章:
0
发表于 2011-07-28 11:26 |显示全部楼层

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
发表于 2011-07-28 12:01 |显示全部楼层
看来应该用oracle用户安装吧。

论坛徽章:
0
发表于 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

论坛徽章:
0
发表于 2011-07-28 12:25 |显示全部楼层
回复 4# renxiao2003


    rpm包用root安装的。

配置的时候在oracle用户下配置的。

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
发表于 2011-07-28 15:59 |显示全部楼层
没错。普通用户一半安装不了rpm
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP