srvctl即Server Control 是一个命令行工具 用以管理Oracle的RAC环境 srvctl在Oracle i中引入 Oracle g对其功能进行了大大增强
在命令行下 使用 h参数可以察看srvctl支持的命令及参数:
bash $ srvctl hUsage: srvctl [ V] Usage: srvctl add a *** n i o [ p ]Usage: srvctl config databaseUsage: 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 a *** 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 db rac Instance eygle is running on node db rac查看数据库实例的状态
bash $ srvctl status instance d eygle i eygle eygle Instance eygle is running on node db rac Instance eygle is running on node db rac使用srvctl stop停止数据库或实例停止实例使用srvctl stop instance命令:
bash $ srvctl stop instance PRKO : Invalid mand line syntaxbash $ srvctl stop instance hUsage: srvctl stop instance d i [ o ] [ c | q] d Unique name for the database i Comma separated instance names o Options to shutdown mand (e g 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 disabledThu Dec : : Stopping background process QMNCThu Dec : : Stopping background process CJQ Thu Dec : : Stopping background process MMNLThu Dec : : Stopping background process MMONThu Dec : : Shutting down instance (immediate)License high water mark = Thu Dec : : Stopping Job queue slave processesThu Dec : : Job queue slave processes stoppedThu Dec : : PMON failed to acquire latch see PMON dumpThu Dec : : ALTER DATABASE CLOSE NORMALThu Dec : : SMON: disabling tx recoverySMON: disabling cache recoveryThu Dec : : Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThread closed at log sequence Successful close of redo thread Thu Dec : : Completed: ALTER DATABASE CLOSE NORMALThu Dec : : ALTER DATABASE DISMOUNTCompleted: ALTER DATABASE DISMOUNTARCH: Archival disabled due to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeARCH: Archival disabled due to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThu Dec : : freeing rdom停止数据库使用srvctl stop database命令
bash $ srvctl stop database hUsage: srvctl stop database d [ o ] [ c | q] d Unique name for the database o Options to shutdown mand (e g 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 disabledThu Dec : : Stopping background process CJQ Thu Dec : : Stopping background process QMNCThu Dec : : Stopping background process MMNLThu Dec : : Stopping background process MMONThu Dec : : Shutting down instance (immediate)License high water mark = Thu Dec : : Stopping Job queue slave processesThu Dec : : Job queue slave processes stoppedThu Dec : : PMON failed to acquire latch see PMON dumpPMON failed to acquire latch see PMON dumpPMON failed to acquire latch see PMON dumpThu Dec : : PMON failed to acquire latch see PMON dumpThu Dec : : ALTER DATABASE CLOSE NORMALThu Dec : : SMON: disabling tx recoverySMON: disabling cache recoveryThu Dec : : Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThread closed at log sequence Successful close of redo thread Thu Dec : : Completed: ALTER DATABASE CLOSE NORMALThu Dec : : ALTER DATABASE DISMOUNTCompleted: ALTER DATABASE DISMOUNTARCH: Archival disabled due to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeARCH: Archival disabled due to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThu 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 interconnectInterface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a public interfacePicked latch free SCN scheme Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/product/ /db/dbs/archAutotune of undo retention is turned on LICENSE_MAX_USERS = SYS auditing is disabledksdpec: called for event prior to event group initializationStarting up ORACLE RDBMS Version: System parameters with non default values:processes = __shared_pool_size = __large_pool_size = __java_pool_size = __streams_pool_size = spfile = /dev/vx/rdsk/xxfdg/spfilesga_target = control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile db_block_size = __db_cache_size = patible = db_file_multiblock_read_count= cluster_database = TRUEcluster_database_instances= thread = instance_number = undo_management = AUTOundo_tablespace = UNDOTBS remote_login_passwordfile= EXCLUSIVEdb_domain = remote_listener = LISTENERS_EYGLEjob_queue_processes = background_dump_dest = /opt/oracle/admin/eygle/bdumpuser_dump_dest = /opt/oracle/admin/eygle/udumpcore_dump_dest = /opt/oracle/admin/eygle/cdumpaudit_file_dest = /opt/oracle/admin/eygle/adumpdb_name = eygleopen_cursors = pga_aggregate_target = Cluster munication is configured to use the following interface(s) for this instance Thu Dec : : cluster interconnect IPC version:Oracle UDP/IPIPC 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 socketOracle requires that the SocketReceive buffer size be tunable upto MBPlease make sure the kernel parameterwhich limits SO_RCVBUF value set byapplications is atleast MBLMD 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 reestablishedMaster broadcasted resource hash value bitmapsNon local Process blocks cleaned outThu Dec : : LMS : GCS shadows cancelled closedThu Dec : : LMS : GCS shadows cancelled closedSet master node info Submitted all remote enqueue requestsDwn cvts replayed VALBLKs dubiousAll grantable enqueues grantedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : Submitted all GCS remote cache requestsFix write in gcs resourcesReconfiguration pleteLCK started with pid= OS id= Thu Dec : : ALTER DATABASE MOUNTThu Dec : : This instance was first to mountSetting 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 MOUNTThu Dec : : ALTER DATABASE OPENThis instance was first to openPicked broadcast on mit scheme to generate SCNsThu 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 setThu Dec : : SMON: enabling cache recoveryThu Dec : : Instance recovery: looking for dead threadsInstance recovery: lock domain invalid but no dead threadsThu Dec : : Successfully onlined Undo Tablespace Thu Dec : : SMON: enabling tx recoveryThu Dec : : Database Characterset is ZHS GBKreplication_dependency_tracking turned off (no async multimaster replication found)Starting background process QMNCQMNC 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 interconnectInterface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a public interfacePicked latch free SCN scheme Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/product/ /db/dbs/archAutotune of undo retention is turned on LICENSE_MAX_USERS = SYS auditing is disabledksdpec: called for event prior to event group initializationStarting up ORACLE RDBMS Version: System parameters with non default values:processes = __shared_pool_size = __large_pool_size = __java_pool_size = __streams_pool_size = spfile = /dev/vx/rdsk/xxfdg/spfilesga_target = control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile db_block_size = __db_cache_size = patible = db_file_multiblock_read_count= cluster_database = TRUEcluster_database_instances= thread = instance_number = undo_management = AUTOundo_tablespace = UNDOTBS remote_login_passwordfile= EXCLUSIVEdb_domain = remote_listener = LISTENERS_EYGLEjob_queue_processes = background_dump_dest = /opt/oracle/admin/eygle/bdumpuser_dump_dest = /opt/oracle/admin/eygle/udumpcore_dump_dest = /opt/oracle/admin/eygle/cdumpaudit_file_dest = /opt/oracle/admin/eygle/adumpdb_name = eygleopen_cursors = pga_aggregate_target = Cluster munication is configured to use the following interface(s) for this instance Thu Dec : : cluster interconnect IPC version:Oracle UDP/IPIPC 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 socketOracle requires that the SocketReceive buffer size be tunable upto MBPlease make sure the kernel parameterwhich limits SO_RCVBUF value set byapplications is atleast MBLMD 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 reestablishedMaster broadcasted resource hash value bitmapsNon local Process blocks cleaned outThu Dec : : LMS : GCS shadows cancelled closedThu Dec : : LMS : GCS shadows cancelled closedSet master node info Submitted all remote enqueue requestsDwn cvts replayed VALBLKs dubiousAll grantable enqueues grantedPost SMON to start st pass IRThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : Submitted all GCS remote cache requestsPost SMON to start st pass IRFix write in gcs resourcesReconfiguration pleteLCK started with pid= OS id= Thu Dec : : ALTER DATABASE MOUNTThu 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 MOUNTThu Dec : : ALTER DATABASE OPENPicked broadcast on mit scheme to generate SCNsThu 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 setThu Dec : : SMON: enabling cache recoveryThu Dec : : Successfully onlined Undo Tablespace Thu Dec : : SMON: enabling tx recoveryThu Dec : : Database Characterset is ZHS GBKreplication_dependency_tracking turned off (no async multimaster replication found)Starting background process QMNCQMNC started with pid= OS id= Thu Dec : : Completed: ALTER DATABASE OPEN lishixinzhi/Article/program/Oracle/201311/18569oracle 12c:新特性-RAC数据库的增强
What-if命令评估
通过srvctl使用新的What-if命令评估选项,现在可以确定运行此命令所造成的影响。这一新添加到srvctl的命令,可以在没有实际执行或是不对当前系统做任何改变的情况下模拟此命令。这在想要对一个已存在的系统进行更改却对结果不确定的时候特别有用。这样,此命令就会提供进行变更的效果。而–eval 选项也可以通过crsctl 命令来使用来源:CUUG官网。
例如,如果你想要知道停止一个特定数据库会发生什么,那么你就可以使用以下示例:
$ ./srvctl stop database –d MYDB –eval
$ ./crsctl eval modify resource -attr “value”
srvctl的改进
对于srvctl命令还有一些新增功能。以下演示了如何用这些新增功能停止或启动集群上的数据库或实例资源。
srvctl start database|instance –startoption NOMOUNT|MOUNT|OPEN
1.模拟删除ASM &DATABASE 注册信息删除前请确认这些资源已经是STOP 状态
[oracle@vmrehl4n1 ~]$ srvctl remove database -d myrac
Remove the database myrac? (y/[n]) y
[oracle@vmrehl4n1 ~]$ srvctl remove asm -n vmrehl4n1 -i +ASM1
[oracle@vmrehl4n1 ~]$ srvctl remove asm -n vmrehl4n2 -i +ASM2
2.添加ASM &DATABASE 注册信息
[oracle@vmrehl4n1 ~]$ srvctl add database -d myrac -o /app/oracle/product/10.2.0/db_1
[oracle@vmrehl4n1 ~]$ srvctl add instance -d myrac -i myrac1 -n vmrehl4n1
[oracle@vmrehl4n1 ~]$ srvctl add instance -d myrac -i myrac2 -n vmrehl4n2
[oracle@vmrehl4n1 ~]$ srvctl add asm -n vmrehl4n1 -i +ASM1 -o /app/oracle/product/10.2.0/db_1
[oracle@vmrehl4n1 ~]$ srvctl add asm -n vmrehl4n2 -i +ASM2 -o /app/oracle/product/10.2.0/db_1
查看[oracle@vmrehl4n2 admin]$ crs_stat -p ora.myrac.myrac1.inst
显示的此行
REQUIRED_RESOURCES=ora.vmrehl4n1.vip ora.vmrehl4n1.ASM1.asm
如果没有ora.vmrehl4n1.ASM1.asm
需要继续运行以下命令,否则CRS自动启动时不能启动DATABASE:
[oracle@vmrehl4n1 ~]$ srvctl modify instance -d myrac -i myrac1 -s +ASM1
[oracle@vmrehl4n1 ~]$ srvctl modify instance -d myrac -i myrac2 -s +ASM2
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)