Home Database Mysql Tutorial Oracle Instanc Client安装命令工具

Oracle Instanc Client安装命令工具

Jun 07, 2016 pm 04:45 PM

前提条件 1.Linux RHEL 6.X X86_64操作系统 2.能从安装Oracle服务器的服务器上获取Oracle相关的文件(相同OS) 软件下载 从Orac

前提条件

1.Linux RHEL 6.X X86_64操作系统

2.能从安装Oracle服务器的服务器上获取Oracle相关的文件(相同OS)

软件下载

 从Oracle的网址下载下面的软件包:

1)  instantclient-basic-linux.x64-11.2.0.4.0.zip (59.282MB)

2)instantclient-sqlplus-linux.x64-11.2.0.4.0.zip(815KB)

3)instantclient-sdk-linux.x64-11.2.0.4.0.zip(629KB)

4)instantclient-jdbc-linux.x64-11.2.0.4.0.zip(1.572MB)

Oracle软件包的下载网址如下:

配置过程

 配置过程关键是环境变量的配置,请根据自己实际情况进行配置。

配置SQLPLUS

1.使用root用户登录,创建目录:mkdir -p /opt/oracle

2.将所有的软件包解压到/opt/oracle目录下:

# unzp instantclient-basic-linux.x64-11.2.0.4.0.zip-d /opt/oracle

注:所有文件将自动解压到/opt/oracle/instantclient_11_2目录下。

3.创建配置文件a

#vi /opt/oracle/instantclie_11_2/tnsnames.ora

CZJGBS =

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = 81.17.1.23)(PORT = 1521)) //需要连接的IP

   (CONNECT_DATA =

     (SERVER = DEDICATED)

     (SERVICE_NAME = czjgbs) //需要连接的实例

    )

  )

 

EXTPROC_CONNECTION_DATA =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

    )

   (CONNECT_DATA =

     (SID = PLSExtProc)

     (PRESENTATION = RO)

    )

  )

在需要使用Oracle功能的测试用户环境变量中添加如下配置:

# vi ~/.bashrc

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export ORACLE_HOME=/opt/oracle/instantclient_11_2

export TNS_ADMIN=$ORACLE_HOME

export PATH=$PATH:$HOME/bin:$ORACLE_HOME

export LD_LIBRARY_PATH=$ORACLE_HOME:/usr/lib

export ORACLE_SID=czjgbs           // (需要连接的实例名称)

注:TNS_ADMIN环境变量用于指定tnsnames.ora文件所在路径。

      #source ~/.bashrc

测试sqlplus命令:

$ sqlplus scott/tiger@ora215

SQL*Plus: Release 10.2.0.4.0 - Productionon 星期五 8月 3 10:41:44 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

 

Oracle Database 10g Enterprise EditionRelease 10.2.0.4.0 - 64bit Production

With the Partitioning, Real ApplicationClusters, OLAP, Data Mining

and Real Application Testing options

SQL>

配置tnsping

      回到root用户,在其它Oracle机器上获取必要的文件。

# cd /opt/oracle/instantclient_11_2/

# scp root@192.168.21.16:/oracle/orahome/product/11.2.0/bin/tnsping./

上面的命令是从其他安装Oracle服务器的服务器上拷贝文件过来。

# mkdir -p network/mesg

# cd network/mesg

# scp root@192.168.21.16:/oracle/orahome/product/11.2.0/network/mesg/tnsus.msb./

 测试tnsping工具:

      $tnsping ora16

配置SQLLDR

      Oracle的InstantClient自带没有sqlldr巩固,也需要从Oracle服务器上获取相关文件。

      使用root用户登录:

# cd /opt/oracle/instantclient_11_2/

# scproot@192.168.21.16:/oracle/orahome/product/11.2.0/bin/sqlldr ./

# mkdir -p rdbms/mesg/

# cd rdbms/mesg/

# scp root@192.168.21.16:/oracle/orahome/product/11.2.0/rdbms/mesg/ulus.msb./

      测试用户中运行sqlldr:

      $sqlldr

配置IMP/EXP

      使用root用户登录,从Oracle服务器上拷贝相关的文件过来。

# cd /opt/oracle/instantclient_11_2/

# scp 192.168.21.16:/oracle/orahome/product/11.2.0/bin/imp./

# scp192.168.21.16:/oracle/orahome/product/11.2.0/bin/exp ./

# cd rdbms/mesg/

# scp192.168.21.16:/oracle/orahome/product/11.2.0/rdbms/mesg/impus.msb ./

# scp 192.168.21.16:/oracle/orahome/product/10.2.0/rdbms/mesg/expus.msb./

 

附录

 

在Linux系统中安装Oracle客户端InstantClient,但是它缺少SQL*Loader、EXP等工具,本文描述如何安装这些命令工具。

直接从相同版本的数据库服务器的安装路径中拷贝sqlldr可执行文件过来,执行sqlldr会报如下错误:

Message 2100 notfound; No message file for product=RDBMS, facility=ULMessage 2100 not found; Nomessage file for product=RDBMS, facility=UL[etl@m1 instantclient_10_2]$^C

实际上,Instant Client安装sqlldr也只能使用拷贝文件的方式。报上面的错误是因为你还需要拷贝下面这些信息文件过来。

首先,从Oracle数据库服务器上找到$ORACLE_HOME/network/mesg下的tnsus.msb文件,,以及$ORACLE_HOME/rdbms/mesg下的ulus.msb文件。

然后,把它们拷贝到InstantClient的安装目录中的相应目录下。例如:/usr/ocal/instantclient_10_2/[rdbms/mesg和network/mesg]。

现在你可以使用SQL*Loader工具了。

如何配置EXP和imp工具,如果只是拷贝可执行文件到对应的目录下,会报如下的错误:

Message 2100 notfound; No message file for product=RDBMS, facility=ULMessage 2100 not found; Nomessage file for product=RDBMS, facility=UL[etl@m1 instantclient_10_2]

此时,你需要从Oracle数据库服务器的安装目录中找到rdbms/mesg下的expus.msb和impus.msb,然后拷贝到对应的目录中文件即可解决。

Oracle 单实例 从32位 迁移到 64位 方法 

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

Oracle RAC 11.2(12C)正确关闭顺序 

本文永久更新链接地址:

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Explain the role of InnoDB redo logs and undo logs. Explain the role of InnoDB redo logs and undo logs. Apr 15, 2025 am 12:16 AM

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL's Place: Databases and Programming MySQL's Place: Databases and Programming Apr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL: From Small Businesses to Large Enterprises MySQL: From Small Businesses to Large Enterprises Apr 13, 2025 am 12:17 AM

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

How does MySQL index cardinality affect query performance? How does MySQL index cardinality affect query performance? Apr 14, 2025 am 12:18 AM

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

See all articles