How to set the default tablespace for each tables, index and lob in a reverse engineered model?
NA
To change tablespace for all tables and indexes, you can use the following script (please run the script in MS Scripting dialog in Model menu):
function Main()
{
var tablespace = "mytablespace";
Log.Clear();
for (e=0; e<Model.CountEntities; e++)
{
Entity = Model.Entities(e);
Entity.SetUserVariable("TableTablespace",tablespace);
Log.Writeln('Entity '+Entity.Name+ ' was changed.');
for (i=0; i<Entity.CountIndexes; i++)
{
Index = Entity.Indexes(i);
Index.SetUserVariable("IndexTablespace",tablespace);
}
}
Log.Writeln('DONE');
}
The tablespace are set as "mytablespace". Names of user-defined variables that are in the code e.g. like "TableTablespace" or "IndexTablespace" can be found in the Templates editor, tab Editor of variables.
You can also change tablespace for LOB. The tablespace for LOB that are written out on the Storage tab of an entity
E.g.
LOB("C") STORE AS
(TABLESPACE "USERS"
CHUNK 8192
NOCACHE NOLOGGING)
NA