Search This Blog

Total Pageviews

Monday, 1 November 2010

Oracle OCR and voting disk

OCR : File that manages the cluster and RAC configuration

Voting Disk : Contains and manages information of all the node memberships and avoid
split-brain

Oracle Licensing Option usage

Oracle Licensing Option usage

set pagesize 200
select name,last_usage_date from dba_feature_usage_statistics where detected_usages>0 order by 1;

SET PAGES 200
COL "Component" FORMAT A55 TRUNC
SELECT name "Component", currently_used "Used",first_usage_date "Start", last_usage_date "Last Time"
FROM dba_feature_usage_statistics;

RAC database user lock script

SQL> connect sys@rac1/sys as sysdba
Connected.



SQL> SELECT o.name object_name, u.name owner, lid.*
FROM (SELECT
s.inst_id, s.SID, s.serial#, p.spid,NVL (s.sql_id, 0), s.sql_hash_value,
DECODE (l.TYPE,
'TM', l.id1,
'TX', DECODE (l.request,
0, NVL (lo.object_id, -1),
s.row_wait_obj#
),
-1
) AS object_id,
l.TYPE lock_type,
DECODE (l.lmode,
0, 'NONE',
1, 'NULL',
2, 'ROW SHARE',
3, 'ROW EXCLUSIVE',
4, 'SHARE',
5, 'SHARE ROW EXCLUSIVE',
6, 'EXCLUSIVE',
'?'
) mode_held,
DECODE (l.request,
0, 'NONE',
1, 'NULL',
2, 'ROW SHARE',
3, 'ROW EXCLUSIVE',
4, 'SHARE',
5, 'SHARE ROW EXCLUSIVE',
6, 'EXCLUSIVE',
'?'
) mode_requested,
l.id1, l.id2, l.ctime time_in_mode,s.row_wait_obj#, s.row_wait_block#,
s.row_wait_row#, s.row_wait_file#
FROM gv$lock l,
gv$session s,
gv$process p,
(SELECT object_id, session_id, xidsqn
FROM gv$locked_object
WHERE xidsqn > 0) lo
WHERE l.inst_id = s.inst_id
AND s.inst_id = p.inst_id
AND s.SID = l.SID
AND p.addr = s.paddr
AND l.SID = lo.session_id(+)
AND l.id2 = lo.xidsqn(+)) lid,
SYS.obj$ o,
SYS.user$ u
WHERE o.obj#(+) = lid.object_id
AND o.owner# = u.user#(+)
AND object_id <> -1 ;

oracle RAC raw device ownership and permissions

lost permission/ownership on ocr&voting device after reboot


from Metalink


Add the required raw device ownership and permissions, for example:
# vi /etc/udev/rules.d/99-raw.rules
KERNEL=="raw[1-2]*", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="660"


or

[root@rac1 ~]# cat /etc/udev/rules.d/99-raw.rules
KERNEL=="raw[1-2]*", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="660"


Restart the UDEV service
Restart the UDEV service as follows, after which devices should now reflect their intended ownership and permissions:

On SLES10:
# /etc/init.d/boot.udev stop
# /etc/init.d/boot.udev start

On RHEL5/OEL5:
# udevcontrol reload_rules
# start_udev

Failure at final check of Oracle CRS stack. 10

Failure at final check of Oracle CRS stack 10



as a root user ( on both the node )


To stop firewall

service iptables stop

service ip6tables stop ( if any )


To permanently disable the firewall, use:

chkconfig iptables off

chkconfig ip6tables off


clear crs and try again .



============

[root@apt-rdbms-01 ~]# iptables -L <------ to check iptable
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT esp -- anywhere anywhere
ACCEPT ah -- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT tcp -- anywhere anywhere tcp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
[root@apt-rdbms-01 ~]# /etc/init.d/iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@apt-rdbms-01 ~]# chkconfig iptables off

Oracle RAC file information on Sql prompt

set linesize 200

select name from v$datafile
union
select name from v$controlfile
union
select name from v$tempfile
union
select member from v$logfile
/

NAME
--------------------------------------------------------------------------------
+DATA/rac/controlfile/current.256.733574031
+DATA/rac/datafile/sysaux.261.733574211
+DATA/rac/datafile/system.259.733574119
+DATA/rac/datafile/undotbs1.260.733574185
+DATA/rac/datafile/undotbs2.263.733574285
+DATA/rac/datafile/users.264.733574311
+DATA/rac/onlinelog/group_1.257.733574057
+DATA/rac/onlinelog/group_2.258.733574085
+DATA/rac/onlinelog/group_3.265.733578267
+DATA/rac/onlinelog/group_4.266.733578281
+DATA/rac/tempfile/temp.262.733574229

11 rows selected.



set linesize 200

select group_number, name,allocation_unit_size alloc_unit_size,state,type,total_mb,usable_file_mb
from v$asm_diskgroup

GROUP_NUMBER NAME ALLOC_UNIT_SIZE STATE TYPE TOTAL_MB USABLE_FILE_MB
------------ -------------------- --------------- ----------- ------ ---------- --------------
1 DATA 1048576 CONNECTED NORMAL 3057 -264



col file_name format a50
select file_name, bytes/1024/1024 from dba_data_files

FILE_NAME BYTES/1024/1024
-------------------------------------------------- ---------------
+DATA/rac/datafile/system.259.733574119 410
+DATA/rac/datafile/undotbs1.260.733574185 110
+DATA/rac/datafile/sysaux.261.733574211 230
+DATA/rac/datafile/undotbs2.263.733574285 100
+DATA/rac/datafile/users.264.733574311 5



col HOST_NAME format a20
select instance_name, host_name, archiver, thread#, status from gv$instance

INSTANCE_NAME HOST_NAME ARCHIVE THREAD# STATUS
---------------- -------------------- ------- ---------- ------------
rac1 rac1 STOPPED 1 OPEN
rac2 rac2 STOPPED 2 OPEN

col MEMBER format a50
select group#, type, member, is_recovery_dest_file from v$logfile
order by group#

GROUP# TYPE MEMBER IS_
---------- ------- -------------------------------------------------- ---
1 ONLINE +DATA/rac/onlinelog/group_1.257.733574057 NO
2 ONLINE +DATA/rac/onlinelog/group_2.258.733574085 NO
3 ONLINE +DATA/rac/onlinelog/group_3.265.733578267 NO
4 ONLINE +DATA/rac/onlinelog/group_4.266.733578281 NO



select group_number, file_number, compound_index, incarnation, block_size, bytes/1024/1024/1024 GB, type, striped,
creation_date, modification_date
from v$asm_file
where TYPE != 'ARCHIVELOG'
/

no rows selected


SQL>
select group_number, file_number, bytes/1024/1024/1024 GB, type, striped, modification_date
from v$asm_file
where TYPE != 'ARCHIVELOG' ;


no rows selected

Oracle DBA

anuj blog Archive