We help IT Professionals succeed at work.

Useage of GV$

GNOVAK
GNOVAK asked
on
298 Views
Last Modified: 2012-08-13
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?
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
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

Author

Commented:
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?
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
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
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
>>> 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%'
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
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

Author

Commented:
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?
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks for the help (once again)!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.