惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

博客园 - LiuLei

[转]oracle RAC 日志体系 [转]oracle v$sqlarea 分析SQL语句使用资源情况 SQL2008数据库还原后显示受限制用户解决办法 [转].net 连接oracle的几种方式 [转]动态交叉表 二维表 [转]日常养生:按摩七大养生穴位 让你百毒不侵! [转]两个长寿穴合谷与内关 [原]C#错误解决-"Window无法访问指定设备,路径或文件..." [转]WeifenLuo.WinFormsUI.Docking——DockPanel的一点点改进 [转]VS2010 项目引用了DLL文件,也写了Using,但是编译时提示:未能找到类型或命名空间名称 [原]升级sqlserver2008 r2的错误:perf-ReportServer-rsctr.dll被使用 [原]安装SQL SERVER2008错误:Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings [原]卸载mssqlserver2008R2并重新安装 [原] sqlserver2008 还原数据库出现错误:3154 [转]【C#】Color颜色对照表 [转]关于本博客数据仓库方面的原创文章汇总 [解决]CS0016: 未能写入输出文件...\App_Web_default.aspx.cdcab7d2.zii776dc.dll”--"拒绝访问。 " 解决方法 - LiuLei [解决]Windows 7 IIS (HTTP Error 500.21 - Internal Server Error)解决 [解决]无法识别的属性“targetFramework”。请注意属性名称区分大小写。错误解决办法
[转]Oracle10g RAC crsctl&srvctl
LiuLei · 2013-08-13 · via 博客园 - LiuLei

记录RAC常用的命令

\Oracle10g RAC on Solaris10(crsctl&srvctl)
转:http://blog.sina.com.cn/s/blog_4d22b9720100ezf4.html

---------------------Start/Stop Instance--------------------

$ srvctl status database -d racdb
$ srvctl stop instance -d racdb -i racdb1 -o abort
$ srvctl status database -d racdb

$ srvctl start instance –d db –i db02

-------------------Start/Stop CRS--------------------------
$ crsctl check crs

$ crsctl stop crs
$ /etc/init.crs stop
$ crs_stop –all

$ crsctl start crs
$ /etc/init.crs start

$ /etc/init.crs disable
$ /etc/init.crs enable

-----------------CRS Resource-----------------------------
$ crs_stat
$ crs_stat -t
$ crsctl check boot
$ crsctl check crs
# /etc/init.crs disable
# /etc/init.crs stop
# su – oracle
$ cd $ORA_CRS_HOME/bin
$./ocrconfig -restore /opt/app/oracle/crs/cdata/crs/week.ocr
# /etc/init.crs enable

$ crsctl
Usage: crsctl check crs - checks the viability of the CRS stack
crsctl check cssd - checks the viability of CSS
crsctl check crsd - checks the viability of CRS
crsctl check evmd - checks the viability of EVM
crsctl set css <parameter> <value> - sets a parameter override
crsctl get css <parameter> - gets the value of a CSS parameter
crsctl unset css <parameter> - sets CSS parameter to its default
crsctl query css votedisk - lists the voting disks used by CSS
crsctl add css votedisk <path> - adds a new voting disk
crsctl delete css votedisk <path> - removes a voting disk
crsctl enable crs - enables startup for all CRS daemons
crsctl disable crs - disables startup for all CRS daemons
crsctl start crs - starts all CRS daemons.
crsctl stop crs - stops all CRS daemons. Stops CRS resources in case of cluster.
crsctl start resources - starts CRS resources.
crsctl stop resources - stops CRS resources.
crsctl debug statedump evm - dumps state info for evm objects
crsctl debug statedump crs - dumps state info for crs objects
crsctl debug statedump css - dumps state info for css objects
crsctl debug log css [module:level]{,module:level} ...
- Turns on debugging for CSS
crsctl debug trace css - dumps CSS in-memory tracing cache
crsctl debug log crs [module:level]{,module:level} ...
- Turns on debugging for CRS
crsctl debug trace crs - dumps CRS in-memory tracing cache
crsctl debug log evm [module:level]{,module:level} ...
- Turns on debugging for EVM
crsctl debug trace evm - dumps EVM in-memory tracing cache
crsctl debug log res <resname:level> turns on debugging for resources
crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
crsctl query crs activeversion - lists the CRS software operating version
crsctl lsmodules css - lists the CSS modules that can be used for debugging
crsctl lsmodules crs - lists the CRS modules that can be used for debugging
crsctl lsmodules evm - lists the EVM modules that can be used for debugging

SRVCTL命令介绍
SRVCTL命令可以控制RAC数据库中的instance,listener以及services。
通常SRVCTL在ORACLE用户下执行。下面我们来介绍srvctl命令。
1、通过SRVCTL命令来start/stop/check所有的实例:
$ srvctl start|stop|status database -d <db_name>

2、start/stop指定的实例:
$ srvctl start|stop|status instance -d <db_name> -i <instance_name>

3、列出当前RAC下所有的
$ srvctl config database -d <db_name>

4、start/stop/check 所有的nodeapps,比如:VIP, GSD, listener, ONS:
$ srvctl start|stop|status nodeapps -n <node_name>
5、如果你使用ASM,srvctl也可以start/stop ASM实例:
$ srvctl start|stop asm -n <node_name> [-i <asm_inst_name>] [-o<oracle_home>]
6、可以获取所有的环境信息:
$ srvctl getenv database -d <db_name> [-i <instance_name>]
7、设置全局环境和变量:
$ srvctl setenv database -d <db_name> -t LANG=en
8、从OCR中删除已有的数据库:
$ srvctl remove database -d <db_name>
9、向OCR中添加一个数据库:
$ srvctl add database -d <db_name> -o <oracle_home>
[-m <domain_name>] [-p<spfile>] [-A <name|ip>/netmask] [-r {PRIMARY | PHYSICAL_STANDBY |LOGICAL_STANDBY}] [-s <start_options>]
10、向OCR中添加一个数据库的实例:
$ srvctl add instance -d <db_name> -i <instance_name> -n <node1>
$ srvctl add instance -d <db_name> -i <instance_name> -n <node2>
11、向OCR中添加一个ASM实例:
$ srvctl add asm -n <node_name> -i <asm_inst_name> -o <oracle_home>
12、添加一个service
$ srvctl add service -d <db_name> -s <service_name> -r <preferred_list>

[-a <available_list>] [-P <TAF_policy>] [-u]
13、修改在其他节点上的service
$ srvctl modify service -d <db_name> -s <service_name> -I <orig_instance_name> -t <target_instance_name>
14、relocate 某个节点的service到其他节点
srvctl relocate service -d <db_name> -s <service_name> -I
<orig_instance_name> -t <target_instance_name>

SRVCTL相关的选项
SRVCTL START/STOP/STATUS options:
-d database name
-i instance name
-n node name (for nodeapps)

SRVCTL ADD options:
-A vip range, node, and database, address specification. The format of address string is:
[<logical host name>]/<VIP address>/<net mask> [/<host interface1 [ | host interface2 |..]>] [,]
[<logical host name>]/<VIP address>/<net mask> [/<host interface1[ | host interface2 |..]>]
-a for services, list of available instances, this list cannot include preferred instances
-m domain name with the format “us.domain.com”
-n node name that will support one or more instances
-o $ORACLE_HOME to locate Oracle binaries
-P for services, TAF preconnect policy - NONE, PRECONNECT
-r for services, list of preferred instances, this list cannot include available instances.
-s spfile name
-u updates the preferred or available list for the service to support the specified
instance. Only one instance may be specified with the -u switch. Instances that already
support the service should not be included.

SRVCTL MODIFY options:
-i <instance-name> -t <instance-name> : the instance name (-i) is replaced by the
instance name (-t) -i <instance-name>
-r : the named instance is modified to be a preferred instance -A address-list for VIP application,
at node level -s <asm_inst_name> : add or remove ASM dependency

SRVCTL RELOCATE options:
-i <instance-name> -t <instance-name> : the instance name (-i) is replaced by the instance name (-t)

CRS及相关服务的常用命令
1、查看状态的命令
# su – oracle -- 先切换到oracle用户
$ crs_stat -t -- 查看crs及所有的service的状态
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application ONLINE ONLINE db01
ora....radb.cs application ONLINE ONLINE db01
ora....db1.srv application ONLINE ONLINE db01
ora....db2.srv application ONLINE ONLINE db02
ora....b1.inst application ONLINE ONLINE db01
ora....b2.inst application ONLINE ONLINE db02
ora....C1.lsnr application ONLINE ONLINE db01
ora.db01.gsd application ONLINE ONLINE db01
ora.db01.ons application ONLINE ONLINE db01
ora.db01.vip application ONLINE ONLINE db01
ora....C2.lsnr application ONLINE ONLINE db02
ora.db02.gsd application ONLINE ONLINE db02
ora.db02.ons application ONLINE ONLINE db02
ora.db02.vip application ONLINE ONLINE db02
$ crsctl check crs -- 用crsctl命令,检查crs相关服务的状态
CSS appears healthy
CRS appears healthy
EVM appears healthy
$ srvctl status nodeapps -n db01 (db02) -- 使用srvctl查看所有节点上的服务是否正常
VIP is running on node:db01
GSD is running on node:db01
Listener is running on node:db01
ONS daemon is running on node:db01
$ srvctl status database -d db -- 使用srvctl查看数据库状态
Instance db01 is running on node db01
Instance db02 is running on node db02
2、启动和关闭相关服务的命令
# su – oracle
$ crs_start –all --启动所有的crs服务
$ crs_stop –all --停止所有的crs服务
$ crsctl start crs --启动crs服务
$ crsctl stop crs --停止crs服务

$ srvctl start nodeapps -n db01(db02) --启动某节点上所有的应用
$ srvctl stop nodeapps -n db01(db02) --停止某节点上所有的应用
$ srvctl start listener -n db01(db02) --启动某个节点的listener
$ srvctl stop listener -n db01(db02) --停止某个节点的listener
$ srvctl start instance –d db –i db01(db02) --启动某个instance
$ srvctl stop instance –d db –i db01(db02) --停止某个instance
$ srvctl start database –d db --启动数据库
$ srvctl stop database –d db --停止数据库