打开或关闭时自动设置service_names

数据库在启动或关闭的时候,会自动设置 service_names这个参数。
下面模拟了一下产生的原因:
结论:如果crs的资源里有这个service的话,会在启动或关闭数据库的时候,自动设置这个service_names这个参数
[oracle@rac1 admin]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.rac.db     application    ONLINE    ONLINE    rac2        
ora....c1.inst application    ONLINE    ONLINE    rac1        
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2 


[oracle@rac1 admin]$ srvctl add service -d rac -s ssss -r rac1          --加服务


[oracle@rac1 admin]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.rac.db     application    ONLINE    ONLINE    rac2        
ora....c1.inst application    ONLINE    ONLINE    rac1        
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....ssss.cs application    OFFLINE   OFFLINE               
ora....ac1.srv application    OFFLINE   OFFLINE               这里是所加的服务
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        




[oracle@rac1 admin]$ crs_start  ora.rac.ssss.cs          --把加的服务启动起来
Attempting to start `ora.rac.ssss.cs` on member `rac1`
Start of `ora.rac.ssss.cs` on member `rac1` succeeded.
[oracle@rac1 admin]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.rac.db     application    ONLINE    ONLINE    rac2        
ora....c1.inst application    ONLINE    ONLINE    rac1        
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....ssss.cs application    ONLINE    ONLINE    rac1        
ora....ac1.srv application    ONLINE    ONLINE    rac1        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2   


[oracle@rac1 admin]$ sqlplus /nolog


SQL*Plus: Release 10.2.0.4.0 - Production on Wed Nov 27 11:54:56 2013


Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


SQL> conn /as sysdba
Connected.
SQL> shutdown immediate;       ---关闭数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
SQL> 
SQL> 
SQL> startup                        --打开数据库
ORACLE instance started.


Total System Global Area  587202560 bytes
Fixed Size                  2085680 bytes
Variable Size             167775440 bytes
Database Buffers          411041792 bytes
Redo Buffers                6299648 bytes
Database mounted.
Database opened.




相应的alert日志中显示是:






Wed Nov 27 11:55:07 2013
Shutting down instance: further logons disabled
Wed Nov 27 11:55:07 2013
Stopping background process CJQ0
Wed Nov 27 11:55:07 2013
Stopping background process QMNC
Wed Nov 27 11:55:08 2013
ALTER SYSTEM SET service_names='rac' SCOPE=MEMORY SID='rac1';      ---关闭时发生的
Wed Nov 27 11:55:08 2013
Stopping background process MMNL
Wed Nov 27 11:55:09 2013
Stopping background process MMON
Wed Nov 27 11:55:10 2013
Shutting down instance (immediate)
License high water mark = 7
All dispatchers and shared servers shutdown
Wed Nov 27 11:55:14 2013
ALTER DATABASE CLOSE NORMAL
Wed Nov 27 11:55:14 2013
SMON: disabling tx recovery
SMON: disabling cache recovery
Wed Nov 27 11:55:15 2013
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Thread 1 closed at log sequence 26
Successful close of redo thread 1
Wed Nov 27 11:55:15 2013
Completed: ALTER DATABASE CLOSE NORMAL
Wed Nov 27 11:55:15 2013
ALTER DATABASE DISMOUNT
Wed Nov 27 11:55:15 2013
SUCCESS: diskgroup DATA1 was dismounted
Wed Nov 27 11:55:15 2013
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
Wed Nov 27 11:55:21 2013
freeing rdom 0
Wed Nov 27 11:55:27 2013
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Interface type 1 eth1 10.10.10.0 configured from OCR for use as a cluster interconnect
Interface type 1 eth0 192.168.118.0 configured from OCR for use as  a public interface
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_10 parameter default value as USE_DB_RECOVERY_FILE_DEST
WARNING: db_recovery_file_dest is same as db_create_file_dest
Autotune of undo retention is turned on. 
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.4.0.
System parameters with non-default values:
  processes                = 150
  __shared_pool_size       = 150994944
  __large_pool_size        = 4194304
  __java_pool_size         = 4194304
  __streams_pool_size      = 8388608
  spfile                   = +DATA1/rac/spfilerac.ora
  sga_target               = 587202560
  control_files            = +DATA1/rac/controlfile/current.260.801539669
  db_block_size            = 8192
  __db_cache_size          = 411041792
  compatible               = 10.2.0.3.0
  db_file_multiblock_read_count= 16
  cluster_database         = TRUE
  cluster_database_instances= 2
  db_create_file_dest      = +DATA1
  db_recovery_file_dest    = +DATA1
  db_recovery_file_dest_size= 104857600
  thread                   = 1
  instance_number          = 1
  undo_management          = AUTO
  undo_tablespace          = UNDOTBS2
  remote_login_passwordfile= EXCLUSIVE
  db_domain                = 
  service_names            = rac
  dispatchers              = (PROTOCOL=TCP) (SERVICE=racXDB)
  remote_listener          = LISTENERS_RAC
  job_queue_processes      = 0
  background_dump_dest     = /u01/app/admin/rac/bdump
  user_dump_dest           = /u01/app/admin/rac/udump
  core_dump_dest           = /u01/app/admin/rac/cdump
  audit_file_dest          = /u01/app/admin/rac/adump
  db_name                  = rac
  open_cursors             = 500
  pga_aggregate_target     = 195035136
Cluster communication is configured to use the following interface(s) for this instance
  10.10.10.10
Wed Nov 27 11:55:27 2013
cluster interconnect IPC version:Oracle UDP/IP (generic)
IPC Vendor 1 proto 2
PMON started with pid=2, OS id=16107
DIAG started with pid=3, OS id=16109
PSP0 started with pid=4, OS id=16111
LMON started with pid=5, OS id=16113
LMD0 started with pid=6, OS id=16115
LMS0 started with pid=7, OS id=16117
MMAN started with pid=8, OS id=16126
DBW0 started with pid=9, OS id=16128
LGWR started with pid=10, OS id=16130
CKPT started with pid=11, OS id=16132
SMON started with pid=12, OS id=16134
RECO started with pid=13, OS id=16136
MMON started with pid=14, OS id=16138
Wed Nov 27 11:55:27 2013
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
MMNL started with pid=15, OS id=16140
Wed Nov 27 11:55:28 2013
starting up 1 shared server(s) ...
Wed Nov 27 11:55:28 2013
lmon registered with NM - instance id 1 (internal mem no 0)
Wed Nov 27 11:55:28 2013
Reconfiguration started (old inc 0, new inc 32)
List of nodes:
 0 1
 Global Resource Directory frozen
* allocate domain 0, invalid = TRUE 
 Communication channels reestablished
 * domain 0 valid according to instance 1 
 * domain 0 valid = 1 according to instance 1 
Wed Nov 27 11:55:29 2013
 Master broadcasted resource hash value bitmaps
 Non-local Process blocks cleaned out
Wed Nov 27 11:55:29 2013
 LMS 0: 0 GCS shadows cancelled, 0 closed
 Set master node info 
 Submitted all remote-enqueue requests
 Dwn-cvts replayed, VALBLKs dubious
 All grantable enqueues granted
Wed Nov 27 11:55:29 2013
 LMS 0: 0 GCS shadows traversed, 0 replayed
Wed Nov 27 11:55:29 2013
 Submitted all GCS remote-cache requests
 Post SMON to start 1st pass IR
 Fix write in gcs resources
Reconfiguration complete
LCK0 started with pid=18, OS id=16151
Wed Nov 27 11:55:29 2013
ALTER DATABASE   MOUNT
Wed Nov 27 11:55:29 2013
Starting background process ASMB
ASMB started with pid=20, OS id=16156
Starting background process RBAL
RBAL started with pid=21, OS id=16174
Loaded ASM Library - Generic Linux, version 2.0.4 (KABI_V2) library for asmlib interface
Wed Nov 27 11:55:35 2013
SUCCESS: diskgroup DATA1 was mounted
Wed Nov 27 11:55:40 2013
Setting recovery target incarnation to 2
Wed Nov 27 11:55:40 2013
Successful mount of redo thread 1, with mount id 2420548486
Wed Nov 27 11:55:40 2013
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Completed: ALTER DATABASE   MOUNT
Wed Nov 27 11:55:40 2013
ALTER DATABASE OPEN
Picked broadcast on commit scheme to generate SCNs
Wed Nov 27 11:55:41 2013
Thread 1 opened at log sequence 26
  Current log# 7 seq# 26 mem# 0: +DATA1/rac/onlinelog/group_7.270.812456015
Successful open of redo thread 1
Wed Nov 27 11:55:41 2013
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Nov 27 11:55:41 2013
SMON: enabling cache recovery
Wed Nov 27 11:55:42 2013
Successfully onlined Undo Tablespace 5.
Wed Nov 27 11:55:42 2013
SMON: enabling tx recovery
Wed Nov 27 11:55:42 2013
Database Characterset is WE8ISO8859P1
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 1
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=26, OS id=16284
Wed Nov 27 11:55:48 2013
Completed: ALTER DATABASE OPEN
Wed Nov 27 11:55:49 2013
Starting background process CJQ0
CJQ0 started with pid=29, OS id=16338
Wed Nov 27 11:55:49 2013
ALTER SYSTEM SET service_names='rac','ssss' SCOPE=MEMORY SID='rac1';                --启动时发生的




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-1061333/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25099483/viewspace-1061333/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值