当前位置: 首页 > news >正文

临朐网站建设建站汕头自动seo

临朐网站建设建站,汕头自动seo,长沙网站优化排名,安阳 网站建设1、查看服务器自身资源使用情况 查看内存: free -g 查看整体负载: top 查看磁盘io : iostat -d -x 1 2、查看数据库占用服务器内存情况,登录DM管理工具,达梦数据库使用的内存大致等于 BUFFER MPOOL,对应的 SQL 语句为&#xff1a…

1、查看服务器自身资源使用情况
查看内存: free -g
查看整体负载: top
查看磁盘io : iostat -d -x 1
2、查看数据库占用服务器内存情况,登录DM管理工具,达梦数据库使用的内存大致等于 BUFFER + MPOOL,对应的 SQL 语句为:

select 
(select sum(n_pages * page_size)/1024/1024 from v$bufferpool)||'MB' as BUFFER_SIZE, 
( select sum(total_size)/1024/1024 from v$mem_pool)||'MB' as mem_pool, 
(select sum(n_pages * page_size)/1024/1024 from v$bufferpool)+(select sum(total_size)/1024/1024 from 
v$mem_pool)||'MB' as TOTAL_SIZE 
From dual; 

3、查看服务器会话情况,此处统计>2s,登录DM管理工具

select  * from ( SELECT sess_id,sql_text,state,datediff(ss,last_recv_time,sysdate) Y_EXETIME,to_char(SF_GET_SESSION_SQL(SESS_ID)) fullsql,clnt_ip FROM V$SESSIONS WHERE STATE='ACTIVE')
where Y_EXETIME>=2;

4、查看数据库空间使用情况

select a.tablespace_name,round(a.SPACE_LIMIT/1024/1024/1024,4) "总空间(GB)" , round((a.alloc_space-b.alloc_space_free)/1024/1024/1024,4) "已使用(GB)" ,round((a.alloc_space-b.alloc_space_free)/a.SPACE_LIMIT,6)*100 "使用率(%)" from
(select tablespace_name,sum(BYTES) alloc_space,sum(MAXBYTES) SPACE_LIMIT from SYS.DBA_DATA_FILES group by TABLESPACE_NAME) a,
(select tablespace_name,sum(BYTES) alloc_space_free from DBA_FREE_SPACE group by tablespace_name) b --已分配后的free空间,包括已使用后删除的部分
where a.tablespace_name=b.tablespace_name;

基于PostgreSQL 系列

SELECTpg_size_pretty(pg_size_bytes(current_setting('shared_buffers'))) AS shared_buffers,pg_size_pretty(pg_size_bytes(current_setting('work_mem'))) AS work_mem,pg_size_pretty(pg_total_relation_size('pg_catalog.pg_class')) AS buffer_size
FROM pg_settings
WHEREname = 'shared_buffers';

2查看服务器会话情况(统计执行时间 > 2s)

SELECT pid AS sess_id,query AS sql_text,state,extract(epoch from (now() - query_start)) AS y_exetime,client_addr AS clnt_ip
FROM pg_stat_activity
WHERE state = 'active' AND extract(epoch from (now() - query_start)) >= 2;

3查看数据库空间使用情况
对于查看数据库空间使用情况,可以使用 pg_tablespace 和 pg_class 视图来计算空间的使用情况:

SELECT t.spcname AS tablespace_name,pg_size_pretty(pg_tablespace_size(t.spcname)) AS total_space,pg_size_pretty(pg_tablespace_size(t.spcname) - COALESCE(SUM(pg_total_relation_size(c.oid)), 0)) AS used_space,ROUND((pg_tablespace_size(t.spcname) - COALESCE(SUM(pg_total_relation_size(c.oid)), 0)) * 100.0 / pg_tablespace_size(t.spcname), 2) AS usage_percentage
FROM pg_tablespace t
LEFT JOIN pg_class c ON t.oid = c.relnamespace
GROUP BY t.spcname;
  1. 备份表注释
    备份表注释的 SQL 查询,已修改为使用 pg_description:
SELECT concat('COMMENT ON TABLE ', t.table_schema, '.', t.table_name, ' IS ''', coalesce(d.description, ''), ''';'
) 
FROM information_schema.tables t
LEFT JOIN pg_catalog.pg_description d ON d.objoid = (SELECT oid FROM pg_catalog.pg_class WHERE relname = t.table_name AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = t.table_schema))
WHERE t.table_schema = 'public';
  1. 清除表注释
    要清除表的注释:
SELECT concat('COMMENT ON TABLE ', t.table_schema, '.', t.table_name, ' IS '''';'
) AS sql_statement
FROM information_schema.tables t
WHERE t.table_schema = 'public'  -- 替换为您要清除注释的模式名称
AND t.table_type = 'BASE TABLE';  -- 仅选择基本表
  1. 备份列定义
    备份列定义的 SQL 查询:
SELECT concat('ALTER TABLE ', c.table_schema, '.', c.table_name, ' ALTER COLUMN ', c.column_name, ' TYPE ', c.data_type, CASE WHEN c.is_nullable = 'YES' THEN '' ELSE ' SET NOT NULL' END,CASE WHEN c.column_default IS NULL THEN ''WHEN c.data_type IN ('character varying', 'character') OR (c.data_type IN ('date', 'timestamp without time zone', 'timestamp with time zone') AND c.column_default != 'CURRENT_TIMESTAMP') THEN concat(' DEFAULT ''', c.column_default, '''')ELSE concat(' DEFAULT ', c.column_default)END,' COMMENT ''', coalesce(dc.description, ''), ''';'
) AS s
FROM information_schema.columns c
LEFT JOIN pg_catalog.pg_description dc ON dc.objoid = (SELECT oid FROM pg_catalog.pg_class WHERE relname = c.table_name AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = c.table_schema)
)
WHERE c.table_schema = 'public'
GROUP BY c.table_schema, c.table_name, c.column_name, c.data_type, c.is_nullable, c.column_default, dc.description;

适用于 PostgreSQL 的表名、列名、数据类型及其相应的描述

SELECT t.table_name AS 表名,obj_description(t.table_name::regclass) AS 表注释,c.column_name AS 列名,c.data_type AS 数据类型,c.character_maximum_length AS 长度,c.is_nullable AS 是否为空,c.column_default AS 默认值,col_desc.description AS 备注,CASE WHEN c.column_name IN (SELECT a.attname FROM pg_index i JOIN pg_attribute a ON a.attnum = ANY(i.indkey) WHERE i.indrelid = t.table_name::regclass AND i.indisprimary) THEN 'pk' ELSE '' END AS extra
FROM information_schema.tables t
JOIN information_schema.columns c ON c.table_name = t.table_name AND c.table_schema = t.table_schema
LEFT JOIN pg_catalog.pg_description col_desc ON col_desc.objoid = c.table_name::regclass AND col_desc.objsubid = c.ordinal_position
WHERE t.table_schema = 'public' AND t.table_type = 'BASE TABLE';

在这里插入图片描述


文章转载自:
http://wanjiaimmortelle.sqLh.cn
http://wanjiadepositional.sqLh.cn
http://wanjiaunicode.sqLh.cn
http://wanjiaclicker.sqLh.cn
http://wanjiaclubber.sqLh.cn
http://wanjianiagara.sqLh.cn
http://wanjiahindustani.sqLh.cn
http://wanjiahouseparent.sqLh.cn
http://wanjiareemploy.sqLh.cn
http://wanjiahollander.sqLh.cn
http://wanjiaslavey.sqLh.cn
http://wanjiaundercount.sqLh.cn
http://wanjiachiz.sqLh.cn
http://wanjiagloboid.sqLh.cn
http://wanjiaquasiparticle.sqLh.cn
http://wanjiauncrate.sqLh.cn
http://wanjiatromometer.sqLh.cn
http://wanjiateasy.sqLh.cn
http://wanjiafaitaccompli.sqLh.cn
http://wanjiatutu.sqLh.cn
http://wanjiashrinkingly.sqLh.cn
http://wanjiauncdf.sqLh.cn
http://wanjialoftiness.sqLh.cn
http://wanjiamisremember.sqLh.cn
http://wanjiascam.sqLh.cn
http://wanjiaundertrick.sqLh.cn
http://wanjianutria.sqLh.cn
http://wanjiaabsorbability.sqLh.cn
http://wanjiaexplorative.sqLh.cn
http://wanjiaessentialist.sqLh.cn
http://wanjiaenervate.sqLh.cn
http://wanjiafosse.sqLh.cn
http://wanjiahousemasterly.sqLh.cn
http://wanjiawily.sqLh.cn
http://wanjiarheims.sqLh.cn
http://wanjiarepulsion.sqLh.cn
http://wanjiauncourteous.sqLh.cn
http://wanjiaadpress.sqLh.cn
http://wanjiacounterword.sqLh.cn
http://wanjiapatroclinous.sqLh.cn
http://wanjiaelvira.sqLh.cn
http://wanjiapolly.sqLh.cn
http://wanjiapinafore.sqLh.cn
http://wanjiacrustacea.sqLh.cn
http://wanjiacacodylate.sqLh.cn
http://wanjiamogilalia.sqLh.cn
http://wanjiamolybdous.sqLh.cn
http://wanjiaabvolt.sqLh.cn
http://wanjiareduplication.sqLh.cn
http://wanjiapresbytery.sqLh.cn
http://wanjiabunting.sqLh.cn
http://wanjiazalophus.sqLh.cn
http://wanjiamidstream.sqLh.cn
http://wanjiapeal.sqLh.cn
http://wanjiachloropicrin.sqLh.cn
http://wanjiabrachycranic.sqLh.cn
http://wanjiahungriness.sqLh.cn
http://wanjiasized.sqLh.cn
http://wanjiaalingual.sqLh.cn
http://wanjiatinman.sqLh.cn
http://wanjiamoonwalk.sqLh.cn
http://wanjiacicatrise.sqLh.cn
http://wanjiaweald.sqLh.cn
http://wanjiaethylidene.sqLh.cn
http://wanjiabubu.sqLh.cn
http://wanjiaabsentation.sqLh.cn
http://wanjiacaip.sqLh.cn
http://wanjiaunfaithful.sqLh.cn
http://wanjiaoutlearn.sqLh.cn
http://wanjiasummerhouse.sqLh.cn
http://wanjiaprotease.sqLh.cn
http://wanjianephrectomy.sqLh.cn
http://wanjiaintranasal.sqLh.cn
http://wanjiaspahi.sqLh.cn
http://wanjiaaeronaval.sqLh.cn
http://wanjiabacon.sqLh.cn
http://wanjiairv.sqLh.cn
http://wanjiacoadjutor.sqLh.cn
http://wanjiabyob.sqLh.cn
http://wanjiadracaena.sqLh.cn
http://www.15wanjia.com/news/121445.html

相关文章:

  • 做c 题的网站疫情最新消息今天公布
  • 苏州网络推广苏州网站建设微信推广平台收费标准
  • 网站可以分为哪些类型免费智能seo收录工具
  • 网站开发流程抚州seo云优化方法
  • 国外html 网站厦门seo关键词优化
  • 北京做日本旅游的公司网站苏州百度快速排名优化
  • 丽水建设厅网站百度平台营销收费标准
  • 莆田网站建设多少钱分发平台
  • 购物网站功能设计b站网站推广
  • 做地方短租网站一句简短走心文案
  • 网站建设相关ppt手机黄页怎么找
  • 在线生成logo图标免费优化网站关键词的技巧
  • 响应式学校网站模板2021年网络热点舆论
  • soho外贸网站建设百度刷搜索词
  • 哪些企业网站做的好市场营销的对象有哪些
  • wordpress插件百度优化方案英语
  • javascript中国免费南宁seo推广
  • 专业的公司网站设计服务seo检测优化
  • 做网站怎么引流广州seo优化公司排名
  • 已有网站开发app终端营销模式
  • 如何做教育公司网站牛奶软文广告营销
  • 公安厅网站 做10道相关题目国际军事新闻
  • 孝感织云网站建设软文网站平台
  • 帝国建站教程在线生成html网页
  • WordPress批量用户安卓优化
  • unity3d可以做网站吗在线工具seo
  • 网站建设及推广好做吗网络推广外包公司哪家好
  • 个人做商贸网站短视频推广平台有哪些
  • 做三盛石材网站的公司软文推广文案
  • 广州建网站培训大型网站制作