Sponsored Content
Top Forums Shell Programming and Scripting Patch query using shell script error Post 302244120 by a1_win on Tuesday 7th of October 2008 08:47:53 AM
Old 10-07-2008
Patch query using shell script error

Hi All,

OS:AIX 5.3

I am using the following shell script for patch query but not getting the prompt to enter values for '&From_date' and '&TO_Date' in the patch query when called from the shell script as below:

patch_query.sh
============

#!/usr/bin/ksh

export DBALIST="xyz@xyz.com"
export USER=apps
export PWD=******
export SID=XYZ

sqlplus "$USER/$PWD" <<!
@patch_query.sql
exit
!
if [ `cat patch_query.alert|wc -l` -gt 0 ]
then
cat patch_query.alert -l patch_query.alert > patch_query.tmp
mailx -s "Patch Query Alert for ${SID}" $DBALIST < patch_query.tmp
fi

patch_query.sql
===============

set feed off
set linesize 100
set pagesize 200
spool patch_query.alert
select BUG_NUMBER "PATCH_NUMBER",to_char(creation_date,'DD-MON-YYYY HH24:MI:SS') CREATION_DATE from ad_bugs
where to_char(creation_date,'DD-MON-YYYY HH24:MI:SS') between '&From_date' and '&TO_Date';
spool off;

Error message:
==============


$ /home/oraxyz $ ./patch_query.sh

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Oct 7 08:16:25 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> Enter value for from_date: Enter value for to_date:
User requested Interrupt or EOF detected.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
cat: 0652-050 Cannot open -l.
$ /home/oraxyz $

could anyone please let me know how to do it?

Thanks for your time!

Regards,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Query on a shell script logic

Hello people, I am new to shell scripting and hoping to get a quick answer to my query. I am writing a simple script which needs to call an executale which generates an output file. Once the output file is generated I have to do a couple of more task with that file. The executable ideally... (1 Reply)
Discussion started by: tipsy
1 Replies

2. Shell Programming and Scripting

shell script related query

Hi I have an input to a file. I want the script to return it formatted the input is a number, say , 1234567895 and the output should be 21 43 65 87 59 ,ie, the pair of two digits should be reversed. How can I do this using a shell script? (1 Reply)
Discussion started by: gopsman
1 Replies

3. Shell Programming and Scripting

C Shell Script query

Hi I need a small help Cshell% more abc.txt ******** Cshell% cat abc.txt | cut -c1-3 *** Cshell%set test3=`cat abc.txt | cut -c1-3` Cshell%echo $test3 a.txt b.txt................. ..... It displays all the file in the current directory. I want *** to be displayed. Can any one of... (1 Reply)
Discussion started by: bpupdown
1 Replies

4. UNIX for Dummies Questions & Answers

Shell script query

Hi, I am stuck assigning a value to a variable. I am trying to assign a value to a variable but getting error.... IP_ADDR=grep 'I.P. Address' /install/cfgdist/`uname -n`.cfg | cut -d : -f 2| cut -d . -f 1-3| sed s/" "//g I am using this script to grep first three octets of an IP address... (4 Replies)
Discussion started by: max29583
4 Replies

5. Shell Programming and Scripting

query sql using shell script

query sql using shell script, is it possible? my friend told me to do a file.sql and link to my shell script, but can i query sql using shell script? thanks in advance! (2 Replies)
Discussion started by: kingpeejay
2 Replies

6. Shell Programming and Scripting

shell script query

hi all i have a shell script for connecting in sybase env what i need is i have around 10 servers , i need to connect to all servers and retrive the database inforamtion in the servers and display them any one of u have it request to share it asap ! "QUERY TO Connect to all servers... (1 Reply)
Discussion started by: mvsramarao
1 Replies

7. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

8. Shell Programming and Scripting

shell script query

Hi Admins, I was trying to list the failed logins as part of my daily checklist. Here is my script for i in `who -s /etc/security/failedlogins|tail -100|grep "$dt"|awk '{print $1" "$6}'` do a=`echo $i|wc -l` if then echo $i else echo "There are no failed logins" fi done but... (3 Replies)
Discussion started by: newaix
3 Replies

9. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

10. SuSE

Query on Linux Patch Installation

Hello Experts, I need your inputs to figure out the issue I faced post applying Linux patch. Question: As a part of change implementation UNIX team applied patches and upgraded OS from version SuSE Linux 11.2.3 to 11.3.6. Post upgrade we could bring up Tomcat successfully; however... (0 Replies)
Discussion started by: MaheshChaudhari
0 Replies
GBP-PQ(1)						      git-buildpackage Manual							 GBP-PQ(1)

NAME
gbp-pq - Manage quilt patches on patch queue branches in git SYNOPSIS
gbp-pq [ --verbose ] [ --color=[auto|on|off] ] [ --[no-]patch-numbers ] [ --topic=topic ] [ --time-machine=num ] drop | export | import | rebase | switch DESCRIPTION
gbp-pq helps one to manage quilt patches in Debian packages that are maintained with git-buildpackage. This is especially useful with pack- ages using the 3.0 (quilt) source format. With gbp-pq you can maintain the quilt patches that should be applied to a package on a separate branch called patch-queue branch. So if your Debian package lives on master the associated patch-queue branch will be called patch- queue/master. See <URL:https://honk.sigxcpu.org/piki/development/debian_packages_in_git/> for example workflows. ACTIONS
import Create a patch queue branch from quilt patches in debian/patches/ that are listed in debian/patches/series. export Export the patches on the patch-queue branch associated to the current branch into a quilt patch series in debian/patches/ and update the series file. rebase Switch to the patch-queue branch associated to the current branch and rebase it against the current branch. drop Drop (delete) the patch queue associated to the current branch. So if you're on branch foo this would drop branch patch-queue/foo. apply Add a single patch to the patch-queue similar to using git-am. Use --topic if you want the patch to appear in a separate subdir when exporting the patch queue using export. This can be used to separate upstream pathes from debian specific patches. switch Switch to the patch-queue branch if on the base branch and switch to base branch if on patch-queue branch. OPTIONS
--verbose -v verbose execution --color=[auto|on|off] Whether to use colored output. --[no-]patch-numbers Whether the patch files should start with a number or not. --topic=topic Topic to use when importing a single patch --time-machine=NUM When importing a patch queue fails, go back commit by commit on the current branch to check if the patch-queue applies there. Do this at most NUM times. This can be useful if the patch-queue doesn't apply to the current branch HEAD anymore, e.g. after import- ing a new upstream version. TAGS
When exporting patches from a patch-queue branch gbp-pq will look at the patch header for special tags it recognizes. All tags need to start at the first column and require at least one whitespace after the colon. Gbp-Pq-Topic: topic Moves the patch into a subdir called topic when running gbp-pq export . This allows for some structure below debian/patches. SEE ALSO
git-buildpackage(1), dpkg-source(1), quilt(1), gbp.conf(5) AUTHOR
Guido Guenther <agx@sigxcpu.org> 01 June 2012 GBP-PQ(1)
All times are GMT -4. The time now is 02:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy