Tutorial: Oracle 11g OCP path (6): Database Start and Stop

Source: Internet
Author: User
Preface
If we have some experience in starting and stopping databases, we always think that there is only one command. However, I have seen a book with more than 100 pages dedicated to the operation process after the command. Let's just talk a little bit.
Start
Database startup in our eyes.
Detailed process. Images stolen from the Internet.
1. shutdown-> nomount
In this process, SQL plus starts the instance and changes the instance status to started. One thing we need to pay attention to is that during the startup nomount process, the database loads a file. Check spfile first.
In order to verify, the database will load this file and we will move this file away.
Why did we move spfileteid. ora and prompt that it is indeed initteid. ora? Why? Create this file first.
Let's move the spfile. Start
It is successfully started to nomount. That is to say, if one spfile or pfile exists, the instance can be started. What is the difference between the two? Spfile content:
Obviously non-plain text files with garbled characters. Pfile content:
Teid. _ db_cache_size = 171966464
Teid. _ java_pool_size = 4194304
Teid. _ large_pool_size = 4194304
Teid. _ oracle_base = 'f: \ Oracle '# ORACLE_BASE set from environment
Teid. _ pga_aggregate_target = 41943040
Teid. _ sga_target = 314572800
Teid. _ shared_io_pool_size = 0
Teid. _ shared_pool_size = 125829120
Teid. _ streams_pool_size = 0
*. Audit_file_dest = 'f: \ Oracle \ admin \ TEST \ adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = 'f: \ Oradata \ TEST \ control01.ctl ', 'f: \ Oracle \ flash_recovery_area \ TEST \ control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'test'
*. Db_recovery_file_dest = 'f: \ Oracle \ flash_recovery_area'
*. Db_recovery_file_dest_size = 5218762752
*. Diagnostic_dest = 'f: \ Oracle'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = TEIDXDB )'
*. Nls_language = 'simplified CHINESE'
*. Nls_territory = 'China'
*. Open_cursors = 300
*. Pga_aggregate_target = 41943040
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 314572800
*. Undo_tablespace = 'undotbs1'
Pfile is created based on spfile, which means the two have the same effect. To put it simply, dynamic parameters are directly written into spfile after modification, rather than manually modifying text documents like pfile. Modify spfile: the types of parameters include Database, system, and session. In fact, we need to understand static and dynamic parameters, which determine how to modify them.
Why is the above scenario. First, we must start with static and dynamic attributes. Static attributes cannot be modified directly. You need to restart the server after modification. You can directly modify the dynamic attributes without restarting the server. Let's talk about several scope values: spfile, memory, and both. It is not hard to understand that a modification to spfile takes effect in the memory, and the last one is to modify both of them at the same time (without parameters ). Static Parameters are first modified to spfile and then restarted to take effect. Dynamic parameters can take effect directly on both sides. CreatePfile FromSpfile;
CreatePfile FromMemory;

CreateSpfileFromPfile;
CreateSpfileFromMemory; To sum up, this process can be said that the system starts the database instance through pfile or spfile. 2. From shutdown to nomount, we use spfile or pfile. There is such a sentence in pfile. We can use this sentence to locate the control file.

*. Control_files = 'f: \ Oradata \ TEST \ control01.ctl ', 'f: \ Oracle \ flash_recovery_area \ TEST \ control02.ctl'
In this way, the Database is changed to the mount state. Let's talk about what happened in this process? To put it simply, load the control file. Let's talk about the role of control files. A. Database Name and database creation time B. names and locations of all data files and redo log files. C. tablespace information. D. offline data file information. E. Redo logs and archive log information. We only need to know a lot of information, which indicates what the information represents. If you can understand it, just let us know what it means. The transition of this state is mainly to load the control file. 3. mount-> open loads database files and log files based on the control file information to open the database.
Close
Close and remember several commands.
Shutdown

Normal: new connections are not allowed. Wait until the current session ends. Wait until the current transaction ends. Force the checkpoint and close the file.

Shutdown transational

Transactional: new connections are not allowed; the current session is not waiting; the current transaction is stopped; the checkpoint is forced and the file is closed.

Shutdown Immediate

Immediate: new connections are not allowed. The system does not wait until the current session ends. It does not wait until the current transaction ends. It forces the checkpoint and closes the file.

Shutdown Abort

Abort: new connections are not allowed; the current session is not waiting; the current transaction is not finished; the check point is not forced and the file is closed.

Conclusion
You need to know several statuses and the relationship between several files, especially spfile and pfile. And parameter settings to control the role of files. Close the last two commands. Finally, I will provide a very detailed article. Oracle database instance startup closing process: http://blog.csdn.net/robinson_0612/article/details/5542983
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.