首页 > 其他分享 >【YashanDB知识库】YFS_修改AU_SIZE参数

【YashanDB知识库】YFS_修改AU_SIZE参数

时间:2025-01-17 16:34:39浏览次数:1  
标签:yashandb AU localhost YFS YashanDB backup bak yac SIZE

本文内容来自YashanDB官网,原文内容请见 https://www.yashandb.com/newsinfo/7080871.html?templateId=1718516

基本信息

场景:YAC数据库已经创建完毕,需要修改DG0的AU_SIZE,提高创建数据文件性能。

DG0的AU_SIZE只能通过重建数据库来修改。本文说明修改方法。

源库版本:YashanDB 企业版 23.2.1.100

基本信息查询:

默认AU_SIZE是1M。

[yac@localhost ~]$ yasql / as sysdba

YashanDB SQL Enterprise Edition Release 23.2.1.100 aarch64

SQL> select * from V$YFS_DISKGROUP

   2 ;

 

          ID NAME AU_SIZE BLOCK_SIZE REDUNDANCY STATE TOTAL_MB FREE_MB USABLE_FILE_MB

------------ ---------------------------------------------------------------- ------------ ------------ ---------------------------------------------------------------- ---------------------------------------------------------------- --------------------- --------------------- ---------------------

           0 DG0 1048576 4096 EXTERNAL MOUNTED 307200 289752 289752

 

1 row fetched.

 

SQL> exit

修改AU_SIZE

备份

[yac@localhost backup]$ yasrman / -c 'create catalog' -D /home/yac/backup/catalog

 

create catalog successfully

 

[yac@localhost backup]$ yasrman / -c 'show all'

+---------------------------+-----------+----------------+

| NAME | DEFAULT | VALUE |

+---------------------------+-----------+----------------+

| PARALLELISM | 2 | 2 |

| SECTION SIZE | 134217728 | 134217728 |

| COMPRESSION ALGORITHM | NONE | NONE |

| COMPRESSION LEVEL | LOW | LOW |

| DEST | SERVER | SERVER |

+---------------------------+-----------+----------------+

[yac@localhost backup]$ yasrman / -c 'configure PARALLELISM 8' -D /home/yac/backup/catalog

 

configure successfully

 

[yac@localhost backup]$ yasrman / -c 'configure COMPRESSION ALGORITHM zstd' -D /home/yac/backup/catalog

 

configure successfully

 

[yac@localhost backup]$ yasrman / -c 'show all' -D /home/yac/backup/catalog

+---------------------------+-----------+----------------+

| NAME | DEFAULT | VALUE |

+---------------------------+-----------+----------------+

| PARALLELISM | 2 | 8 |

| SECTION SIZE | 134217728 | 134217728 |

| COMPRESSION ALGORITHM | NONE | ZSTD |

| COMPRESSION LEVEL | LOW | LOW |

| DEST | SERVER | SERVER |

+---------------------------+-----------+----------------+

[yac@localhost backup]$ yasrman sys/Cod-2022 -c "backup database tag 'full_1' format '/home/yac/backup/full_bak_1'" -D /home/yac/backup/catalog

 

backup successfully

 

[yac@localhost full_bak_1]$ pwd

/home/yac/backup/full_bak_1

[yac@localhost full_bak_1]$ ll

total 19632

-rw-r----- 1 yac yac 5632 Apr 9 18:43 backup_filelist

-rw-r----- 1 yac yac 16777216 Apr 9 18:43 backup_profile

-rw-r----- 1 yac yac 5120 Apr 9 18:43 ctrl_0_0_0.bak

-rw-r----- 1 yac yac 1318400 Apr 9 18:43 data_0_0_0.bak

-rw-r----- 1 yac yac 208384 Apr 9 18:43 data_1_0_0.bak

-rw-r----- 1 yac yac 512 Apr 9 18:43 data_2_0_0.bak

-rw-r----- 1 yac yac 512 Apr 9 18:43 data_3_0_0.bak

-rw-r----- 1 yac yac 167424 Apr 9 18:43 data_4_0_0.bak

-rw-r----- 1 yac yac 1158144 Apr 9 18:43 data_5_0_0.bak

-rw-r----- 1 yac yac 230400 Apr 9 18:43 data_6_0_0.bak

-rw-r----- 1 yac yac 93696 Apr 9 18:43 redo0_0_2_0.bak

-rw-r----- 1 yac yac 117760 Apr 9 18:43 redo1_0_1_0.bak

[yac@localhost full_bak_1]$

删除数据库

[yac@localhost full_bak_1]$ yasboot cluster clean --purge -c yashandb -d

Are you sure you want to CLEAN cluster: [yashandb], AND ALL DATA WILL BE DELETED (-p/--purge is given)?

[yes/no]: yes

 type | uuid | name | hostid | index | status | return_code | progress | cost

-----------------------------------------------------------------------------------------------------------------------

 task | 794bab4eb2b31232 | CleanYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 1

-------+------------------+-------------------+----------+-------------------+---------+-------------+----------+------

 child | 49fb78339719543e | CleanYasdbNode | host0001 | yashandb.host0001 | SUCCESS | 0 | 100 | 1

       +------------------+-------------------+----------+-------------------+---------+-------------+----------+------

       | 18e112cf6e61c0c7 | CleanYasdbNode | host0002 | yashandb.host0002 | SUCCESS | 0 | 100 | 1

-------+------------------+-------------------+----------+-------------------+---------+-------------+----------+------

task completed, status: SUCCESS

[yac@localhost full_bak_1]$

修改建库脚本,修改AU_SIZE

获取默认的diskgroup创建语句

[yac@localhost log]$ grep -i 'create diskgroup' yasagent.log

2024-04-09 18:33:19 DEBUG [yashandb-1-1] exec.go:63 exec: bash -c /home/yac/yashandb/23.2.1.100/bin/yfscmd -D /home/yac/data/ycs/ce-1-1 exec "create diskgroup DG0 external redundancy disk '/dev/yas/data' force attribute 'au_size'='1M'" starting

[yac@localhost log]$

修改yashandb.toml

修改yashandb.toml

在[group.config之前]添加,注意au_size已经修改为32M。

[group.create_sql]

 create_diskgroup = "create diskgroup DG0 external redundancy disk '/dev/yas/data' force attribute 'au_size'='32M';"

完整yashandb.toml如下

[yac@localhost install]$ cat yashandb.toml

cluster = "yashandb"

create_simple_schema = false

uuid = "661518c0de3db7d39125706474b55a89"

yas_type = "CE"

 

[CEDisk]

  data = "/dev/yas/data"

  vote = "/dev/yas/vote"

  ycr = "/dev/yas/ycr"

 

[YFSConfig]

  RECY_INTERVAL = "86400"

  SHM_POOL_SIZE = "2G"

  SYS_AREA_SIZE = "1G"

  YFS_PACKET_SIZE = "1M"

 

[[group]]

  group_type = "ce"

  name = "ceg1"

  

 [group.create_sql]

 create_diskgroup"create diskgroup DG0 external redundancy disk '/dev/yas/data' force attribute 'au_size'='32M';"

  

  [group.config]

    CHARACTER_SET = "gbk"

    ISARCHIVELOG = true

    REDO_FILE_NUM = 8

    REDO_FILE_SIZE = "1G"

    YFS_FORCE_CREATE = true

 

  [[group.node]]

    data_path = "/home/yac/data"

    hostid = "host0001"

    role = 1

    [group.node.config]

      CLUSTER_DATABASE = "TRUE"

      CLUSTER_INTERCONNECT = "192.168.27.28:1989"

      DATA_BUFFER_SIZE = "1G"

      HA_ELECTION_TIMEOUT = 18

      HA_HEARTBEAT_INTERVAL = 6

      INTER_URL = "192.168.27.28:2088"

      LISTEN_ADDR = "192.168.27.28:1988"

      REDO_BUFFER_PARTS = 8

      REDO_BUFFER_SIZE = "64M"

      RUN_LOG_FILE_PATH = "/home/yac/yashandb/23.2.1.100/log/yashandb/ce-1-1/run"

      SHARE_POOL_SIZE = "1G"

      SLOW_LOG_FILE_PATH = "/home/yac/yashandb/23.2.1.100/log/yashandb/ce-1-1/slow"

      SQL_POOL_PARTS = 8

 

  [[group.node]]

    data_path = "/home/yac/data"

    hostid = "host0002"

    role = 2

    [group.node.config]

      CLUSTER_DATABASE = "TRUE"

      CLUSTER_INTERCONNECT = "192.168.27.29:1989"

      DATA_BUFFER_SIZE = "1G"

      HA_ELECTION_TIMEOUT = 18

      HA_HEARTBEAT_INTERVAL = 6

      INTER_URL = "192.168.27.29:2088"

      LISTEN_ADDR = "192.168.27.29:1988"

      REDO_BUFFER_PARTS = 8

      REDO_BUFFER_SIZE = "64M"

      RUN_LOG_FILE_PATH = "/home/yac/yashandb/23.2.1.100/log/yashandb/ce-1-2/run"

      SHARE_POOL_SIZE = "1G"

      SLOW_LOG_FILE_PATH = "/home/yac/yashandb/23.2.1.100/log/yashandb/ce-1-2/slow"

      SQL_POOL_PARTS = 8

[yac@localhost install]$

重建集群

[yac@localhost install]$ ./bin/yasboot cluster deploy -t yashandb.toml -d

 type | uuid | name | hostid | index | status | return_code | progress | cost

------------------------------------------------------------------------------------------------------------------------

 task | febed9e9d11051f6 | DeployYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 154

-------+------------------+--------------------+----------+-------------------+---------+-------------+----------+------

 child | fd7f36bebd8c6690 | DeployCePrimary | host0001 | yashandb.1-1 | SUCCESS | 0 | 100 | 138

       +------------------+--------------------+----------+-------------------+---------+-------------+----------+------

       | 6b8097c29ae76eb5 | DeployCeStandby | host0002 | yashandb.1-2 | SUCCESS | 0 | 100 | 13

       +------------------+--------------------+----------+-------------------+---------+-------------+----------+------

       | ac33cca0038effe3 | SyncNodeConfig | - | yashandb | SUCCESS | 0 | 100 | 1

       +------------------+--------------------+----------+-------------------+---------+-------------+----------+------

       | ae8d99b094cdf85f | MonitReload | host0001 | yashandb-host0001 | SUCCESS | 0 | 100 | 1

       +------------------+--------------------+----------+-------------------+---------+-------------+----------+------

       | 1c0e0f77c6268465 | MonitReload | host0002 | yashandb-host0002 | SUCCESS | 0 | 100 | 1

-------+------------------+--------------------+----------+-------------------+---------+-------------+----------+------

task completed, status: SUCCESS

确认AU_SIZE已经修改

[yac@localhost install]$ yasql / as sysdba

YashanDB SQL Enterprise Edition Release 23.2.1.100 aarch64

SQL> select name,au_size/1024/1024 from v$yfs_diskgroup;

 

NAME AU_SIZE/1024/1024

---------------------------------------------------------------- -----------------

DG0 32

 

1 row fetched.

 

SQL>

恢复数据库

[yac@localhost install]$ yasboot cluster clean -c yashandb --restore -d

Are you sure you want to CLEAN cluster: [yashandb], NODES DATA WILL BE DELETED AND RESTART WITH 'NOMOUNT' STATUS (-r/--restore is given)?

[yes/no]: yes

 type | uuid | name | hostid | index | status | return_code | progress | cost

----------------------------------------------------------------------------------------------------------------------------

 task | 93b8e4c5d11e4cc6 | CleanYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 44

-------+------------------+-------------------+----------+------------------------+---------+-------------+----------+------

 child | 2dea5296ca43b64b | StopYasdbYasce | host0001 | yashandb.1-1.ForceStop | SUCCESS | 0 | 100 | 1

       +------------------+-------------------+----------+------------------------+---------+-------------+----------+------

       | 4395ef7a8f1acb88 | StopYasdbYasce | host0002 | yashandb.1-2.ForceStop | SUCCESS | 0 | 100 | 1

       +------------------+-------------------+----------+------------------------+---------+-------------+----------+------

       | 3398f9d85a07c56a | RestoreCleanYasce | host0001 | yashandb.1-1 | SUCCESS | 0 | 100 | 39

       +------------------+-------------------+----------+------------------------+---------+-------------+----------+------

       | 8727a602b3b696fd | StartYasdbYasce | host0002 | yashandb.1-2 | SUCCESS | 0 | 100 | 4

-------+------------------+-------------------+----------+------------------------+---------+-------------+----------+------

task completed, status: SUCCESS

[yac@localhost install]$

[yac@localhost backup]$ yasrman / -c "list backup" -D /home/yac/backup/catalog

Group: type DB, tag: full_1, format: /home/yac/backup/full_bak_1, connect url: , nodeCount: 1, distribution: FALSE, isClient: FALSE, offset: 0

    backup path: /home/yac/backup/full_bak_1

    instance: 1, archive range sequence: 2-2

                   scn: 552231634862604288-552233372626141184

    instance: 2, archive range sequence: 1-1

                   scn: 552231634862604288-552233372626141184

 

[yac@localhost backup]$

[yac@localhost backup]$ yasrman sys/Cod-2022 -c "restore database from tag 'full_1'" -D /home/yac/backup/catalog

yashan

restore successfully

标签:yashandb,AU,localhost,YFS,YashanDB,backup,bak,yac,SIZE
From: https://www.cnblogs.com/YashanDB/p/18677260

相关文章

  • 【一看就会】Autoware.universe的“规划”部分源码梳理【一】
    文章目录前言一、planning实现的几个功能1.规划起点到目标点的路线2.规划跟随路线的轨迹3.确保车辆不与障碍物发生碰撞4.确保车辆遵守交通规则5.规划车辆可行的轨迹二、全局路径生成模块——mission_planner1.mission_planner.cpp1.输入输出:2.代码流程:3.源码注释2.rout......
  • SautinSoft PDF Focus .Net 2024.12.18
    SautinSoftPDFFocus.NetisapowerfultoolfordevelopersneedingtoconvertPDFdocumentsintovariousformatslikeWord(DOCX,RTF),Excel(CSV,XLS,XLSX),HTML,XML,text,andimages(JPEG,PNG,TIFF,GIF,Bitmap).ItsupportsallPDFversionsfrom......
  • 创建一个.NET MAUI应用(二)
    开发本机跨平台.NET多平台应用UI(.NETMAUI)应用需要VisualStudio202217.12或更高版本 安装若要创建.NETMAUI应用,需要下载最新版本的VisualStudio2022:下载VisualStudio2022社区版下载VisualStudio2022专业版下载VisualStudio2022企业......
  • GaussDB云原生数据库SQL引擎继承原来openGauss的词法解析,语法解析,查询重写,查询优化和
    云原生数据库SQL引擎继承原来openGauss的词法解析,语法解析,查询重写,查询优化和执行引擎的能力。由于云原生数据库是shareddisk架构,一个事务在一个节点上执行,所以不需要原来分布式根据分布式key进行数据分布,分布式执行和分布式2PC提交的能力。为了支持数据库粒度的异地多活,云原生......
  • GaussDB云原生架构
    分层原则。整体层次分为三层,分别为ApplicationLayer,ComputerLayer和StorageLayer。ApplicationLayer应用层主要是客户端各种语言的驱动,这些驱动通过通信与计算层ComputerLayer进行交互,对数据库进行操作。下面是ComputerLayer计算层,计算层负责SQL处理和事务处理,数据库的......
  • GaussDB事务存储组件
    事务存储组件云原生数据库支持透明多写,所有节点对等,每个计算节点都可以读写全部的数据页面,事务在本节点执行,没有分布式事务。每个计算节点都有Localbufferpool,采用Remotememorypool扩展计算节点的内存,在多个计算节点之间共享buffer地址,避免页面在多个计算节点之间传来传去。......
  • GaussDB实时分析组件
    云原生数据库以OLTP为主,同时也支持基于OLTP数据的OLAP需求,如每日报表。在云原生数据库中,DBA可以选择为这部分表创建列存索引。创建完列存索引之后,执行器在做顺序扫描的时候,会自动选择列存索引进行数据的读取,实现快速扫描计算的能力。云原生数据库以行存为基础,数据的增删改都先以......
  • GaussDB关键技术方案_通信组件
    GaussDB关键技术方案_通信组件云原生数据库采用shareddisk架构,各个计算节点对等,计算节点之间通过页面交换实现缓存数据的一致性,为了提高页面传递的效率,需要利用RDMA或UB单边读写的能力;云原生数据库为了管理动态资源,需要对动态资源的owner分配进行加锁,分布式锁管理需要利用原子操......
  • GaussDB多租组件
    云原生数据库支持多租户,通过多租户资源共享,一是降低租户的成本,二是通过共享资源的池化实现租户的资源弹性,提高租户业务的可用性。租户的资源弹性支持两种模式,ScaleUp和ScaleOut。ScaleUp是在单个计算节点上对租户的分配资源进行弹性处理,ScaleOut是在计算节点之间对租户的分配......
  • automa 使用教程 采集小红书关键词搜索结果
    博主制作的视频教程Automa介绍Automa是一款低代码/无代码的浏览器扩展,用于进行浏览器自动化操作。与手动输入、点击和从网站检索数据相比,Automa将帮助您自动执行所有这些操作。官方仓库:https://github.com/AutomaApp/automa安装Automa在Chrome商店搜索"Automa"并安装......