Happy Friday!
In 12.12.0.29, I’m doing a Database->Export->Generate Schema Script. In the “Source and Output” tab, I check two schemas. I then check “User’s Roles” at the top of the Object Types tab, as well as Tables. In Script Options, I have “Sort for Creation” checked. The resulting code has the roles generated, but some object GRANTs are generated before the objects are created. e.g.:
CREATE ROLE MY_ROLE NOT IDENTIFIED;
GRANT ALTER ON SCHEMA2.TABLE2 TO MY_ROLE;
CREATE TABLE SCHEMA1.TABLE1 (BLEAH1 NUMBER);
GRANT ALTER ON SCHEMA1.TABLE1 TO MY_ROLE;
CREATE TABLE SCHEMA2.TABLE2 (BLARF2 NUMBER);
GRANT ALTER ON SCHEMA2.TABLE2 TO MY_ROLE;
Both SCHEMA1 and SCHEMA2 have the MY_ROLE granted. So it seems the generator forgets that SCHEMA2 also needs objects created before granting to the role while it’s dealing with SCHEMA1 objects.
The workaround is obvious and easy…
Thanks!
Rich