熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

10gRAC系列之使用srvctl管理RAC數據庫

2013-11-13 22:14:22  來源: Oracle 

  srvctl即Server Control是一個命令行工具用以管理Oracle的RAC環境srvctl在Oraclei中引入Oracleg對其功能進行了大大增強

  在命令行下使用h參數可以察看srvctl支持的命令及參數:

bash$ srvctl h
Usage: srvctl [V]

Usage: srvctl add asm n i o [p ]
Usage: srvctl config database
Usage: srvctl config database d [a] [t]
Usage: srvctl config service d [s ] [a] [S ]
Usage: srvctl config nodeapps n [a] [g] [o] [s] [l]
Usage: srvctl config asm n
Usage: srvctl config listener n
Usage: srvctl disable database d

  常用的命令主要如下:
使用srvctl status查看數據庫及實例狀態
查看數據庫的狀態

bash$ srvctl status database d eygle
Instance eygle is running on node dbrac
Instance eygle is running on node dbrac

  查看數據庫實例的狀態

bash$ srvctl status instance d eygle i eygleeygle
Instance eygle is running on node dbrac
Instance eygle is running on node dbrac

  使用srvctl stop停止數據庫或實例
停止實例使用srvctl stop instance命令:

bash$ srvctl stop instance
PRKO : Invalid command line syntax
bash$ srvctl stop instance h
Usage: srvctl stop instance d i [o ] [c | q]
d Unique name for the database
i Comma separated instance names
o Options to shutdown command (eg normal transactional immediate or abort)
c Connect string (default: / as sysdba)
q Query connect string from standard input
h Print usage

  在命令行發出如下命令

bash$ srvctl stop instance d eygle i eygle

  在該節點的警告日志文件中就可以看到如下關閉信息:

Thu Dec ::
Shutting down instance: further logons disabled
Thu Dec ::
Stopping background process QMNC
Thu Dec ::
Stopping background process CJQ
Thu Dec ::
Stopping background process MMNL
Thu Dec ::
Stopping background process MMON
Thu Dec ::
Shutting down instance (immediate)
License high water mark =
Thu Dec ::
Stopping Job queue slave processes
Thu Dec ::
Job queue slave processes stopped
Thu Dec ::
PMON failed to acquire latch see PMON dump
Thu Dec ::
ALTER DATABASE CLOSE NORMAL
Thu Dec ::
SMON: disabling tx recovery
SMON: disabling cache recovery
Thu Dec ::
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
Thread closed at log sequence
Successful close of redo thread
Thu Dec ::
Completed: ALTER DATABASE CLOSE NORMAL
Thu Dec ::
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown:
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
ARCH: Archival disabled due to shutdown:
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
Thu Dec ::
freeing rdom

  停止數據庫使用srvctl stop database命令

bash$ srvctl stop database h
Usage: srvctl stop database d [o ] [c | q]
d Unique name for the database
o Options to shutdown command (eg normal transactional immediate or abort)
c Connect string (default: / as sysdba)
q Query connect string from standard input
h Print usage

  發出如下命令後數據庫停止:

bash$ srvctl stop database d eygle

  日志文件記錄如下過程:

Thu Dec ::
Shutting down instance: further logons disabled
Thu Dec ::
Stopping background process CJQ
Thu Dec ::
Stopping background process QMNC
Thu Dec ::
Stopping background process MMNL
Thu Dec ::
Stopping background process MMON
Thu Dec ::
Shutting down instance (immediate)
License high water mark =
Thu Dec ::
Stopping Job queue slave processes
Thu Dec ::
Job queue slave processes stopped
Thu Dec ::
PMON failed to acquire latch see PMON dump
PMON failed to acquire latch see PMON dump
PMON failed to acquire latch see PMON dump
Thu Dec ::
PMON failed to acquire latch see PMON dump
Thu Dec ::
ALTER DATABASE CLOSE NORMAL
Thu Dec ::
SMON: disabling tx recovery
SMON: disabling cache recovery
Thu Dec ::
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
Thread closed at log sequence
Successful close of redo thread
Thu Dec ::
Completed: ALTER DATABASE CLOSE NORMAL
Thu Dec ::
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown:
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
ARCH: Archival disabled due to shutdown:
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: active
Thu Dec ::
freeing rdom

  使用srvctl start命令啟動數據庫或實例
使用srvctl start database可以啟動數據庫的所有實例:

bash$ srvctl start database d eygle

  在第一個節點警告日志記錄了如下啟動過程

Thu Dec ::
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION =
LICENSE_SESSIONS_WARNING =
Interface type bge configured from OCR for use as a cluster interconnect
Interface type bge configured from OCR for use as a cluster interconnect
Interface type bge configured from OCR for use as a public interface
Picked latchfree SCN scheme
Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/product//db/dbs/arch
Autotune of undo retention is turned on
LICENSE_MAX_USERS =
SYS auditing is disabled
ksdpec: called for event prior to event group initialization
Starting up ORACLE RDBMS Version:
System parameters with nondefault values:
processes =
__shared_pool_size =
__large_pool_size =
__java_pool_size =
__streams_pool_size =
spfile = /dev/vx/rdsk/xxfdg/spfile
sga_target =
control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile
db_block_size =
__db_cache_size =
compatible =
db_file_multiblock_read_count=
cluster_database = TRUE
cluster_database_instances=
thread =
instance_number =
undo_management = AUTO
undo_tablespace = UNDOTBS
remote_login_passwordfile= EXCLUSIVE
db_domain =
remote_listener = LISTENERS_EYGLE
job_queue_processes =
background_dump_dest = /opt/oracle/admin/eygle/bdump
user_dump_dest = /opt/oracle/admin/eygle/udump
core_dump_dest = /opt/oracle/admin/eygle/cdump
audit_file_dest = /opt/oracle/admin/eygle/adump
db_name = eygle
open_cursors =
pga_aggregate_target =
Cluster communication is configured to use the following interface(s) for this instance


Thu Dec ::
cluster interconnect IPC version:Oracle UDP/IP
IPC Vendor proto
DIAG started with pid= OS id=
PMON started with pid= OS id=
PSP started with pid= OS id=
LMON started with pid= OS id=
Thu Dec ::
WARNING: Failed to set buffer limit on IPC interconnect socket
Oracle requires that the SocketReceive buffer size be tunable upto MB
Please make sure the kernel parameterwhich limits SO_RCVBUF value set by
applications is atleast MB
LMD started with pid= OS id=
LMS started with pid= OS id=
LMS started with pid= OS id=
MMAN started with pid= OS id=
DBW started with pid= OS id=
LGWR started with pid= OS id=
CKPT started with pid= OS id=
SMON started with pid= OS id=
RECO started with pid= OS id=
CJQ started with pid= OS id=
MMON started with pid= OS id=
MMNL started with pid= OS id=
Thu Dec ::
lmon registered with NM instance id (internal mem no )
Thu Dec ::
Reconfiguration started (old inc new inc )
List of nodes:

Global Resource Directory frozen
* allocate domain invalid = TRUE
Communication channels reestablished
Master broadcasted resource hash value bitmaps
Nonlocal Process blocks cleaned out
Thu Dec ::
LMS : GCS shadows cancelled closed
Thu Dec ::
LMS : GCS shadows cancelled closed
Set master node info
Submitted all remoteenqueue requests
Dwncvts replayed VALBLKs dubious
All grantable enqueues granted
Thu Dec ::
LMS : GCS shadows traversed replayed
Thu Dec ::
LMS : GCS shadows traversed replayed
Thu Dec ::
Submitted all GCS remotecache requests
Fix write in gcs resources
Reconfiguration complete
LCK started with pid= OS id=
Thu Dec ::
ALTER DATABASE MOUNT
Thu Dec ::
This instance was first to mount
Setting recovery target incarnation to
Thu Dec ::
Successful mount of redo thread with mount id
Thu Dec ::
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Completed: ALTER DATABASE MOUNT
Thu Dec ::
ALTER DATABASE OPEN
This instance was first to open
Picked broadcast on commit scheme to generate SCNs
Thu Dec ::
Thread advanced to log sequence
Thread opened at log sequence
Current log# seq# mem# : /dev/vx/rdsk/xxfdg/redo
Successful open of redo thread
Thu Dec ::
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu Dec ::
SMON: enabling cache recovery
Thu Dec ::
Instance recovery: looking for dead threads
Instance recovery: lock domain invalid but no dead threads
Thu Dec ::
Successfully onlined Undo Tablespace
Thu Dec ::
SMON: enabling tx recovery
Thu Dec ::
Database Characterset is ZHSGBK
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid= OS id=
Thu Dec ::
Completed: ALTER DATABASE OPEN

  節點記錄了如下啟動過程:

Thu Dec ::
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION =
LICENSE_SESSIONS_WARNING =
Interface type bge configured from OCR for use as a cluster interconnect
Interface type bge configured from OCR for use as a cluster interconnect
Interface type bge configured from OCR for use as a public interface
Picked latchfree SCN scheme
Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/product//db/dbs/arch
Autotune of undo retention is turned on
LICENSE_MAX_USERS =
SYS auditing is disabled
ksdpec: called for event prior to event group initialization
Starting up ORACLE RDBMS Version:
System parameters with nondefault values:
processes =
__shared_pool_size =
__large_pool_size =
__java_pool_size =
__streams_pool_size =
spfile = /dev/vx/rdsk/xxfdg/spfile
sga_target =
control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile
db_block_size =
__db_cache_size =
compatible =
db_file_multiblock_read_count=
cluster_database = TRUE
cluster_database_instances=
thread =
instance_number =
undo_management = AUTO
undo_tablespace = UNDOTBS
remote_login_passwordfile= EXCLUSIVE
db_domain =
remote_listener = LISTENERS_EYGLE
job_queue_processes =
background_dump_dest = /opt/oracle/admin/eygle/bdump
user_dump_dest = /opt/oracle/admin/eygle/udump
core_dump_dest = /opt/oracle/admin/eygle/cdump
audit_file_dest = /opt/oracle/admin/eygle/adump
db_name = eygle
open_cursors =
pga_aggregate_target =
Cluster communication is configured to use the following interface(s) for this instance


Thu Dec ::
cluster interconnect IPC version:Oracle UDP/IP
IPC Vendor proto
PMON started with pid= OS id=
DIAG started with pid= OS id=
PSP started with pid= OS id=
LMON started with pid= OS id=
Thu Dec ::
WARNING: Failed to set buffer limit on IPC interconnect socket
Oracle requires that the SocketReceive buffer size be tunable upto MB
Please make sure the kernel parameterwhich limits SO_RCVBUF value set by
applications is atleast MB
LMD started with pid= OS id=
LMS started with pid= OS id=
LMS started with pid= OS id=
MMAN started with pid= OS id=
DBW started with pid= OS id=
LGWR started with pid= OS id=
CKPT started with pid= OS id=
SMON started with pid= OS id=
RECO started with pid= OS id=
CJQ started with pid= OS id=
MMON started with pid= OS id=
MMNL started with pid= OS id=
Thu Dec ::
lmon registered with NM instance id (internal mem no )
Thu Dec ::
Reconfiguration started (old inc new inc )
List of nodes:

Global Resource Directory frozen
* allocate domain invalid = TRUE
Communication channels reestablished
Master broadcasted resource hash value bitmaps
Nonlocal Process blocks cleaned out
Thu Dec ::
LMS : GCS shadows cancelled closed
Thu Dec ::
LMS : GCS shadows cancelled closed
Set master node info
Submitted all remoteenqueue requests
Dwncvts replayed VALBLKs dubious
All grantable enqueues granted
Post SMON to start st pass IR
Thu Dec ::
LMS : GCS shadows traversed replayed
Thu Dec ::
LMS : GCS shadows traversed replayed
Thu Dec ::
Submitted all GCS remotecache requests
Post SMON to start st pass IR
Fix write in gcs resources
Reconfiguration complete
LCK started with pid= OS id=
Thu Dec ::
ALTER DATABASE MOUNT
Thu Dec ::
Setting recovery target incarnation to
Thu Dec ::
Successful mount of redo thread with mount id
Thu Dec ::
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Completed: ALTER DATABASE MOUNT
Thu Dec ::
ALTER DATABASE OPEN
Picked broadcast on commit scheme to generate SCNs
Thu Dec ::
Thread opened at log sequence
Current log# seq# mem# : /dev/vx/rdsk/xxfdg/redo
Successful open of redo thread
Thu Dec ::
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu Dec ::
SMON: enabling cache recovery
Thu Dec ::
Successfully onlined Undo Tablespace
Thu Dec ::
SMON: enabling tx recovery
Thu Dec ::
Database Characterset is ZHSGBK
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid= OS id=
Thu Dec ::
Completed: ALTER DATABASE OPEN

  The End


From:http://tw.wingwit.com/Article/program/Oracle/201311/18569.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.