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

如何做logo模板下载网站app开发费用一览表

如何做logo模板下载网站,app开发费用一览表,如何查看网站名称,当当网网站建设建议整理了一些在OceanBase使用过程中常用的SQL语句,这些语句均适用于4.x版本,并将持续进行更新。后续还将分享一些V4.x版本常用的操作指南,以便更好地帮助大家使用OceanBase数据库。 集群信息 版本查看 show variables like version_comment; …

整理了一些在OceanBase使用过程中常用的SQL语句,这些语句均适用于4.x版本,并将持续进行更新。后续还将分享一些V4.x版本常用的操作指南,以便更好地帮助大家使用OceanBase数据库。

集群信息

版本查看

show variables like 'version_comment';

集群ID和集群名查看

show parameters like '%cluster%';

当前服务器信息查看

select * from DBA_OB_SERVERS;

集群的zone信息查看

SELECT * FROM dba_ob_zones;

集群所支持的字符集列表查看

select * from information_schema.collations;

租户信息

查看租户创建基本信息

show create tenant xxx;

查看对应 Unit 的配置。

SELECT * FROM oceanbase.dba_ob_units;

查看租户对应的资源池(可以加 tenant_id 筛选)。

SELECT * FROM oceanbase.dba_ob_resource_pools;

查看租户基本信息。

SELECT * FROM oceanbase.dba_ob_tenants;

当前集群内的租户

select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;

RS 相关

切换rs leader

alter system switch rootservice leader zone='z1';

查看 RS 任务

select * from __all_rootservice_event_history order by 1 desc limit 10;

查看 rs 列表

show parameters like '%rootservice_list%';

查看 rs leader,WITH_ROOTSERVER=yes

SELECT * FROM oceanbase.DBA_OB_SERVERS;

资源分配

资源分配查询

服务器资源分配

select * from GV$OB_SERVERS;

各租户资源分配

select t1.name resource_pool_name, t2.`name` unit_config_name, 
t2.max_cpu, t2.min_cpu, 
round(t2.memory_size/1024/1024/1024,2) mem_size_gb,
round(t2.log_disk_size/1024/1024/1024,2) log_disk_size_gb, t2.max_iops, 
t2.min_iops, t3.unit_id, t3.zone, concat(t3.svr_ip,':',t3.`svr_port`) observer,
t4.tenant_id, t4.tenant_name
from __all_resource_pool t1
join __all_unit_config t2 on (t1.unit_config_id=t2.unit_config_id)
join __all_unit t3 on (t1.`resource_pool_id` = t3.`resource_pool_id`)
left join __all_tenant t4 on (t1.tenant_id=t4.tenant_id)
order by t1.`resource_pool_id`, t2.`unit_config_id`, t3.unit_id;

查看 observer 内存、磁盘配置大小

select zone,svr_ip,svr_port,name,value 
from __all_virtual_sys_parameter_stat 
where 
name in ('memory_limit','memory_limit_percentage','system_memory','datafile_size','datafile_disk_percentage') 
order by svr_ip,svr_port;

容量使用统计

默认情况下统计的是三/多副本的大小,可以通过增加 role 来获取单副本大小。

统计租户的大小

select t.tenant_name,
round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb,
round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb
from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2
where t.tenant_id=t1.tenant_id
and t1.svr_ip=t2.svr_ip
and t1.tenant_id=t2.tenant_id
and t1.ls_id=t2.ls_id
and t1.tablet_id=t2.tablet_id
-- and t1.role='leader'
group by t.tenant_name
order by 3 desc;

统计库的大小

select t1.database_name,
round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb,
round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb
from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2
where t.tenant_id=t1.tenant_id
and t1.svr_ip=t2.svr_ip
and t1.tenant_id=t2.tenant_id
and t1.ls_id=t2.ls_id
and t1.tablet_id=t2.tablet_id
-- and t1.role='leader'
and t.tenant_name='test1'
group by t1.database_name
order by 3 desc;

统计表/索引的大小

select t1.table_name,
round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb,
round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb
from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2
where t.tenant_id=t1.tenant_id
and t1.svr_ip=t2.svr_ip
and t1.tenant_id=t2.tenant_id
and t1.ls_id=t2.ls_id
and t1.tablet_id=t2.tablet_id
-- and t1.role='leader'
and t.tenant_name='test1'
and t1.database_name='sbtest'
and t1.table_name='sbtest1'
group by t1.table_name
order by 3 desc;

统计表对应的分区大小

select t1.table_name,t1.partition_name,
round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb,
round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb
from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2
where t.tenant_id=t1.tenant_id
and t1.svr_ip=t2.svr_ip
and t1.tenant_id=t2.tenant_id
and t1.ls_id=t2.ls_id
and t1.tablet_id=t2.tablet_id
and t1.role='leader'
and t.tenant_name='test1'
and t1.database_name='sbtest'
and t1.table_name='sbtest1_part'
group by t1.table_name,t1.partition_name;

内存占用

租户内存参数:

show parameters where name in ('memstore_limit_percentage','freeze_trigger_percentage');

租户内存持有:

select TENANT_ID,SVR_IP,SVR_PORT,HOLD/1024/1024/1024,FREE/1024/1024/1024 
from oceanbase.GV$OB_TENANT_MEMORY 
where tenant_id =1002;

租户内存模块占用:

select * from V$OB_MEMORY where tenant_id=1002;

memstore占用:

select * from V$OB_MEMSTORE where tenant_id=1002;

总体实际占用的memory 大小以及大小限制:

select * from oceanbase.GV$OB_SERVERS;

memory_limit字段代表实际的memory_limit大小。

MEM_CAPACITY 是 memory_limit - system_memory

  • 内存资源:包括两个配置,MIN_MEMORY和MAX_MEMORY,他们含义如下:
    • MIN_MEMORY:表示为租户分配的最小内存规格,observer上,所有租户的MIN_MEMORY的总和不能超过物理可用内存大小MEM_CAPACITY
    • MAX_MEMORY:表示为租户分配的最大内存规格,observer上,所有租户的MAX_MEMORY的总和不能超过物理可用内存的超卖值:MEM_CAPACITY * resource_hard_limit

表分区和日志流分布

表及分区

查看当前所有表详情

select * from __all_table

查看所有分区详情

select * from __all_part

查看表及分区leader分布

select * from oceanbase.DBA_OB_TABLE_LOCATIONS where ROLE='LEADER'  and table_name='xxx'

查看表及分区的预估数据量

select * from OCEANBASE.DBA_TAB_STATISTICS

日志流

日志流分布

select SVR_IP,ROLE,count(*) from CDB_OB_LS_LOCATIONS group by SVR_IP,ROLE;

查看日志流状态

select * from GV$OB_LOG_STAT;

查看日志流详情

select svr_ip,svr_port,tenant_id,ls_id,replica_type,ls_state,tablet_count from __all_virtual_ls_info;

常用hint

OceanBase Hint 用法

  • 支持不带参数,如 /*+ FUNC */
  • 支持带参数,如 /*+ FUNC(param) */
  • 多个hint可以写到同一个注释中,用逗号分隔,如/*+ FUNC1, FUNC2(param) */
  • SELECT语句的hint必须近接在关键字SELECT之后,其他词之前。如:SELECT /*+ FUNC */ …
  • UPDATE, DELETE 语句的 hint 必须紧接在关键字 UPDATE,DELETE 之后

Hint 参数

Hint 相关参数名称、语义和语法如下表所示。

名称语法语义
NO_REWRITENO_REWRITE禁止 SQL 改写。
READ_CONSISTENCYREAD_CONSISTENCY (WEAK[STRONGFROZEN])读一致性设置(弱/强)。
INDEX_HINT/*+ INDEX(table_name index_name) */设置表索引。
QUERY_TIMEOUTQUERY_TIMEOUT(INTNUM)设置超时时间。
LOG_LEVELLOG_LEVEL([']log_level['])设置日志级别,当设置模块级别语句时候,以第一个单引号(')作为开始,第二个单引号(')作为结束;例如'DEBUG'。
LEADINGLEADING([qb_name] TBL_NAME_LIST)设置联接顺序。
ORDEREDORDERED设置按照 SQL 中的顺序进行联接。
FULLFULL([qb_name] TBL_NAME)设置表访问路径为主表等价于 INDEX(TBL_NAME PRIMARY)。
USE_PLAN_CACHEUSE_PLAN_CACHE(NONE[DEFAULT])设置是否使用计划缓存:NONE:表示不使用计划缓存。DEFAULT:表示按照服务器本身的设置来决定是否使用计划缓存。
USE_MERGEUSE_MERGE([qb_name] TBL_NAME_LIST)设置指定表在作为右表时使用 Merge Join。
USE_HASHUSE_HASH([qb_name] TBL_NAME_LIST)设置指定表在作为右表时使用 Hash Join。
NO_USE_HASHNO_USE_HASH([qb_name] TBL_NAME_LIST)设置指定表在作为右表时不使用 Hash Join。
USE_NLUSE_NL([qb_name] TBL_NAME_LIST)设置指定表在作为右表时使用 Nested Loop Join。
USE_BNLUSE_BNL([qb_name] TBL_NAME_LIST)设置指定表在作为右表时使用 Block Nested Loop Join
USE_HASH_AGGREGATIONUSE_HASH_AGGREGATION([qb_name])设置聚合算法为 Hash。例如 Hash Group By 或者 Hash Distinct。
NO_USE_HASH_AGGREGATIONNO_USE_HASH_AGGREGATION([qb_name])设置 Aggregate 方法不使用 Hash Aggregate,使用 Merge Group By 或者 Merge Distinct。
USE_LATE_MATERIALIZATIONUSE_LATE_MATERIALIZATION设置使用晚期物化。
NO_USE_LATE_MATERIALIZATIONNO_USE_LATE_MATERIALIZATION设置不使用晚期物化。
TRACE_LOGTRACE_LOG设置收集 Trace 记录用于 SHOW TRACE 展示。
QB_NAMEQB_NAME( NAME )设置 Query Block 的名称。
PARALLELPARALLEL(INTNUM)设置分布式执行并行度。
TOPKTOPK(PRECISION MINIMUM_ROWS)设置模糊查询的精度和最小行数。 其中 PRECSION 为整型,取值范围[0,100],表示模糊查询的行数百分比;MINIMUM_ROWS 为最小返回行数。

sql audit

查询资源占用最多的SQL

select SQL_ID, avg(ELAPSED_TIME), 
avg(QUEUE_TIME), 
avg(ROW_CACHE_HIT + BLOOM_FILTER_CACHE_HIT + BLOCK_CACHE_HIT + DISK_READS) avg_logical_read, 
avg(execute_time) avg_exec_time, 
count(*) cnt, 
avg(execute_time - TOTAL_WAIT_TIME_MICRO ) avg_cpu_time, 
avg( TOTAL_WAIT_TIME_MICRO ) avg_wait_time, 
WAIT_CLASS, avg(retry_cnt) from v$OB_SQL_AUDIT 
group by 1 
order by avg_exec_time * cnt desc 
limit 10;

最近100s某个租户的TOP SQL耗时监控

select /*+read_consistency(weak),query_timeout(100000000)*/ SQL_ID,count(1),avg(ELAPSED_TIME),avg(EXECUTE_TIME),avg(QUEUE_TIME),avg(AFFECTED_ROWS),avg(GET_PLAN_TIME) 
from gv$ob_sql_audit  
where time_to_usec(now(6))-request_time <1000000000 
and tenant_name='test_tenant' 
group by SQL_ID order by avg(ELAPSED_TIME)*count(1) desc limit 20;

某个时间段请求次数排在 TOP-N 的 SQL

select SQL_ID, count(*) as QPS, avg(t1.elapsed_time) RT
from oceanbase.gv$ob_sql_audit t1
where   tenant_id = 1001       and IS_EXECUTOR_RPC = 0
and request_time > (time_to_usec(now()) - 10000000)
and request_time < time_to_usec(now())
group by t1.sql_id order by QPS desc limit 10;

定位所有SQL中消耗CPU最多的sql(或者不做聚合直接查询)

select sql_id, substr(query_sql, 1, 200) as query_sql, sum(elapsed_time - queue_time) sum_t, count(*) cnt, avg(get_plan_time), avg(execute_time)    
from oceanbase.gv$ob_sql_audit     
where   tenant_id = 1001      and request_time > (time_to_usec(now()) - 10000000)     and request_time < time_to_usec(now())
group by sql_id order by sum_t desc   limit 10;

巡检、运维相关

自增值

获取每张表的自增值(下一个自增值)

select a.table_name,b.AUTO_INCREMENT_VALUE 
from oceanbase.__all_table a, oceanbase.DBA_OB_AUTO_INCREMENT b 
where a.table_id=b.AUTO_INCREMENT_KEY and a.autoinc_column_id=b.COLUMN_ID and a.TABLE_NAME='t3';

DDL

查询DDL进度

mysql> select * from oceanbase.gv$session_longops\G;
  1. sid:现在没有填值,为默认的 -1。
  2. trace_id: OBServer 程序日志的ID,可以用该ID来搜索相关的日志文件。
  3. opname:建索引时,会展示 create index 信息。
  4. target:建索引时,展示正在创建的索引名。
  5. svr_ip: 调度任务在哪个 OBServer 执行。
  6. svr_port:调度任务在哪个 OBServer 执行。
  7. start_time:索引构建开始时间,这里只精确到日期,跟 Oracle 是兼容的。
  8. elapsed_seconds: 索引构建执行的时间,单位为秒。
  9. time_remaining: 兼容 Oracle 的字段,暂时还没有实现剩余时间预测的能力。
  10. last_update_time: 统计信息收集的时间,也是精确到日期,跟 Oracle 是兼容的。
  11. message:里面包含了多个信息,ENANT_ID为租户 ID,TASK_ID为DDL 的任务 ID,STATUS 为 DDL 执行到的状态,REPLICA BUILD 指的是数据补全阶段,索引数据补全主要分为扫描主表数据,排序,写入到索引表阶段,三个阶段处理的行数分别对应于ROW_SCANNED, ROW_SORTED 和 ROW_INSERTED,因排序阶段可能会进行多轮归并,所以ROW_SORTED 的行数通常比 ROW_SCANNED 和 ROW_INSERTED 要多。

文章转载自:
http://modge.pwmm.cn
http://tomcat.pwmm.cn
http://anode.pwmm.cn
http://maxillary.pwmm.cn
http://perdurable.pwmm.cn
http://polythene.pwmm.cn
http://proletariat.pwmm.cn
http://upu.pwmm.cn
http://pilotage.pwmm.cn
http://naida.pwmm.cn
http://mmpi.pwmm.cn
http://steady.pwmm.cn
http://boozeroo.pwmm.cn
http://tiltmeter.pwmm.cn
http://antiimperialism.pwmm.cn
http://interlanguage.pwmm.cn
http://plantaginaceous.pwmm.cn
http://lakelet.pwmm.cn
http://principium.pwmm.cn
http://mulligatawny.pwmm.cn
http://deepie.pwmm.cn
http://helix.pwmm.cn
http://flocculence.pwmm.cn
http://sponsor.pwmm.cn
http://lavement.pwmm.cn
http://rapidan.pwmm.cn
http://contumely.pwmm.cn
http://implode.pwmm.cn
http://scatterometer.pwmm.cn
http://superconduct.pwmm.cn
http://flockpaper.pwmm.cn
http://bodywork.pwmm.cn
http://panic.pwmm.cn
http://vedette.pwmm.cn
http://yami.pwmm.cn
http://kilocalorie.pwmm.cn
http://adjoint.pwmm.cn
http://nepman.pwmm.cn
http://equilibrator.pwmm.cn
http://ecsc.pwmm.cn
http://outroot.pwmm.cn
http://gothamite.pwmm.cn
http://perdie.pwmm.cn
http://plash.pwmm.cn
http://nonsuch.pwmm.cn
http://sassy.pwmm.cn
http://soochow.pwmm.cn
http://mice.pwmm.cn
http://undersupply.pwmm.cn
http://interferometer.pwmm.cn
http://weevily.pwmm.cn
http://additivity.pwmm.cn
http://lionesque.pwmm.cn
http://phonetic.pwmm.cn
http://piezochemistry.pwmm.cn
http://msbc.pwmm.cn
http://aftercare.pwmm.cn
http://uracil.pwmm.cn
http://enumerable.pwmm.cn
http://ordinance.pwmm.cn
http://champ.pwmm.cn
http://artwork.pwmm.cn
http://onrushing.pwmm.cn
http://chromophore.pwmm.cn
http://cavy.pwmm.cn
http://night.pwmm.cn
http://entablature.pwmm.cn
http://countermovement.pwmm.cn
http://tensity.pwmm.cn
http://lyssophobia.pwmm.cn
http://cabletron.pwmm.cn
http://reside.pwmm.cn
http://apotheosize.pwmm.cn
http://hake.pwmm.cn
http://arcade.pwmm.cn
http://dunnock.pwmm.cn
http://lcj.pwmm.cn
http://ginshop.pwmm.cn
http://burberry.pwmm.cn
http://koppa.pwmm.cn
http://naan.pwmm.cn
http://gaborone.pwmm.cn
http://extrajudicial.pwmm.cn
http://reprehensive.pwmm.cn
http://kinglet.pwmm.cn
http://military.pwmm.cn
http://mallard.pwmm.cn
http://recreative.pwmm.cn
http://setback.pwmm.cn
http://fathomable.pwmm.cn
http://precursor.pwmm.cn
http://vermis.pwmm.cn
http://rubydazzler.pwmm.cn
http://pictorialist.pwmm.cn
http://harlequinade.pwmm.cn
http://flatus.pwmm.cn
http://sarcosine.pwmm.cn
http://finial.pwmm.cn
http://sorry.pwmm.cn
http://guest.pwmm.cn
http://www.dt0577.cn/news/81992.html

相关文章:

  • 地税局内网网站建设建设网站费用
  • 如何删除错误wordpressaso优化技术
  • 福田网站制作报价广州疫情最新数据
  • cdn如何做网站统计网络营销理论基础
  • 泉州做网站开发公司网络推广优化
  • 展示型的网站开发价格seo管理与优化期末试题
  • wordpress php5.3.5访问慢seo站群优化技术
  • seo网站排名优化服务科学新概念seo外链平台
  • xml是用来做网站的嘛网络推销平台有哪些
  • 做网站网页的专业长沙seo优化哪家好
  • 瓜子网网站建设策划书跨境电商有哪些平台
  • 集团网站开发公众号开发网站公司
  • 邢台网约车资格证哪里申请seo爱站网
  • 做网站视频教程百度企业官网认证
  • 怎么做代购彩票网站百度视频下载
  • asp网站开发实训总结宁波seo教程
  • 游戏网站建设与策划seo公司赚钱吗
  • 网站开发 设置背景图片windows优化大师靠谱吗
  • 网站诊断书怎么做哈尔滨seo关键字优化
  • 中国建设移动门户网站免费建站
  • 门户网站建设思维导图网站打开速度优化
  • 呼市网站seo优化工资提成怎么算中国十大搜索引擎排名
  • 网站前台功能模块设计北京推广平台
  • 网站自助建设推广博客网
  • 网页设计与网站开发试卷百度统计怎么使用
  • 石家庄新华区网站建设今日头条军事新闻
  • 保险公司网站开发seo外链要做些什么
  • 青海做网站哪家好比较靠谱的网站
  • 自己做付费网站最快新闻资讯在哪看
  • 转转假网站怎么做搜索引擎推广一般包括哪些