Want to post your scripts here in this blog ? Email it to snojha@gmail.com. You will be rewarded for your scripts if selected by our experts.

Wednesday, January 13, 2010

Database Links - SQL

Show all links

Select db_link||': '||host from dba_db_links;

-- Check links
select owner, db_link, username from dba_db_links;

select owner||': '||db_link from dba_db_links
where (username is not NULL and username <> 'CURRENT_USER');

select 'Number of replication objects defined = '||count(*)
from dba_tables where table_name='REPCAT$_REPOBJECT';

--Database Link Permissions

select grantee||': '||privilege from dba_tab_privs
where grantee <> 'DELETE_CATALOG_ROLE'
and table_name='LINK$'
and grantee not in (select grantee from dba_role_privs where granted_role='DBA');

-- Check which links are defined in LINK$

select substr(name,1,20) Name, substr(host,1,20) Host, substr(password,1,20),
substr(authusr,1,20), substr(authpwd,1,20), substr(passwordx,1,5)
from sys.link$;

No comments: