Oracle on UNIX - How to connect via command line ???

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
Doug
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 49
Joined: Wed, 07 Feb 2007 1:08 pm
Location: São Paulo

Environment information:
* Oracle version: 10 g
* Operating system: UNIX

Good evening.

My problem is the following: I have a SQL file that I set myself up. This file works perfectly, but I need to automate this activity.

My client has Oracle installed on a UNIX server.
As I do not manjo anything UNIX I decided to ask you: You can create a bat (with CTZ) on UNIX, it connects to the bank and calls the script via the command line.

If it were in Windows, it would be + or - so:

Select all

#------------------------------------------  
# Interface Automatizada do MasterSaf  
#------------------------------------------  
 
echo Iniciando Processo na Instancia Local  
 
sqlplus doug@local  
@c:\temp\Bat.sql  
quit  
 
echo Finalizando Processo na Instancia Local 
Any idea of ??how to call this bat.sql On UNIX.

ABS ...
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

Doug wrote: Environment information:
* Oracle version: 10 g
* Operating system: UNIX

Good evening.

My problem is the following: I have a SQL file that I set myself up. This file works perfectly, but I need to automate this activity.

My client has Oracle installed on a UNIX server.
How Unix Nothing I decided to ask you: You can create a BAT (with CTZ) on UNIX, it connects to the bank and calls the script via the command line.

If it were in Windows, it would be + or - so:

Select all

#------------------------------------------  
# Interface Automatizada do MasterSaf  
#------------------------------------------  
 
echo Iniciando Processo na Instancia Local  
 
sqlplus doug@local  
@c:\temp\Bat.sql  
quit  
 
echo Finalizando Processo na Instancia Local 
Any idea of ??how to call this bat.sql On UNIX.

ABS ...
If only this script would be thus:

Select all

#------------------------------------------  
# Interface Automatizada do MasterSaf  
#------------------------------------------  
 
echo Iniciando Processo na Instancia Local  
 
sqlplus doug@local  
@/home/usuario/temp/Bat.sql  
quit  
 
echo Finalizando Processo na Instancia Local 
The only difference is how to locate the file.
Detail, need to be the user who installed Oracle, as it contains the environment settings required to run any Oracle torque.

Gilberto
Doug
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 49
Joined: Wed, 07 Feb 2007 1:08 pm
Location: São Paulo

Thanks Gilberto. I'll be going to the code for the test consultant.

grateful.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests