I have the requirement to run multiple SQLs against database running on a server and save the output of SQL executed to a log.
I thought about writing a Function in sh that will take file name as argument and function should return the SQL output to calling program. E.g.
This function I am planning to call multiple times for all SQL files that need to be executed one by one.
Can someone please suggest if the approach I used is correct or is there a better way to achieve it. I am a novice to shell scripting.
Thanks a lot for your time.
Moderator's Comments:
Please view this code tag video for how to use code tags when posting code and data.
Last edited by vbe; 08-31-2012 at 05:21 AM..
Reason: replaced fonts by code tags
As I was just pondering to myself I relized that emergency's do happen and there are times when people need an anwser to their problem ASAP. So what i was thinking why not add a live chat to this board this way people could chat amongst each other in real time. I know this could be done with a... (1 Reply)
I am a student and I love the computer very much ,
especially in programming. However I know little about
programming .
I don't know which I should learn (JAVA and C++).
Would you like to give me a suggestion ?
Thanks! (6 Replies)
Hi all:
I need your suggestion about how to making this script
Purpose:-
Monitor log for the system
OS: Unix Sun Solaris 10
Hold oracle database 10 g
Life time for the system cycle to 48 hours
the system working as the follow
1- the system is divided into three steps
2-... (0 Replies)
Discussion started by: dellsh
0 Replies
5. Post Here to Contact Site Administrators and Moderators
Can we have a forum that is dedicated to topics concerning power management ? It'd be great to have a few moderators to address these issues concerning the power-management. More-so-ever since research related to power management at the OS level is kicking up a lot of dust and becoming a hot area... (7 Replies)
Hello,
I'm working on a Linux 2.6.32-33-server (Ubuntu 4.4.3).
I typed in man -k package and got e.g. apt
I typed in apt --help and got:
The program 'apt' is currently not installed. You can install it by typing:
sudo apt-get install openjdk-6-jdkI don't understand where this... (2 Replies)
Hi folks,
Any good suggestion concerning this BASH search script?
#Any good suggestions for this simple search shell?
#================================
#!/bin/bash
clear
echo "Enter File Name for search"
echo
read filename
locate $filename
if ;
then
echo No such file... (1 Reply)
I'm searching to learn linux coding for a month but no clear about the where to start . Right now i'm in networking but not much interested in this maintenance jobs . I'm looking to create my own product in wireless network and also having idea about gadget that can be useful for students . But i... (1 Reply)
Discussion started by: Cholasivam
1 Replies
9. Post Here to Contact Site Administrators and Moderators
Hello Admin/moderators Team,
Greetings !!
This is regarding a suggestion which may help our forum if this is possible.
Thanks,
R. Singh
"GOD helps those who help themselves" (2 Replies)
Discussion started by: RavinderSingh13
2 Replies
LEARN ABOUT CENTOS
pmdadbping
PMDADBPING(1) Performance Co-Pilot PMDADBPING(1)NAME
pmdadbping - database response time and availability PMDA
DESCRIPTION
Simple database response time measurement PMDA. dbprobe.pl(1) should be configured to use the type of DBI appropriate for your database,
which includes: RDBMS flavour, user/password, delay between "ping" requests, and the SQL statement to use. pmdadbping runs dbprobe.pl(1),
and exports the performance measurements it makes available as PCP metrics.
INSTALLATION
Configure dbprobe.pl(1) - it uses a configuration file from (in this order):
o /etc/pcpdbi.conf
o $PCP_PMDAS_DIR/dbping/dbprobe.conf
This file can contain overridden values (Perl code) for the settings listed at the start of dbprobe.pl, namely:
o database name (see DBI(3) for details)
o database user name
o database pass word
o SQL statement to measure (probe)
o delay between probes
Once this is setup, you can access the names and values for the dbping performance metrics by doing the following as root:
# cd $PCP_PMDAS_DIR/dbping
# ./Install
If you want to undo the installation, do the following as root:
# cd $PCP_PMDAS_DIR/dbping
# ./Remove
pmdadbping is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is
installed or removed.
FILES
$PCP_PMDAS_DIR/dbping/probes.stp
probe configuration file for stap(1), run by pmdadbping
$PCP_PMDAS_DIR/dbping/Install
installation script for the pmdadbping agent
$PCP_PMDAS_DIR/dbping/Remove
undo installation script for the pmdadbping agent
$PCP_LOG_DIR/pmcd/dbping.log
default log file for error messages from pmdadbping
SEE ALSO pmcd(1), dbprobe.pl(1) and DBI(3).
3.8.10 Performance Co-Pilot PMDADBPING(1)