Oracle Rac check commands
==> Asm commmands
set pagesize 2000
set lines 2000
set long 999
col path for a54
select name, path, header_status, total_mb free_mb, trunc(bytes_read/1024/1024) read_mb, trunc(bytes_written/1024/1024) write_mb from v$asm_disk;
SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;
select * from V$ASM_DISK_IOSTAT;
==> Mount/dismount ASM disk groups
-- For mount a diskgroup,(This is instance specific, for mounting on all nodes, run the same on all nodes)
SQL>alter diskgroup DATA mount;
or
asmcmd>mount DATA
-- For umount a diskgroup,(This is instance specific, for unmounting on all nodes, run the same on all nodes)
SQL>alter diskgroup DATA dismount;
Or
asmcmd>umount DATA
-- To mount/Dismount all the diskgroups
SQL>alter diskgroup ALL mount;
SQL>alter diskgroup ALL dismount;
==> Drop ASM diskgroup
-- To drop a diskgroup, make sure the diskgroup has been dismounted from all the remote nodes, It should be mounted only
on the local nodes, where we will run the drop command.
drop diskgroup NSMREDOA including contents
==> Drop Disk
Drop an ASM disk
-----Dropping one disk:
alter diskgroup data drop disk DATA_ASM0001;
-----Dropping multiple disk:
alter diskgroup data drop disk DATA_ASM0001,DATA_ASM00002, DATA_ASM0003 rebalance power 100;
---- Monitoring the rebalance operation:
select * from v$asm_operation;
set pagesize 299
set lines 2999
select GROUP_NUMBER,OPERATION,STATE,POWER, ACTUAL,ACTUAL,EST_MINUTES from gv$asm_operation;
alter diskgroup SALDATA rebalance power 4;
==> Create ASM disk in Linux using oracleasm
-- Check the asm disk labelling
#/etc/init.d/oracleasm querydisk /dev/sdn1
Device "/dev/sdn" is not marked as an ASM disk
-- Create asm disk
# /etc/init.d/oracleasm createdisk ARCDATA /dev/sdn1
Marking disk "ARCDATA" as an ASM disk: [ OK ]
-- Check the asm disk labelling
# /etc/init.d/oracleasm querydisk /dev/sdn1
Device "/dev/sdn1" is marked an ASM disk with the label "ARCDATA"
-- List the asm disks present
# /etc/init.d/oracleasm listdisks
ARCDATA
==> Modify ASM user password
-- list asm users
ASMCMD> lspwusr
Username sysdba sysoper sysasm
SYS TRUE TRUE TRUE
ASMSNMP TRUE FALSE FALSE -- >
-- Modify user password
ASMCMD> orapwusr --modify asmsnmp
Enter password: ********
==> How to Change ASM sys password
$ export ORACLE_SID=+ASM
$ asmcmd
ASMCMD> orapwusr --modify --password sys
Enter password: ******
ASMCMD> exit
Alternatively, we can use orapwd to recreate pwd file
ASMCMD
2. List asm disks:
-- List all asm disks
ASMCMD> lsdsk -k
-- List disks of a diskgroup(CDATA) with free and total MB
ASMCMD> lsdsk -k -G CDATA
-- List disks of a diskgroup(CDATA) with group and disk number
ASMCMD> lsdsk -p -G CDATA
-- List disks with disk creation date
ASMCMD> lsdsk -t -G CDATA
-- List candidiate disks only
ASMCMD> lsdsk --candidate -k
-- List member disks only
ASMCMD> lsdsk --candidate -p
-- List attribute of all diskgroups:
ASMCMD> lsattr -lm
-- List attribute of specific diskgroup(DMARCH)
ASMCMD> lsattr -lm -G DMARCH
-- List attributes with specific pattern
ASMCMD> lsattr -lm %au_size%
-- mount all diskgroups on local node
ASMCMD> mount -a
--- mount a specific diskgroup on local node
ASMCMD> mount ARCH
-- here asm_power_limit is 8 and diskgroup is ARCH
ASMCMD> rebal --power 8 ARCH
8 .Get password file of asm :
ASMCMD> pwget --dbuniquename DBACLASS
ASMCMD> pwget --asm
ASMCMD> showclustermode
ASMCMD> showclusterstate
Srvctl commands :
srvctl status nodeapps
srvctl config nodeapps -viponly
CRS commands :
=> Crs Commands :
# crsctl stop has
# crsctl start has
#crsctl start has
#crsctl stop has
#crsctl disable has
#crsctl enable has
# crsctl enable crs
# crsctl disable crs
crsctl check ctss
crsctl check cluster -all
crsctl stat res -t
crsctl check has
crsctl config has
crsctl query crs softwareversion
crsctl query has releaseversion
crsctl query crs activeversion
crsctl get cluster configuration
crsctl check crs
crsctl check cssd
crsctl check crsd
crsctl check evmd
crsctl status resource ora.testcdb.db -f
crsctl status res ora.pro02int.db -t
crsctl get node role status -all
crsctl get css misscount
crsctl get css disktimeout
Other cluster commands :
cemutlo -n
oifcfg getif -- interconnect information
oifcfg iflist -p -n
Olsnodes :
-- List of nodes in the cluster
olsnodes
-- Nodes with node number
olsnodes -n
-- Node with vip
olsnodes -i
olsnodes -s -t
-- Leaf or Hub
olsnodes -a
-- Getting private ip details of the local node
olsnodes -l -p
-- Get cluster name
olsnodes -c
Ocr and Voting Disk commands :
crscrtl query css votedisk
crsctl replace votedisk +NEW_DG
ocrcheck
ocrconfig -showbackup
ocrconfig -manualbackup
cluvfy commands :
cluvfy comp clocksync -n all
Correct the START_DEPENDENCIES Attribute value
[oracle@ed-olraclin1:TESTCDB1:~]$ /u01/19.0/grid/bin/crsctl modify resource ora.testcdb.db -attr "START_DEPENDENCIES='hard(global:uniform:ora.TEST.dg) pullup(global:ora.TEST.dg) weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns)'" -unsupported
Note the -unsupported option used to modify this Attribute value while this option is not required to modify any other Attribute's value. Moreover this option is not mentioned in the Syntax as shown below,
Comments
Post a Comment