Fastest way to count exact number of rows in a very large table
From: Ashoke Mandal <ramukam1983_at_gmail.com>
Date: Fri, 2 Oct 2020 12:44:04 -0500
Message-ID: <CAF3+JmKvtkR1y2Z8e+XPFSVY74kLcYL7ZxvN2aExXuztwhkv7g_at_mail.gmail.com>
Dear All,
I have a table with 108 billion rows and migrating this database from Oracle 11g on Solaris to Oracle 12c on Linux.
108,424,262,144
Elapsed: 02:22:46.18
Date: Fri, 2 Oct 2020 12:44:04 -0500
Message-ID: <CAF3+JmKvtkR1y2Z8e+XPFSVY74kLcYL7ZxvN2aExXuztwhkv7g_at_mail.gmail.com>
Dear All,
I have a table with 108 billion rows and migrating this database from Oracle 11g on Solaris to Oracle 12c on Linux.
After the migration I need to compare the row count of this table in both
the source DB and the destination DB. It takes almost two hours to get the
row count from this table.
SQL> select to_char(count(*), '999,999,999,999') from test_data;
TO_CHAR(COUNT(*)
108,424,262,144
Elapsed: 02:22:46.18
Could you please suggest some tips to get the row count faster so that it reduces the cut-over downtime.
Thanks,
Ashoke
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Oct 02 2020 - 19:44:04 CEST