Oracle instant client sqlplus linux

Содержание
  1. D SQL*Plus Instant Client
  2. Choosing the SQL*Plus Instant Client to Install
  3. Basic Instant Client
  4. Lightweight Instant Client
  5. Lightweight SQL*Plus Instant Client Error with Unsupported Character Set
  6. Installing SQL*Plus Instant Client by Downloading from OTN
  7. Installing SQL*Plus Instant Client from Linux RPM Packages
  8. Installing SQL*Plus Instant Client from the UNIX or Windows Zip Files
  9. List of Files Required for SQL*Plus Instant Client
  10. Installing SQL*Plus Instant Client from the 12 c Client Release Media
  11. Installing SQL*Plus Instant Client on UNIX or Linux
  12. Installing SQL*Plus Instant Client on Windows
  13. Configuring SQL*Plus Instant Client
  14. Configuring SQL*Plus Instant Client on Linux (from RPMs)
  15. Configuring SQL*Plus Instant Client on Linux (from Client Media or Zip File) and UNIX
  16. Configuring SQL*Plus Instant Client on Windows
  17. Connecting to a Database with SQL*Plus Instant Client
  18. AS SYSDBA or AS SYSOPER Connections with SQL*Plus Instant Client
  19. Uninstalling Instant Client
  20. Uninstalling SQL*Plus Instant Client
  21. Oracle instant client sqlplus linux
  22. D.1 About Choosing the SQL*Plus Instant Client to Install
  23. D.1.1 Basic Instant Client
  24. D.1.2 Lightweight Instant Client
  25. D.2 About Installing SQL*Plus Instant Client by Downloading from OTN
  26. D.2.1 Installing SQL*Plus Instant Client from Linux RPM Packages
  27. D.2.2 Installing SQL*Plus Instant Client from the UNIX or Windows Zip Files
  28. D.2.3 List of Files Required for SQL*Plus Instant Client
  29. D.3 Installing SQL*Plus Instant Client from the 12 c Client Release Media
  30. D.3.1 Installing SQL*Plus Instant Client on UNIX or Linux
  31. D.3.2 Installing SQL*Plus Instant Client on Windows
  32. D.4 About Configuring SQL*Plus Instant Client
  33. D.4.1 Configuring SQL*Plus Instant Client on Linux (from RPMs)
  34. D.4.2 Configuring SQL*Plus Instant Client on Linux (from Client Media or Zip File) and UNIX
  35. D.4.3 Configuring SQL*Plus Instant Client on Windows
  36. D.5 About Connecting to a Database with SQL*Plus Instant Client
  37. D.6 AS SYSDBA or AS SYSOPER Connections with SQL*Plus Instant Client
  38. D.7 About Uninstalling Instant Client
  39. D.7.1 Uninstalling SQL*Plus Instant Client

D SQL*Plus Instant Client

SQL*Plus Instant Client is a standalone product with all the functionality of SQL*Plus command-line. It connects to existing remote Oracle databases, but does not include its own database. It is easy to install and uses significantly less disk space than the full Oracle Database Client installation required to use SQL*Plus command-line.

SQL*Plus Instant Client is available on platforms that support the OCI Instant Client. See the Oracle Call Interface Programmer’s Guide for more information on the OCI Instant Client.

To install SQL*Plus Instant Client, you need two packages:

SQL*Plus Instant Client package.

Either the Basic OCI Instant Client package, or the lightweight OCI Instant Client package.

Choosing the SQL*Plus Instant Client to Install

SQL*Plus Instant Client can be installed in two ways:

Download the packages from the Oracle Technology Network (OTN).

Copy the same files that are in the packages from an Oracle Database 12 c Client Administrator installation.

Both the SQL*Plus and OCI packages must be from the same Oracle Database version, for example, 12.1.0.0.0.

Basic Instant Client

SQL*Plus Instant Client using the Basic OCI package works with any NLS_LANG setting supported by the Oracle Database. It supports all character sets and language settings available in the Oracle Database.

Lightweight Instant Client

SQL*Plus Instant Client using the lightweight OCI package displays error messages in English only and supports only specific character sets. It is significantly smaller than SQL*Plus Instant Client using the Basic OCI package.

Valid values for NLS_LANG parameters with the lightweight Instant Client are:

language can be any valid language supported by the Oracle Database, however, error messages are only reported in English.

territory can be any valid territory supported by the Oracle Database.

charset is one of the following character sets:

Lightweight SQL*Plus Instant Client Error with Unsupported Character Set

Attempting to start SQL*Plus Instant Client with an unsupported character set will fail with the following error:

Installing SQL*Plus Instant Client by Downloading from OTN

The OTN downloads for Linux are RPM packages. The OTN downloads for UNIX and Windows are zip files.

The SQL*Plus Instant Client package should never be installed on an ORACLE_HOME.

Installing SQL*Plus Instant Client from Linux RPM Packages

Download the RPM packages containing the SQL*Plus Instant Client package, and the OCI package from the OTN Instant Client page at http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html . Both packages must be from the same version such as 12.1.0.0.0.

Use rpm -i for the initial install of the RPM packages, or rpm -u to upgrade to a newer version of the packages.

Installing SQL*Plus Instant Client from the UNIX or Windows Zip Files

Download the zip files containing the SQL*Plus Instant Client package, and the OCI package from the OTN Instant Client page at http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html . Both packages must be from the same version such as 12.1.0.0.0.

Create a new directory, for example, /home/instantclient12_1 on UNIX or c:\instantclient12_1 on Windows.

Unzip the two packages into the new directory.

List of Files Required for SQL*Plus Instant Client

Tables E-1, E-2 and E-3 list the required files from each of the SQL*Plus and OCI packages. The files from only one of the OCI packages are required. Other files installed that are not listed here can be ignored, or can be removed to save disk space.

Table D-1 Instant Client Files in the SQL*Plus Package

SQL*Plus data shared library

Table D-2 Instant Client Files in the Basic OCI Package

Linux and UNIX Windows Description

Client code library

OCI Instant Client data shared Library

OCI Instant Client data shared library

Table D-3 Instant Client Files in the Lightweight OCI Package

Linux and UNIX Windows Description

Client code library

OCI Instant Client data shared library (English only)

Installing SQL*Plus Instant Client from the 12 c Client Release Media

Run the installer on the Oracle Database 12 c Client Release media and choose the Administrator option.

Create a new directory, for example, /home/instantclient12_1 on UNIX and Linux, or c:\instantclient12_1 on Windows.

Copy the SQL*Plus Instant Client and the OCI Instant Client files to the new directory. All files must be copied from the same ORACLE_HOME.

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:

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

Installing SQL*Plus Instant Client on Windows

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

To install SQL*Plus Instant Client using the lightweight OCI package on Windows, copy the following files:

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:

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:

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 12.1.0.1, /usr/bin/sqlplus is a symbolic link to the SQL*Plus binary at /usr/lib/oracle/12.1.0.1/client/bin/sqlplus .

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.

Configuring SQL*Plus Instant Client on Linux (from Client Media or Zip File) and UNIX

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:

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:

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.

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.

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:\instantclient12_1 to the beginning of PATH.

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:

Alternatively you can use a Net Service Name:

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 12 c . See the Oracle Database Net Services Reference for more information.

If you want to use Net Service Names configured in a local Oracle Net tnsnames.ora file, then set the environment variable TNS_ADMIN to the directory containing the tnsnames.ora file. For example, on UNIX, if your tnsnames.ora file is in /home/user1 and it defines the Net Service Name MYDB2:

If TNS_ADMIN is not set, then an operating system dependent set of directories is examined to find tnsnames.ora . This search path includes looking in the directory specified by the ORACLE_HOME environment variable for network/admin/tnsnames.ora . This is the only reason to set the ORACLE_HOME environment variable for SQL*Plus Instant Client. If ORACLE_HOME is set when running Instant Client applications, it must be set to a directory that exists.

This example assumes the ORACLE_HOME environment variable is set, and the $ORACLE_HOME/network/admin/tnsnames.ora or ORACLE_HOME\network\admin\tnsnames.ora file defines the Net Service Name MYDB3:

The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can be set to a connection identifier. This removes the need to explicitly enter the connection identifier whenever a connection is made in SQL*Plus or SQL*Plus Instant Client. This UNIX example connects to the database known as MYDB4:

On Windows, TNS_ADMIN and LOCAL may be set in the System Properties. See Configuring SQL*Plus Instant Client on Windows.

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:

See the Oracle Database Administrator’s Guide for information on Oracle password files.

Uninstalling Instant Client

The SQL*Plus Instant Client package can be removed separately from the OCI Instant Client. After uninstalling the SQL*Plus Instant Client package, the remaining OCI Instant Client libraries enable custom written OCI programs or third party database utilities to connect to a database.

Uninstalling SQL*Plus Instant Client

For installations on Linux from RPM packages, use rpm -e only on the SQL*Plus Instant Client package

For installations on UNIX and Windows, and installations on Linux from the Client Release media, manually remove the following SQL*Plus specific files:

Table D-4 Instant Client Files in the SQL*Plus Package

Источник

Oracle instant client sqlplus linux

SQL*Plus Instant Client is a standalone product with all the functionality of SQL*Plus command-line. It connects to existing remote Oracle databases, but does not include its own database. It is easy to install and uses significantly less disk space than the full Oracle Database Client installation required to use SQL*Plus command-line.

SQL*Plus Instant Client is available on platforms that support the OCI Instant Client. See About OCI Instant Client for more information on the OCI Instant Client.

To install SQL*Plus Instant Client, you need two packages:

SQL*Plus Instant Client package.

Either the Basic OCI Instant Client package, or the lightweight OCI Instant Client package.

D.1 About Choosing the SQL*Plus Instant Client to Install

SQL*Plus Instant Client can be installed in two ways:

Download the packages from the Oracle Technology Network (OTN).

Copy the same files that are in the packages from an Oracle Database 12 c Client Administrator installation.

Both the SQL*Plus and OCI packages must be from the same Oracle Database version, for example, 12.2.0.0.0.

D.1.1 Basic Instant Client

SQL*Plus Instant Client using the Basic OCI package works with any NLS_LANG setting supported by the Oracle Database. It supports all character sets and language settings available in the Oracle Database.

D.1.2 Lightweight Instant Client

SQL*Plus Instant Client using the lightweight OCI package displays error messages in English only and supports only specific character sets. It is significantly smaller than SQL*Plus Instant Client using the Basic OCI package.

Valid values for NLS_LANG parameters with the lightweight Instant Client are:

language can be any valid language supported by the Oracle Database, however, error messages are only reported in English.

territory can be any valid territory supported by the Oracle Database.

charset is one of the following character sets:

D.1.2.1 Lightweight SQL*Plus Instant Client Error with Unsupported Character Set

Attempting to start SQL*Plus Instant Client with an unsupported character set will fail with the following error:

D.2 About Installing SQL*Plus Instant Client by Downloading from OTN

The OTN downloads for Linux are RPM packages. The OTN downloads for UNIX and Windows are zip files.

The SQL*Plus Instant Client package should never be installed on an ORACLE_HOME.

D.2.1 Installing SQL*Plus Instant Client from Linux RPM Packages

  1. Download the RPM packages containing the SQL*Plus Instant Client package, and the OCI package from the OTN Instant Client page at http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html . Both packages must be from the same version such as 12.2.0.0.0.

D.2.2 Installing SQL*Plus Instant Client from the UNIX or Windows Zip Files

  1. Download the zip files containing the SQL*Plus Instant Client package, and the OCI package from the OTN Instant Client page at http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html . Both packages must be from the same version such as 12.2.0.0.0.

D.2.3 List of Files Required for SQL*Plus Instant Client

Tables E-1, E-2 and E-3 list the required files from each of the SQL*Plus and OCI packages. The files from only one of the OCI packages are required. Other files installed that are not listed here can be ignored, or can be removed to save disk space.

Table D-1 Instant Client Files in the SQL*Plus Package

Linux and UNIX Windows Description

SQL*Plus data shared library

Table D-2 Instant Client Files in the Basic OCI Package

Linux and UNIX Windows Description

Client code library

OCI Instant Client data shared Library

OCI Instant Client data shared library

Table D-3 Instant Client Files in the Lightweight OCI Package

Linux and UNIX Windows Description

Client code library

OCI Instant Client data shared library (English only)

D.3 Installing SQL*Plus Instant Client from the 12 c Client Release Media

  1. Run the installer on the Oracle Database 12 c Client Release media and choose the Administrator option.

D.3.1 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:

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

D.3.2 Installing SQL*Plus Instant Client on Windows

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

To install SQL*Plus Instant Client using the lightweight OCI package on Windows, copy the following files:

D.4 About 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.

D.4.1 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:

For example, to set PATH in the bash shell:

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 12.2.0.1, /usr/bin/sqlplus is a symbolic link to the SQL*Plus binary at /usr/lib/oracle/12.1.0.1/client/bin/sqlplus .

D.4.2 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:

D.4.3 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:\instantclient12_2 to the beginning of PATH.

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

D.5 About 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:

Alternatively you can use a Net Service Name:

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 12 c . See Local Naming Parameters in the tnsnames.ora Filefor more information.

If you want to use Net Service Names configured in a local Oracle Net tnsnames.ora file, then set the environment variable TNS_ADMIN to the directory containing the tnsnames.ora file. For example, on UNIX, if your tnsnames.ora file is in /home/user1 and it defines the Net Service Name MYDB2:

If TNS_ADMIN is not set, then an operating system dependent set of directories is examined to find tnsnames.ora . This search path includes looking in the directory specified by the ORACLE_HOME environment variable for network/admin/tnsnames.ora . This is the only reason to set the ORACLE_HOME environment variable for SQL*Plus Instant Client. If ORACLE_HOME is set when running Instant Client applications, it must be set to a directory that exists.

This example assumes the ORACLE_HOME environment variable is set, and the $ORACLE_HOME/network/admin/tnsnames.ora or ORACLE_HOME\network\admin\tnsnames.ora file defines the Net Service Name MYDB3:

The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can be set to a connection identifier. This removes the need to explicitly enter the connection identifier whenever a connection is made in SQL*Plus or SQL*Plus Instant Client. This UNIX example connects to the database known as MYDB4:

On Windows, TNS_ADMIN and LOCAL may be set in the System Properties. See Configuring SQL*Plus Instant Client on Windows.

D.6 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:

See Using Password File Authenticationfor information on Oracle password files.

D.7 About Uninstalling Instant Client

The SQL*Plus Instant Client package can be removed separately from the OCI Instant Client. After uninstalling the SQL*Plus Instant Client package, the remaining OCI Instant Client libraries enable custom written OCI programs or third party database utilities to connect to a database.

D.7.1 Uninstalling SQL*Plus Instant Client

  1. For installations on Linux from RPM packages, use rpm -e only on the SQL*Plus Instant Client package

For installations on UNIX and Windows, and installations on Linux from the Client Release media, manually remove the following SQL*Plus specific files:

Table D-4 Instant Client Files in the SQL*Plus Package

Источник

Читайте также:  Xerox workcentre 3210 прошивка картриджа
Поделиться с друзьями
КомпСовет
Adblock
detector
Linux and UNIX Windows Description