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

相关文章

SQL Server修改数据库名及物理数据文件名操作步骤

《SQLServer修改数据库名及物理数据文件名操作步骤》在SQLServer中重命名数据库是一个常见的操作,但需要确保用户具有足够的权限来执行此操作,:本文主要介绍SQLServer修改数据... 目录一、背景介绍二、操作步骤2.1 设置为单用户模式(断开连接)2.2 修改数据库名称2.3 查找逻辑文件名

SQL Server数据库死锁处理超详细攻略

《SQLServer数据库死锁处理超详细攻略》SQLServer作为主流数据库管理系统,在高并发场景下可能面临死锁问题,影响系统性能和稳定性,这篇文章主要给大家介绍了关于SQLServer数据库死... 目录一、引言二、查询 Sqlserver 中造成死锁的 SPID三、用内置函数查询执行信息1. sp_w

Druid连接池实现自定义数据库密码加解密功能

《Druid连接池实现自定义数据库密码加解密功能》在现代应用开发中,数据安全是至关重要的,本文将介绍如何在​​Druid​​连接池中实现自定义的数据库密码加解密功能,有需要的小伙伴可以参考一下... 目录1. 环境准备2. 密码加密算法的选择3. 自定义 ​​DruidDataSource​​ 的密码解密3

Maven项目中集成数据库文档生成工具的操作步骤

《Maven项目中集成数据库文档生成工具的操作步骤》在Maven项目中,可以通过集成数据库文档生成工具来自动生成数据库文档,本文为大家整理了使用screw-maven-plugin(推荐)的完... 目录1. 添加插件配置到 pom.XML2. 配置数据库信息3. 执行生成命令4. 高级配置选项5. 注意事

在Java中基于Geotools对PostGIS数据库的空间查询实践教程

《在Java中基于Geotools对PostGIS数据库的空间查询实践教程》本文将深入探讨这一实践,从连接配置到复杂空间查询操作,包括点查询、区域范围查询以及空间关系判断等,全方位展示如何在Java环... 目录前言一、相关技术背景介绍1、评价对象AOI2、数据处理流程二、对AOI空间范围查询实践1、空间查

Python+PyQt5实现MySQL数据库备份神器

《Python+PyQt5实现MySQL数据库备份神器》在数据库管理工作中,定期备份是确保数据安全的重要措施,本文将介绍如何使用Python+PyQt5开发一个高颜值,多功能的MySQL数据库备份工具... 目录概述功能特性核心功能矩阵特色功能界面展示主界面设计动态效果演示使用教程环境准备操作流程代码深度解

MySQL数据库实现批量表分区完整示例

《MySQL数据库实现批量表分区完整示例》通俗地讲表分区是将一大表,根据条件分割成若干个小表,:本文主要介绍MySQL数据库实现批量表分区的相关资料,文中通过代码介绍的非常详细,需要的朋友可以参考... 目录一、表分区条件二、常规表和分区表的区别三、表分区的创建四、将既有表转换分区表脚本五、批量转换表为分区

MySQL Workbench工具导出导入数据库方式

《MySQLWorkbench工具导出导入数据库方式》:本文主要介绍MySQLWorkbench工具导出导入数据库方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录mysql Workbench工具导出导入数据库第一步 www.chinasem.cn数据库导出第二步

Mysql数据库中数据的操作CRUD详解

《Mysql数据库中数据的操作CRUD详解》:本文主要介绍Mysql数据库中数据的操作(CRUD),详细描述对Mysql数据库中数据的操作(CRUD),包括插入、修改、删除数据,还有查询数据,包括... 目录一、插入数据(insert)1.插入数据的语法2.注意事项二、修改数据(update)1.语法2.有

Android与iOS设备MAC地址生成原理及Java实现详解

《Android与iOS设备MAC地址生成原理及Java实现详解》在无线网络通信中,MAC(MediaAccessControl)地址是设备的唯一网络标识符,本文主要介绍了Android与iOS设备M... 目录引言1. MAC地址基础1.1 MAC地址的组成1.2 MAC地址的分类2. android与I