Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: sqlplus question
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;
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: sfaroult_at_oriole.com 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: ListGuru_at_fatcity.com (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: Rajesh_at_ohitelecom.com 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: ListGuru_at_fatcity.com (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).Received on Tue Jan 29 2002 - 05:45:21 CST