Find the script to check partition in Oracle
spool F:\precheck.log
set line 999 pages 999
column tablespace_name format a40
column file_name format a50
PROMPT Datafiles and tablespace detail
select tablespace_name,file_name from dba_data_files;
column table_owner format a40
column partition_name format a40
PROMPT Check partition table present in database rather than SYS,SYSTEM Schema
select table_owner,table_name,partition_name,high_value from dba_tab_partitions where table_owner not in ('SYS','SYSTEM');
column owner format a30
column table_name format a30
column index_name format a30
column status format a25
PROMPT Details of the indexes
SELECT DP.OWNER,DP.TABLE_NAME,DP.INDEX_NAME,DI.STATUS FROM DBA_PART_INDEXES DP,DBA_IND_PARTITIONS DI
WHERE DP.OWNER = DI.INDEX_OWNER AND DP.INDEX_NAME = DI.INDEX_NAME and dp.owner not in ('SYS','SYSTEM');
column name format a40
column value format a40
PROMPT check the value of db_files parameter
select name,value from v$parameter where lower(name) like 'db_file%';
column datafilespresent format 99999
PROMPT Exact value of datafiles present in the database
select count(*) as datafilespresent from v$datafile;
column objectinvalidcount format 99999
PROMPT Object Invalid count in database
select count(*) as objectinvalidcount from dba_objects where status = 'INVALID';
Prompt list of invalid objects
col object_name format a40
col owner format a30
select object_name,owner,object_type from dba_objects where status = 'INVALID';
spool off
Related