Change AWR DBID


def dbid=&DBID;
alter table awr_stage.WRM$_SNAPSHOT  disable constraint WRM$_SNAPSHOT_FK;
   update awr_stage.WRM$_DATABASE_INSTANCE set dbid=&dbid;
   update awr_stage.wrm$_snapshot set dbid=&dbid;
alter table awr_stage.WRM$_SNAPSHOT  enable constraint WRM$_SNAPSHOT_FK;
update AWR_STAGE.WRH$_FILESTATXS set dbid=&dbid;
update AWR_STAGE.WRH$_SQLSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_SYSTEM_EVENT set dbid=&dbid;
update AWR_STAGE.WRH$_WAITSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_CHILDREN set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_PARENT set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_MISSES_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_EVENT_HISTOGRAM set dbid=&dbid;
update AWR_STAGE.WRH$_DB_CACHE_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_ROWCACHE_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_SGASTAT set dbid=&dbid;
update AWR_STAGE.WRH$_SYSSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_SYS_TIME_MODEL set dbid=&dbid;
update AWR_STAGE.WRH$_OSSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_PARAMETER set dbid=&dbid;
update AWR_STAGE.WRH$_SEG_STAT set dbid=&dbid;
update AWR_STAGE.WRH$_DLM_MISC set dbid=&dbid;
update AWR_STAGE.WRH$_INST_CACHE_TRANSFER set dbid=&dbid;
update AWR_STAGE.WRH$_ACTIVE_SESSION_HISTORY set dbid=&dbid;
update AWR_STAGE.WRH$_TABLESPACE_STAT set dbid=&dbid;
update AWR_STAGE.WRH$_SERVICE_STAT set dbid=&dbid;
update AWR_STAGE.WRH$_SERVICE_WAIT_CLASS set dbid=&dbid;
update AWR_STAGE.WRH$_INTERCONNECT_PINGS set dbid=&dbid;
update AWR_STAGE.WRH$_FILESTATXS_BL set dbid=&dbid;
update AWR_STAGE.WRH$_TEMPSTATXS set dbid=&dbid;
update AWR_STAGE.WRH$_DATAFILE set dbid=&dbid;
update AWR_STAGE.WRH$_TEMPFILE set dbid=&dbid;
update AWR_STAGE.WRH$_COMP_IOSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_IOSTAT_FUNCTION set dbid=&dbid;
update AWR_STAGE.WRH$_IOSTAT_FUNCTION_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_IOSTAT_FILETYPE set dbid=&dbid;
update AWR_STAGE.WRH$_IOSTAT_FILETYPE_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_SQLSTAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SQL_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_SQL_BIND_METADATA set dbid=&dbid;
update AWR_STAGE.WRH$_OPTIMIZER_ENV set dbid=&dbid;
update AWR_STAGE.WRH$_SYSTEM_EVENT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_EVENT_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_BG_EVENT_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_WAITSTAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_ENQUEUE_STAT set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_BL set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_CHILDREN_BL set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_PARENT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_LATCH_MISSES_SUMMARY_BL set dbid=&dbid;
update AWR_STAGE.WRH$_EVENT_HISTOGRAM_BL set dbid=&dbid;
update AWR_STAGE.WRH$_MUTEX_SLEEP set dbid=&dbid;
update AWR_STAGE.WRH$_LIBRARYCACHE set dbid=&dbid;
update AWR_STAGE.WRH$_DB_CACHE_ADVICE_BL set dbid=&dbid;
update AWR_STAGE.WRH$_BUFFER_POOL_STATISTICS set dbid=&dbid;
update AWR_STAGE.WRH$_ROWCACHE_SUMMARY_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SGA set dbid=&dbid;
update AWR_STAGE.WRH$_SGASTAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_PGASTAT set dbid=&dbid;
update AWR_STAGE.WRH$_PROCESS_MEMORY_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_RESOURCE_LIMIT set dbid=&dbid;
update AWR_STAGE.WRH$_SHARED_POOL_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_STREAMS_POOL_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_SQL_WORKAREA_HISTOGRAM set dbid=&dbid;
update AWR_STAGE.WRH$_PGA_TARGET_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_SGA_TARGET_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_MEMORY_TARGET_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_MEMORY_RESIZE_OPS set dbid=&dbid;
update AWR_STAGE.WRH$_INSTANCE_RECOVERY set dbid=&dbid;
update AWR_STAGE.WRH$_JAVA_POOL_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_THREAD set dbid=&dbid;
update AWR_STAGE.WRH$_SYSSTAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SYS_TIME_MODEL_BL set dbid=&dbid;
update AWR_STAGE.WRH$_OSSTAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_PARAMETER_BL set dbid=&dbid;
update AWR_STAGE.WRH$_STAT_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_OSSTAT_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_PARAMETER_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_UNDOSTAT set dbid=&dbid;
update AWR_STAGE.WRH$_SEG_STAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SEG_STAT_OBJ set dbid=&dbid;
update AWR_STAGE.WRH$_METRIC_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_SYSMETRIC_HISTORY set dbid=&dbid;
update AWR_STAGE.WRH$_SYSMETRIC_SUMMARY set dbid=&dbid;
update AWR_STAGE.WRH$_SESSMETRIC_HISTORY set dbid=&dbid;
update AWR_STAGE.WRH$_FILEMETRIC_HISTORY set dbid=&dbid;
update AWR_STAGE.WRH$_WAITCLASSMETRIC_HISTORY set dbid=&dbid;
update AWR_STAGE.WRH$_DLM_MISC_BL set dbid=&dbid;
update AWR_STAGE.WRH$_CR_BLOCK_SERVER set dbid=&dbid;
update AWR_STAGE.WRH$_CURRENT_BLOCK_SERVER set dbid=&dbid;
update AWR_STAGE.WRH$_INST_CACHE_TRANSFER_BL set dbid=&dbid;
update AWR_STAGE.WRH$_ACTIVE_SESSION_HISTORY_BL set dbid=&dbid;
update AWR_STAGE.WRH$_TABLESPACE_STAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_LOG set dbid=&dbid;
update AWR_STAGE.WRH$_MTTR_TARGET_ADVICE set dbid=&dbid;
update AWR_STAGE.WRH$_TABLESPACE_SPACE_USAGE set dbid=&dbid;
update AWR_STAGE.WRH$_SERVICE_NAME set dbid=&dbid;
update AWR_STAGE.WRH$_SERVICE_STAT_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SERVICE_WAIT_CLASS_BL set dbid=&dbid;
update AWR_STAGE.WRH$_SESS_TIME_STATS set dbid=&dbid;
update AWR_STAGE.WRH$_STREAMS_CAPTURE set dbid=&dbid;
update AWR_STAGE.WRH$_STREAMS_APPLY_SUM set dbid=&dbid;
update AWR_STAGE.WRH$_BUFFERED_QUEUES set dbid=&dbid;
update AWR_STAGE.WRH$_BUFFERED_SUBSCRIBERS set dbid=&dbid;
update AWR_STAGE.WRH$_PERSISTENT_QUEUES set dbid=&dbid;
update AWR_STAGE.WRH$_PERSISTENT_SUBSCRIBERS set dbid=&dbid;
update AWR_STAGE.WRH$_RULE_SET set dbid=&dbid;
update AWR_STAGE.WRH$_RSRC_CONSUMER_GROUP set dbid=&dbid;
update AWR_STAGE.WRH$_RSRC_PLAN set dbid=&dbid;
update AWR_STAGE.WRH$_CLUSTER_INTERCON set dbid=&dbid;
update AWR_STAGE.WRH$_IC_DEVICE_STATS set dbid=&dbid;
update AWR_STAGE.WRH$_IC_CLIENT_STATS set dbid=&dbid;
update AWR_STAGE.WRH$_MEM_DYNAMIC_COMP set dbid=&dbid;
update AWR_STAGE.WRH$_INTERCONNECT_PINGS_BL set dbid=&dbid;
update AWR_STAGE.WRM$_SNAP_ERROR set dbid=&dbid;
update AWR_STAGE.WRM$_COLORED_SQL set dbid=&dbid;
update AWR_STAGE.WRM$_BASELINE_DETAILS set dbid=&dbid;
update AWR_STAGE.WRM$_BASELINE_TEMPLATE set dbid=&dbid;
update AWR_STAGE.WRM$_WR_CONTROL set dbid=&dbid;
update AWR_STAGE.WRH$_SQLTEXT set dbid=&dbid;
update AWR_STAGE.WRH$_SQL_PLAN set dbid=&dbid;

Comments