查询大于1000行的表

1、 登录数据库服务器
2、 查看当前数据的实例
$ps -ef|grep smon
oracle 8747 1 0 14:38 ? 00:00:00 ora_smon_spsj ==spsj
则当前库的实例是spsj

sqlplus "/as sysdba"
3、 确认使用的schema,即登录数据库的用户名
SQL> select username from dba_users where account_status='OPEN';
4、 查询每个实例下用户的表的数据量
$export ORACLE_SID=spsj
$sqlplus / as sysdba
SQL>set linesize 200 pagesize 5000
SQL>select table_name,num_rows from dba_tables where owner in('用户1', '用户2') and num_rows>1000;

如:
select table_name,num_rows from dba_tables where owner in('SPSJ') and num_rows>1000;

原文地址:https://www.cnblogs.com/sprinng/p/6403542.html