Toad's unit test functionality allows you to install to all schemas on an instance or pick individual schemas. If you pick an individual schema (schema 2) and it is already installed in another schema on the same instance (schema 1), the schema 2 install breaks the functionality in schema 1. Running a unit test in schema 1 yields....
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SESSION", line 237
ORA-06512: at "SCHEMA_1.UT_SESSION_CONTEXT", line 36
ORA-06512: at "SCHEMA_1.UT_SESSION_INFO", line 109
ORA-06512: at "SCHEMA_1.UT_SESSION_INFO", line 175
ORA-06512: at "SCHEMA_1.UT_EVENT_MANAGER", line 70
ORA-06512: at "SCHEMA_1.UT_EVENT_MANAGER", line 80
ORA-06512: at "SCHEMA_1.UT_RUNNER", line 47
ORA-06512: at "SCHEMA_1.UT_RUNNER", line 177
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SESSION", line 141
ORA-06512: at "SCHEMA_1.UT_SESSION_CONTEXT", line 26
ORA-06512: at "SCHEMA_1.UT_SESSION_INFO", line 30
ORA-06512: at "SCHEMA_1.UT_SESSION_INFO", line 171
ORA-06512: at "SCHEMA_1.UT_EVENT_MANAGER", line 70
ORA-06512: at "SCHEMA_1.UT_EVENT_MANAGER", line 80
ORA-06512: at "SCHEMA_1.UT_RUN", line 60
ORA-06512: at "SCHEMA_1.UT_SUITE_ITEM", line 49
ORA-06512: at "SCHEMA_1.UT_RUNNER", line 172
ORA-06512: at line 23
This is because the context it uses (in this case UT_SESSION_CONTEXT) has to be associated to a given package (local to the schema it is installed to) and it is set to be access locally.
For various security policy reasons, we cannot install for all schemas, so this bug makes the unit test functionality next to useless as it has now broken the functionality. Given the individual schema install option is there as part of the installation wizard, it seems it wasn't tested very well at Quest. Any ideas how to address this?