데이터베이스 링크 구축, 통계 표 기록 수, 세 션 보기 및 최대 세 션 수

1503 단어 Oacle
1. 통계 표 데이터 생 성 SQL
select 'analyze table ' || table_name || ' compute statistics;' from user_tables where table_name like 'PR\_%\_%'  escape '\' and tablespace_name = 'PR_DATA1'

2. 기업 과 제품 총수 통계
select (select sum(NUM_ROWS)
          from (select t.TABLE_NAME, t.NUM_ROWS
                  from user_tables t
                 where table_name like 'PR_%_SHOP')) as   ,
       (select sum(NUM_ROWS)
          from (select t.TABLE_NAME, t.NUM_ROWS
                  from user_tables t
                 where table_name like 'PR_%_PRODUCT')) as   
  from dual;

3. 통계표 의 기록 수
CREATE VIEW v_pr_sum as 
	SELECT t.table_name as   , SUM(t.num_rows) as    
	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. 데이터베이스 현재 세 션 과 최대 세 션 보기
select to_number(value) from V$parameter where name='processes' 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)))'

좋은 웹페이지 즐겨찾기