cron run every hr
every Hr ....
59 min =hr
59 * * * * echo " ">/var/log/warn > /dev/null 2>&1
59 * * * * echo " ">/var/log/messages > /dev/null 2>&1
Search This Blog
Total Pageviews
Thursday, 4 November 2010
Tuesday, 2 November 2010
expdp with Query
expdp "'/ as sysdba'" directory=datapump_dir DUMPFILE=user_sites.dmp TABLES=cccprod1.user_sites QUERY=ANUJ.user_sites:\"order by USER_OBJECT_ID,SITE_NO\" EXCLUDE=STATISTICS
with parallel option
-bash-3.00$ expdp "'/ as sysdba'" directory=datapump_dir DUMPFILE=user_sites%U.dmp TABLES=cccprod1.user_sites QUERY=cccprod1.user_sites:\"order by USER_OBJECT_ID,SITE_NO\" EXCLUDE=STATISTICS PARALLEL=4 LOGFILE=user_sites_exp.log job_name=anuj1
with parallel option
-bash-3.00$ expdp "'/ as sysdba'" directory=datapump_dir DUMPFILE=user_sites%U.dmp TABLES=cccprod1.user_sites QUERY=cccprod1.user_sites:\"order by USER_OBJECT_ID,SITE_NO\" EXCLUDE=STATISTICS PARALLEL=4 LOGFILE=user_sites_exp.log job_name=anuj1
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
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;
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 ;
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
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
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
Subscribe to:
Posts (Atom)
Oracle DBA
anuj blog Archive
- ► 2011 (362)
