【Exadata一体机】Dcli工具使用

Dcli工具可以从一台服务器上发起命令控制多台服务器, 但是dcli不支持远程应用使用交互式的方式。

 

以下为Dcli的语法:

 

–version Shows the version number of the program and then exits.
-c cells Specifies a comma-delimited list of target cells to which commands are sent.
-d destfile Specifies the target destination directory or file on remote cells to be used when copying files or directories using the -f option.
-f file Specifies the files to be copied to the cells. These files are not run. These files can be script files to be run later. The files are copied to the default home directory of the user on the target cell.
-g groupFile Specifies a file containing a list of target cells to which commands are sent. The cells can be identified by cell names or IP addresses.
-h, –help Displays help text and then exits.
-k Sets up SSH user-equivalence for the current user to the cells specified with the -c or -g option by appending public key files to the authorized_keys file on cells.
-l userId Identifies the user to log in as on remote cells. The default is the celladmin user.
-n Abbreviates nonerror output. Cells that return normal output
(return code of 0) only have the cell name listed.
The -n and -r options cannot be used together.
-r regexp Abbreviates the output lines that match a regular expression. All output lines with that pattern are deleted from output, and the cells names from those output lines are listed on one line. The -r and -n options cannot be used together.
-s sshOptions Passes a string of options to SSH.
–scp= scpOptions Passes a string of options to scp if different from sshoptions.
-t Displays the target cells that are named with the -c option or in the groupfile identified by the -g option.
-v Prints the verbose version of messages to stdout.
–vmstat=VMSTATOPS Displays view process, virtual memory, disk, trap, and CPU activity information, depending on the switches.
-x execFile Specifies the command file to be copied and run on the cells. The specified file contains a list of commands. A file with the .scl extension is run by the CellCLI utility. A file with a different extension is run by the operating system shell on the cell. The file is copied to the default home directory of the user on the target cell.

 

使用示例:

注意dbs_group 、all_group 、all_ib_group、cell_group、cell_ib_group等组文件一般仅在第一台computenode上有

[root@dm01db01 ~]# dcli -g    cell_group   -l   root     “cellcli -e list alerthistory”

 

dm01cel01: 7_1 2013-04-17T02:00:54-04:00 info “The disk controller battery is executing a learn cycle and may temporarily enter WriteThrough Caching mode as part of the learn cycle. Disk write throughput might be temporarily lower during this time. The flash drives are not affected. The battery learn cycle is a normal maintenance activity that occurs quarterly and runs for approximately 1 to 12 hours. Note that many learn cycles do not require entering WriteThrough caching mode. When the disk controller cache returns to the normal WriteBack caching mode, an additional informational alert will be sent. Battery Serial Number : 643 Battery Type : iBBU08 Battery Temperature : 40 C Full Charge Capacity : 1263 mAh Relative Charge : 97 % Ambient Temperature : 25 C”
dm01cel01: 7_2 2013-04-17T07:40:55-04:00 clear “All disk drives are in WriteBack caching mode. Battery Serial Number : 643 Battery Type : iBBU08 Battery Temperature : 44 C Full Charge Capacity : 1265 mAh Relative Charge : 76 % Ambient Temperature : 25 C”
dm01cel01: 8_1 2013-04-22T13:24:18-04:00 info “All disk drives have been temporarily placed in WriteThrough caching mode because the disk controller battery was replaced. The flash drives are not affected. Battery Serial Number : 384 Battery Type : iBBU08 Battery Temperature : 48 C Full Charge Capacity : 1327 mAh Relative Charge : 73 % Ambient Temperature : 25 C”
dm01cel01: 8_2 2013-04-22T14:24:18-04:00 clear “All disk drives are back in WriteBack caching mode. Battery has completed charging. Battery Serial Number : 384 Battery Type : iBBU08 Battery Temperature : 45 C Full Charge Capacity : 1330 mAh Relative Charge : 73 % Ambient Temperature : 25 C”
dm01cel02: 7 2013-03-11T21:18:34-04:00 critical “RS-7445 [Serv MS is absent] [It will be restarted] [] [] [] [] [] [] [] [] [] []”
dm01cel02: 8_1 2013-04-17T02:01:02-04:00 info “The disk controller battery is executing a learn cycle and may temporarily enter WriteThrough Caching mode as part of the learn cycle. Disk write throughput might be temporarily lower during this time. The flash drives are not affected. The battery learn cycle is a normal maintenance activity that occurs quarterly and runs for approximately 1 to 12 hours. Note that many learn cycles do not require entering WriteThrough caching mode. When the disk controller cache returns to the normal WriteBack caching mode, an additional informational alert will be sent. Battery Serial Number : 541 Battery Type : iBBU08 Battery Temperature : 41 C Full Charge Capacity : 1291 mAh Relative Charge : 97 % Ambient Temperature : 25 C”
dm01cel02: 8_2 2013-04-17T08:14:24-04:00 clear “All disk drives are in WriteBack caching mode. Battery Serial Number : 541 Battery Type : iBBU08 Battery Temperature : 45 C Full Charge Capacity : 1278 mAh Relative Charge : 76 % Ambient Temperature : 25 C”
dm01cel02: 9_1 2013-04-22T13:17:28-04:00 info “All disk drives have been temporarily placed in WriteThrough caching mode because the disk controller battery was replaced. The flash drives are not affected. Battery Serial Number : 940 Battery Type : iBBU08 Battery Temperature : 47 C Full Charge Capacity : 1328 mAh Relative Charge : 73 % Ambient Temperature : 25 C”
dm01cel02: 9_2 2013-04-22T14:19:08-04:00 clear “All disk drives are back in WriteBack caching mode. Battery has completed charging. Battery Serial Number : 940 Battery Type : iBBU08 Battery Temperature : 45 C Full Charge Capacity : 1330 mAh Relative Charge : 74 % Ambient Temperature : 25 C”
dm01cel03: 16_1 2013-04-17T02:01:20-04:00 info “The disk controller battery is executing a learn cycle and may temporarily enter WriteThrough Caching mode as part of the learn cycle. Disk write throughput might be temporarily lower during this time. The flash drives are not affected. The battery learn cycle is a normal maintenance activity that occurs quarterly and runs for approximately 1 to 12 hours. Note that many learn cycles do not require entering WriteThrough caching mode. When the disk controller cache returns to the normal WriteBack caching mode, an additional informational alert will be sent. Battery Serial Number : 1485 Battery Type : iBBU08 Battery Temperature : 41 C Full Charge Capacity : 1205 mAh Relative Charge : 97 % Ambient Temperature : 25 C”
dm01cel03: 16_2 2013-04-17T07:58:03-04:00 clear “All disk drives are in WriteBack caching mode. Battery Serial Number : 1485 Battery Type : iBBU08 Battery Temperature : 44 C Full Charge Capacity : 1111 mAh Relative Charge : 87 % Ambient Temperature : 25 C”
dm01cel03: 17_1 2013-04-22T13:35:40-04:00 info “All disk drives have been temporarily placed in WriteThrough caching mode because the disk controller battery was replaced. The flash drives are not affected. Battery Serial Number : 941 Battery Type : iBBU08 Battery Temperature : 45 C Full Charge Capacity : 1328 mAh Relative Charge : 72 % Ambient Temperature : 25 C”
dm01cel03: 17_2 2013-04-22T14:35:40-04:00 clear “All disk drives are back in WriteBack caching mode. Battery has completed charging. Battery Serial Number : 941 Battery Type : iBBU08 Battery Temperature : 44 C Full Charge Capacity : 1332 mAh Relative Charge : 73 % Ambient Temperature : 25 C”

 

[oracle@dm01db01 ~]$ dcli -l oracle -g /home/oracle/dbs_group “echo $(hostname -s)”
dm01db01: dm01db01
dm01db02: dm01db01

 

列出每天db node上的instance alert.log

dcli -l oracle -g /home/oracle/dbs_group “ls –l /u01/app/oracle/diag/rdbms/ORCL/ORCL*/trace/alert_ORCL*.log”

 

为当前用户创建ssh等价性:

dcli -k -g mycells

Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号