No question at this time
DBA Top 10
1 A. Kavsek 10000
2 M. Cadot 9900
3 B. Vroman 5700
4 P. Wisse 4300
5 J. PĂ©ran 1800
6 . Lauri 1200
7 J. Schnackenberg 600
8 F. Pachot 500
9 Z. Hudec 400
9 G. Lambregts 400
9 N. Havard 400
About
DBA-Village
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48503
Total active users1429
Act. users last 24h2
Act. users last hour0
Registered user hits last week104
Registered user hits last month599
Go up

SQL Script
Next thread: Monitor user access
Prev thread: automatic diagnostic dest monitor

Message Score Author Date
Hi, I need to run a sql script that is (.sql fi...... rishaan ahamed Jul 02, 2011, 17:51
Hello, there are more options. For example crea...... Score: 900 PtsScore: 900 PtsScore: 900 PtsScore: 900 PtsScore: 900 Pts Matej Pagac Jul 02, 2011, 18:16

Follow up by mail Click here


Subject: SQL Script
Author: rishaan ahamed, India
Date: Jul 02, 2011, 17:51, 3253 days ago
Os info: solaris 10
Oracle info: 10.2.0.4
Message: Hi,

I need to run a sql script that is (.sql file) which is doing some inserts and delete operation and the developers informed that it will take more than 5hrs and they asked me run in the background eventhough if there is any problem in the network the script will run in the server.

Is there any way to run the script in nohup which will execute in the backgroud.

Script name and location:

/export/oracle/test.sql

This script to be run by using schema and also there are some scripts to be run by SYS user.


My scripts have the spool file on and off.
How i can achive this?

Thanks,
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: SQL Script
Author: Matej Pagac, Slovakia
Date: Jul 02, 2011, 18:16, 3253 days ago
Score:   Score: 900 PtsScore: 900 PtsScore: 900 PtsScore: 900 PtsScore: 900 Pts
Message: Hello,

there are more options. For example create simple script to run your .sql file or execute it directly:

1)
nohup sqlplus -S "/ as sysdba" @/export/oracle/test.sql &

or:

2)
oracle@server> cat run.ksh
#!/usr/bin/ksh

export ORACLE_SID=DB_NAME
export ORACLE_HOME=ORACLE_HOME
$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" @/export/oracle/test.sql
exit 0;
oracle@server>

oracle@server> cat /export/oracle/test.sql
spool file_name
"execute job work"
spool off
quit;
oracle@server>


And execute

nohup ./run.ksh &


mTj
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here