Oracle数据库启动时,经历了三个过程:(用命名如下)startup nomount;alter database mount; alter database open;当然数据库关
Oracle数据库启动时,经历了三个过程:(用命名如下)
startup nomount;
alter database mount; alter database open;
当然数据库关闭时也是经历了三个相反的过程:
alter database close;
alter database dismount;
shutdown;(shutdown 后面跟了四个参数:normal;immediate;transactional;abort)
四种方式关闭数据库的比较:
(NO YES)
关闭方式 A I T N
允许新的连接 N N N N
等待活动会话终止 N N N Y
等待活动事务终止 N N
强制进行checkpoint,关闭所有文件 N Y Y Y
分析第一个过程startup nomount:
这个过程数据库首先到参数文件(pfile/spfile)中读取数据库的设置,创建实例.
数据库所在的操作系统版本:
[oracle@localhost ~]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Release: 5.5
Codename: Carthage
数据库版本:
SQL> SELECT * FROM v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
因为spfile是二进制文件,不能直接读取,在linux中,可以用命令String转储出来:
[oracle@localhost dbs]$ strings spfileorcl3939.ora
orcl3939.__db_cache_size=54525952
orcl3939.__java_pool_size=4194304
orcl3939.__large_pool_size=4194304
orcl3939.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl3939.__pga_aggregate_target=171966464
orcl3939.__sga_target=251658240
orcl3939.__shared_io_pool_size=0
orcl3939.__shared_pool_size=176160768
orcl3939.__streams_pool_size=4194304
*.audit_file_dest='/u01/app/oracle/admin/orcl3939/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/o
racle/oradata/orcl3939/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl3939/control02.ctl','/u01/app/oracle/oradata/orcl3939/control03.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='orcl3939'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orcl3939XDB)'
*.instance_name='ORCL3939'
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST = local
host.localdomain)(PORT = 1521))'
*.memory_target=423624704
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.service_names='a,b,c,d'
*.trace_enabled=TRUE
*.undo_tablespace='UNDOTBS1'
spfile文件中你可以看到数据库在nomount时做了些什么,根据参数文件的内容,创建了instance,分配了相应的内存区域,启动了相应的后台进程。
我们再看告警日志文件(alert_.log):读取了参数文件,启动了实例
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
Using parameter settings in server-side spfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl3939.ora
System parameters with non-default values:
processes = 150
memory_target = 404M
control_files = "/u01/app/oracle/oradata/orcl3939/control01.ctl"
control_files = "/u01/app/oracle/flash_recovery_area/orcl3939/control02.ctl"
control_files = "/u01/app/oracle/oradata/orcl3939/control03.ctl"
db_block_size = 8192
compatible = "11.2.0.0.0"
db_recovery_file_dest = "/u01/app/oracle/flash_recovery_area"
db_recovery_file_dest_size= 3852M
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = "localdomain"
instance_name = "ORCL3939"
service_names = "a,b,c,d"
dispatchers = "(PROTOCOL=TCP) (SERVICE=orcl3939XDB)"
local_listener = "(ADDRESS=(PROTOCOL=TCP)(HOST = localhost.localdomain)(PORT = 1521))"
audit_file_dest = "/u01/app/oracle/admin/orcl3939/adump"
audit_trail = "DB"
db_name = "orcl3939"
open_cursors = 300
diagnostic_dest = "/u01/app/oracle"
trace_enabled = TRUE
Thu Apr 02 14:59:41 2015
PMON started with pid=2, OS id=5989
Thu Apr 02 14:59:41 2015
VKTM started with pid=3, OS id=5991 at elevated priority
VKTM running at (10)millisec precision with DBRM quantum (100)ms
Thu Apr 02 14:59:41 2015
GEN0 started with pid=4, OS id=5995
Thu Apr 02 14:59:41 2015
DIAG started with pid=5, OS id=5997
Thu Apr 02 14:59:41 2015
DBRM started with pid=6, OS id=5999
Thu Apr 02 14:59:41 2015
PSP0 started with pid=7, OS id=6001
Thu Apr 02 14:59:41 2015
DIA0 started with pid=8, OS id=6003
Thu Apr 02 14:59:41 2015
MMAN started with pid=9, OS id=6005
Thu Apr 02 14:59:41 2015
DBW0 started with pid=10, OS id=6007
Thu Apr 02 14:59:41 2015
LGWR started with pid=11, OS id=6009
Thu Apr 02 14:59:41 2015
CKPT started with pid=12, OS id=6011
Thu Apr 02 14:59:41 2015
SMON started with pid=13, OS id=6013
Thu Apr 02 14:59:41 2015
RECO started with pid=14, OS id=6015
Thu Apr 02 14:59:41 2015
MMON started with pid=15, OS id=6017
Thu Apr 02 14:59:41 2015
MMNL started with pid=16, OS id=6019
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.

MySQL is not a programming language, but its query language SQL has the characteristics of a programming language: 1. SQL supports conditional judgment, loops and variable operations; 2. Through stored procedures, triggers and functions, users can perform complex logical operations in the database.

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is an open source relational database management system suitable for data storage, management, query and security. 1. It supports a variety of operating systems and is widely used in Web applications and other fields. 2. Through the client-server architecture and different storage engines, MySQL processes data efficiently. 3. Basic usage includes creating databases and tables, inserting, querying and updating data. 4. Advanced usage involves complex queries and stored procedures. 5. Common errors can be debugged through the EXPLAIN statement. 6. Performance optimization includes the rational use of indexes and optimized query statements.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

InnoDB's lock mechanisms include shared locks, exclusive locks, intention locks, record locks, gap locks and next key locks. 1. Shared lock allows transactions to read data without preventing other transactions from reading. 2. Exclusive lock prevents other transactions from reading and modifying data. 3. Intention lock optimizes lock efficiency. 4. Record lock lock index record. 5. Gap lock locks index recording gap. 6. The next key lock is a combination of record lock and gap lock to ensure data consistency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),