Using UltraEdit to quickly analyze the number of records in an Oracle table sometimes you need to view the number of records in a batch of tables in the Oracle database, such as data conversion and data verification scenarios. Method 1: Perform table analysis first and then query the Oracle system table (inaccurate)
SQL code -- Statement for generating all table analysis elect 'analyze table' | tname | 'compute statistics; 'from tab; -- execute the preceding statement to perform full-Database Table Analysis (if there is a large amount of data, you must wait) -- query the system table to see the table size select * from user_tables where num_Rows & gt; 0;
Method 2: directly count and analyze the SQL code using a text Tool
-- Generate the count statement select 'select count (1) from' | tname | ';' from tab
Execution result
SQL code SQL> select count (1) from STREETNEW; COUNT (1) ---------- 326 SQL> select count (1) from STREETMAP; COUNT (1) ---------- 337 SQL> select count (1) from STREETMANAGE; COUNT (1) ---------- 141 SQL> select count (1) from SIPLUGINTAB; COUNT (1) ---------- 1 SQL> select count (1) from SIPLUGINCOL; COUNT (1) ---------- 12 SQL> select count (1) from REMOTE_ORG_USER; COUNT (1) ---------- 1548
What should I do if there are too many tables that seem to be difficult? Use UltraEdit to add a macro. Choose menu macro> edit macro> new macro (enter a name)
Macro code InsertMode ColumnModeOff HexOff ColumnModeOn ColumnModeOff UltraEditReOn Find RegExp ";" Replace All "" UltraEditReOn Find RegExp "SQL> select count (1) from "Replace All" "UltraEditReOn Find RegExp" COUNT (1) ---------- "Replace All" "UltraEditReOn Find RegExp" COUNT (1) ---------- "Replace All" "UltraEditReOn Find RegExp" "Replace All" "UltraEditReOn Find RegExp" "Replace All" ^ t"
After saving, create a new file, paste the preceding SQL Execution result (move the cursor to the beginning of the file), and select Run macro. The SQL query result is as follows:
SQL code STREETNEW 326 STREETMAP 337 STREETMANAGE 141 SIPLUGINTAB 1 SIPLUGINCOL 12 REMOTE_ORG_USER 1548
Copy the result to Ecxel, Which is perfect.