Oracle中的实例和数据库概念
来源:互联网 发布:淘宝充值流量怎么查询 编辑:程序博客网 时间:2024/05/18 01:57
在Oracle中,数据库用来描述存储信息的物理文件,包括数据文件、控制文件以及重做日志(Redo-log)。
实例是内存结构和与数据库交互的多个进程。
Oracle Server启动经过3个步骤:
第一步,内存结构被建立、相关进程启动;
第二步,挂载数据库;
第三步,开放数据库为用户提供访问。
如果只启动实例不访问数据库可以使用“STARTUP NOMOUNT”参数。
原文:http://webcache.googleusercontent.com/search?q=cache:07l5aoU1M6UJ:www.devx.com/dbzone/Article/20713+instance+definition+database&cd=3&hl=zh-CN&ct=clnk
Database programs, with few exceptions, need to utilize both the computer's memory and permanent storage space such as the hard drive to operate. The drives provide both long-term storage and the necessary room for millions of records and gigabytes worth of information. However, accessing information from disks is much slower than retrieving the same information from memory. Therefore,database engines use memory to cache information, which speeds its retrieval.
The complexity of how the information is stored and where it is retrieved from is hidden from the casual user who queries thedatabase. But if you plan on administering Oracle, you need to become familiar with how Oracle handles both resources. In this article, I discuss two basic but important concepts with regard to memory and disk: thedatabase and theinstance.
The Database
In Oracle, a database is used to describe the physical files used to store information. There are three types of physical files:
- Data files store—you guessed it—all the data that caused us to get adatabase engine to begin with.
- Control files store metadata about the rest of the database for use by the Oracle engine.
- Redo-log files are used to record all changes made to the data for use in backup and recovery.
SQL Server uses the term database very differently. It's used to define a collection of objects such as tables. Each of these collections is stored in a separate set of files. One SQL Server installation typically contains many databases. In fact, the SQL Server installation process itself creates four databases.
Understanding how each vendor uses the term is critical to understanding the literature written about each of the products.
The Instance
Database files themselves are useless without the memory structures and processes to interact with thedatabase. Oracle defines the terminstance as the memory structure and the background processes used to access data from adatabase.
An instance has two major memory structures:
- The System Global Area, also known as the Shared Global Area (SGA) stores information in memory that is shared by the various processes in Oracle.
- The Program Global Area, also known as the Private Global Area (PGA) contains information that is private to a particular process.
In the SQL Server world, it has not been till the 2000 version that the word instance has had any practical significance. Up to that point, you could only have one installation of SQL Server on a machine. With the 2000 version, you can actually have many "instances" of SQL Server running at once. In the SQL Server world, aninstance refers to both the memory and files used by that particular installation.
More Than Just a Name
Other than providing yet more acronyms to remember, is there any practical implication to the distinction between the disk files and memory in Oracle? The answer is a resounding yes. Let's look at a couple of Oracle features that illustrate this.
Oracle Parallel Server A single machine can contain only so many CPUs and so much memory. The separation between the memory structures and data files allows Oracle to scale beyond a single machine by allowing multiple instances—that is, multiple separate Oracle memory structures—on different machines to access the samedatabase.
My understanding is that the configuration and use of Parallel Server is rather complicated. Additionally, single Oracle boxes (especially on Unix) can scale quite high with numerous CPUs and large amounts of memory. You may never need this feature, but it does illustrate one practical outcome of the division between the database and the instance.
Starting Oracle Server The division between the instance and the database can be seen by the various steps for starting Oracle. The first step is when theinstance itself is started. Memory in the computer is allocated and the various background processes are started. The second step is when theinstance then "mounts" thedatabase—i.e., accesses thedatabase files themselves. The last step is opening thedatabase for access by users.
Although you normally make Oracle go through all three steps when starting, it is possible and sometimes necessary to make Oracle stop at a particular stage in the process. Let's look at some of the syntax involved. Use SQL*Plus to log in to Oracle and try these commands if you like. (Assuming Oracle has already started, you can issue the shutdown command to first shut Oracle down.)
STARTUP or STARTUP OPEN tells Oracle to go through all three stages of the startup process. If you want Oracle only to start up theinstance, you can instead issue a STARTUP NOMOUNT instead. Oracle will start theinstance but not touch any of thedatabase files yet.
Why would you want to do this? Well, let's say you were creating new control files (the files used to store the metadata about the rest of thedatabase) or a whole newdatabase. Such operations need to occur before thedatabase is accessed. You can also issue a STARTUP MOUNT (or if you've previously issued a STARTUP NOMOUNT you can issue an ALTERDATABASE MOUNT) to tell Oracle to mount thedatabase files. In this condition, theinstance itself has access to all the information regarding thedatabase. However, it is not yet accessible to users. One example of an operation that must be done in this state is renaming the files used by the SYSTEM tablespace. Once you've finished your changes you can issue the ALTERDATABASE OPEN command to make thedatabase accessible to the public.
As I said, in Oracle an instance refers to the memory and background processes. Adatabase refers to the physical files that store the data. Both are needed to provide the user with the information he or she needs. But Oracle allows (and in some cases requires) you to deal with both parts separately.
- Oracle中的实例和数据库概念
- oracle概念:实例和数据库
- Oracle 概念(3)-数据库和实例
- oracle中的数据库和数据库实例
- ORACLE中的数据库、服务名、实例的概念
- 关于oracle的几个概念:数据库、实例、用户名和密码
- Oracle数据库中的特权和角色概念解析
- 随笔“ORACLE数据库中的实例(instance)和数据库(database)区别”
- oracle 实例与数据库的概念
- Oracle单实例数据库基础概念
- Oracle实例和数据库
- Oracle数据库和实例
- oracle 10g中的几个概念(表空间,数据库名,实例名,操作系统环境变量SID)
- Oracle 实例和 Oracle 数据库
- oracle数据库和数据库实例
- Oracle 数据库和数据库实例
- Oracle中的Instance实例和数据库的区别
- 如何理解oracle实例(instance)和数据库(database)的概念
- Android: 第三方jar打包进APK
- PHPExcel表格生成
- 外部数据源驱动QTP运行
- C/C++中static关键字详解(转)
- org.hibernate.NonUniqueObjectException异常解决方法
- Oracle中的实例和数据库概念
- 温故知新-- 在webform(网页)中登陆,写出登陆的存储过程usp_Login,并使用
- c++标准模板库容器分类
- url中传递中文乱码解决方案
- Java 枚举7常见种用法
- Android WebView使用总结
- maven项目开发能用到的所有知识点总结
- Linux - Yum Install GCC - Missing Kernel-headers
- public final void wait (long millis)的解释