Shell script to call Oracle archive backup script when file system reaches threshold value


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script to call Oracle archive backup script when file system reaches threshold value
# 1  
Old 10-16-2013
Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All,

I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60%


Need to identify the unique file system that reaches threshold value.
ex:
capacity
60%

file system /ora/arch/dbname1/*.arch
/ora/arch/dbname2/*.arch

script need to run when file system reaches 60 % ----archivebkup.ksh

Last edited by sasikanthdba; 10-16-2013 at 09:46 AM.. Reason: more details
# 2  
Old 10-16-2013
Here an attempt that may need to be tested and adapted
Code:
df | grep [6-90][0-9][%] | awk '/ora\/arch\/dbname.\/*.arch/{print $NF}' | while read f
do archivebkup.ksh $f
done

# 3  
Old 10-16-2013
Hi Thanks for quick reply.

I will check in my environment and get back to you.

Kindly help me on this.

---------- Post updated at 06:12 AM ---------- Previous update was at 05:07 AM ----------

I am giving some more details of my environment this will help you understand my scenario.

capacity
--------
/dev/fvg03_lv6471 62.75 61.01 3% 70 1% /oraarch/fs1771
/dev/fvg03_lv6472 62.75 43.98 50% 221 1% /oraarch/fs1772

First file system /oraarch/fs1771 contains the below database archive directories
OS00DB1 OS00DB2 OS00DB3

and second file system /oraarch/fs1772 contains database arch directories
OS00DB1 OS00DB2 OS00DB3

disk usage using du command:
oracle > du *
0 OS00DB1
1496 OS00DB2
38818792 OS00DB3

Inside each directory archive files will be stored with .arc extension
ex:/oraarch/fs1772/OS00DB3/1_1035_721234582.arc
/oraarch/fs1772/OS00DB2/1_1035_721234594.arc
.
.

I need to find the unique database name that is causing the archive file system crossing threshold value and check which database actually reaching the threshold value and appropriate script needs to run.

/u01/script/rman_OS00DB1_ar.ksh
/u01/script/rman_OS00DB2_ar.ksh
/u01/script/rman_OS00DB3_ar.ksh

Last edited by sasikanthdba; 10-16-2013 at 09:59 AM..
# 4  
Old 10-16-2013
Having 3 archive directories on a single filesystem is a bad idea : if for any reason one of the archive directory fills the FS, it will also freeze the 2 other databases.

You'd better to separate 3 differents FS and mount each of them on their own directories so that if a problem occurs, the problem will not impact the 2 other database.
# 5  
Old 10-17-2013
In production environment there is dedicated archive file system for each database.

df -g | grep arch
/dev/P0054D_lv10019 251.00 224.12 59% 61 1% /oraarch/fs2718

cd /oraarch/fs2718
>ls
DB0070
cd DB0070
.arc files exists in this directory

pwd
/oraarch/fs2718/DB0070

Archive backup script location is /u01/apps/script/DB0070_ar.ksh
some other database archive scripts are also there in servers which are migrated to another server.
I want to call the script by checking the database name in archive destination respective database archive should run.

Please let me know if you need any more details

Thanks in advance,

---------- Post updated 10-17-13 at 08:51 AM ---------- Previous update was 10-16-13 at 09:14 AM ----------

Could any one help me with this shell script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to call Oracle function with multiple arguments from shell script?

Dear All, I want to know how can i call oracle function from shell script code . My oracle function have around 5 input parameters and one return value. for name in *.csv; do echo "connecting to DB and start processing '$name' file at " echo "csv file name=$x" sqlplus -s scoot/tiger <!... (2 Replies)
Discussion started by: Balraj
2 Replies

2. Shell Programming and Scripting

Run a sql script on multiple $Oracle_SID at once and send an alert if reaches the threshold

I am trying to accomplish following tasks in my KSH script: Run a sql script on multiple $ORACLE_SID at once Sends an alert only if the threshold > 2 for any of the $ORACLE_SID Please advice as to how I can approach this!! Thanks in advance! (1 Reply)
Discussion started by: jd_2000
1 Replies

3. Red Hat

How to call Oracle package through shell script?

Hey i have a package in oracle to validate file mask. can i call it in through shell script . if yes , how Thanks (1 Reply)
Discussion started by: ramsavi
1 Replies

4. Shell Programming and Scripting

Running script automatically when threshold limit met in one of the field in oracle database

Hi Guys, Need you help in one point! I am working on one shell script which takes following steps : 1. Taking one query result from oracle database 2. Exporting that result to Xls file 3. Mailing that file to my own mail ID Now, I want to give a threshold limit to one of the column... (0 Replies)
Discussion started by: Agupte
0 Replies

5. Shell Programming and Scripting

Script for deleting files and directories when the file system reaches the threshold

Hi Can someone assist in writing a script. I have a filesystem named /sybase in my aix lpar. When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
Discussion started by: newtoaixos
7 Replies

6. Shell Programming and Scripting

Not correct processing of “\ “ in names of dirs inside shell script (tar command - system backup scr

Hello, Recently, I've started with shell scripting, and decided to write a script for my system backup using tar. When I was dealing with tar execution inside shell script I found this, inside shell we have the following code: tar $TAR_PARAMS $ARCHIVE_FILE $EXCLUDE $BACKUP_STARTwith... (6 Replies)
Discussion started by: ilnar
6 Replies

7. Shell Programming and Scripting

Shell Script for call a procedure in Oracle DB

Hi everyone! I'm new with Shell Scripting, and I have to do a shell script to call a procedure, which have 2 input parameters, the directory(from server) and the txt file (which have informations to update/insert in DB). I have to create a shell script to execute that procedure for each txt... (5 Replies)
Discussion started by: renatoal
5 Replies

8. Shell Programming and Scripting

Generic Shell Script to Archive a file

Would appreciate if any one can paste a generic schell script to archive a file with date stamp by passing the file with fullpath as parameter For Eg. /apps/scripts/Archive_File.sh /data_home/project_home/file.txt this should place the file in the following directory ... (8 Replies)
Discussion started by: mak1600
8 Replies

9. Shell Programming and Scripting

i want to call a oracle function in my shell script

i want to call a oracle function in my shell script (4 Replies)
Discussion started by: dineshr85
4 Replies

10. UNIX for Advanced & Expert Users

Shell script on Oracle hot backup got an error

Hi Unix Shell Script Expert, We have a robust shell script (from old time) for our 9i database hot backup but generated error: Shell Script Content: #check for auto log mode and redirect as early as possible # autolog_enable $AUTOLOG_MODE $ORACLE_BASE/${ORASID_LOW}log/cron_hotbackup.log... (1 Reply)
Discussion started by: oradbus
1 Replies
Login or Register to Ask a Question