oracle启动,关闭过程
1,oracle启动过程
nomount(instance started) -> mount(database mounted) -> open(database opened)
SQL> startup ORACLE instance started. Total System Global Area 599785472 bytes Fixed Size 2022632 bytes Variable Size 121635608 bytes Database Buffers 473956352 bytes Redo Buffers 2170880 bytes Database mounted. Database opened.
启动数据库的后台日志:
Thu Nov 8 20:01:04 2012 Starting ORACLE instance (normal) --start instance LICENSE_MAX_SESSION = 0 LICENSE_SESSIONS_WARNING = 0 Picked latch-free SCN scheme 1 Using LOG_ARCHIVE_DEST_10 parameter default value as USE_DB_RECOVERY_FILE_DEST Autotune of undo retention is turned on. IMODE=BR ILAT =18 LICENSE_MAX_USERS = 0 SYS auditing is disabled ksdpec: called for event 13740 prior to event group initialization Starting up ORACLE RDBMS Version: 10.2.0.1.0. System parameters with non-default values: processes = 150 __shared_pool_size = 163577856 __large_pool_size = 4194304 __java_pool_size = 4194304 __streams_pool_size = 0 nls_date_language = american nls_date_format = yyyy-mm-dd nls_timestamp_format = yyyy-mm-dd hh24:mi:ss sga_target = 599785472 control_files = /home/oracle/oracle/oradata/TESTDB/control01.ctl, /home/oracle/oracle/oradata/TESTDB/control02.ctl, /home/oracle/oracle/oradata/TESTDB/control03.ctl db_block_size = 8192 __db_cache_size = 423624704 compatible = 10.2.0.1.0 db_file_multiblock_read_count= 16 db_recovery_file_dest = /home/oracle/oracle/flash_recovery_area db_recovery_file_dest_size= 2147483648 undo_management = AUTO undo_tablespace = UNDOTBS1 remote_login_passwordfile= EXCLUSIVE db_domain = dispatchers = (PROTOCOL=TCP) (SERVICE=LCDMP2XDB) job_queue_processes = 10 background_dump_dest = /home/oracle/oracle/admin/TESTDB/bdump user_dump_dest = /home/oracle/oracle/admin/TESTDB/udump core_dump_dest = /home/oracle/oracle/admin/TESTDB/cdump audit_file_dest = /home/oracle/oracle/admin/TESTDB/adump db_name = TESTDB open_cursors = 300 pga_aggregate_target = 199229440 PMON started with pid=2, OS id=22564 PSP0 started with pid=3, OS id=22566 MMAN started with pid=4, OS id=22568 DBW0 started with pid=5, OS id=22570 LGWR started with pid=6, OS id=22572 CKPT started with pid=7, OS id=22574 SMON started with pid=8, OS id=22576 RECO started with pid=9, OS id=22578 CJQ0 started with pid=10, OS id=22580 MMON started with pid=11, OS id=22582 MMNL started with pid=12, OS id=22584 Thu Nov 8 20:01:04 2012 starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'... starting up 1 shared server(s) ... Thu Nov 8 20:01:04 2012 ALTER DATABASE MOUNT --mount Thu Nov 8 20:01:08 2012 Setting recovery target incarnation to 2 Thu Nov 8 20:01:08 2012 Successful mount of redo thread 1, with mount id 1508843648 Thu Nov 8 20:01:08 2012 Database mounted in Exclusive Mode Completed: ALTER DATABASE MOUNT --mount over Thu Nov 8 20:01:09 2012 ALTER DATABASE OPEN --db open Thu Nov 8 20:01:09 2012 Thread 1 opened at log sequence 3442 Current log# 1 seq# 3442 mem# 0: /home/oracle/oracle/oradata/TESTDB/redo01.log Successful open of redo thread 1 Thu Nov 8 20:01:09 2012 MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set Thu Nov 8 20:01:09 2012 SMON: enabling cache recovery Thu Nov 8 20:01:09 2012 Successfully onlined Undo Tablespace 1. Thu Nov 8 20:01:09 2012 SMON: enabling tx recovery Thu Nov 8 20:01:09 2012 Database Characterset is AL32UTF8 replication_dependency_tracking turned off (no async multimaster replication found) Starting background process QMNC QMNC started with pid=17, OS id=22594 Thu Nov 8 20:01:10 2012 db_recovery_file_dest_size of 2048 MB is 0.00% used. This is a user-specified limit on the amount of space that will be used by this database for recovery-related files, and does not reflect the amount of space available in the underlying filesystem or ASM diskgroup. Thu Nov 8 20:01:11 2012 Completed: ALTER DATABASE OPEN --db open over
instance started (启动数据库实例):
既然是启动实例,那么oracle首先根据参数文件参数创建实例,分配内存,启动后台进程。
进程信息中pid表示进程在数据库内部的标识符号,os id表示进程在操作系统上的进程编号
PMON started with pid=2, OS id=22564
[oracle@oracle ~]$ ps -ef|grep 22564 oracle 2530 2504 0 11:46 pts/1 00:00:00 grep 22564 oracle 22564 1 0 Nov08 ? 00:00:00 ora_pmon_TESTDB
2,oracle关闭过程
与启动过程正好相反,为逆向过程
database closed -> database dismounted -> instance shut down
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down.
关闭数据库的后台日志:
Thu Nov 8 19:54:47 2012 Starting background process EMN0 EMN0 started with pid=25, OS id=22441 Thu Nov 8 19:54:47 2012 Shutting down instance: further logons disabled Thu Nov 8 19:54:48 2012 Stopping background process CJQ0 Thu Nov 8 19:54:48 2012 Stopping background process QMNC Thu Nov 8 19:54:50 2012 Stopping background process MMNL Thu Nov 8 19:54:51 2012 Stopping background process MMON Thu Nov 8 19:54:52 2012 Shutting down instance (immediate) License high water mark = 9 Thu Nov 8 19:54:52 2012 Stopping Job queue slave processes Thu Nov 8 19:54:57 2012 Process OS id : 22429 alive after kill Errors in file Thu Nov 8 19:54:57 2012 Job queue slave processes stopped All dispatchers and shared servers shutdown Thu Nov 8 19:55:09 2012 PMON failed to acquire latch, see PMON dump Thu Nov 8 19:55:10 2012 ALTER DATABASE CLOSE NORMAL Thu Nov 8 19:55:10 2012 SMON: disabling tx recovery SMON: disabling cache recovery Thu Nov 8 19:55:10 2012 Shutting down archive processes Archiving is disabled Archive process shutdown avoided: 0 active Thread 1 closed at log sequence 3442 Successful close of redo thread 1 Thu Nov 8 19:55:10 2012 Completed: ALTER DATABASE CLOSE NORMAL Thu Nov 8 19:55:10 2012 ALTER DATABASE DISMOUNT Completed: ALTER DATABASE DISMOUNT ARCH: Archival disabled due to shutdown: 1089 Shutting down archive processes Archiving is disabled Archive process shutdown avoided: 0 active ARCH: Archival disabled due to shutdown: 1089 Shutting down archive processes Archiving is disabled Archive process shutdown avoided: 0 active