10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What I have:
I have a input.sh (script which basically connect to mysql-db and query's multiple tables to write back the output to output1.out file in a directory)
note: I need to pass an integer (unique_id = anything b/w 1- 1000) next to the script everytime I run the script which generates... (3 Replies)
Discussion started by: kkpand
3 Replies
2. Shell Programming and Scripting
Hi All,
In my script I have used the below code to retrieve the instance name
V_INSTANCE_NAME=`sqlplus -s ${APPS_USR_PSWD} <<+
set pagesize 0 linesize 256 feedback off verify off head off echo off
set serveroutput off
select... (2 Replies)
Discussion started by: kalidoss
2 Replies
3. Shell Programming and Scripting
#!/bin/bash
user=`mysql userList -uuserlist -puserlistpassword -s -N -e "SELECT userName FROM users WHERE activated='n'"`
for i in $user; do
useradd "$i" -m
doneThis is what I have done so far. But obviously it still does not work.
I'm trying to create users based on information stored in a... (5 Replies)
Discussion started by: bucketuk
5 Replies
4. Shell Programming and Scripting
I have an input file with contents like :
1LMXTJJD0W28TX2
1LS1XJGDEVWAC5T
1LK81JVDE2HRNDG
1LMXTJJD0W28TX2
1LS1XJGDEVWAC5T
1LK81JVDE2HRNDG
1LMXTJJD0W28TX2
I need to read each field from the file
pass it to a query:
select count(*) from usage_error where usage_id='$field... (17 Replies)
Discussion started by: Rajesh Putnala
17 Replies
5. Shell Programming and Scripting
I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error:
ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies
6. Shell Programming and Scripting
I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this?
Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
Hello,
I am new to Unix and shell scripting. I am trying to find unowned files and groups on my servers. I know, i could use the below command to find it on individual server.
#find / -nouser -o -nogroup -print
But I was wondering, if someone could help with a shell script so that I can... (2 Replies)
Discussion started by: ut916
2 Replies
10. Shell Programming and Scripting
Hi,
I want to compare two tables fieldwise using shell script. Can anyone help me regarding the same.
The approach which i tried is to first move the two tables in simple txt file where each field is now seperated by space. But i can't retrive each field with "space" as a seperator b'coz there... (1 Reply)
Discussion started by: dtidke
1 Replies
DBI::Shell(3) User Contributed Perl Documentation DBI::Shell(3)
NAME
DBI::Shell - Interactive command shell for the DBI
SYNOPSIS
perl -MDBI::Shell -e shell [<DBI data source> [<user> [<password>]]]
or
dbish [<DBI data source> [<user> [<password>]]]
DESCRIPTION
The DBI::Shell module (and dbish command, if installed) provide a simple but effective command line interface for the Perl DBI module.
DBI::Shell is very new, very experimental and very subject to change. Your milage will vary. Interfaces will change with each release.
TO DO
Proper docs - but not yet, too much is changing.
"/source file" command to read command file. Allow to nest via stack of command file handles. Add command log facility to create batch
files.
Commands: load (query?) from file save (query?) to file
Use Data::ShowTable if available.
Define DBI::Shell plug-in semantics. Implement import/export as plug-in module
Clarify meaning of batch mode
Completion hooks
Set/Get DBI handle attributes
Portability
Emulate popular command shell modes (Oracle, Ingres etc)?
COMMANDS
Many commands - few documented, yet!
help
/help
chistory
/chistory (display history of all commands entered)
/chistory | YourPager (display history with paging)
clear
/clear (Clears the current command buffer)
commit
/commit (commit changes to the database)
connect
/connect (pick from available drivers and sources)
/connect dbi:Oracle (pick source from based on driver)
/connect dbi:YourDriver:YourSource i.e. dbi:Oracle:mysid
Use this option to change userid or password.
current
/current (Display current statement in the buffer)
do
/do (execute the current (non-select) statement)
dbish> create table foo ( mykey integer )
dbish> /do
dbish> truncate table OldTable /do (Oracle truncate)
drivers
/drivers (Display available DBI drivers)
edit
/edit (Edit current statement in an external editor)
Editor is defined using the enviroment variable $VISUAL or $EDITOR or default is vi. Use /option editor=new editor to change in the
current session.
To read a file from the operating system invoke the editor (/edit) and read the file into the editor buffer.
exit
/exit (Exits the shell)
get
/get (Retrieve a previous command to the current buffer)
go
/go (Execute the current statement)
Run (execute) the statement in the current buffer. This is the default action if the statement ends with /
dbish> select * from user_views/
dbish> select table_name from user_tables
dbish> where table_name like 'DSP%'
dbish> /
dbish> select table_name from all_tables/ | more
history
/history (Display combined command and result history)
/history | more
option
/option [option1[=value]] [option2 ...]
/option (Displays the current options)
/option MyOption (Displays the value, if exists, of MyOption)
/option MyOption=4 (defines and/or sets value for MyOption)
perl
/perl (Evaluate the current statement as perl code)
quit
/quit (Leaves shell. Same as exit)
redo
/redo (Re-execute the previously executed statement)
rhistory
/rhistory (Display result history)
rollback
/rollback (rollback changes to the database)
For this to be useful, turn the autocommit off. /option autocommit=0
table_info
/table_info (display all tables that exist in current database)
/table_info | more (for paging)
trace
/trace (set DBI trace level for current database)
Adjust the trace level for DBI 0 - 4. 0 off. 4 is lots of information. Useful for determining what is really happening in DBI. See
DBI.
type_info
/type_info (display data types supported by current server)
AUTHORS and ACKNOWLEDGEMENTS
The DBI::Shell has a long lineage.
It started life around 1994-1997 as the pmsql script written by Andreas Konig. Jochen Wiedmann picked it up and ran with it (adding much
along the way) as dbimon, bundled with his DBD::mSQL driver modules. In 1998, around the time I wanted to bundle a shell with the DBI, Adam
Marks was working on a dbish modeled after the Sybase sqsh utility.
Wanting to start from a cleaner slate than the feature-full but complex dbimon, I worked with Adam to create a fairly open modular and very
configurable DBI::Shell module. Along the way Tom Lowery chipped in ideas and patches. As we go further along more useful code and concepts
from Jochen's dbimon is bound to find it's way back in.
COPYRIGHT
The DBI::Shell module is Copyright (c) 1998 Tim Bunce. England. All rights reserved. Portions are Copyright by Jochen Wiedmann, Adam Marks
and Tom Lowery.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
perl v5.8.0 2002-11-29 DBI::Shell(3)