Link to home
Start Free TrialLog in
Avatar of Jerry N
Jerry NFlag for United States of America

asked on

Useage of GV$

I have PLSQL CODE that I inhertied and am trying to understand.  In the Package Spec, there is a cursor defined and a gv$ var:

CURSOR GV$IND IS
SELECT index_name FROM USER_INDEXES
where index_type = 'NORMAL';

gv$nt_type     abp1.nt_type%type;

If my understanding is correct, the GV$IND collects the indexes and is global in scope
The gv$nt_type is global in scope and is of the same type as abp1.nt_type.

In looking through the package body, I can not find any reference to GV$IND.
I find one reference in a line that sets gv$_nt_type:= '11' but is not present in the rest of the package body.
I'm tempted to delete the cursor and the gv$nt_type from the code since it doesnt seem to be used anywhere. I've looked in all the objects for that schema and cant see any references to these at all.

Is there something going on behind the scenes potentially, or do I have to look anywhere else?
Avatar of Sean Stuber
Sean Stuber

look in dba_dependencies to see if any other objects were dependent on that package.


if you don't find any you could comment it out (rather than delete)

or use conditional compilation to exclude it
Avatar of Jerry N

ASKER

Potentially dumb question -
where do I find dba_dependencies?

I use TOAD and did a global search in all objects and cant find it anywhere.
Is there any magic to this or just a global naming convention that would have to be referenced exactly?

For example, I shouldnt have to look for nt_type  VS. gv$nt_type, should I?
you might not have access to it,  it's owned by SYS

try all_dependencies.  - but, if you do that, you could miss some that you don't have access to
>>> I shouldnt have to look for nt_type  VS. gv$nt_type, should I?


dependencies will simply show you if there is ANY dependency between two objects, not necessarily on those declarations.

you might want to search dba_source/all_source

where lower(text) like '%nt_type%')  or lower(text) like '%gv$nt_type%'
actually, if you're using Toad, you can go to the schema browser and check the dependency tab on the right after selecting your package.

but that's just querying all/dba_dependencies, so it has the same restrictions
Avatar of Jerry N

ASKER

Although the package uses other packages and tables, the specific gv$nt_type is not found anywhere.
So, I'm not loosing my mind, there's no magic to the gv$xxxxxx, right?
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jerry N

ASKER

thanks for the help (once again)!