Hostview.sql

From DB Optimizer
Jump to: navigation, search
create table sash_hostview ( dbid number);
delete from sash_hostview;
commit;
select host from sash_targets;
column f_host new_value v_host
column f_dbid new_value v_dbid;
select '&host' f_host  from dual;
select dbid f_dbid from sash_targets where host='&v_host';
insert into sash_hostview values (&v_dbid);
commit;
create or replace view dbids as select * from sash_targets;
create or replace view sash as 
select  * from sash_all
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_users as 
select * from sash_users_all 
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_sqltxt as 
select * from sash_sqltxt_all 
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_event_names as
select * from sash_event_names_all 
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_sqlstats as
select * from sash_sqlstats_all
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_objs as 
select * from sash_objs_all
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_sqlplans as
select * from sash_sqlplans_all
where dbid = ( select dbid from sash_hostview) ;
create or replace view sash_params as
select * from sash_params_all
where dbid = ( select dbid from sash_hostview) ;