Oracle tables and indexes can now declare tablespace and physical attributes in a physical block, and Atlas inspects, diffs, and plans in-place changes.
Atlas already models the physical attributes and storage clause of an Oracle table. This release adds tablespace to that block, extends the block to indexes, and plans every change in the form that keeps the segment usable.
Tablespace
Set tablespace in a table's physical block to place its segment. Atlas records a tablespace only when it differs from the schema owner's default, so a table sitting in the owner's default carries none and stays unmanaged.
table "T1" { schema = schema.APP column "A" { null = true type = NUMBER } physical { tablespace = "SYSAUX" }}
-- add new table named "T1"CREATE TABLE "APP"."T1" ("A" NUMBER) TABLESPACE "SYSAUX";
Index Physical Attributes
Each index takes its own physical block with tablespace, pctfree, initrans, and a nested storage block, so an index can be placed and tuned independently of the table it belongs to.
table "T3" { schema = schema.APP column "A" { null = true type = NUMBER } index "I_T3" { columns = [column.A] physical { initrans = 4 tablespace = "SYSAUX" } } physical { pctfree = 5 tablespace = "SYSAUX" storage { buffer_pool = KEEP } }}
-- add new table named "T3"CREATE TABLE "APP"."T3" ("A" NUMBER) PCTFREE 5 STORAGE (BUFFER_POOL KEEP) TABLESPACE "SYSAUX";-- create index "I_T3" to table: "T3"CREATE INDEX "I_T3" ON "APP"."T3" ("A") INITRANS 4 TABLESPACE "SYSAUX";
Changes Planned In Place
On an existing schema, Atlas diffs the clause and plans each change in place. Relocating a table uses MOVE ONLINE so its indexes stay usable, other physical attributes are altered directly, and an index whose clause changed is rebuilt:
-- move table "T1" to tablespace "SYSAUX"ALTER TABLE "APP"."T1" MOVE ONLINE TABLESPACE "SYSAUX";-- alter physical attributes of table "T3"ALTER TABLE "APP"."T3" PCTFREE 5;-- rebuild index "I_T3" of table: "T3"ALTER INDEX "I_T3" REBUILD INITRANS 4 TABLESPACE "SYSAUX";
Defaults and Unmanaged Segments
Omitting the block leaves the segment's clause unmanaged, and so does a block whose values all match Oracle's defaults: pctfree = 10, pctused = 40, and a table's initrans = 1 are erased at evaluation. An index's initrans defaults to 2, a table's to 1.
pctused is a table-only option. Declaring it on an index produces an ORA-02158, which Atlas reports when the statement runs against the dev database. Domain and constraint-backed indexes cannot carry the clause, so they are skipped.
Getting Started
Oracle support is part of Atlas Pro. Run atlas login, then declare physical blocks on the tables and indexes you want to manage and run atlas migrate diff or atlas schema apply. See the Oracle HCL reference for the full list of attributes.