Create database links, Count table records, view sessions, and Max sessions

Source: Internet
Author: User

Set up database links, Count table records, view sessions, and Max sessions. 1. SQL code select 'analyze table' | table_name | 'compute statistics; 'From user_tables where table_name like 'pr \ _ % 'escape '\' and tablespace_name = 'pr _ DATA1 '2. SQL code select (select sum (NUM_ROWS) from (select t. TABLE_NAME, t. NUM_ROWS from user_tables t where table_name like 'pr _ % _ SHOP ') as merchant, (select sum (NUM_ROWS) from (select t. TABLE_NAME, t. NUM_ROWS from user_tables t where table_name like 'pr _ % _ product') as PRODUCT from dual; 3. number of records in the statistical table SQL code CREATE VIEW v_pr_sum as SELECT t. table_name as table name, SUM (t. num_rows) as record count FROM user_tables t WHERE (t. table_name LIKE 'pr \ _ % 'escape '\' and t. table_name not like '% _ image') group by t. table_name order by t. table_name 4. view the SQL code for the current session and maximum SESSION OF THE database select to_number (value) from V $ parameter where name = 'processs' union select count (*) from V $ process; 5. create database link dl_temp connect to zq identified by zq using (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.4.210) (PORT = 1521) (CONNECT_DATA = (SID = orcl )))'

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.