Saturday, February 2, 2008

Accessing Monitored Database Objects with OEM Grid Control Reports

Accessing Monitored Database Objects with OEM Grid Control Reports

Ever want to create an Oracle Enterprise Manager Grid Control Report on using objects in the monitored database not from the gird control repository objects? There is a way

We can create a user in the grid control repository database create a database link to the monitored database create view(s) of the across the database link to the object(s) that we want to be able to built the OEM Grid Control Report on then grant access to the view(s) to the MGMT_VIEW user in the grid control repository. Then you can use the view created in a OEM Grid Control Report.

Example:

-- will set up a user in the grid control repository that will own
-- the private database link and views here we will name the user same
-- as the database
create user prd identified by password ;
alter user prd default tablespace users ;
alter user prd temporary tablespace temp ;

grant create session to prd ;
grant create database link to prd ;
grant create view to prd ;

-- connect as our user so that we can create the database
-- link and view as well as grant to the MGMT_VIEW user
connect prd/password@gridrepository

-- drop the database link if it already exists
drop database link prd ;

-- create the database link to the monitored database where the
-- objects we want to use in our OEM Grid Control Reports exists
create database link prd connect to dbsnmp identified by password using 'PRD' ;

-- Create our view
create or replace view prd.DBA_HIST_SYSMETRIC_SUMMARY as select * from DBA_HIST_SYSMETRIC_SUMMARY@prd ;

-- grant permissions to the MGMT_VIEW user
grant select on prd.DBA_HIST_SYSMETRIC_SUMMARY to MGMT_VIEW ;

-- Now ready to use the prd.DBA_HIST_SYSMETRIC_SUMMARY
-- in our Grid Control Reports

No comments: