Home Database Mysql Tutorial Oracle连接远程数据库配置介绍

Oracle连接远程数据库配置介绍

Jun 07, 2016 pm 05:22 PM

Oracle数据库的远程连接可以通过多种方式来实现,本文我们主要介绍四种远程连接的方法和注意事项,并通过示例来说明,接下来我们

Oracle数据库的远程连接可以通过多种方式来实现,本文我们主要介绍四种远程连接的方法和注意事项,并通过示例来说明,接下来我们就开始介绍。

第一种情况:

若oracle服务器装在本机上,那就不多说了,连接只是用户名和密码的问题了。不过要注意环境变量%ORACLE_HOME%/network/admin/是否设置。

第二种情况:

本机未安装oracle服务器,也未安装oracle客户端。但是安装了pl sql development、toad sql development、sql navigator等管理数据库的工具。在虚拟机或者另一台电脑上安装了oracle服务器,也就是虚拟机或者另一台电脑此时作为服务器。

这种情况下,本人以pl sql development远程连接ORACLE服务端数据库为例:

1、在安装oracle服务器的机器上搜索下列文件:

oci.dll

ocijdbc10.dll

ociw32.dll

orannzsbb10.dll

oraocci10.dll

oraociei10.dll

sqlnet.ora

tnsnames.ora

classes12.jar

ojdbc14.jar

把这些找到的文件复制放到一个文件夹,如 oraclient,将此文件夹复制到客户端机器上。如放置路径为 D:oraclient。

2、配置tnsnames.ora,修改其中的数据库连接串。

oracledata =  (DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.58)(PORT = 1521))    (CONNECT_DATA =  (SERVICE_NAME = oracledata)    )

其中,oracledata是要连接的服务名;HOST = 192.168.0.58,是服务器IP地址;PORT = 1521是端口号。

3、添加第一个环境变量,名为TNS_ADMIN,值为tnsnames.ora文件所在路径(如:D:oraclient,特别是重装后或其它操作,忘了TNS_ADMIN变量,plsql登陆就会报无法解析指定的连接标识符),这是为了能够找到上面说的tnsnames.ora。这步是最重要的。

添加第二个环境变量(可有可无):“NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK”,(AMERICAN_AMERICA.US7ASCII 是ASCII编码类型,其它类型可自己到服务器看一下或网上查找一下)(本步骤暂时要做对,如果编码不对,,会产生乱码)。

4、下载并安装PL SQL Developer配置应用:

打开PL SQL Developer,登入界面点取消,进入后选择菜单栏 tools->preferences->connection :

Oracle Home=D:oracleclient  OCI library=D:oracleclientoci.dll

5、再次打开plsql则会在database中有oracledata 选项输入用户名密码就可以登陆。

第三种情况:

本机未安装ORACLE服务器,但是安装了oracle客户端,也安装了pl sql development、toad sql development、sql navigator等管理数据库的工具。在虚拟机或者另一台电脑上安装了oracle服务器,也就是虚拟机或者另一台电脑此时作为服务器。

这种情况下,本人以pl sql development远程连接oracle服务端数据库为例:

1、打开oracle客户端中的net manager,配置要远程连接的数据库名、IP地址等,如果net manager中没有要远程连接的数据库名,则新建即可。

2、其他步骤与第二种情况中的2---5相同。

第四种情况:

本机未安装oracle服务器,也未安装pl sql development、toad sql development、sql navigator等管理数据库的工具,但是安装了oracle客户端。在虚拟机或者另一台电脑上安装了ORACLE服务器,也就是虚拟机或者另一台电脑此时作为服务器。

这种情况下,本人以oracle客户端中的sqlplus远程连接oracle服务端数据库为例:

1、打开oracle客户端中的net manager,配置要远程连接的数据库名、IP地址等,如果net manager中没有要远程连接的数据库名,则新建即可。

2、同第二种情况中的步骤二。

3、同第二种情况中的步骤三。

4、打开sqlplus:

(1)如果用sys用户登入,则用户名:sys 密码:xxxxxx 主机字符串:要连接的数据库名 as sysdba,登入即可。

(2)如果用其他用户登入,则用户名:xxx 密码:xxxxxx 主机字符串:要连接的数据库名,登入即可。

注意事项:

1、服务器端和客户端防火墙需要关闭;

2、我们经常会遇到***服务无法启动,那么需要打开Net Configuration Assistant修复,或者新建***服务。

3、数据库密码如果忘了怎么办?按照以下方法修改密码即可:

开始-->运行-->cmd

输入 :sqlplus /nolog 回车

输入 :connect / as sysdba 回车

用户解锁 : alter user system account unlock 回车

修改密码:alter user system identified by manager

4、怎样判断数据库是运行在归档模式下还是运行在非归档模式下?

进入dbastudio,历程--〉数据库---〉归档查看。

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 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
1663
14
PHP Tutorial
1263
29
C# Tutorial
1236
24
When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

Laravel Eloquent ORM in Bangla partial model search) Laravel Eloquent ORM in Bangla partial model search) Apr 08, 2025 pm 02:06 PM

LaravelEloquent Model Retrieval: Easily obtaining database data EloquentORM provides a concise and easy-to-understand way to operate the database. This article will introduce various Eloquent model search techniques in detail to help you obtain data from the database efficiently. 1. Get all records. Use the all() method to get all records in the database table: useApp\Models\Post;$posts=Post::all(); This will return a collection. You can access data using foreach loop or other collection methods: foreach($postsas$post){echo$post->

RDS MySQL integration with Redshift zero ETL RDS MySQL integration with Redshift zero ETL Apr 08, 2025 pm 07:06 PM

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

MySQL: The Ease of Data Management for Beginners MySQL: The Ease of Data Management for Beginners Apr 09, 2025 am 12:07 AM

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

See all articles