Tuesday, 5 May 2015

create your MDSys Tables in your schema


create table my_user_sdo_geom_metadata as select * from user_sdo_geom_metadata;

create table my_user_sdo_styles as select * from user_sdo_styles;

create table my_user_sdo_themes as select * from user_sdo_themes ;

create table my_user_sdo_maps as select * from user_sdo_maps;

create table my_user_sdo_cached_maps as select * from user_sdo_cached_maps;

create table my_user_sdo_geor_sysdata as select * from user_sdo_geor_sysdata;


To insert them again to MDSys views 

insert into user_sdo_geom_metadata select * from my_user_sdo_geom_metadata;

insert into user_sdo_styles select * from my_user_sdo_styles;

insert into user_sdo_themes select * from my_user_sdo_themes;

insert into user_sdo_maps select * from my_user_sdo_maps;

insert into user_sdo_cached_maps select * from my_user_sdo_cached_maps;

insert into user_sdo_geor_sysdata select * from my_user_sdo_geor_sysdata;

commit;

To insert them again to MDSys views without duplicate 

insert into user_sdo_styles
(select * from my_user_sdo_styles
where name not in (select name from user_sdo_styles ))

insert into user_sdo_geom_metadata
(select * from my_user_sdo_geom_metadata
where table_name  not in (select table_name  from user_sdo_geom_metadata))

insert into user_sdo_themes
(select * from my_user_sdo_themes
where name not in (select name from user_sdo_themes))

insert into user_sdo_maps
(select * from my_user_sdo_maps
where name not in (select name from user_sdo_maps))

insert into user_sdo_cached_maps
(select * from my_user_sdo_cached_maps
where name not in (select name from user_sdo_cached_maps))

commit;

delete from user_sdo_styles;
delete from user_sdo_themes;
delete from user_sdo_maps;
delete from user_sdo_cached_maps;
delete from user_sdo_geom_metadata;
delete from user_sdo_geor_sysdata;
commit;

drop table my_user_sdo_geom_metadata;
drop table my_user_sdo_styles;
drop table my_user_sdo_themes;
drop table my_user_sdo_maps;
drop table my_user_sdo_cached_maps;
drop table my_user_sdo_geor_sysdata;



No comments:

Post a Comment