Home Database Mysql Tutorial Oracle中Instance实例和数据库的区别

Oracle中Instance实例和数据库的区别

Jun 07, 2016 pm 03:03 PM
oracle the difference Example database

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 Oracle中Instance实例和数据库的区别 什么是数据库,其实很简单,数据库就是存储数据的一种媒介。比如常用的文件就是一种,在Oracle10G中,数据的存储有好几种。第一种是文件形式,也就是在你的磁盘

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

    Oracle中Instance实例和数据库的区别

    什么是数据库,其实很简单,数据库就是存储数据的一种媒介。比如常用的文件就是一种,在Oracle10G中,数据的存储有好几种。第一种是文件形式,也就是在你的磁盘中创建一批文件,然后在这些文件中存储信息。第二种就是磁盘阵列形式,这个是什么意思呢,这个就是说明数据库不是存放为某个文件,而是把一个或者多个磁盘格式化成Oracle的一种格式了,等于整个磁盘就是存放Oracle数据库的,不能作为别的用途。

    这样的优点是存储性能高,因为不再借助别的文件格式了,而是把整个磁盘都成为Oracle最适应的文件系统格式。当然还可能有别的形式,比如网络什么的。不过我们最常用的还是文件格式的,在文件格式中,数据库指的就是那些数据文件,控制文件以及REDO文件等等一系列文件。

    而什么是Instance呢,Instance其实就是指的操作系统中一系列的进程以及为这些进程所分配的内存块。在Oracle中,我们可以新建一个Oracle的Instance,这个时候虽然有了进程还有SGA等一系列的内存快,但是这个时候并没有把数据库文件读取进来。所以只是一个实例,在后来,你可以通过命令手动或者自动地把数据库文件加载进我们的数据库Instance中,这个时候的数据库才可以让我们真正的开始访问操作。

    www.2cto.com

    所以说,数据库的应用如果想实现,数据库和数据库Instance是缺一不可的,如果只有数据库的那些文件,那么,只能代表数据在这个文件中,但是我们无法直接进行操作。而如果只有数据库Instance,那么我们虽然可以急性操作,但是也不知道操作哪些数据,操作生成的数据也无法保存等等。所以,当一个Oracle Instance真正Load了一个Oracle Database了以后,数据库才可以被我们使用。

    在这里要注意一点的是,Oracle的实例在启动以后,只能load一次数据库,如果想把数据库与Instance断开,然后再重新挂在一个数据库Instance,那么就需要你首先把数据库Instance进程结束,然后重新建立这个instance的一个进程,再load另外一个数据库。否则肯定要抛除ORA-16169错误,说数据库已经被打开。因为一个数据库Instance在其生存期中最多只能load和打开一个instance。

    ORACLE实例 = 进程 + 进程所使用的内存(SGA)

    实例是一个临时性的东西,你也可以认为它代表了数据库某一时刻的状态!

    数据库 = 重做文件 + 控制文件 + 数据文件 + 临时文件

    数据库是永久的,是一个文件的集合。

    ORACLE实例和数据库之间的关系

    1.

    临时性和永久性

    2.

    实例可以在没有数据文件的情况下单独启动 startup nomount , 通常没什么意义

    3.

    一个实例在其生存期内只能装载(alter database mount)和打开(alter database open)一个数据库

    4.

    一个数据库可被许多实例同时装载和打开(即RAC),RAC环境中实例的作用能够得到充分的体现!

    下面对实例和数据库做详细的诠释:

    在Oracle领域中有两个词很容易混淆,这就是“实例”(instance)和“数据库”(database)。作为Oracle术语,这两个词的定义如下:

    q

    数据库(database):物理操作系统文件或磁盘(disk)的集合。使用Oracle 10g的自动存储管理(Automatic Storage Management,ASM)或RAW分区时,数据库可能不作为操作系统中单独的文件,但定义仍然不变。

    q

    实例(instance):一组Oracle后台进程/线程以及一个共享内存区,这些内存由同一个计算机上运行的线程/进程所共享。这里可以维护易失的、非持久性内容(有些可以刷新输出到磁盘)。就算没有磁盘存储,数据库实例也能存在。也许实例不能算是世界上最有用的事物,不过你完全可以把它想成是最有用的事物,这有助于对实例和数据库划清界线。

    这两个词有时可互换使用,不过二者的概念完全不同。实例和数据库之间的关系是:数据库可以由多个实例装载和打开,而实例可以在任何时间点装载和打开一个数据库。实际上,准确地讲,实例在其整个生存期中最多能装载和打开一个数据库!稍后就会介绍这样的一个例子。

    是不是更糊涂了?我们还会做进一步的解释,应该能帮助你搞清楚这些概念。实例就是一组操作系统进程(或者是一个多线程的进程)以及一些内存。这些进程可以操作数据库;而数据库只是一个文件集合(包括数据文件、临时文件、重做日志文件和控制文件)。在任何时刻,一个实例只能有一组相关的文件(与一个数据库关联)。大多数情况下,反过来也成立:一个数据库上只有一个实例对其进行操作。不过,Oracle的真正应用集群(Real Application Clusters,RAC)是一个例外,这是Oracle提供的一个选项,允许在集群环境中的多台计算机上操作,这样就可以有多台实例同时装载并打开一个数据库(位于一组共享物理磁盘上)。由此,我们可以同时从多台不同的计算机访问这个数据库。Oracle RAC能支持高度可用的系统,可用于构建可扩缩性极好的解决方案。

Oracle中Instance实例和数据库的区别

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
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 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
1671
14
PHP Tutorial
1276
29
C# Tutorial
1256
24
Difference between centos and ubuntu Difference between centos and ubuntu Apr 14, 2025 pm 09:09 PM

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

The difference between laravel and thinkphp The difference between laravel and thinkphp Apr 18, 2025 pm 01:09 PM

Laravel and ThinkPHP are both popular PHP frameworks and have their own advantages and disadvantages in development. This article will compare the two in depth, highlighting their architecture, features, and performance differences to help developers make informed choices based on their specific project needs.

How to view firewall status in centos How to view firewall status in centos Apr 14, 2025 pm 08:18 PM

The state of the CentOS firewall can be viewed through the sudo firewall-cmd --state command, returning to running or not running. For more detailed information, you can use sudo firewall-cmd --list-all to view, including configured areas, services, ports, etc. If firewall-cmd does not solve the problem, you can use sudo iptables -L -n to view iptables rules. Be sure to make a backup before modifying the firewall configuration to ensure server security.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

How to configure the database connection of weblogic on centos How to configure the database connection of weblogic on centos Apr 14, 2025 pm 02:06 PM

Configuring WebLogic database connection on a CentOS system requires the following steps: JDK installation and environment configuration: Make sure that the server has installed a JDK that is compatible with the WebLogic version (for example, WebLogic14.1.1 usually requires JDK8). Correctly set JAVA_HOME, CLASSPATH and PATH environment variables. WebLogic installation and decompression: Download the WebLogic installation package for CentOS system from the official Oracle website and unzip it to the specified directory. WebLogic user and directory creation: Create a dedicated WebLogic user account and set a security password

See all articles