分享
 
 
 

10gRAC系列之使用srvctl管理RAC数据库

王朝vc·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

srvctl即Server Control,是一个命令行工具,用以治理Oracle的RAC环境,srvctl在Oracle9i中引入,Oracle10g对其功能进行了大大增强。

在命令行下,使用-h参数可以察看srvctl支持的命令及参数:

bash-2.05$ 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

.....................

常用的命令主要如下:

1.使用srvctl status查看数据库及实例状态

查看数据库的状态

bash-2.05$ srvctl status database -d eygle

Instance eygle1 is running on node db210-rac1

Instance eygle2 is running on node db210-rac2

查看数据库实例的状态

bash-2.05$ srvctl status instance -d eygle -i eygle1,eygle2

Instance eygle1 is running on node db210-rac1

Instance eygle2 is running on node db210-rac2

2.使用srvctl stop停止数据库或实例

停止实例使用srvctl stop instance命令:

bash-2.05$ srvctl stop instance

PRKO-2001 : Invalid command line syntax

bash-2.05$ 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 (e.g. normal, transactional, immediate, or abort)

-c Connect string (default: / as sysdba)

-q Query connect string from standard input

-h Print usage

在命令行发出如下命令:

bash-2.05$ srvctl stop instance -d eygle -i eygle2

在该节点的警告日志文件中就可以看到如下关闭信息:

Thu Dec 28 14:32:04 2006

Shutting down instance: further logons disabled

Thu Dec 28 14:32:04 2006

Stopping background process QMNC

Thu Dec 28 14:32:04 2006

Stopping background process CJQ0

Thu Dec 28 14:32:06 2006

Stopping background process MMNL

Thu Dec 28 14:32:07 2006

Stopping background process MMON

Thu Dec 28 14:32:08 2006

Shutting down instance (immediate)

License high water mark = 11

Thu Dec 28 14:32:08 2006

Stopping Job queue slave processes

Thu Dec 28 14:32:08 2006

Job queue slave processes stopped

Thu Dec 28 14:32:15 2006

PMON failed to acquire latch, see PMON dump

Thu Dec 28 14:32:16 2006

ALTER DATABASE CLOSE NORMAL

Thu Dec 28 14:32:16 2006

SMON: disabling tx recovery

SMON: disabling cache recovery

Thu Dec 28 14:32:17 2006

Shutting down archive processes

Archiving is disabled

Archive process shutdown avoided: 0 active

Thread 2 closed at log sequence 1

SUCcessful close of redo thread 2

Thu Dec 28 14:32:17 2006

Completed: ALTER DATABASE CLOSE NORMAL

Thu Dec 28 14:32:17 2006

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

Thu Dec 28 14:32:20 2006

freeing rdom 0

停止数据库使用srvctl stop database命令;

bash-2.05$ srvctl stop database -h

Usage: srvctl stop database -d [-o ] [-c -q]

-d Unique name for the database

-o Options to shutdown command (e.g. normal, transactional, immediate, or abort)

-c Connect string (default: / as sysdba)

-q Query connect string from standard input

-h Print usage

发出如下命令后,数据库停止:

bash-2.05$ srvctl stop database -d eygle

日志文件记录如下过程:

Thu Dec 28 14:46:22 2006

Shutting down instance: further logons disabled

Thu Dec 28 14:46:22 2006

Stopping background process CJQ0

Thu Dec 28 14:46:22 2006

Stopping background process QMNC

Thu Dec 28 14:46:24 2006

Stopping background process MMNL

Thu Dec 28 14:46:25 2006

Stopping background process MMON

Thu Dec 28 14:46:26 2006

Shutting down instance (immediate)

License high water mark = 15

Thu Dec 28 14:46:26 2006

Stopping Job queue slave processes

Thu Dec 28 14:46:26 2006

Job queue slave processes stopped

Thu Dec 28 14:46:33 2006

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 28 14:46:46 2006

PMON failed to acquire latch, see PMON dump

Thu Dec 28 14:46:47 2006

ALTER DATABASE CLOSE NORMAL

Thu Dec 28 14:46:47 2006

SMON: disabling tx recovery

SMON: disabling cache recovery

Thu Dec 28 14:46:47 2006

Shutting down archive processes

Archiving is disabled

Archive process shutdown avoided: 0 active

Thread 1 closed at log sequence 16

Successful close of redo thread 1

Thu Dec 28 14:46:47 2006

Completed: ALTER DATABASE CLOSE NORMAL

Thu Dec 28 14:46:47 2006

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

Thu Dec 28 14:46:50 2006

freeing rdom 0

3.使用srvctl start命令启动数据库或实例

使用srvctl start database可以启动数据库的所有实例:

bash-2.05$ srvctl start database -d eygle

在第一个节点,警告日志记录了如下启动过程:

Thu Dec 28 14:54:27 2006

Starting ORACLE instance (normal)

LICENSE_MAX_SESSION = 0

LICENSE_SESSIONS_WARNING = 0

Interface type 1 bge1 192.168.18.0 configured from OCR for use as a cluster interconnect

Interface type 1 bge2 192.168.19.0 configured from OCR for use as a cluster interconnect

Interface type 1 bge0 172.16.19.0 configured from OCR for use as a public interface

Picked latch-free SCN scheme 3

Using LOG_ARCHIVE_DEST_1 parameter default value as /opt/oracle/product/10.2.0/db/dbs/arch

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.1.0.

System parameters with non-default values:

processes = 150

__shared_pool_size = 301989888

__large_pool_size = 16777216

__Java_pool_size = 16777216

__streams_pool_size = 0

spfile = /dev/vx/rdsk/xxfdg/spfile

sga_target = 1258291200

control_files = /dev/vx/rdsk/xxfdg/ctlfile1, /dev/vx/rdsk/xxfdg/ctlfile2

db_block_size = 8192

__db_cache_size = 905969664

compatible = 10.2.0.1.0

db_file_multiblock_read_count= 16

cluster_database = TRUE

cluster_database_instances= 2

thread = 2

instance_number = 2

undo_management = AUTO

undo_tablespace = UNDOTBS2

remote_login_passWordfile= EXCLUSIVE

db_domain =

remote_listener = LISTENERS_EYGLE

job_queue_processes = 10

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 = 300

pga_aggregate_target = 418381824

Cluster communication is configured to use the following interface(s) for this instance

192.168.18.12

192.168.19.12

Thu Dec 28 14:54:29 2006

cluster interconnect IPC version:Oracle UDP/IP

IPC Vendor 1 proto 2

DIAG started with pid=3, OS id=363

PMON started with pid=2, OS id=361

PSP0 started with pid=4, OS id=381

LMON started with pid=5, OS id=393

Thu Dec 28 14:54:30 2006

WARNING: Failed to set buffer limit on IPC interconnect socket

Oracle requires that the SocketReceive buffer size be tunable upto 1MB

Please make sure the kernel parameterwhich limits SO_RCVBUF value set by

applications is atleast 1MB

LMD0 started with pid=6, OS id=398

LMS0 started with pid=7, OS id=405

LMS1 started with pid=8, OS id=409

MMAN started with pid=9, OS id=413

DBW0 started with pid=10, OS id=415

LGWR started with pid=11, OS id=417

CKPT started with pid=12, OS id=419

SMON started with pid=13, OS id=433

RECO started with pid=14, OS id=451

CJQ0 started with pid=15, OS id=457

MMON started with pid=16, OS id=459

MMNL started with pid=17, OS id=462

Thu Dec 28 14:54:31 2006

lmon registered with NM - instance id 2 (internal mem no 1)

Thu Dec 28 14:54:32 2006

Reconfiguration started (old inc 0, new inc 2)

List of nodes:

0 1

Global Resource Directory frozen

* allocate domain 0, invalid = TRUE

Communication channels reestablished

Master broadcasted resource hash value bitmaps

Non-local Process blocks cleaned out

Thu Dec 28 14:54:33 2006

LMS 1: 0 GCS shadows cancelled, 0 closed

Thu Dec 28 14:54:33 2006

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

Thu Dec 28 14:54:33 2006

LMS 0: 0 GCS shadows traversed, 0 replayed

Thu Dec 28 14:54:33 2006

LMS 1: 0 GCS shadows traversed, 0 replayed

Thu Dec 28 14:54:33 2006

Submitted all GCS remote-cache requests

Fix write in gcs resources

Reconfiguration complete

LCK0 started with pid=18, OS id=527

Thu Dec 28 14:54:34 2006

ALTER DATABASE MOUNT

Thu Dec 28 14:54:34 2006

This instance was first to mount

Setting recovery target incarnation to 1

Thu Dec 28 14:54:39 2006

Successful mount of redo thread 2, with mount id 1429486954

Thu Dec 28 14:54:39 2006

Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)

Completed: ALTER DATABASE MOUNT

Thu Dec 28 14:54:40 2006

ALTER DATABASE OPEN

This instance was first to open

Picked broadcast on commit scheme to generate SCNs

Thu Dec 28 14:54:43 2006

Thread 2 advanced to log sequence 2

Thread 2 opened at log sequence 2

Current log# 4 seq# 2 mem# 0: /dev/vx/rdsk/xxfdg/redo202

Successful open of redo thread 2

Thu Dec 28 14:54:43 2006

MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set

Thu Dec 28 14:54:43 2006

SMON: enabling cache recovery

Thu Dec 28 14:54:45 2006

Instance recovery: looking for dead threads

Instance recovery: lock domain invalid but no dead threads

Thu Dec 28 14:54:50 2006

Successfully onlined Undo Tablespace 4.

Thu Dec 28 14:54:50 2006

SMON: enabling tx recovery

Thu Dec 28 14:54:51 2006

Database Characterset is ZHS16GBK

replication_dependency_tracking turned off (no async multimaster replication found)

Starting background process QMNC

QMNC started with pid=20, OS id=1234

Thu Dec 28 14:54:57 2006

Completed: ALTER DATABASE OPEN

节点2记录了如下启动过程:

Thu Dec 28 15:04:53 2006

Starting ORACLE instance (normal)

LICENSE_MAX_SESSION = 0

LICENSE_SESSIONS_WARNING = 0

Interface type 1 bge1 192.168.18.0 configured from OCR for use as a cluster interconnect

Interface type 1 bge2 192.168.19.0 configured from OCR for use as a cluster interconnect

Interface type 1 bge0 172.16.19.0 configured from OCR for use as a public interface

Picked latch-free SCN scheme 3

Using LOG_ARCHIVE_DEST_1 parameter default value as /opt/oracle/product/10.2.0/db/dbs/arch

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.1.0.

System parameters with non-default values:

processes = 150

__shared_pool_size = 318767104

__large_pool_size = 16777216

__java_pool_size = 16777216

__streams_pool_size = 0

spfile = /dev/vx/rdsk/xxfdg/spfile

sga_target = 1258291200

control_files = /dev/vx/rdsk/xxfdg/ctlfile1, /dev/vx/rdsk/xxfdg/ctlfile2

db_block_size = 8192

__db_cache_size = 889192448

compatible = 10.2.0.1.0

db_file_multiblock_read_count= 16

cluster_database = TRUE

cluster_database_instances= 2

thread = 1

instance_number = 1

undo_management = AUTO

undo_tablespace = UNDOTBS1

remote_login_passwordfile= EXCLUSIVE

db_domain =

remote_listener = LISTENERS_EYGLE

job_queue_processes = 10

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 = 300

pga_aggregate_target = 418381824

Cluster communication is configured to use the following interface(s) for this instance

192.168.18.11

192.168.19.11

Thu Dec 28 15:04:55 2006

cluster interconnect IPC version:Oracle UDP/IP

IPC Vendor 1 proto 2

PMON started with pid=2, OS id=1123

DIAG started with pid=3, OS id=1125

PSP0 started with pid=4, OS id=1127

LMON started with pid=5, OS id=1129

Thu Dec 28 15:04:56 2006

WARNING: Failed to set buffer limit on IPC interconnect socket

Oracle requires that the SocketReceive buffer size be tunable upto 1MB

Please make sure the kernel parameterwhich limits SO_RCVBUF value set by

applications is atleast 1MB

LMD0 started with pid=6, OS id=1131

LMS0 started with pid=7, OS id=1133

LMS1 started with pid=8, OS id=1137

MMAN started with pid=9, OS id=1141

DBW0 started with pid=10, OS id=1143

LGWR started with pid=11, OS id=1153

CKPT started with pid=12, OS id=1156

SMON started with pid=13, OS id=1167

RECO started with pid=14, OS id=1172

CJQ0 started with pid=15, OS id=1182

MMON started with pid=16, OS id=1184

MMNL started with pid=17, OS id=1186

Thu Dec 28 15:04:57 2006

lmon registered with NM - instance id 1 (internal mem no 0)

Thu Dec 28 15:04:57 2006

Reconfiguration started (old inc 0, new inc 2)

List of nodes:

0 1

Global Resource Directory frozen

* allocate domain 0, invalid = TRUE

Communication channels reestablished

Master broadcasted resource hash value bitmaps

Non-local Process blocks cleaned out

Thu Dec 28 15:04:59 2006

LMS 0: 0 GCS shadows cancelled, 0 closed

Thu Dec 28 15:04:59 2006

LMS 1: 0 GCS shadows cancelled, 0 closed

Set master node info

Submitted all remote-enqueue requests

Dwn-cvts replayed, VALBLKs dubious

All grantable enqueues granted

Post SMON to start 1st pass IR

Thu Dec 28 15:04:59 2006

LMS 0: 0 GCS shadows traversed, 0 replayed

Thu Dec 28 15:04:59 2006

LMS 1: 0 GCS shadows traversed, 0 replayed

Thu Dec 28 15:04:59 2006

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=1237

Thu Dec 28 15:05:00 2006

ALTER DATABASE MOUNT

Thu Dec 28 15:05:08 2006

Setting recovery target incarnation to 1

Thu Dec 28 15:05:09 2006

Successful mount of redo thread 1, with mount id 1429486954

Thu Dec 28 15:05:09 2006

Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)

Completed: ALTER DATABASE MOUNT

Thu Dec 28 15:05:10 2006

ALTER DATABASE OPEN

Picked broadcast on commit scheme to generate SCNs

Thu Dec 28 15:05:10 2006

Thread 1 opened at log sequence 16

Current log# 2 seq# 16 mem# 0: /dev/vx/rdsk/xxfdg/redo102

Successful open of redo thread 1

Thu Dec 28 15:05:10 2006

MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set

Thu Dec 28 15:05:10 2006

SMON: enabling cache recovery

Thu Dec 28 15:05:13 2006

Successfully onlined Undo Tablespace 1.

Thu Dec 28 15:05:13 2006

SMON: enabling tx recovery

Thu Dec 28 15:05:13 2006

Database Characterset is ZHS16GBK

replication_dependency_tracking turned off (no async multimaster replication found)

Starting background process QMNC

QMNC started with pid=20, OS id=1721

Thu Dec 28 15:05:20 2006

Completed: ALTER DATABASE OPEN

-The End-

原文地址:http://www.eygle.com/archives/2007/01/srvctl_oracle10g_rac.Html

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有