analyze_comp
BEGIN
SYS
END;
/
pop_vol
insert into utl_vol_facts
select table_name
from all_tables
or just user_tables
where owner in (
or a comma
/
commit
/
C
nextext
To find tables that don
The implicit rule here is that every table in a given tablespace should
use the exact same value for NEXT
default value for NEXT
his tells us what the setting for NEXT is for these objects today
SELECT segment_name
FROM dba_tablespaces dt
WHERE dt
AND dt
AND ds
ORDER BY tablespace_name
existext
To check existing extents
This tells us how many of each object
the tablespace
sized extents
this tablespace is a candidate for reorganizing
SELECT segment_name
FROM dba_tablespaces dt
WHERE dt
AND dx
GROUP BY segment_name
no_pk
To find tables without PK constraint
SELECT table_name
FROM all_tables
WHERE wner =
MINUS
SELECT table_name
FROM all_constraints
WHERE wner =
AND constraint_type =
disPK
To find out which primary keys are disabled
SELECT owner
FROM all_constraints
WHERE wner =
nonuPK
To find tables with nonunique PK indexes
follow a naming convention
does not have this requirement
SELECT index_name
FROM all_indexes
WHERE index_name like
AND wner =
SELECT nstraint_name
FROM all_constraints c
WHERE c
AND nstraint_type =
mkrebuild_idx
Rebuild indexes to have correct storage parameters
SELECT
||
FROM all_indexes
WHERE ( tablespace_name !=
OR next_extent != (
)
AND wner =
/
datatype
To check datatype consistency between two environments
SELECT table_name
FROM all_tab_columns
WHERE wner =
MINUS
SELECT table_name
FROM all_tab_columns@&my_db_link
WHERE wner =
order by table_name
obj_coord
To find out any difference in objects between two instances
SELECT object_name
FROM user_objects
MINUS
SELECT object_name
FROM user_objects@&my_db_link
From:http://tw.wingwit.com/Article/program/Oracle/201311/17515.html