sybase数据库扩设备

2024-04-02 03:58
文章标签 数据库 设备 sybase

本文主要是介绍sybase数据库扩设备,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

sybase数据库扩设备

1 背景

  近几个月发生两次因为某个专业网管问题,在短时间内涌现大量告警,因此造成tacfm库空间迅速占满的

  故障。

  sp_helpdb tacfm

  name                     db_size       owner                    dbid        created        status                                                                                                

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

tacfm                        5120.0 MB tacfm                              6 Nov 15, 2005   select into/bulkcopy/pllsort, trunc log on chkpt, allow nulls by default                              

device_fragments               size          usage                created             free kbytes     

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

data2                              4096.0 MB data only            Nov 15 2005  4:31PM           503896

log2                               1024.0 MB log only             Nov 15 2005  4:31PM not applicable  

-                                                                                               

log only free kbytes = 1044408                                                                  

device                         segment                                                                                                                                                                                                                                                        

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

data2                          default                                                                                                                                                                                                                                                        

data2                          system                                                                                                                                                                                                                                                         

log2                           logsegment                                                                                                                                                                                                                                                     

由此可见tacfm一共使用了data2设备上的4G空间。

sp_helpdevice

device_name physical_name description status cntrltype device_number low high

data1 /dev/vg00/rlvdata1                             special, dsync off, physical disk, 10240.00 MB 2 0 3 50331648 55574527

data2 /dev/vg00/rlvdata2                             special, dsync off, physical disk, 10240.00 MB 2 0 4 67108864 72351743

data3 /dev/vg00/rlvdata3                             special, dsync off, physical disk, 5000.00 MB 2 0 7 117440512 120000511

log1 /dev/vg00/rlvlog1                             special, dsync off, physical disk, 3072.00 MB 2 0 5 83886080 85458943

log2 /dev/vg00/rlvlog2                             special, dsync off, physical disk, 3072.00 MB 2 0 6 100663296 102236159

master /dev/vg00/rlvmaster                           special, dsync on, default disk, physical disk, 144.00 MB 3 0 0 0 73727

sysprocsdev /dev/vg00/rlvtemproc                           special, dsync on, physical disk, 300.00 MB 16386 0 1 16777216 16930815

tapedump1 /dev/rmt/0m                                   disk, dump device 16 2 0 0 20000

tapedump2 /dev/rct/0                                     tape,        625 MB, dump device 16 3 0 0 20000

tempdb /dev/vg00/rlvtempdb                           special, dsync on, physical disk, 5000.00 MB 16386 0 2 33554432 36114431

sp_helpdevice data2 该设备空间大小为10G.

device_name                    physical_name                                  description                                                                                                                                                                                                                                                     status      cntrltype   device_number low                                                                             high                                                                           

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

data2                          /dev/vg00/rlvdata2                             special, dsync off, physical disk, 10240.00 MB  

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

select distinct su.dbid

from master..sysusages su,master..sysdevices sd

where su.vstart between sd.low and sd.high

and sd.name='data2'

看哪些数据库使用了data2 设备。

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

sp_helpdb tacpm

name                     db_size       owner                    dbid        created        status                                                                                                

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

tacpm                        7168.0 MB tacpm                              8 May 08, 2006   select into/bulkcopy/pllsort, trunc log on chkpt, allow nulls by default                              

device_fragments               size          usage                created             free kbytes     

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

data2                              4096.0 MB data only            May  8 2006  4:16PM                0

log2                               1024.0 MB log only             May  8 2006  4:16PM not applicable  

data2                              2048.0 MB data only            Nov 28 2006 11:39AM                0

tacpm使用了6G data2设备空间。因此只能考虑新增数据库设备

沿用上述方法,可以看到 tacfm tacpm各使用了

log2                           /dev/vg00/rlvlog2                              special, dsync off, physical disk, 3072.00 MB

中的1024MB,还有剩余1024M,可以分配给新增设备后的tacfm使用的日志空间。

2 vgdisplay -v vg00

--- Volume groups ---

VG Name                     /dev/vg00

VG Write Access             read/write    

VG Status                   available                

Max LV                      255   

Cur LV                      18    

Open LV                     18    

Max PV                      16    

Cur PV                      2     

Act PV                      2     

Max PE per PV               4384        

VGDA                        4  

PE Size (Mbytes)            16             

Total PE                    8748   

Alloc PE                    7618   

Free PE                     1130   

Total PVG                   0       

Total Spare PVs             0             

Total Spare PVs in use      0                    

   --- Logical volumes ---

   LV Name                     /dev/vg00/lvol1

   LV Status                   available/syncd          

   LV Size (Mbytes)            304            

   Current LE                  19       

   Allocated PE                38         

   Used PV                     2      

   LV Name                     /dev/vg00/lvol2

   LV Status                   available/syncd          

   LV Size (Mbytes)            4096           

   Current LE                  256      

   Allocated PE                512        

   Used PV                     2      

   LV Name                     /dev/vg00/lvol3

   LV Status                   available/syncd          

   LV Size (Mbytes)            208            

   Current LE                  13       

   Allocated PE                26         

   Used PV                     2      

   LV Name                     /dev/vg00/lvol4

   LV Status                   available/syncd          

   LV Size (Mbytes)            208            

   Current LE                  13       

   Allocated PE                26         

   Used PV                     2      

   LV Name                     /dev/vg00/lvol5

   LV Status                   available/syncd          

   LV Size (Mbytes)            32             

   Current LE                  2        

   Allocated PE                4          

   Used PV                     2      

   LV Name                     /dev/vg00/lvol6

   LV Status                   available/syncd          

   LV Size (Mbytes)            2672           

   Current LE                  167      

   Allocated PE                334        

   Used PV                     2      

   LV Name                     /dev/vg00/lvol7

   LV Status                   available/syncd          

   LV Size (Mbytes)            2208           

   Current LE                  138      

   Allocated PE                276        

   Used PV                     2      

   LV Name                     /dev/vg00/lvol8

   LV Status                   available/syncd          

   LV Size (Mbytes)            4608           

   Current LE                  288      

   Allocated PE                576        

   Used PV                     2      

   LV Name                     /dev/vg00/lvsybase

   LV Status                   available/syncd          

   LV Size (Mbytes)            10240          

   Current LE                  640      

   Allocated PE                1280       

   Used PV                     2      

   LV Name                     /dev/vg00/lvmaster

   LV Status                   available/syncd          

   LV Size (Mbytes)            160            

   Current LE                  10       

   Allocated PE                20         

   Used PV                     2      

   LV Name                     /dev/vg00/lvtemproc

   LV Status                   available/syncd          

   LV Size (Mbytes)            304            

   Current LE                  19       

   Allocated PE                38         

   Used PV                     2      

   LV Name                     /dev/vg00/lvtempdb

   LV Status                   available/syncd          

   LV Size (Mbytes)            5120           

   Current LE                  320      

   Allocated PE                640        

   Used PV                     2      

   LV Name                     /dev/vg00/lvdata1

   LV Status                   available/syncd          

   LV Size (Mbytes)            10240          

   Current LE                  640      

   Allocated PE                1280       

   Used PV                     2      

   LV Name                     /dev/vg00/lvdata2

   LV Status                   available/syncd          

   LV Size (Mbytes)            10240          

   Current LE                  640      

   Allocated PE                1280       

   Used PV                     2      

   LV Name                     /dev/vg00/lvlog1

   LV Status                   available/syncd          

   LV Size (Mbytes)            3072           

   Current LE                  192      

   Allocated PE                384        

   Used PV                     2      

   LV Name                     /dev/vg00/lvlog2

   LV Status                   available/syncd          

   LV Size (Mbytes)            3072           

   Current LE                  192      

   Allocated PE                384        

   Used PV                     2      

   LV Name                     /dev/vg00/nsmfs

   LV Status                   available/syncd          

   LV Size (Mbytes)            3200           

   Current LE                  200      

   Allocated PE                200        

   Used PV                     1      

   LV Name                     /dev/vg00/lvdata3

   LV Status                   available/syncd          

   LV Size (Mbytes)            5120           

   Current LE                  320      

   Allocated PE                320        

   Used PV                     1      

   --- Physical volumes ---

   PV Name                     /dev/dsk/c2t0d0

   PV Status                   available               

   Total PE                    4374   

   Free PE                     305    

   Autoswitch                  On       

   PV Name                     /dev/dsk/c2t1d0

   PV Status                   available               

   Total PE                    4374   

   Free PE                     825    

   Autoswitch                  On       

   空闲的PE是1130个 大小为1130×16=18080MB

   如果扩充tacfm的空间为4096MB的话,应该使用256个PE。 亦即新建一个LV /dev/vg00/lvdata4,大小为4096MB,用来分配给tacfm。

3 创建LV

  # lvcreate -l 256 -n lvdata4 vg00

4 增加数据库设备

  在sa下

  disk init name="data4",physname="/dev/vg00/rlvdata4",vdevno=8,size=2097152

  将tacfm扩展到data4设备上

  alter database tacfm on data4=4096   

  扩展tacfm的日志空间

  alter database tacfm log on log2=1024

5 执行

# lvcreate -l 256 -n lvdata4 vg00

Logical volume "/dev/vg00/lvdata4" has been successfully created with

character device "/dev/vg00/rlvdata4".

Logical volume "/dev/vg00/lvdata4" has been successfully extended.

Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

# chown sybase rlvdata4     -------------这里要写绝对路径

# chgrp sybase rlvdata4      -------------这里要写绝对路径

su - sybase

$isql -Usa -P12txwgc -Sntalarm

1> disk init name="data4",physname="/dev/vg00/rlvdata4",vdevno=13,size=2097152

2> go

1> alter database tacfm on data4=4096

2> go

Extending database by 524288 pages (4096.0 megabytes) on disk data4

1> alter database tacfm log on log2=1024

2> go

Extending database by 131072 pages (1024.0 megabytes) on disk log2

Warning: Using ALTER DATABASE to extend the log segment will cause user

thresholds on the log segment within 128 pages of the last chance threshold to

be disabled.

1> sp_helpdb tacfm

2> go

 name                     db_size       owner                    dbid 

         created      

         status                                                                                                

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

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

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

 tacfm                       10240.0 MB tacfm                         6

         Nov 15, 2005 

         select into/bulkcopy/pllsort, trunc log on chkpt, allow nulls by defaul

         t                              

(1 row affected)

 device_fragments               size          usage              

         created             free kbytes     

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

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

 data2                              4096.0 MB data only          

         Nov 15 2005  4:31PM          1285944

 log2                               1024.0 MB log only           

         Nov 15 2005  4:31PM not applicable  

 data4                              4096.0 MB data only          

         Sep 18 2007 10:33AM          4177920

 log2                               1024.0 MB log only           

         Sep 18 2007 10:38AM not applicable  

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

 log only free kbytes = 2088928              

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/croco1981/archive/2009/05/22/4205729.aspx

这篇关于sybase数据库扩设备的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/868901

相关文章

IDEA如何切换数据库版本mysql5或mysql8

《IDEA如何切换数据库版本mysql5或mysql8》本文介绍了如何将IntelliJIDEA从MySQL5切换到MySQL8的详细步骤,包括下载MySQL8、安装、配置、停止旧服务、启动新服务以及... 目录问题描述解决方案第一步第二步第三步第四步第五步总结问题描述最近想开发一个新应用,想使用mysq

Oracle数据库使用 listagg去重删除重复数据的方法汇总

《Oracle数据库使用listagg去重删除重复数据的方法汇总》文章介绍了在Oracle数据库中使用LISTAGG和XMLAGG函数进行字符串聚合并去重的方法,包括去重聚合、使用XML解析和CLO... 目录案例表第一种:使用wm_concat() + distinct去重聚合第二种:使用listagg,

Java读取InfluxDB数据库的方法详解

《Java读取InfluxDB数据库的方法详解》本文介绍基于Java语言,读取InfluxDB数据库的方法,包括读取InfluxDB的所有数据库,以及指定数据库中的measurement、field、... 首先,创建一个Java项目,用于撰写代码。接下来,配置所需要的依赖;这里我们就选择可用于与Infl

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

C#实现文件读写到SQLite数据库

《C#实现文件读写到SQLite数据库》这篇文章主要为大家详细介绍了使用C#将文件读写到SQLite数据库的几种方法,文中的示例代码讲解详细,感兴趣的小伙伴可以参考一下... 目录1. 使用 BLOB 存储文件2. 存储文件路径3. 分块存储文件《文件读写到SQLite数据库China编程的方法》博客中,介绍了文

Android数据库Room的实际使用过程总结

《Android数据库Room的实际使用过程总结》这篇文章主要给大家介绍了关于Android数据库Room的实际使用过程,详细介绍了如何创建实体类、数据访问对象(DAO)和数据库抽象类,需要的朋友可以... 目录前言一、Room的基本使用1.项目配置2.创建实体类(Entity)3.创建数据访问对象(DAO

SQL Server数据库磁盘满了的解决办法

《SQLServer数据库磁盘满了的解决办法》系统再正常运行,我还在操作中,突然发现接口报错,后续所有接口都报错了,一查日志发现说是数据库磁盘满了,所以本文记录了SQLServer数据库磁盘满了的解... 目录问题解决方法删除数据库日志设置数据库日志大小问题今http://www.chinasem.cn天发

Oracle数据库执行计划的查看与分析技巧

《Oracle数据库执行计划的查看与分析技巧》在Oracle数据库中,执行计划能够帮助我们深入了解SQL语句在数据库内部的执行细节,进而优化查询性能、提升系统效率,执行计划是Oracle数据库优化器为... 目录一、什么是执行计划二、查看执行计划的方法(一)使用 EXPLAIN PLAN 命令(二)通过 S

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica