srvctl即Server Control,是一个命令行工具,用以管理Oracle的RAC环境,srvctl在Oracle9i中引入,Oracle10g对其功能进行了大大增强。
在命令行下,使用-h参数可以察看srvctl支持的命令及参数:
bash-2.05$ srvctl -h
Usage: srvctl [-V]
................<
br />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&nbs (本文已被浏览 次) | | |