Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql statements in my script

Status
Not open for further replies.

230173

MIS
Jun 22, 2001
208
SG
Hi,

I'm trying to make a script that gathers some information.
How do i start sqlplus and do some statements with the user sys as sysdba.
I know the syntax: sqlplus -s user/pwd@sqlscript.
This is not what i'm searching. I want to do these sqlstatements in my script. So no extra sqlscript.
And how do i end this sqlsession in my script?
 
From memory, something like this

sqlplus -s user/pwd@instance << EOS
select * from table;
... other sql commands ...
exit
EOS

Steve
 
Thanks but there are 3 instances from witch i need information.
So i cannot use user/pwd@instance.
Is there no way i can connect with sys as sysdba?
 
set up database links to the other databases from one database, then you can have sql statements like this

select * from local_table;
select * from remote_table_a@remote_db_a;
select * from remote_table_b@remote_db_b;

Also -- there are some quite good Oracle forums here at Tek-Tips which you may find useful. Mike
______________________________________________________________________
&quot;Experience is the comb that Nature gives us after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top