The concept of database and instance in oracle

 

What is a database is actually very simple, a database is a medium for storing data. For example, a commonly used file is one type. In Oracle10G, there are several types of data storage. The first is the file format, which is to create a batch of files on your disk and store information in those files. The second is the disk array form. What does this mean? This means that the database is not stored as a file, but one or more disks are formatted into an Oracle format, which means that the entire disk is used to store the Oracle database. , cannot be used for other purposes. The advantage of this is that the storage performance is high, because no other file formats are used, but the entire disk becomes the most suitable file system format for Oracle. Of course, there may be other forms, such as the Internet or something. However, the most commonly used is the file format. In the file format, the database refers to a series of files such as data files, control files, and REDO files.

    And what is Instance, Instance actually refers to a series of processes in the operating system and the memory blocks allocated for these processes. In Oracle, we can create a new Oracle Instance. At this time, although there are processes and a series of memory devices such as SGA, the database files are not read in at this time. So it's just an instance. Later, you can manually or automatically load the database file into our database instance through commands, and the database at this time can allow us to actually start access operations.

    Therefore, if the application of the database is to be realized, the database and the database instance are indispensable. If there are only those files of the database, then it can only represent the data in this file, but we cannot operate it directly. If there is only a database instance, then although we can operate urgently, we do not know which data to operate, and the data generated by the operation cannot be saved, and so on. Therefore, when an Oracle Instance actually loads an Oracle Database, the database can be used by us.

    One thing to note here is that after the Oracle instance is started, the database can only be loaded once. If you want to disconnect the database from the Instance, and then re-attach it to a database Instance, you need to end the database Instance process first. Then re-establish a process of this instance, and then load another database. Otherwise, the ORA-16169 error must be thrown out, saying that the database has been opened. Because a database Instance can only load and open at most one instance during its lifetime.

 


The following is a detailed explanation of the instance and database:

There are two words in the Oracle field that are easily confused, which are "instance" and "database". As Oracle terms, these two terms are defined as follows:

 Database: A collection of physical operating system files or disks. When using Oracle 10g's Automatic Storage Management (ASM) or RAW partitions, the database may not be a separate file in the operating system, but the definition remains the same.

 Instance (instance): A set of Oracle background processes/threads and a shared memory area shared by threads/processes running on the same computer. Volatile, non-persistent content can be maintained here (some can flush output to disk). A database instance can exist even without disk storage. Instances may not be the most useful thing in the world, but you can think of them as the most useful thing, which helps to draw the line between instances and databases.

The two terms are sometimes used interchangeably, but they have completely different concepts. The relationship between an instance and a database is that a database can be loaded and opened by multiple instances, and an instance can load and open a database at any point in time. In fact, an instance can mount and open at most one database during its entire lifetime, to be precise! An example of this will be presented later.

Are you more confused? We'll explain further, which should help you understand these concepts. An instance is a set of operating system processes (or a multithreaded process) and some memory. These processes can operate on the database; the database is just a collection of files (including data files, temporary files, redo log files, and control files). An instance can only have one set of related files (associated with one database) at any one time. In most cases, the reverse is also true: only one instance on a database operates on it. The exception, however, is Oracle's Real Application Clusters (RAC), an option provided by Oracle that allows operation on multiple machines in a clustered environment, so that multiple instances can be mounted and one open at the same time. Database (on a set of shared physical disks). From this, we can access this database from many different computers at the same time. Oracle RAC supports highly available systems and can be used to build extremely scalable solutions.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326076881&siteId=291194637