Sponsored Content
Top Forums Shell Programming and Scripting Different way to connect to database ans execute sql query Post 302417151 by soleil4716 on Wednesday 28th of April 2010 04:44:11 PM
Old 04-28-2010
Ideally you should pass the username and password inside the here doc for security reasons:

Code:
sqlplus -s <<!
<USERNAME>/<PASSWORD>
@<SQL FILE TO EXECUTE>
exit
!

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

TO execute .sql 2005 query file in shell script

Hi, I know in oracle a .sql file is called by @ <path> /<filename>. But how to call in sql 2005, I am opening the sql sessionwith sqsh, is there any command to execute there a .sql file (query in sql 2005) in K shell script. (0 Replies)
Discussion started by: n2ekhil
0 Replies

2. Shell Programming and Scripting

Oracle SQL Query & connect?

Hi I'm looking to query a table on a database and then iterate over the results in a loop. I believe this is the last part of my script that I need (after finding out threads for passing variables to other scripts and calling functions in other scripts). I've searched the forums but the best... (8 Replies)
Discussion started by: Dird
8 Replies

3. Shell Programming and Scripting

Execute SQL query in unix script

Hi I am new in unix. oracle and unix are installed in my sytem.i need the script which could connect to the oracle using username ,password and schema and can run the select * from tab query. Thanks vijay (8 Replies)
Discussion started by: vijays3
8 Replies

4. Shell Programming and Scripting

We need a script that invokes the sql query every 14 days ans send email

Hi, We need a script that invokes the sql query every 14 days ans send email (0 Replies)
Discussion started by: bujjisveeru
0 Replies

5. Shell Programming and Scripting

We need a script that invokes the sql query every 14 days ans send email

HI, We need a script that invokes the sql query every 14 days ans send email (0 Replies)
Discussion started by: bujjisveeru
0 Replies

6. Shell Programming and Scripting

Shell Linux to connect to a database and execute store procedure

HI, i want to write a script (Linux) that: 1) connect to a database oracle 2) execute some store procedure. Can anybody help me, please? Thanks a lot Andrew (3 Replies)
Discussion started by: manichino74
3 Replies

7. Programming

JDBC code to pass the SQL query as parameter and execute?

Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file. here the number of columns are unknown. some times it may be 2,3 or entire columns from the table. read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies

8. Shell Programming and Scripting

Korn Script to connect and query oracle database

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

9. AIX

Connect to database server and execute sql

I have a requirement and below is the detail. Create a shell script and needs to run in server "a". Connect to teradata database server "b". execute the .sql file from server "a" Save the output of the query to a file in server "a" Schedule this shell script to run every day for every 4... (1 Reply)
Discussion started by: MadhuSeven
1 Replies

10. Shell Programming and Scripting

Shell script to execute sql query.

Hi Experts, Need your support. Not able to use sql query alias in shell script. Could you please help me in finding right way to use alias with sql query in shell script. Below is the code i am using. #!/bin/bash sqlplus -s abc/abc@abc << EOF> bcd.csv set trimspool on select zone_id... (4 Replies)
Discussion started by: as7951
4 Replies
SmbHash(3)						User Contributed Perl Documentation						SmbHash(3)

NAME
Crypt::SmbHash - Perl-only implementation of lanman and nt md4 hash functions, for use in Samba style smbpasswd entries SYNOPSIS
use Crypt::SmbHash; ntlmgen SCALAR, LMSCALAR, NTSCALAR; DESCRIPTION
This module generates Lanman and NT MD4 style password hashes, using perl-only code for portability. The module aids in the administration of Samba style systems. In the Samba distribution, authentication is referred to a private smbpasswd file. Entries have similar forms to the following: username:unixuid:LM:NT Where LM and NT are one-way password hashes of the same password. ntlmgen generates the hashes given in the first argument, and places the result in the second and third arguments. Example: To generate a smbpasswd entry: #!/usr/local/bin/perl use Crypt::SmbHash; $username = $ARGV[0]; $password = $ARGV[1]; if ( !$password ) { print "Not enough arguments "; print "Usage: $0 username password "; exit 1; } $uid = (getpwnam($username))[2]; my ($login,undef,$uid) = getpwnam($ARGV[0]); ntlmgen $password, $lm, $nt; printf "%s:%d:%s:%s:[%-11s]:LCT-%08X ", $login, $uid, $lm, $nt, "U", time; ntlmgen returns returns the hash values in a list context, so the alternative method of using it is: ( $lm, $nt ) = ntlmgen $password; The functions lmhash and nthash are used by ntlmgen to generate the hashes, and are available when requested: use Crypt::SmbHash qw(lmhash nthash) $lm = lmhash($pass); $nt = nthash($pass); If Encoding is available (part of perl-5.8) the $pass argument to ntlmgen, lmhash and nthash must be a perl string. In double use this: use Crypt::SmbHash qw(ntlmgen lmhash nthash); use Encode; ( $lm, $nt ) = ntlmgen decode('iso-8859-1', $pass); $lm = lmhash(decode_utf8($pass), $pwenc); $nt = nthash(decode_utf8($pass)); The $pwenc parameter to lmhash() is optional and defaults to 'iso-8859-1'. It specifies the encoding to which the password is encoded before hashing. MD4 The algorithm used in nthash requires the md4 algorithm. This algorithm is included in this module for completeness, but because it is written in all-perl code ( rather than in C ), it's not very quick. However if you have the Digest::MD4 module installed, Crypt::SmbHash will try to use that module instead, making it much faster. A simple test compared calling nthash without Digest::MD4 installed, and with, this showed that using nthash on a system with Digest::MD4 installed proved to be over 90 times faster. AUTHOR
Ported from Samba by Benjamin Kuit <lt>bj@it.uts.edu.au<gt>. Samba is Copyright(C) Andrew Tridgell 1997-1998 Because this module is a direct port of code within the Samba distribution, it follows the same license, that is: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. perl v5.12.1 2004-10-17 SmbHash(3)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy