1.启动数据库:startup命令后,执行顺序如下 首先使用服务器上的spfilesid文件启动实例,如未找到,使用服务器上默认的spfile启动实例;如未找到默认spfile,使用initsid文件启动实例,如仍未找到,报错。 sys@bys1startup; ora-01078: failure in processing
1.启动数据库:startup命令后,执行顺序如下首先使用服务器上的spfilesid文件启动实例,如未找到,使用服务器上默认的spfile启动实例;如未找到默认spfile,使用initsid文件启动实例,如仍未找到,报错。
sys@bys1>startup;
ora-01078: failure in processing system parameters
lrm-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initaaa.ora'
找到参数文件后,此时oracle根据参数文件中的设置创建实例,分配内存,启动后台进程。
可以在startup 命令中使用pfile选项指定参数文件来改变优先顺序 :startuppfile=c:\orcl\pfile\init.ora
2.startup nomount
只启动实例不打开数据库中任何文件,不打开控制文件,只使用了初始化参数文件。这个过程也是启动数据库实例的过程。即读取参数文件,应用参数启动实例。
在windows上是orcle.exe初始化,在unix/linux上是oracle可执行文件初始化。在操作系统中查看oracle可执行文件:win平台dir oracle.exe 或者 unix/linux平台 file oracle
此状态只有在创建数据库或重建控制文件时使用。此时oracle将进行如下工作:
分配sga配置所有内存缓冲区和相关结构,启动所需全部后台进程,打开报警文件alertsid.log和追踪文件trace;
下面是实现启动的信息
sql> conn sys/oraclesys as sysdba
已连接到空闲例程。
sql> startup nomount;
oracle 例程已经启动。
total system global area 431038464 bytes
fixed size 1375088 bytes
variable size 331351184 bytes
database buffers 92274688 bytes
redo buffers 6037504 bytes
3.实例启动时alert日志文件中的信息在alert日志中可以看到实例启动时后台进程也相应启动,并且给出了pid及osid信息。pid是进程在数据库内部的标识符编号,osid代表进程在操作系统上进程编号。
通过数据库v$process视图,查询pid与spid对应: v$process视图是操作系统到数据库的入口。
其中pid=1的进程是初始化数据库的进程,启动其它进程前即被占用,并在数据库中一直存在。spid列代表操作上的进程号,通过查询spid可以在os中相应查询到进程。比如在操作系统中发现某进程占用高cpu/内存,可以通过进程号的对应找出相应的数据库进程,进行诊断优化。
latchwait列代表进程当前正在等待的latch信息,latchspin列记录进程正在通过spin进行latch竞争。addr列代表进程地址、进程状态等信息在内存中记录。
select addr,pid,spid,username,program,latchwait from v$process;
sunfeb 03 21:50:38 2013
startingoracle instance (normal)
license_max_session= 0
license_sessions_warning= 0
pickedlatch-free scn scheme 2
autotuneof undo retention is turned on.
imode=br
ilat=27
license_max_users= 0
sysauditing is disabled
startingup:
oracledatabase 11g enterprise edition release11.2.0.1.0 - production --------------数据库版本
withthe partitioning, olap, data mining and real application testing options.
usingparameter settings in server-side spfile c:\app\administrator\product\11.2.0\dbhome_1\database\spfileorcl.ora
systemparameters with non-default values:
processes = 150
large_pool_size = 8m
memory_target = 412m
control_files =d:\disk1\control01.ctl --------------------参数文件中的参数
control_files =d:\disk2\control02.ctl
control_files =d:\disk3\control03.ctl
control_files =d:\disk4\control04.ctl
control_files =d:\disk5\control05.ctl
db_block_size = 8192
db_cache_size = 32m
db_cache_advice = on
compatible = 11.2.0.0.0
log_archive_dest_1 = location=d:\disk1\offlinelog\mandatory
log_archive_dest_2 = location=d:\disk2\offlinelog\
log_archive_dest_3 = location=d:\disk3\offlinelog\optional
log_archive_dest_4 = location=d:\disk4\offlinelog\optional
log_archive_dest_5 = location=d:\disk5\offlinelog\mandatory
log_archive_dest_state_1 = enable
log_archive_min_succeed_dest= 3
db_recovery_file_dest =c:\app\administrator\flash_recovery_area
db_recovery_file_dest_size= 3852m
undo_tablespace = undotbs1
remote_login_passwordfile=exclusive
db_domain =
dispatchers = (protocol=tcp)(service=orclxdb)
audit_file_dest =c:\app\administrator\admin\orcl\adump
audit_trail = db
db_name = orcl
open_cursors = 300
diagnostic_dest = c:\app\administrator
sunfeb 03 21:50:38 2013
pmonstarted with pid=2, os id=2396
sunfeb 03 21:50:38 2013
vktmstarted with pid=3, os id=2408 at elevated priority
vktmrunning at (10)millisec precision with dbrm quantum (100)ms -----------------------后台进程启动
sunfeb 03 21:50:38 2013
gen0started with pid=4, os id=612
sunfeb 03 21:50:38 2013
diagstarted with pid=5, os id=2100
sunfeb 03 21:50:38 2013
dbrmstarted with pid=6, os id=2332
sunfeb 03 21:50:38 2013
psp0started with pid=7, os id=2072
sunfeb 03 21:50:38 2013
dia0started with pid=8, os id=2404
sunfeb 03 21:50:38 2013
mmanstarted with pid=9, os id=2400
sunfeb 03 21:50:38 2013
dbw0started with pid=10, os id=2356
sunfeb 03 21:50:38 2013
lgwrstarted with pid=11, os id=2484
sunfeb 03 21:50:38 2013
ckptstarted with pid=12, os id=2488
sunfeb 03 21:50:38 2013
smonstarted with pid=13, os id=2352
sunfeb 03 21:50:38 2013
recostarted with pid=14, os id=2376
sunfeb 03 21:50:38 2013
mmonstarted with pid=15, os id=2360
sunfeb 03 21:50:38 2013
mmnlstarted with pid=16, os id=2512
startingup 1 dispatcher(s) for network address'(address=(partial=yes)(protocol=tcp))'...
startingup 1 shared server(s) ...
oracle_basefrom environment = c:\app\administrator