首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Oracle频道
中国IT教育
Google
首页 入门基础 安装配置 体系架构 PLSQL 备份恢复 性能调优 开发技术 资讯动态 考试认证 下载 专题 讨论
您现在的位置: 中国IT实验室 >> Oracle >> 开发技术 >> 正文

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

 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

 

[1] [2] [3] 下一页

【责编:Peng】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 专题推荐

 ·关于Java框架技术专题
 ·XML全攻略技术专题
 ·JAVA开源技术介绍专题
 ·Java嵌入式开发之J2ME技术专题
 ·超前体验 Oracle 11g的5个新特性…
 ·揭密使用VB.NET的五个实用技巧
 ·Oracle和SQL Server常用函数对比专题…
 ·展现C#世界 C#程序设计专题…
 ·Java入门 Tomcat的配置技巧精华专题…
 ·Oracle RMAN物理备份技术详解…
 今日更新
 社区讨论
 博客论点
 频道精选
 Oracle频道相关导航