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
Session::Store::Oracle(3)				User Contributed Perl Documentation				 Session::Store::Oracle(3)

NAME
Apache::Session::Store::Oracle - Store persistent data in a Oracle database SYNOPSIS
use Apache::Session::Store::Oracle; my $store = new Apache::Session::Store::Oracle; $store->insert($ref); $store->update($ref); $store->materialize($ref); $store->remove($ref); DESCRIPTION
Apache::Session::Store::Oracle fulfills the storage interface of Apache::Session. Session data is stored in a Oracle database. SCHEMA
To use this module, you will need at least these columns in a table called 'sessions': id varchar2(32) # or however long your session IDs are. a_session long To create this schema, you can execute this command using the sqlplus program: CREATE TABLE sessions ( id varchar2(32) not null primary key, a_session long ); If you use some other command, ensure that there is a unique index on the table's id column. CONFIGURATION
The module must know what datasource, username, and password to use when connecting to the database. These values can be set using the options hash (see Apache::Session documentation). The options are DataSource, UserName, and Password. Example: tie %hash, 'Apache::Session::Oracle', $id, { DataSource => 'dbi:Oracle:database', UserName => 'database_user', Password => 'K00l' }; Instead, you may pass in an already-opened DBI handle to your database. tie %hash, 'Apache::Session::Oracle', $id, { Handle => $dbh }; The last option is LongReadLen, which specifies the maximum size of the session object. If not supplied, the default maximum size is 8 KB. AUTHOR
This modules was written by Jeffrey William Baker <jwbaker@acm.org> A fix for the commit policy was contributed by Michael Schout <mschout@gkg.net> SEE ALSO
Apache::Session, Apache::Session::Store::DBI perl v5.12.1 2007-09-28 Session::Store::Oracle(3)
All times are GMT -4. The time now is 05:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy