We are now going to create the editions that you decided on in the planning stage:
create edition RED as child of ora$base;comment on edition RED is ‘This is the red edition’;grant use on edition RED to PUBLIC;create edition BLACK as child of RED;comment on edition BLACK is ‘This is the black edition’;grant use on edition BLACK to PUBLIC;
Now you can see your shiny new editions:
SELECT e.*, c.comments FROM dba_editions e JOIN dba_edition_comments c ON (c.edition_name = e.edition_name);
You should see 3 editions, all marked as usable.
Check on the grants with this SQL, each edition should have a grant to public.
SELECT * FROM dba_tab_privs WHERE privilege = ‘USE’;
Now you are ready to set the default edition to the first of your newly created editions.
First, check the current default edition:
SELECT property_value FROM database_properties WHERE property_name = ‘DEFAULT_EDITION’;
It should return ORA$BASE
Now change the default edition to RED:
ALTER SESSION SET DDL_LOCK_TIMEOUT=30;
ALTER DATABASE DEFAULT EDITION=RED;
Check the default edition again:
SELECT property_value FROM database_properties WHERE property_name = ‘DEFAULT_EDITION’;
This time it should return ‘RED’
As a final check, exit your sqlplus session and relogin. You should now be in the RED edition, check that with:
SELECT sys_context(‘USERENV’, ‘CURRENT_EDITION_NAME’) FROM dual;
Incidentally, after you are fully switched over to the new editions, you can revoke use on ORA$BASE from public to retire the default edition. Don’t do that yet, you might want to switch back.
