Sponsored Content
Top Forums Shell Programming and Scripting Read Oracle connection details from a configuration file Post 302945659 by sudhakaratp on Monday 1st of June 2015 06:16:25 PM
Old 06-01-2015
After I executed the above command, I saw that there was \n at the end, corrected that and when I run my shell script, I get the prompt to enter username and password and once entered I am getting the error "ORA-12545: Connect failed because target host or object does not exist". Is it because I have @SID?

---------- Post updated Jun 2nd, 2015 at 03:46 AM ---------- Previous update was Jun 1st, 2015 at 08:17 PM ----------

Thanks for all your help...problem resolved...this is what I did...

Code:
#Get oracle database credentials from configuration file
DB_INFO=`cat $parent/dev2_config.txt`
echo $DB_INFO

and that's it...now I am able to connect to database and insert from sample csv file...

thanks again for your help...

Thanks & Regards,
Sudhakara.T.P.

Last edited by Don Cragun; 06-01-2015 at 07:32 PM.. Reason: Add CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to read configuration file

Hi, I would like to write a Korn shell script which will remove files older than a certain date. In my script, it will read a configuration file with the following entries: # <directory> <filename wildcard> # /home/philip/log *.log /home/philip/log1 delete-me*.log The... (1 Reply)
Discussion started by: philip_dba
1 Replies

2. Shell Programming and Scripting

Read relevent details from Log File

Hi All, We have requirement to read XML details from large Log File and save in new file name. I have enclosed the sample xml which has start tag <OUTBOUND_MESSAGE xmlns="http://www.abc.com"> and the end tag as </OUTBOUND_MESSAGE> The log file contains many lines with other details which... (6 Replies)
Discussion started by: thinakarmani
6 Replies

3. Shell Programming and Scripting

How to read the configuration file from shell script

Hello all, Please let me know if anyone have the idea how to read the configuration file from the shell script? Thanks in advance, Nishanth (7 Replies)
Discussion started by: nishanth hampal
7 Replies

4. Solaris

Configuration details

hi can you please tell me how to get the configuration details from unix server. Rajesh. (6 Replies)
Discussion started by: pmrajesh21
6 Replies

5. Shell Programming and Scripting

How to stop Sqlplus command from printing db connection details

Hi, Could someone tell me how to stop SQLPLUS command from printing the connection details in the console. Below is the lines i get in console when executing the sqlplus... SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 9 03:31:03 2011 Copyright (c) 1982, 2005, Oracle. All rights... (2 Replies)
Discussion started by: funonnet
2 Replies

6. Solaris

Solaris configuration details.

How to find the entire configuration details of a solaris. I need to know what partion were made, which OS is used and wat version is used etc... Thanks to tell (4 Replies)
Discussion started by: kkalyan
4 Replies

7. UNIX for Advanced & Expert Users

UNIX / LINUX OS CPU configuration details

Hi, How to find the cpu configuration details of Cores, Speed MHz, virtual processors for the following servers: LINUX OS Servers: Linux 2.6.9-89.0.3.ELsmp #1 SMP Sat Jun 13 07:05:54 EDT 2009 i686 i686 i386 GNU/Linux. (Cores, Speed, Processor) Linux 2.6.18-164.el5 #1 SMP Tue Aug 18... (5 Replies)
Discussion started by: jagtheesh
5 Replies

8. Shell Programming and Scripting

Connection to Oracle data and dump text file

Hi for all! I need for my job one shell script very concrete about connection to oracle databases and writing to text file. Well I tell you: 1.- I must read a file as parameter from linux interface: > example.sh fileToRead 2.-I must read line to line in "fileToRead" and take a... (9 Replies)
Discussion started by: wien996
9 Replies

9. Shell Programming and Scripting

File read from UNIX to Oracle

hi all, I have flat file in unix. By using sql loader i need to import the data from the flat file. I have created a control file, table with the below data structure and pasted the sample input file. I am not sure whether it is a right way to do it. can anyone provide the thought on this. ... (2 Replies)
Discussion started by: arun888
2 Replies

10. UNIX for Beginners Questions & Answers

Unable to fetch BIOS configuration details

Hi All, unable to fetch the bios configuration information and service provider information in centos 5 using dmidecode command. ServiceProvider=`dmidecode -s system-product-name |awk '{print $1}'` BIOS_Configuration=`dmidecode | grep "BIOS Information" -A10 | grep -e... (4 Replies)
Discussion started by: sravani25
4 Replies
DROPDB(1)						  PostgreSQL Client Applications						 DROPDB(1)

NAME
dropdb - remove a PostgreSQL database SYNOPSIS
dropdb [ option... ] dbname DESCRIPTION
dropdb destroys an existing PostgreSQL database. The user who executes this command must be a database superuser or the owner of the data- base. dropdb is a wrapper around the SQL command DROP DATABASE [drop_database(7)]. There is no effective difference between dropping databases via this utility and via other methods for accessing the server. OPTIONS
dropdb accepts the following command-line arguments: dbname Specifies the name of the database to be removed. -e --echo Echo the commands that dropdb generates and sends to the server. -i --interactive Issues a verification prompt before doing anything destructive. dropdb also accepts the following command-line arguments for connection parameters: -h host --host host Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. -p port --port port Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. -U username --username username User name to connect as. -w --no-password Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. -W --password Force dropdb to prompt for a password before connecting to a database. This option is never essential, since dropdb will automatically prompt for a password if the server demands password authentication. However, dropdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. ENVIRONMENT
PGHOST PGPORT PGUSER Default connection parameters This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see in the documentation). DIAGNOSTICS
In case of difficulty, see DROP DATABASE [drop_database(7)] and psql(1) for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the libpq front-end library will apply. EXAMPLES
To destroy the database demo on the default database server: $ dropdb demo To destroy the database demo using the server on host eden, port 5000, with verification and a peek at the underlying command: $ dropdb -p 5000 -h eden -i -e demo Database "demo" will be permanently deleted. Are you sure? (y/n) y DROP DATABASE demo; SEE ALSO
createdb(1), DROP DATABASE [drop_database(7)] Application 2010-05-14 DROPDB(1)
All times are GMT -4. The time now is 12:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy