script for RAC information required

Hello,

is it possible for someone to generate a shell script that will do the following, please. UNIX Shell script novice who is after a script to look at a few things within an Oracle RAC environment

Hopefully if this works, I can schedule this via cron

Many thanks

I can execute these commands individually and they all work, but how do I combine bash commands with SQL commands?

here is the code, I'd like in 1 huge script I can schedule on a daily basis and then mail me a report

thankyou

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

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';

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

select group#, type, member, is_recovery_dest_file from v$logfile order by group#;

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

set numwidth 10
column event format a25 tru
select inst_id, event, time_waited, total_waits, total_timeouts
from (select inst_id, event, time_waited, total_waits, total_timeouts
from gv$system_event where event not in ('rdbms ipc message','smon timer',
'pmon timer', 'SQL*Net message from client','lock manager wait for remote message',
'ges remote message', 'gcs remote message', 'gcs for action', 'client message', 
'pipe get', 'null event', 'PX Idle Wait', 'single-task message', 
'PX Deq: Execution Msg', 'KXFQ: kxfqdeq - normal deqeue', 
'listen endpoint status','slave wait','wakeup time manager')
order by time_waited desc)
where rownum < 11
order by time_waited desc;


cd /u01/app/11.2.0/grid/bin
./crs_stat -t

cd /u01/app/11.2.0/grid/bin
./crsctl check crs

srvctl status asm -n ukedxdtmtdbs01a
srvctl status asm -n ukedxdtmtdbs01b

I`m not DBA but will this be helpful

test.sql

connect myuser/mypass
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';

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

select group#, type, member, is_recovery_dest_file from v$logfile order by group#;

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

set numwidth 10
column event format a25 tru
select inst_id, event, time_waited, total_waits, total_timeouts
from (select inst_id, event, time_waited, total_waits, total_timeouts
from gv$system_event where event not in ('rdbms ipc message','smon timer',
'pmon timer', 'SQL*Net message from client','lock manager wait for remote message',
'ges remote message', 'gcs remote message', 'gcs for action', 'client message', 
'pipe get', 'null event', 'PX Idle Wait', 'single-task message', 
'PX Deq: Execution Msg', 'KXFQ: kxfqdeq - normal deqeue', 
'listen endpoint status','slave wait','wakeup time manager')
order by time_waited desc)
where rownum < 11
order by time_waited desc;

test.sh

#!/bin/bash
sqlplus internal @test.sql
/u01/app/11.2.0/grid/bin/crs_stat -t
/u01/app/11.2.0/grid/bin/crsctl check crs

srvctl status asm -n ukedxdtmtdbs01a
srvctl status asm -n ukedxdtmtdbs01b     

If you like to get it as e-mail run

test.sh | mail -s "Oracle report" john@smith.org

As I said I`m no DBA so no guarantee it would work :slight_smile:

Just a small correction: the internal login was desupported in 9i,
use / as sysdba instead.

works like a dream,

Many thanks