Database > Export > Generate Database Script (Sorting)

Hi all,

i try to export DB Script (Toad 16.2) to move to a new instance with the simiar schema/roles/...

But i already fail with exporting roles in the correct sorting.

Short Sample Export (no matter if i use Option Script > Sort for Creation):

CREATE ROLE ACCOUNTMANAGEMENT NOT IDENTIFIED;

-- System privileges granted to ACCOUNTMANAGEMENT
GRANT ALTER USER TO ACCOUNTMANAGEMENT;
GRANT CREATE USER TO ACCOUNTMANAGEMENT;
GRANT DROP USER TO ACCOUNTMANAGEMENT;

-- Roles granted to ACCOUNTMANAGEMENT
GRANT SELECT_BATCHES TO ACCOUNTMANAGEMENT WITH ADMIN OPTION;
GRANT SELECT_MATERIAL TO ACCOUNTMANAGEMENT WITH ADMIN OPTION;

later in the script........

CREATE ROLE SELECT_BATCHES NOT IDENTIFIED;
CREATE ROLE SELECT_MATERIAL NOT IDENTIFIED;

What do i have to do to get an usable Script that runs once and without any errors?

Yes, i can only export roles to get just the create roles, but how to get only the Object and System grants without a create role statement?

Thank you for your support

BR
J

It looks like role dependency sorting doesn't happen unless this box is checked. That's a bug and I'll fix it. Do you have it checked?

I guess as a workaround, you could create a script with only "Roles" checked.
image

Run that script first, then run the script with everything you need checked, and ignore errors.

Then you could do a DB Compare to make sure everything is ok, since you ignored errors and might not be sure.

Sorry about that. I'll fix.

Thanks John.

In all my attempts it made no difference whether the checkbox was activated or not.
So it looks like a bug yes.

image

Do you have an idea when it is fixed?

THX

It should work if you check both "sort for creation" and "object privileges granted to roles".

It will be fixed in the next beta.

FIXED in Beta 16.3.29.1831, Released 7-Nov-2022

Thank you John

1 Like