Thanks Stephan,
        Your suggestion had motivated me and I wrote the code,
after RTFM.

Sameer,

I didn't scheduled the job on OS because this should an Oracle Job,
log switching has nothing to do with OS (you don't trouble a company 
GM when the work should be done by a Normal Manager right??). 
And you need to handle the error conditions of OS when your 
DB is down, which is eliminated in this case. 

Any-way thanks to all, 
Rajesh

And-yes, the code is like this:

create or replace PROCEDURE SWITCH1 IS
  c       number;
  d       number;
begin
  c := dbms_sql.open_cursor;
  dbms_sql.parse(c, 'alter system switch logfile', 1);
  d := dbms_sql.execute(c);
  dbms_sql.close_cursor(c);
commit ;
END;

-----Original Message-----
Faroult
Sent: Tuesday, January 29, 2002 1:36 PM
To: Multiple recipients of list ORACLE-L

Rajesh Dayal wrote:
>
> I was also trying to put some script on Oracle scheduler and successful
too.
> But on Oracle 8
> I failed. It was successful on Oracle 8i (8 doesn't support execute
> immediate). Would appreciate,
> if someone can give equivalent code for Oracle 8.
>         Here is the code for Oracle 8i,
>
> create or replace PROCEDURE SWITCH IS
>   2  BEGIN
>   3  execute immediate 'alter system switch logfile ';
>   4  commit ;
>   5  END;
> 6 /
>
> Thanks in Advance,
> Rajesh
> NOTE: It would be executed with any user having sysdba privilege.
>

Look in the doc for the dbms_sql package. Hardly more complicated than
'execute immediate' for DDL (you declare a handler for the cursor, then
it's done in two calls, parse and execute).
--
Regards,

Stephane Faroult
Oriole Ltd
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Stephane Faroult
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rajesh Dayal
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to