前提条件 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软件包的下载网址如下:
配置过程配置过程关键是环境变量的配置,请根据自己实际情况进行配置。
配置SQLPLUS1.使用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
配置SQLLDROracle的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)正确关闭顺序
本文永久更新链接地址:

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.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

SQL commands in MySQL can be divided into categories such as DDL, DML, DQL, DCL, etc., and are used to create, modify, delete databases and tables, insert, update, delete data, and perform complex query operations. 1. Basic usage includes CREATETABLE creation table, INSERTINTO insert data, and SELECT query data. 2. Advanced usage involves JOIN for table joins, subqueries and GROUPBY for data aggregation. 3. Common errors such as syntax errors, data type mismatch and permission problems can be debugged through syntax checking, data type conversion and permission management. 4. Performance optimization suggestions include using indexes, avoiding full table scanning, optimizing JOIN operations and using transactions to ensure data consistency.

InnoDB achieves atomicity through undolog, consistency and isolation through locking mechanism and MVCC, and persistence through redolog. 1) Atomicity: Use undolog to record the original data to ensure that the transaction can be rolled back. 2) Consistency: Ensure the data consistency through row-level locking and MVCC. 3) Isolation: Supports multiple isolation levels, and REPEATABLEREAD is used by default. 4) Persistence: Use redolog to record modifications to ensure that data is saved for a long time.

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

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.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6
Visual web development tools