SET line 132
SET recsep OFF
SET pages 0

/*
SPOOL _tmp.sql
SELECT 
	'CREATE SNAPSHOT  '||owner||'.'||table_name||CHR(10)||'TABLESPACE CWSP'||
	CHR(10)||'BUILD DEFERRED'||'USING INDEX TABLESPACE CWSP_IDX'||CHR(10)||
	'REFRESH FORCE WITH ROWID'||CHR(10)||'ON DEMAND'||CHR(10)||'AS'||CHR(10)||
	'SELECT * FROM '||owner||'.'||table_name||'@SITEBUILDERCE'
FROM
	all_tables
WHERE
	owner = 'SITEBUILDER'
/

SPOOL OFF
*/

SPOOL _tmp.sql
SELECT 
	CHR(10)||'CREATE MATERIALIZED VIEW '||owner||'.'||table_name||CHR(10)||'ON PREBUILT TABLE'
	||CHR(10)||'USING INDEX TABLESPACE CWSP_IDX'
	||CHR(10)||'REFRESH FORCE WITH PRIMARY KEY'||CHR(10)||'ON DEMAND'
	||CHR(10)||'AS'||CHR(10)||'SELECT * FROM '||owner||'.'||table_name||'@CWCOMCE'
	||CHR(10)||'/'
FROM
	all_tables
WHERE
	owner IN ('CWCOM')
/

SPOOL OFF
