Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Master/slave scripts
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
![]() |
![]() |