(Oracle) Data volume statistics stored procedures

Source: Internet
Author: User

This procedure applies to Oracle data volume statistics.

Create or Replace procedureSp_get_tab_count asv_tablename HDSD_TJ. Tablename%type; V_tablecount HDSD_TJ. Tablecount%type; V_tmpvarchar2( -); V_TMP2varchar2( -); V_tmp3varchar2( -); cursorCur_tab is  SelectTableName fromHDSD_TJ;begin   OpenCur_tab; LoopFetchCur_tab intoV_tablename; Exit  whenCur_tab%NotFound; V_tmp:='Analyze Table'||V_tablename||'Estimate Statistics'; Executeimmediate v_tmp; V_TMP2:= 'Select Num_rows from tabs where table_name =" "||V_tablename||" '"; ExecuteImmediate V_TMP2 intoV_tablecount; V_tmp3:='Update HDSD_TJ Set tablecount='||V_tablecount||'WHERE tableName =" "||V_tablename||" '"; Executeimmediate V_tmp3; EndLoop; CloseCur_tab;End;

-- Create Table Create Table HDSD_TJ (  tablename  VARCHAR2(+),  number (  A ))

(Oracle) Data volume statistics stored procedures

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.