Do not use on any
shared computer
September 6, 2008 12:12pm pdt
 
[x]
Attachment Details

Oracle + Unix Sheel Question.

Tags: UNIX Shell, Explorer
I have the following simpe shell script. I am trying to get the start time and end time of the script plus I am also calling other shell scripts in the master script. All the called scripts are supposed to initiate an oracle session and then do something...whats happening is that the Oracle session does get initiated by the called scripts but no SQL runs. I am listing the Master script and one of the called scripts below... I will appreciate all your help. I am substituting the real user name and password by the words username./password.


Master Script:
--------------------------------

${ORACLE_HOME}/bin/sqlplus <username/password> <<S_TIME
   set head off;
   set serveroutput on;
   spool start_t;
   declare
   start_time varchar2(20) :=NULL;
   begin
     SELECT to_char(sysdate,'HH24:MI:SS')
       INTO start_time
       FROM dual;
     dbms_output.put_line('Start Time: '|| start_time);
   end;
   spool off;
S_TIME


Wrapper_0.sh &
Wrapper_1.sh &
Wrapper_2.sh &
Wrapper_3.sh &
Wrapper_4.sh &
Wrapper_5.sh &
Wrapper_6.sh &
Wrapper_7.sh &
Wrapper_8.sh &
Wrapper_9.sh &
Wrapper_a.sh &
Wrapper_at.sh &
Wrapper_b.sh &
Wrapper_c.sh &
Wrapper_d.sh &
Wrapper_dot.sh &
Wrapper_e.sh &
Wrapper_f.sh &
Wrapper_g.sh &
Wrapper_h.sh &
Wrapper_i.sh &
Wrapper_j.sh &
Wrapper_k.sh &
Wrapper_l.sh &
Wrapper_m.sh &
Wrapper_minus.sh &
Wrapper_n.sh &
Wrapper_o.sh &
Wrapper_p.sh &
Wrapper_q.sh &
Wrapper_r.sh &
Wrapper_s.sh &
Wrapper_t.sh &
Wrapper_u.sh &
Wrapper_uscore.sh &
Wrapper_v.sh &
Wrapper_w.sh &
Wrapper_x.sh &
Wrapper_y.sh &
Wrapper_z.sh &

${ORACLE_HOME}/bin/sqlplus <username/password>  <<E_TIME
   set head off;
   set serveroutput on;
   spool end_t;
   declare
   end_time varchar2(20):=NULL;
   begin
     SELECT to_char(sysdate,'HH24:MI:SS')
       INTO end_time
       FROM dual;
     dbms_output.put_line('End Time: '|| end_time);
   end;
   spool off;
E_TIME

One of the called script
---------------------------------

${ORACLE_HOME}/bin/sqlplus <username/password> <<LOAD_0
declare
p_errbuf_o   varchar2(2000);
p_retcode_o  varchar2(2000);  
start_time   date;
end_time     date;
begin
start_time := sysdate;
dbms_output.put_line('Start Time: '|| to_char(start_time,'HH:MM:SS'));
xxcss_am_contract_data_sync1.xxcss_am_data_copy_id(p_errbuf_o, p_retcode_o, '0');
end_time := sysdate;                                                
dbms_output.put_line('end_time: '|| to_char(end_time,'HH:MM:SS'));
exception
when others then
dbms_output.put_line('SQLERRM: '|| SQLERRM);
end;
LOAD_0

Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: OS
Question Asked By: mkmunir70
Solution Provided By: DrSQL
Participating Experts: 2
Solution Grade: B
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by sdstuber

Rank: Sage

Expert Comment by sdstuber:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by DrSQL

Rank: Master

Accepted Solution by DrSQL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628