473,786 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting to multiple oracle databases from unix

1 New Member
Hi all,
I need to write a script that logs into several oracle databases in a sequential manner from a unix box using different login and password e.g sqlplus found/duckl@dnd007 and many more databases to check the logon details work and database is up. At the moment i've got it all hardcoded in a script e.g
echo 'testing xxx'
sqlplus xxx/yyy@xxx
.
.
.
echo 'testing aaa'
sqlplus aa/yyy@aaa

but the problem is i have to type exit at the sqlplus prompt all the time and this can be pretty boring as i've got a long list.
Thanks for the help.
Cheers.
Feb 20 '08 #1
1 3106
osuri
3 New Member
Here is the code (I put it in a script called check_mult_db_s tatus.sh) that you are looking for:
Expand|Select|Wrap|Line Numbers
  1. echo Testing db1
  2. sqlplus -s u1/p1@db1<< EOF
  3. quit
  4. EOF
  5. echo Testing non-existent db2
  6. sqlplus -s u2/p2@db2<< EOF
  7. quit
  8. EOF
  9. echo Testing db1
  10. sqlplus -s u1/p1@db1<< EOF
  11. quit
  12. EOF
When you execute this script, you will see less visual noise (as a result of the -s parameter) and will still see errors at the appropriate place, as you will see below in the execution dialog:

$ ./check_mult_db_s tatus.sh
Testing db1
Testing non-existent db2
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified



ERROR:
ORA-01005: null password given; logon denied


Testing db1
$
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

100
9107
by: Peter | last post by:
Company thought DB2 will be better than Oracle. The bottom line is when you do select, the system crash. I think it may take 4-5 years for DB2 to reach Oracle standard. Peter
5
3009
by: Girish | last post by:
Hi, How will know whether oracle is installed or not in the unix box? The unix box is used as the APP server. Regards
1
3187
by: Wayne Happ | last post by:
I have Oracle 9 running on a Linux RedHat Box V9.0. But I'm having trouble connecting from a windows machine via PL/SQL Develover. When I startup the application the instance name appears but when I try to login as sysdba I get the error. ORA-12545 Connection failed because target host or object does not exist. I'm guessing that there's something net8 I have to setup. This is a new installation. Can someone point me in the right...
0
1386
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong Li (likong@email.com)
3
3608
by: Rob | last post by:
Does anyone know if there are any good comparisons between Windows and Unix performance? Or does anyone have examples of Oracle databases running large numbers (200+) of concurrent users. I am trying to investigate what size implementations can be placed onto Windows 2000 / Windows 2003 as opposed to UNIX but cannot find much data. Any information would be much appreciated. Cheers.
125
15511
by: Rhino | last post by:
One of my friends, Scott, is a consultant who doesn't currently have newsgroup access so I am asking these questions for him. I'll be telling him how to monitor the answers via Google Newsgroup searches. Scott has heard a lot of hype about DB2 and Oracle and is trying to understand the pros and cons of each product. I'm quite familiar with DB2 but have never used Oracle so I can't make any meaningful comparisons for him. He does not have...
10
3536
by: Andrea M. Segovia | last post by:
Hello, I am a newbie to Oracle databases.... We have a visualization front-end tool connected to an Oracle back-end database on a Tru64 UNIX server. We also have clients with MS access databases who would like to share their data using this visualization tool but do not want to import their data into the Oracle server back-end.
13
3330
by: BigDaDDY | last post by:
Um yeah....In case you haven't figured it out, Microsoft sucks. I'm going to be kicked back in my chair eating popcorn and watching football 10 years from now, while all you clowns are scrambling to rewrite all your code because Microsoft upgraded all their crap and nothing you wrote 10 years earlier works. It doesn't take a rocket scientist to figure out that Microsoft is unreliable. Try opening an Excel 95 spreadsheet you wrote in...
4
5746
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.