Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to collect log files in case of server crash Post 302848877 by Siva SQL on Friday 30th of August 2013 09:27:40 AM
Old 08-30-2013
HP Script to collect log files in case of server crash

Environmnet: HP-UX B.11.31 U ia64
RDBMS: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

Question:

When server hangs or node evicts, we open up tickets with Oracle Support and Oracle Support ask for some list of log files.

Currently we can not use the TFA(trace file analyzer) tool/script.

We like to automate the log from following location;

Clusterware related:
1.CRS logs from $ORA_CRS_HOME/log/<hostname>/crsd/
2.CSS logs from $ORA_CRS_HOME/log/<hostname>/cssd/
3.CRS alert<nodename>.log present from the $ORA_CRS_HOME/log/<hostname>

OS related
4.OS log /var/adm/syslog/syslog.log
5. OSWatcher logs from all nodes

DB related
6. DB alert.log and all trace files from bdump & udump directories generated at time of problem
7. If ASM from use same information from it is needed


Please review and advise on the script.

Code:
#!/bin/ksh

HOST_NAME=`hostname -a`
export ORACLE_SID=+ASM1
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=${ORACLE_BASE}/product/11.2.0.3/db
export PATH=$ORACLE_HOME/bin:$PATH
export TRACE_LOG=/exports/crs_trace.log
export ADR_HOME=/u01/oracle/admin/diag/rdbms/orcl/orcl
export ORA_CRS_HOME=/app/grid/product/11.2.0.3
export PATH=${PATH}:${ORACLE_HOME}/bin:${ORA_CRS_HOME}/bin
srcdir="/app/oracle/product/osw/archive"
dstdir="/exports"
d=$(date +%m%d%y)

for srcfile in ${srcdir}/*
do
    dstfile=$(basename $srcfile)
    dstfile=${dstfile/\./${d}\.}
    cp $srcfile $dstdir/$dstfile
done
cd /exports
$ORA_CRS_HOME/bin/diagcollection.pl --collect --adr --aftertime $1 >$TRACE_LOG
exit


Last edited by Scott; 08-30-2013 at 10:30 AM.. Reason: Removed FONT tags from within CODE tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

linux server crash

Hi I faced a problem while booting linux which is as follows;- ************************************************* Inode 146180 has illegal block(s) xauth:error in locking authority file /home/root/.Xauthority Fatal Server Error: Could not create lock file in /tmp/tXo-lock ... (1 Reply)
Discussion started by: Abhishek
1 Replies

2. UNIX for Dummies Questions & Answers

server crash

Our SUn Solaris Server has crashed second time in 2 days, reason is not known , we are trying to determine what could have gone wrong, any ideas, the power supply seems to be fine, there is no response from keyboard,monitor etc and we had to do a hot boot yesterday.. Any suggestions what could be... (9 Replies)
Discussion started by: knarayan
9 Replies

3. UNIX for Advanced & Expert Users

Solaris Server Crash

We have had a server (Solaris 2.6) hardisk crash. When booting the server we get: ok> boot -S Boot Device: /sbus/espdmc@e, 8400000/esp@e,8800000/sd@0,0 short read 0x2000 chars read disk read error The only way we can get into the console is to ok> boot cdrom whereby everything (e.g.... (3 Replies)
Discussion started by: Breen
3 Replies

4. Shell Programming and Scripting

How to collect all the list of files along with the permissions

Hi guys, I have one problem. I need collect the list files along with the file permissions in all directories in one server. Is their any easy way to collect using any commands or any scripts? Advance Thanks :) (2 Replies)
Discussion started by: kartheek
2 Replies

5. SCO

Crash error on my unix server

Hi there. Well i have a really bad problem with my server: UnixWare Version 5 Release 7 The system crash :wall: and show the error: Panic: Kernel-mode address fault on user address 0x00000004 :eek: If anyone knows about the reason of this error please give me a help Sorry by my english.... (3 Replies)
Discussion started by: danilosevilla
3 Replies

6. UNIX Desktop Questions & Answers

collect data from files

there are 200 files named file1_0.pdb,file1_60.pdb etc....it looks like: ATOM 1 N VAL 1 8.897 -21.545 -7.276 1.00 0.00 ATOM 2 H1 VAL 1 9.692 -22.015 -6.868 1.00 0.00 ATOM 3 H2 VAL 1 9.228 -20.766 -7.827 1.00 0.00 ATOM 4 H3 ... (5 Replies)
Discussion started by: kanikasharma
5 Replies

7. UNIX for Advanced & Expert Users

Collect files from different servers to a single server and append them

Hi, I have script1.sh on 3 servers. I want to collect output report generated by them to a single server and append all the reports. Please tell me how can i do this? (2 Replies)
Discussion started by: pratikm23
2 Replies

8. Shell Programming and Scripting

Case script to get missing sequence among files

I want to use case statement to find the range of missing sequence in my directory which it has some few ( dat & DAT ) files my directory /home/arm/my_folder/20130428 contains : f01_201304280000.DAT f01_201304280001.DAT f01_201304280003.DAT f02_201304280000.dat f02_201304280002.dat... (2 Replies)
Discussion started by: arm
2 Replies

9. Shell Programming and Scripting

Collect files for specific hours

I have to fetch files from a location hour wise. Eg files available at location /tmp/data/ are A20140205.1300-1315...... . . A20140205.1400-1415...... . . A20140205.1700-1715...... . . . . Below is the code I have prepared. But it works only for one hour. For instance... (1 Reply)
Discussion started by: Saidul
1 Replies
SQL::ReservedWords::Oracle(3pm) 			User Contributed Perl Documentation			   SQL::ReservedWords::Oracle(3pm)

NAME
SQL::ReservedWords::Oracle - Reserved SQL words by Oracle SYNOPSIS
if ( SQL::ReservedWords::Oracle->is_reserved( $word ) ) { print "$word is a reserved Oracle word!"; } DESCRIPTION
Determine if words are reserved by Oracle Database. METHODS
is_reserved( $word ) Returns a boolean indicating if $word is reserved by either Oracle7, Oracle8i, Oracle9i or Oracle10g. is_reserved_by_oracle7( $word ) Returns a boolean indicating if $word is reserved by Oracle7. is_reserved_by_oracle8( $word ) Returns a boolean indicating if $word is reserved by Oracle8i. is_reserved_by_oracle9( $word ) Returns a boolean indicating if $word is reserved by Oracle9i. is_reserved_by_oracle10( $word ) Returns a boolean indicating if $word is reserved by Oracle10g. reserved_by( $word ) Returns a list with Oracle versions that reserves $word. words Returns a list with all reserved words. EXPORTS
Nothing by default. Following subroutines can be exported: is_reserved is_reserved_by_oracle7 is_reserved_by_oracle8 is_reserved_by_oracle9 is_reserved_by_oracle10 reserved_by words SEE ALSO
SQL::ReservedWords <http://www.oracle.com/technology/documentation/> AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-28 SQL::ReservedWords::Oracle(3pm)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy