During upgrade this query can be quite handy to find the Row Count of tables in the database.
set linesize 999
set pages 0
set trimspool on
set linesize 999
set pages 0
set trimspool on
spool D:\row_count_FSCM88_01_bfr_upgrade.txt
-- spool D:\row_count_FSCM91_02_afr_upgrade.txt
SELECT table_name, to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) c from 'table_name)),'/ROWSET/ROW/C')) AS COUNT FROM DBA_TABLES WHERE table_name IN (SELECT TABLE_NAME FROM DBA_TABLES WHERE TABLE_NAME LIKE 'PS%')AND owner = 'SYSADM' GROUP BY table_name ORDER BY table_name
/
spool off
-- spool D:\row_count_FSCM91_02_afr_upgrade.txt
SELECT table_name, to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) c from 'table_name)),'/ROWSET/ROW/C')) AS COUNT FROM DBA_TABLES WHERE table_name IN (SELECT TABLE_NAME FROM DBA_TABLES WHERE TABLE_NAME LIKE 'PS%')AND owner = 'SYSADM' GROUP BY table_name ORDER BY table_name
/
spool off
3 comments:
Can't we use UPGCOUNT for this?
Yes we can use UPGCOUNT app engine but at times we may not be able to use it as it has PeopleTools dependency. Using the query eliminates PeopleTools dependency. This is particularly useful when you are having infrastructure upgrades along-with PeopleSoft upgrade and your new server do not have old version of PeopleTools installed in it...
This blog post help me a lot to find out the queries.Blogtipshub is the best source to get latest blog tips on how to blog, SEO, Marketing and so on.
Post a Comment