Sponsored Content
Top Forums Shell Programming and Scripting Help with SQL*Plus Connection Post 302419474 by clx on Friday 7th of May 2010 09:19:38 AM
Old 05-07-2010
Did you try this:
Code:
${ORACLE_HOME}/bin/sqlplus "`decrypt -a 3des -k ${DIR_CHAVES}/key.3des.aga -i ${DIR_CHAVES}/login.aga >/dev/null`"@orahmp01 <<EOF

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SQL Connection check though Scripting

Hi Guys, I wanted to check the sql connection through scripting if it is avilable then proceed else stop the process I was trying sqlplus -L username/passwd@sid if this is not sucess it gives non-zero. but if it is success it is going into the sqlplus prompt. So how could i get out... (2 Replies)
Discussion started by: Swapna173
2 Replies

2. UNIX for Advanced & Expert Users

Connection reset by peer..closing connection

Hello I'm facing the above problem while doing a performance run. I've a script which I'm launching from my windows desktop using mozilla. The script will invoke backend action on a Solaris host which in turn feeds the records to a driver located on a linux box(Cent OS). What's happening is... (1 Reply)
Discussion started by: subramanyab
1 Replies

3. Shell Programming and Scripting

Connection to Microsoft SQL Server

Hi, I am using "ksh" and trying to connect to the Microsoft SQL Server but it gives an error that is: DB-LIBRARY error: Unexpected EOF from SQL Server. Can any one please help me to resolve this issue. And i am using Putty to connect to the Unix server. Thanks (3 Replies)
Discussion started by: anupdas
3 Replies

4. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

5. Shell Programming and Scripting

Execute multiple SQL scripts from single SQL Plus connection

Hi! I would like to do a single connection to sqlplus and execute some querys. Actually I do for every query one connection to database i.e echo 'select STATUS from v$instance; exit' > $SQL_FILE sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies

6. Shell Programming and Scripting

SQL query in a loop with single sqlplus connection

Hi, I'm trying to build a shell script that reads a set of accounts from a file. For each account I need to perform a set of sql queries. So I have a loop with a set of sqlplus connections to retrieved my data. Is it possible to have a single sqlplus connection before entering the loop and... (4 Replies)
Discussion started by: lsantacana
4 Replies

7. UNIX for Dummies Questions & Answers

Test new DSN connection to sql server

I installed an odbc driver and created a DSN to connect to a sql server database on AIX 6. I want to know how to test the DSN from the command line. What syntax or commands do I use? ---------- Post updated at 11:44 AM ---------- Previous update was at 08:26 AM ---------- OK I figured out how... (9 Replies)
Discussion started by: Jdbrown239
9 Replies

8. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

9. UNIX for Dummies Questions & Answers

UNIX string connection to sql server db

Hi, i have to perform a connection from unix to sql server database, using TCP protocol. I have all connection parameters (user,pwd,server_name,port,db_name). How can i perform this connection, by unix console ? is it available a command similar to this one (for oracle): sqlplus... (1 Reply)
Discussion started by: nash83
1 Replies

10. UNIX for Beginners Questions & Answers

How to use for loop to execute multiple .sql files while using SQLPLUS for db connection.?

Hello , Im calling every single file inside my script like 1.sql,2.sql so on it looks so tedious. I want to replace with for loop where every file gets executed. When i use for loop im getting errorUnexpected EOF] , can anyone please help me out in this.. How i can use for loop to invoke my... (6 Replies)
Discussion started by: preethi87
6 Replies
encrypt(1)							   User Commands							encrypt(1)

NAME
encrypt, decrypt - encrypt or decrypt files SYNOPSIS
/usr/bin/encrypt -l /usr/bin/encrypt -a algorithm [-v] [-k key_file | -K key_label [-T token_spec]] [-i input_file] [-o output_file] /usr/bin/decrypt -l /usr/bin/decrypt -a algorithm [-v] [-k key_file | -K key_label [-T token_spec]] [-i input_file] [-o output_file] DESCRIPTION
This utility encrypts or decrypts the given file or stdin using the algorithm specified. If no output file is specified, output is to stan- dard out. If input and output are the same file, the encrypted output is written to a temporary work file in the same filesystem and then used to replace the original file. On decryption, if the input and output are the same file, the cleartext replaces the ciphertext file. The output file of encrypt and the input file for decrypt contains the following information: o Output format version number, 4 bytes in network byte order. The current version is 1. o Iterations used in key generation function, 4 bytes in network byte order. o IV (ivlen bytes)[1]. iv data is generated by random bytes equal to one block size. o Salt data used in key generation (16 bytes). o Cipher text data. OPTIONS
The following options are supported: -a algorithm Specify the name of the algorithm to use during the encryption or decryption process. See USAGE, Algorithms for details. -i input_file Specify the input file. Default is stdin if input_file is not specified. -k key_file Specify the file containing the key value for the encryption algorithm. Each algorithm has specific key material require- ments, as stated in the PKCS#11 specification. If -k is not specified, encrypt prompts for key material using get- passphrase(3C). The size of the key file determines the key length, and passphrases set from the terminal are always used to generate 128 bit long keys for ciphers with a variable key length. For information on generating a key file, see the genkey subcommand in pktool(1). Alternatively, dd(1M) can be used. -K key_label Specify the label of a symmetric token key in a PKCS#11 token. -l Display the list of algorithms available on the system. This list can change depending on the configuration of the cryp- tographic framework. The keysizes are displayed in bits. -o output_file Specify output file. Default is stdout if output_file is not specified. If stdout is used without redirecting to a file, the terminal window can appear to hang because the raw encrypted or decrypted data has disrupted the terminal emulation, much like viewing a binary file can do at times. -T token_spec Specify a PKCS#11 token other than the default soft token object store when the -K is specified. token_spec has the format of: token_name [:manuf_id [:serial_no]] When a token label contains trailing spaces, this option does not require them to be typed as a convenience to the user. Colon separates token identification string. If any of the parts have a literal colon (:) character, it must be escaped by a backslash (). If a colon (:) is not found, the entire string (up to 32 characters) is taken as the token label. If only one colon (:) is found, the string is the token label and the manufacturer. -v Display verbose information. See Verbose. USAGE
Algorithms The supported algorithms are displayed with their minimum and maximum key sizes in the -l option. These algorithms are provided by the cryptographic framework. Each supported algorithm is an alias of the PKCS #11 mechanism that is the most commonly used and least restricted version of a particular algorithm type. For example, des is an alias to CKM_DES_CBC_PAD and arcfour is an alias to CKM_RC4. Algorithm vari- ants with no padding or ECB are not supported. These aliases are used with the -a option and are case-sensitive. Passphrase When the -k option is not used during encryption and decryption tasks, the user is prompted for a passphrase. The passphrase is manipulated into a more secure key using the PBKDF2 algorithm specified in PKCS #5. When a passphrase is used with encrypt and decrypt, the user entered passphrase is turned into an encryption key using the PBKDF2 algorithm as defined defined in http://www.rsasecurity.com, PKCS #5 v2.0. Verbose If an input file is provided to the command, a progress bar spans the screen. The progress bar denotes every 25% completed with a pipe sign (|). If the input is from standard input, a period (.) is displayed each time 40KB is read. Upon completion of both input methods, Done is printed. EXAMPLES
Example 1 Listing Available Algorithms The following example lists available algorithms: example$ encrypt -l Algorithm Keysize: Min Max ----------------------------------- aes 128 128 arcfour 8 128 des 64 64 3des 192 192 Example 2 Encrypting Using AES The following example encrypts using AES and prompts for the encryption key: example$ encrypt -a aes -i myfile.txt -o secretstuff Example 3 Encrypting Using AES with a Key File The following example encrypts using AES after the key file has been created: example$ pktool genkey keystore=file keytype=aes keylen=128 outkey=key example$ encrypt -a aes -k key -i myfile.txt -o secretstuff Example 4 Using an In Pipe to Provide Encrypted Tape Backup The following example uses an in pipe to provide encrypted tape backup: example$ ufsdump 0f - /var | encrypt -a arcfour -k /etc/mykeys/backup.k | dd of=/dev/rmt/0 Example 5 Using an In Pipe to Restore Tape Backup The following example uses and in pipe to restore a tape backup: example$ decrypt -a arcfour -k /etc/mykeys/backup.k -i /dev/rmt/0 | ufsrestore xvf - Example 6 Encrypting an Input File Using the 3DES Algorithm The following example encrypts the inputfile file with the 192-bit key stored in the des3key file: example$ encrypt -a 3des -k des3key -i inputfile -o outputfile Example 7 Encrypting an Input File with a DES token key The following example encrypts the input file file with a DES token key in the soft token keystore. The DES token key can be generated with pktool(1): example$ encrypt -a des -K mydeskey -T "Sun Software PKCS#11 softtoken" -i inputfile -o outputfile EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
digest(1), pktool(1), mac(1), dd(1M), getpassphrase(3C), libpkcs11(3LIB), attributes(5), pkcs11_softtoken(5) System Administration Guide: Security Services RSA PKCS#11 v2.11: http://www.rsasecurity.com RSA PKCS#5 v2.0: http://www.rsasecurity.com SunOS 5.11 17 Dec 2008 encrypt(1)
All times are GMT -4. The time now is 03:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy