Use UltraEdit to quickly analyze the number of records in an Oracle table

Source: Internet
Author: User
Tags ultraedit

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.