Home » SQL & PL/SQL » SQL & PL/SQL » how to run PLSQL procedure in foreground in SQL command prompt
how to run PLSQL procedure in foreground in SQL command prompt [message #631126] Fri, 09 January 2015 10:59 Go to next message
victoryhendry
Messages: 96
Registered: January 2007
Location: Bangalore
Member

want to run some plsql procedure in forground which is taking 10 min, and result should display once its completed. mean while I have to do some other work in same SQL command prompt. Not sure we can do with shadow process or backend process.

1) I do not wish to work with diff session or through dbms_jobs.

Thanks,

Victory
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631128 is a reply to message #631126] Fri, 09 January 2015 11:04 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
I want to poke my eyes while I want to take some beatiful pictures from my camera.
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631132 is a reply to message #631126] Fri, 09 January 2015 11:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
1) I do not wish to work with diff session or through dbms_jobs.


Use dbms_scheduler. Razz

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631134 is a reply to message #631132] Fri, 09 January 2015 11:24 Go to previous messageGo to next message
victoryhendry
Messages: 96
Registered: January 2007
Location: Bangalore
Member

UNIX there is a option, we can run some task in background process(server side) even though if your connection is disconnected due to some network issue with your connection and we can get the results once again if we connected, I would like to know is there a way to get the dbms output results later on?

[Updated on: Fri, 09 January 2015 11:25]

Report message to a moderator

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631135 is a reply to message #631132] Fri, 09 January 2015 11:25 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
I want to run a FAST marathon with my left wrist tied to my right ankle.
tell me how to obtain main goal.
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631137 is a reply to message #631134] Fri, 09 January 2015 11:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
I would like to know is there a way to get the dbms output results later on?


No.
But you can write the result in a table or a file, like in Unix.

[Updated on: Fri, 09 January 2015 11:28]

Report message to a moderator

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631139 is a reply to message #631137] Fri, 09 January 2015 11:33 Go to previous messageGo to next message
victoryhendry
Messages: 96
Registered: January 2007
Location: Bangalore
Member

Have you understand my point? what I am looking actually?
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631141 is a reply to message #631139] Fri, 09 January 2015 11:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Yes.
And you, do you understand the answers?

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631145 is a reply to message #631134] Fri, 09 January 2015 12:54 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
You create a script with your commands and execute it something like this:
$ nohup ./myScript.sh >./myScript.out 2>&1&

and it will return to the command line.
Then you can start sqlplus to continue working.
And check the script output in the ./myScript.out file.
[no evil]

[Updated on: Fri, 09 January 2015 12:55]

Report message to a moderator

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631146 is a reply to message #631145] Fri, 09 January 2015 13:01 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
LKBrwn_DBA wrote on Fri, 09 January 2015 10:54
You create a script with your commands and execute it something like this:
$ nohup ./myScript.sh >./myScript.out 2>&1&

and it will return to the command line.
Then you can start sqlplus to continue working.
And check the script output in the ./myScript.out file.
[no evil]



how does above meet stated requirement below?

> I do not wish to work with diff session
icon12.gif  Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631150 is a reply to message #631146] Fri, 09 January 2015 14:11 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
nohup will execute the script in background allowing to continue using same terminal session.

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631152 is a reply to message #631150] Fri, 09 January 2015 14:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

But not Oracle session; this is the question. You are insincere.
OP said: "mean while I have to do some other work in same SQL command prompt." which means he does not leave his SQL prompt, i.e. sqlplus and Oracle session, don't you think?

icon12.gif  Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631155 is a reply to message #631152] Fri, 09 January 2015 14:34 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
He could use the "host" command:
SQL> host nohup ./myScript.sh >./myScript.out 2>&1&

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631157 is a reply to message #631155] Fri, 09 January 2015 14:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Don't play silly.
You are not in the same Oracle session, this is the question and you know it.

Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631179 is a reply to message #631155] Fri, 09 January 2015 23:07 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

Quote:
He could use the "host" command:

i don't think while using host command he can work on sql prompt till the cmd prompt doesn't get closed , but he can open one more sql prompt window and can easily do his work.
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631214 is a reply to message #631155] Sat, 10 January 2015 07:56 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
LKBrwn_DBA wrote on Fri, 09 January 2015 14:34
He could use the "host" command:
SQL> host nohup ./myScript.sh >./myScript.out 2>&1&



I don't think that will achieve what the OP thinks he wants.
oracle:mydb$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 10 07:51:13 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> host sleep 10
-- waited 10 seconds before control returned to sqlplus
SQL> host nohup sleep 10
-- waited 10 seconds before control returned to sqlplus
nohup: appending output to `nohup.out'
SQL> 


But like the others, I believe the OP needs to re-think his assumed requirement and self-imposed limitations.
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631215 is a reply to message #631126] Sat, 10 January 2015 07:59 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
What is your business requirement?
How do you imagine you will get notified of completion by this imagined "sqlnohup" process?
How do you imagine you will use the results of this imagined "sqlnohup" process?
Re: how to run PLSQL procedure in foreground in SQL command prompt [message #631216 is a reply to message #631215] Sat, 10 January 2015 08:20 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I do not wish to work with diff session or through dbms_jobs.

please post URL to where DBMS_JOBS is documented
Previous Topic: How to find Nth weekday from current date?
Next Topic: How to count working day
Goto Forum:
  


Current Time: Fri Apr 19 13:56:58 CDT 2024