Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Master/slave scripts

Re: Master/slave scripts

From: Andrew Babb <andrewb_at_mail.com>
Date: Thu, 15 Apr 1999 10:01:56 +0800
Message-ID: <37154894.BB9BC5A4@mail.com>


Master/Slave scripts, or SQL from SQL scripts are just that.

The Master script generates SQL Statements that are written to the Slave file which can then be run as SQL Statements.

I've used them for generating create object scripts (tables/indexes) when I want to resize the object or relocate the object into another tablespace.

Another example would be to count the number of rows in all the tables of the current schema (bad example)

set heading off feedback off pause off pages 0 lines 70 spool slave.sql
select 'select count(*) from '||table_name||';'   from user_tables;
spool off
set heading on feedback on pause off pages 0 lines 70 spool slave.log
start slave.sql
spool off

Hope this helps,
Andrew

Izabella wrote:

> Hi,
>
> Browsing through the Oracle newsgroups I have come across the term
> "master/slave scripts" several times. Reading the answers, it would seem
> that usually they are just PL/SQL or SQL scripts. Do they have any special
> properties to be called master/slave or is it just a term come from another
> language? I've been writing scripts for Oracle for quite a number of years
> now and haven't come across the term before. Could anyone explain just what
> those master/slave scripts are?
>
> Thanks
> Izabella
Received on Wed Apr 14 1999 - 21:01:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US