oracle leases,Orcle 12c 新特性---Oracle Cluster What-If Command Evaluation

1

说明

Oracle Clusterware现在提供了一组评估命令,来确定在实际执行操作之前该操作的影响。这个特性帮助了DBA们确定自己所执行的操作对集群的影响,从而能够做出正确并影响小的决定。

2

查看帮助命令

https://www.cndba.cn/cndba/Expect-le/article/2139

[Expect-le@www.cndba.cn~]$ crsctl -help

Usage: crsctl add - add a resource, type or other entity

crsctl check - check the state or operating status of a service, resource, or other entity

crsctl config - display automatic startup configuration

crsctl debug - display or modify debug state

crsctl delete - delete a resource, type or other entity

crsctl disable - disable automatic startup

crsctl discover - discover DHCP server

crsctl enable - enable automatic startup

crsctl eval - evaluate operations on resource or other entity without performing them

crsctl get - get an entity value

crsctl getperm - get entity permissions

crsctl lsmodules - list debug modules

crsctl modify - modify a resource, type or other entity

crsctl query - query service state

crsctl pin - make the leases of specified nodes immutable

crsctl relocate - relocate a resource, server or other entity

crsctl replace - change the location of voting files

crsctl release - release a DHCP lease

crsctl request - request a DHCP lease or an action entry point

crsctl setperm - set entity permissions

crsctl set - set an entity value

crsctl start - start a resource, server or other entity

crsctl status - get status of a resource or other entity

crsctl stop - stop a resource, server or other entity

crsctl unpin - make the leases of previously pinned nodes mutable

crsctl unset - unset an entity value, restoring its default

新增一个eval命令,用于评估该命令,但不实际执行。

3

eval支持的操作

crsctl eval activate policy

crsctl eval add resource

crsctl eval add server

crsctl eval add serverpool

crsctl eval delete server

crsctl eval delete serverpool

crsctl eval fail resource

crsctl eval modify resource

crsctl eval modify serverpool

crsctl eval relocate resource

crsctl eval relocate server

crsctl eval start resource

crsctl eval stop resource

注意:CRSCTL can only evaluate third-party resources. Resources with the .ora prefix, such as ora.orcl.db, must be evaluated using SRVCTL commands.  --从12.1开始,Oracle禁止使用CRSCTL评估ora.资源的操作,统一使用SRVCTL命令。实际上从12c开始,crsctl的功能已经被弱化了。大大强化了SRVCTL命令的功能。

报错:

CRS-4995:  The command 'stop  resource' is invalid in crsctl. Use srvctl for this command

3.1

crsctl eval -help可查看更为详细的帮助信息

例如:

Usage:

crsctl eval start resource {|-w }[-n server] [-f]

Evaluate start of specified resources

where

resname Name of a resource

-w Resource filter

-n Server Name

-f Evaluate as with force option

crsctl eval stop resource {|-w } [-f]

Evaluate stop of specified resources

where

resname Name of a resource

-w Resource filter

-f Evaluate as with force option

4

例子-CRSCTL

4.1

添加一个resource

---添加一个TYPE

https://www.cndba.cn/cndba/Expect-le/article/2139

crsctl add type cndba -basetype cluster_resource -attr "ATTRIBUTE=FOO,TYPE=integer,DEFAULT_VALUE=0"

--添加资源,type名称错误

[Expect-le@www.cndba.cn~]$ crsctl eval add resource test_resource -type cndbaa

Stage Group 1:

-------------------------------------------------------------------------------

Stage NumberRequiredAction

--------------------------------------------------------------------------------

1 NError code [220] for entity [test_resource].

Message is [CRS-0175: Resource type 'cndbaa'

either doesn't exist or cannot be accessed.].

--TYPE名称正确,则没有提示

https://www.cndba.cn/cndba/Expect-le/article/2139

[Expect-le@www.cndba.cn~]$ crsctl eval add resource test_resource -type cndba

[Expect-le@www.cndba.cn~]$

5

例子-SRVCTL

5.1

支持的命令

srvctl add database

srvctl add service

srvctl add srvpool

srvctl modify database

srvctl modify service

srvctl modify srvpool

srvctl relocate server

srvctl relocate service

srvctl remove srvpool

srvctl start database

srvctl start service

srvctl stop database

srvctl stop service

5.2

停止数据库

[Expect-le@www.cndba.cn~]$ srvctl stop database -db cndba -stopoption NORMAL -eval

PRKO-2712 :Administrator-managed database cndba is not supported with -eval option

这里报了个错,说Administrator-managed管理的数据库不支持eval选项。

官网解释:administrator-managed database:

A database that you specifically define on which servers it can run, and where services can run within the database.

--查看数据库配置信息

https://www.cndba.cn/cndba/Expect-le/article/2139

[Expect-le@www.cndba.cn~]$ srvctl config database -db cndba

Database unique name: cndba

Database name: cndba

Oracle home: /u01/app/oracle/12.2.0/db_1

Oracle user: oracle

Spfile: +DATA/CNDBA/PARAMETERFILE/spfile.276.951664119

Password file: +DATA/CNDBA/PASSWORD/pwdcndba.256.951662701

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA

Mount point paths:

Services:

Type: RAC

Start concurrency:

Stop concurrency:

OSDBA group: dba

OSOPER group: oper

Database instances: cndba1,cndba2

Configured nodes: rac1,rac2

Database is administrator managed

[Expect-le@www.cndba.cn~]$ srvctl config service -db cndba

[Expect-le@www.cndba.cn~]$

将 Administrator-Managed Database 转换为Policy-Managed Database:

5.2.1

再次评估关闭数据库

https://www.cndba.cn/cndba/Expect-le/article/2139

[Expect-le@www.cndba.cn~]$ srvctl stop database -db cndba -stopoption NORMAL -eval

Database cndba will be stopped on node rac1

可以看到Oracle提示数据库会在节点rac1上被关闭。

5.3

查看数据库状态

[Expect-le@www.cndba.cn~]$ srvctl status database -db cndba

Instance cndba_1 is running on node rac1

数据库正常运行。

更多详细信息,参考官方文档:

https://www.cndba.cn/cndba/Expect-le/article/2139

https://www.cndba.cn/cndba/Expect-le/article/2139

https://www.cndba.cn/cndba/Expect-le/article/2139

版权声明:本文为博主原创文章,未经博主允许不得转载。

Oracle Cluster What-If Command Evaluation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值