search
HomeDatabaseMysql Tutorialoracle如何配置多个数据库

oracle如何配置多个数据库

Jun 07, 2016 pm 04:20 PM
oracleMultiplehowdatabaseConfiguration

Oracle中可以配多个数据库,并只需要开启一个侦听器就可以了,对多个数据库只要配置相应的服务命名就可以连接了。 我用的是Oracle 8.1.7 Enterprise Edition,OS是Windows 2000 Server,我把我的配置过程和情况图解说明一下,和大家共同探讨。 第一步:用Net

  Oracle中可以配多个数据库,并只需要开启一个侦听器就可以了,对多个数据库只要配置相应的服务命名就可以连接了。

  我用的是Oracle 8.1.7 Enterprise Edition,OS是Windows 2000 Server,我把我的配置过程和情况图解说明一下,和大家共同探讨。

oracle如何配置多个数据库

  第一步:用Net8 Configuration Assistant工具配置监听器,一直点下一步,最后完成即可!监听地址一般配成默认的1521就可以了。

  也可以用Net8 Assistant工具来验证或配置监听器,如下图,可以配置主机和端口。

oracle如何配置多个数据库

  第二步:用Net8 Assistant工具来配置命名服务,如下图:

  注意服务名是数据库名,主机名和端口号一定要和监听器的一样!

oracle如何配置多个数据库

  测试一下,连接成功,OK!

oracle如何配置多个数据库

  好,再配第二个库的服务命名,如下图:

  注意服务名要对应到第二个数据库名!

oracle如何配置多个数据库

  再测试一下第二个库的连接,连接成功,OK!

oracle如何配置多个数据库

  最后有几点注意:

  1.对一般如果有多个应用程序用Oracle的数据库,一般只需要建立一个数据库就可以了,对不同的应用设立不同的用户(不同的表空间)就可以了。

  2.如果多个应用程序的字符集不一样,如既有BIG5又有GB2312,那一般就需要考虑配置多个服务器,或者建立多个数据库,或者转换到UTF-8之类的字符集。

  3.如果开发需要装多个版本的Oracle,如同时安装Oracle9i和Oracle8.1.7,则需要配置各自的监听端口,环境变量没有什么需要配置的,不会冲突;注册表都放在HKEY_LOCAL_MACHINESOFTWAREORACLE下,但是会分HOME0~HOME...不同的Key中存放,所以也不会有冲突。

  4.配置命名服务和监听器还可以直接编辑如下2个文件:

  监听器:$ORACLE_HOME$ etworkADMINlistener.ora,一般文件如下:

  # LISTENER.ORA Network Configuration File: D:DATABASEOracle81 etworkadminlistener.ora

  # Generated by Oracle configuration tools.

  LISTENER =

  (DESCRIPTION_LIST =

  (DESCRIPTION =

  (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = HARRY)(PORT = 1521))

  )

  )

  )

  SID_LIST_LISTENER =

  (SID_LIST =

  (SID_DESC =

  (SID_NAME = PLSExtProc)

  (ORACLE_HOME = D:DATABASEOracle81)

  (PROGRAM = extproc)

  )

  (SID_DESC =

  (GLOBAL_DBNAME = ORASUN)

  (ORACLE_HOME = D:DATABASEOracle81)

  (SID_NAME = ORASUN)

  )

  (SID_DESC =

  (GLOBAL_DBNAME = ORAGCE)

  (ORACLE_HOME = D:DATABASEOracle81)

  (SID_NAME = ORAGCE)

  )

  )

  服务命名:$ORACLE_HOME$ etworkADMIN nsnames.ora,一般文件如下:

  # TNSNAMES.ORA Network Configuration File: D:DATABASEOracle81NETWORKADMIN nsnames.ora

  # Generated by Oracle configuration tools.

  SMEST =

  (DESCRIPTION =

  (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

  )

  (CONNECT_DATA =

  (SERVICE_NAME = ORAGCE)

  )

  )

  SMEDI =

  (DESCRIPTION =

  (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

  )

  (CONNECT_DATA =

  (SERVICE_NAME = ORASUN)

  )

  )

  INST1_HTTP =

  (DESCRIPTION =

  (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

  )

  (CONNECT_DATA =

  (SERVER = SHARED)

  (SERVICE_NAME = ORAGCE)

  (PRESENTATION = )

  )

  )

  EXTPROC_CONNECTION_DATA =

  (DESCRIPTION =

  (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

  )

  (CONNECT_DATA =

  (SID = PLSExtProc)

  (PRESENTATION = RO)

  )

  )

  这2个文件在$ORACLE_HOME$ etworkADMINSAMPLE下有相应的范例文件,可以参考。

  监听器配置修改后,需要重新启动监听器的服务!!!

  再补充一点,配置多个侦听器或者一个侦听器侦听多个数据库的时候,对侦听器注意需要配置数据库服务。

  如图,一个侦听器侦听多个数据库,如下配置,数据库名和SID分别是ORASUN和ORAGCE,同样配多个侦听器侦听一个数据库(分别对内网和外网提供),,如果碰到连接问题,请大家检查一下数据库配置这一项,当然如果直接写文件来配置就很简单了,一下就可以搞定了,大家也可以对照我前面给出的配置文件看一下。

oracle如何配置多个数据库

Statement
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
When should you use a composite index versus multiple single-column indexes?When should you use a composite index versus multiple single-column indexes?Apr 11, 2025 am 12:06 AM

In database optimization, indexing strategies should be selected according to query requirements: 1. When the query involves multiple columns and the order of conditions is fixed, use composite indexes; 2. When the query involves multiple columns but the order of conditions is not fixed, use multiple single-column indexes. Composite indexes are suitable for optimizing multi-column queries, while single-column indexes are suitable for single-column queries.

How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)Apr 10, 2025 am 09:36 AM

To optimize MySQL slow query, slowquerylog and performance_schema need to be used: 1. Enable slowquerylog and set thresholds to record slow query; 2. Use performance_schema to analyze query execution details, find out performance bottlenecks and optimize.

MySQL and SQL: Essential Skills for DevelopersMySQL and SQL: Essential Skills for DevelopersApr 10, 2025 am 09:30 AM

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

Describe MySQL asynchronous master-slave replication process.Describe MySQL asynchronous master-slave replication process.Apr 10, 2025 am 09:30 AM

MySQL asynchronous master-slave replication enables data synchronization through binlog, improving read performance and high availability. 1) The master server record changes to binlog; 2) The slave server reads binlog through I/O threads; 3) The server SQL thread applies binlog to synchronize data.

MySQL: Simple Concepts for Easy LearningMySQL: Simple Concepts for Easy LearningApr 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.

MySQL: A User-Friendly Introduction to DatabasesMySQL: A User-Friendly Introduction to DatabasesApr 10, 2025 am 09:27 AM

The installation and basic operations of MySQL include: 1. Download and install MySQL, set the root user password; 2. Use SQL commands to create databases and tables, such as CREATEDATABASE and CREATETABLE; 3. Execute CRUD operations, use INSERT, SELECT, UPDATE, DELETE commands; 4. Create indexes and stored procedures to optimize performance and implement complex logic. With these steps, you can build and manage MySQL databases from scratch.

How does the InnoDB Buffer Pool work and why is it crucial for performance?How does the InnoDB Buffer Pool work and why is it crucial for performance?Apr 09, 2025 am 12:12 AM

InnoDBBufferPool improves the performance of MySQL databases by loading data and index pages into memory. 1) The data page is loaded into the BufferPool to reduce disk I/O. 2) Dirty pages are marked and refreshed to disk regularly. 3) LRU algorithm management data page elimination. 4) The read-out mechanism loads the possible data pages in advance.

MySQL: The Ease of Data Management for BeginnersMySQL: The Ease of Data Management for BeginnersApr 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

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser

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.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.