美文网首页
2019-05-09 sap maxDB日常运维

2019-05-09 sap maxDB日常运维

作者: 麦兜的刀 | 来源:发表于2019-05-09 15:20 被阅读0次

    =====================================================

    启动
    1. 启动MaxDB
      su - sqdgcs

    看状态
    dbmcli -d gcs -u superdba,Mypassword db_state

    启动
    dbmcli -d gcs -u superdba,Mypassword db_online

    1. 启动xs_server
      su - sdb
      /sapdb/programs/bin/x_server -S 7210 start

    2. 启动apache
      su - sapcs
      apachectl start

    3. 验证,健康监控

    http://172.16.120.121:1090/ContentServer/ContentServer.dll?serverInfo

    +++++++++++++++++++++++++++++++++++++++++++++

    关闭
    1. 关闭apache
      su - sapcs
      apachectl stop

    2. 关闭 xs_server
      su - sdb
      /sapdb/programs/bin/x_server -S 7210 stop

    3. 关闭MaxDB
      su - sqdgcs
      dbmcli -d gcs -u superdba,Mypassword db_offline

    ==============================================================

    扩容

    1. 先确认是否磁盘还有剩余空间用于创建新逻辑分区 例子( fdisk -l /dev/sdg ) ,如果还有剩余空间,则执行2,否则执行《给虚拟机添加新磁盘》
    2. 事先已经约定SAP MaxDB使用的裸磁盘设备为100G一个分区,创建逻辑分区设备
    3. 配置raw裸设备,将新建的逻辑分区设备映射为裸设备,编辑文件 vi /etc/raw ,重新启动裸设备服务 rcraw start
    4. 链接数据库文件到裸设备
    5. 将裸设备添加到数据库
    创建逻辑分区设备
    dms-prd01:~ # fdisk /dev/sdg
    
    Command (m for help): p
    
    Disk /dev/sdg: 1288.5 GB, 1288490188800 bytes
    3 heads, 24 sectors/track, 34952533 cylinders, total 2516582400 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x70dd3e67
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdg1            2048  2516582399  1258290176    5  Extended
    /dev/sdg5            4096   209719295   104857600   83  Linux
    /dev/sdg6       209721344   419436543   104857600   83  Linux
    /dev/sdg7       419438592   629153791   104857600   83  Linux
    /dev/sdg8       629155840   838871039   104857600   83  Linux
    /dev/sdg9       838873088  1048588287   104857600   83  Linux
    
    Command (m for help): n
    Command action
       l   logical (5 or over)
       p   primary partition (1-4)
    l
    First sector (1048590336-2516582399, default 1048590336):
    Using default value 1048590336
    Last sector, +sectors or +size{K,M,G} (1048590336-2516582399, default 2516582399): +100G
    
    Command (m for help): p
    
    Disk /dev/sdg: 1288.5 GB, 1288490188800 bytes
    3 heads, 24 sectors/track, 34952533 cylinders, total 2516582400 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x70dd3e67
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdg1            2048  2516582399  1258290176    5  Extended
    /dev/sdg5            4096   209719295   104857600   83  Linux
    /dev/sdg6       209721344   419436543   104857600   83  Linux
    /dev/sdg7       419438592   629153791   104857600   83  Linux
    /dev/sdg8       629155840   838871039   104857600   83  Linux
    /dev/sdg9       838873088  1048588287   104857600   83  Linux
    /dev/sdg10     1048590336  1258305535   104857600   83  Linux
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    
    WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
    The kernel still uses the old table. The new table will be used at
    the next reboot or after you run partprobe(8) or kpartx(8)
    Syncing disks.
    dms-prd01:~ # partprobe
    
    逻辑分区设备映射为裸设备
    dms-prd01:/sapdb # cat /etc/raw
    # /etc/raw
    
    #
    # sample configuration to bind raw devices
    # to block devices
    #
    # The format of this file is:
    # raw<N>:<blockdev>
    #
    # example:
    # ---------
    # raw1:hdb1
    #
    # this means: bind /dev/raw/raw1 to /dev/hdb1
    #
    # ...
    raw1:sdb1
    raw2:sdb2
    raw3:sdb3
    raw5:sdb5
    raw6:sdb6
    raw7:sdb7
    raw8:sdb8
    raw9:sdb9
    raw10:sdb10
    raw11:sdd1
    raw12:sdd2
    raw13:sdd3
    raw14:sdd5
    raw15:sdd6
    raw16:sdd7
    raw17:sdd8
    raw18:sdd9
    raw19:sdd10
    raw20:sde1
    raw21:sde2
    raw22:sde3
    raw23:sde5
    raw24:sde6
    raw25:sde7
    raw26:sde8
    raw27:sde9
    raw28:sde10
    raw29:sdf1
    raw30:sdf2
    raw35:sdg5
    raw36:sdg6
    raw37:sdg7
    raw38:sdg8
    raw39:sdg9
    raw40:sdg10
    
    dms-prd01:~ # rcraw status
    /dev/raw/raw1:  bound to major 8, minor 17
    /dev/raw/raw2:  bound to major 8, minor 18
    /dev/raw/raw3:  bound to major 8, minor 19
    /dev/raw/raw5:  bound to major 8, minor 21
    /dev/raw/raw6:  bound to major 8, minor 22
    /dev/raw/raw7:  bound to major 8, minor 23
    /dev/raw/raw8:  bound to major 8, minor 24
    /dev/raw/raw9:  bound to major 8, minor 25
    /dev/raw/raw10: bound to major 8, minor 26
    /dev/raw/raw11: bound to major 8, minor 49
    /dev/raw/raw12: bound to major 8, minor 50
    /dev/raw/raw13: bound to major 8, minor 51
    /dev/raw/raw14: bound to major 8, minor 53
    /dev/raw/raw15: bound to major 8, minor 54
    /dev/raw/raw16: bound to major 8, minor 55
    /dev/raw/raw17: bound to major 8, minor 56
    /dev/raw/raw18: bound to major 8, minor 57
    /dev/raw/raw19: bound to major 8, minor 58
    /dev/raw/raw20: bound to major 8, minor 65
    /dev/raw/raw21: bound to major 8, minor 66
    /dev/raw/raw22: bound to major 8, minor 67
    /dev/raw/raw23: bound to major 8, minor 69
    /dev/raw/raw24: bound to major 8, minor 70
    /dev/raw/raw25: bound to major 8, minor 71
    /dev/raw/raw26: bound to major 8, minor 72
    /dev/raw/raw27: bound to major 8, minor 73
    /dev/raw/raw28: bound to major 8, minor 74
    /dev/raw/raw29: bound to major 8, minor 81
    /dev/raw/raw30: bound to major 8, minor 82
    /dev/raw/raw35: bound to major 8, minor 101
    /dev/raw/raw36: bound to major 8, minor 102
    /dev/raw/raw37: bound to major 8, minor 103
    /dev/raw/raw38: bound to major 8, minor 104
    /dev/raw/raw39: bound to major 8, minor 105
    
    dms-prd01:~ # rcraw start
    bind /dev/raw/raw1 to /dev/sdb1...
    bind /dev/raw/raw2 to /dev/sdb2...
    bind /dev/raw/raw3 to /dev/sdb3...
    bind /dev/raw/raw5 to /dev/sdb5...
    bind /dev/raw/raw6 to /dev/sdb6...
    bind /dev/raw/raw7 to /dev/sdb7...
    bind /dev/raw/raw8 to /dev/sdb8...
    bind /dev/raw/raw9 to /dev/sdb9...
    bind /dev/raw/raw10 to /dev/sdb10...
    bind /dev/raw/raw11 to /dev/sdd1...
    bind /dev/raw/raw12 to /dev/sdd2...
    bind /dev/raw/raw13 to /dev/sdd3...
    bind /dev/raw/raw14 to /dev/sdd5...
    bind /dev/raw/raw15 to /dev/sdd6...
    bind /dev/raw/raw16 to /dev/sdd7...
    bind /dev/raw/raw17 to /dev/sdd8...
    bind /dev/raw/raw18 to /dev/sdd9...
    bind /dev/raw/raw19 to /dev/sdd10...
    bind /dev/raw/raw20 to /dev/sde1...
    bind /dev/raw/raw21 to /dev/sde2...
    bind /dev/raw/raw22 to /dev/sde3...
    bind /dev/raw/raw23 to /dev/sde5...
    bind /dev/raw/raw24 to /dev/sde6...
    bind /dev/raw/raw25 to /dev/sde7...
    bind /dev/raw/raw26 to /dev/sde8...
    bind /dev/raw/raw27 to /dev/sde9...
    bind /dev/raw/raw28 to /dev/sde10...
    bind /dev/raw/raw29 to /dev/sdf1...
    bind /dev/raw/raw30 to /dev/sdf2...
    bind /dev/raw/raw35 to /dev/sdg5...
    bind /dev/raw/raw36 to /dev/sdg6...
    bind /dev/raw/raw37 to /dev/sdg7...
    bind /dev/raw/raw38 to /dev/sdg8...
    bind /dev/raw/raw39 to /dev/sdg9...
    bind /dev/raw/raw40 to /dev/sdg10...
    dms-prd01:~ # rcraw status
    /dev/raw/raw1:  bound to major 8, minor 17
    /dev/raw/raw2:  bound to major 8, minor 18
    /dev/raw/raw3:  bound to major 8, minor 19
    /dev/raw/raw5:  bound to major 8, minor 21
    /dev/raw/raw6:  bound to major 8, minor 22
    /dev/raw/raw7:  bound to major 8, minor 23
    /dev/raw/raw8:  bound to major 8, minor 24
    /dev/raw/raw9:  bound to major 8, minor 25
    /dev/raw/raw10: bound to major 8, minor 26
    /dev/raw/raw11: bound to major 8, minor 49
    /dev/raw/raw12: bound to major 8, minor 50
    /dev/raw/raw13: bound to major 8, minor 51
    /dev/raw/raw14: bound to major 8, minor 53
    /dev/raw/raw15: bound to major 8, minor 54
    /dev/raw/raw16: bound to major 8, minor 55
    /dev/raw/raw17: bound to major 8, minor 56
    /dev/raw/raw18: bound to major 8, minor 57
    /dev/raw/raw19: bound to major 8, minor 58
    /dev/raw/raw20: bound to major 8, minor 65
    /dev/raw/raw21: bound to major 8, minor 66
    /dev/raw/raw22: bound to major 8, minor 67
    /dev/raw/raw23: bound to major 8, minor 69
    /dev/raw/raw24: bound to major 8, minor 70
    /dev/raw/raw25: bound to major 8, minor 71
    /dev/raw/raw26: bound to major 8, minor 72
    /dev/raw/raw27: bound to major 8, minor 73
    /dev/raw/raw28: bound to major 8, minor 74
    /dev/raw/raw29: bound to major 8, minor 81
    /dev/raw/raw30: bound to major 8, minor 82
    /dev/raw/raw35: bound to major 8, minor 101
    /dev/raw/raw36: bound to major 8, minor 102
    /dev/raw/raw37: bound to major 8, minor 103
    /dev/raw/raw38: bound to major 8, minor 104
    /dev/raw/raw39: bound to major 8, minor 105
    /dev/raw/raw40: bound to major 8, minor 106
    
    dms-prd01:~ #
    
    
    链接数据库文件到裸设备
    dms-prd01:~ # su - sqdgcs
    dms-prd01:sqdgcs> cd /sapdb/GCS/
    data/    db/      sapdata/ saplog/
    dms-prd01:sqdgcs> cd /sapdb/GCS/sapdata/
    dms-prd01:sqdgcs> ll
    total 0
    lrwxrwxrwx 1 sqdgcs sdba 13 Jul 16  2017 data_vol_1 -> /dev/raw/raw1
    lrwxrwxrwx 1 sqdgcs sdba 14 Nov 22  2017 data_vol_10 -> /dev/raw/raw10
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_11 -> /dev/raw/raw11
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_12 -> /dev/raw/raw12
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_13 -> /dev/raw/raw13
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_14 -> /dev/raw/raw14
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_15 -> /dev/raw/raw15
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_16 -> /dev/raw/raw16
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 26  2017 data_vol_17 -> /dev/raw/raw17
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_18 -> /dev/raw/raw18
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_19 -> /dev/raw/raw19
    lrwxrwxrwx 1 sqdgcs sdba 13 Jul 16  2017 data_vol_2 -> /dev/raw/raw2
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_20 -> /dev/raw/raw20
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_21 -> /dev/raw/raw21
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_22 -> /dev/raw/raw22
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_23 -> /dev/raw/raw23
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_24 -> /dev/raw/raw24
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_25 -> /dev/raw/raw25
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_26 -> /dev/raw/raw26
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_27 -> /dev/raw/raw27
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 24  2018 data_vol_28 -> /dev/raw/raw28
    lrwxrwxrwx 1 sqdgcs sdba 14 Nov 29 09:45 data_vol_29 -> /dev/raw/raw29
    lrwxrwxrwx 1 sqdgcs sdba 14 Dec 11 10:49 data_vol_30 -> /dev/raw/raw30
    lrwxrwxrwx 1 sqdgcs sdba 14 Jan  5 23:53 data_vol_35 -> /dev/raw/raw35
    lrwxrwxrwx 1 sqdgcs sdba 14 Jan  5 23:54 data_vol_36 -> /dev/raw/raw36
    lrwxrwxrwx 1 sqdgcs sdba 14 Jan  5 23:54 data_vol_37 -> /dev/raw/raw37
    lrwxrwxrwx 1 sqdgcs sdba 14 Jan  5 23:54 data_vol_38 -> /dev/raw/raw38
    lrwxrwxrwx 1 sqdgcs sdba 14 Apr 17 08:38 data_vol_39 -> /dev/raw/raw39
    lrwxrwxrwx 1 sqdgcs sdba 13 Oct 21  2017 data_vol_5 -> /dev/raw/raw5
    lrwxrwxrwx 1 sqdgcs sdba 13 Oct 21  2017 data_vol_6 -> /dev/raw/raw6
    lrwxrwxrwx 1 sqdgcs sdba 13 Oct 21  2017 data_vol_7 -> /dev/raw/raw7
    lrwxrwxrwx 1 sqdgcs sdba 13 Oct 21  2017 data_vol_8 -> /dev/raw/raw8
    lrwxrwxrwx 1 sqdgcs sdba 13 Nov 22  2017 data_vol_9 -> /dev/raw/raw9
    dms-prd01:sqdgcs> ln -s /dev/raw/raw40 data_vol_40
    
    
    将裸设备添加到数据库
    dms-prd01:sqdgcs> dbmcli -d gcs -u superdba,Mypassword
    dbmcli on gcs>db_addvolume DATA /sapdb/GCS/sapdata/data_vol_40 R 13107200
    OK
    ---
    dbmcli on gcs>param_getvolsall
    OK
    UseMirroredLog                   NO
    MaxLogVolumes                    2
    MaxDataVolumes                   42
    LogVolumeName001                 1310718    R  /sapdb/GCS/saplog/log_vol_1  1
    DataVolumeName0001               13107198   R  /sapdb/GCS/sapdata/data_vol_1
    DataVolumeName0002               13107198   R  /sapdb/GCS/sapdata/data_vol_2
    DataVolumeName0003               13107198   R  /sapdb/GCS/sapdata/data_vol_5
    DataVolumeName0004               13107198   R  /sapdb/GCS/sapdata/data_vol_6
    DataVolumeName0005               13107198   R  /sapdb/GCS/sapdata/data_vol_7
    DataVolumeName0006               13107200   R  /sapdb/GCS/sapdata/data_vol_9
    DataVolumeName0007               13107200   R  /sapdb/GCS/sapdata/data_vol_10
    DataVolumeName0008               13107200   R  /sapdb/GCS/sapdata/data_vol_11
    DataVolumeName0009               13107200   R  /sapdb/GCS/sapdata/data_vol_12
    DataVolumeName0010               13107200   R  /sapdb/GCS/sapdata/data_vol_13
    DataVolumeName0011               13107200   R  /sapdb/GCS/sapdata/data_vol_14
    DataVolumeName0012               13107200   R  /sapdb/GCS/sapdata/data_vol_15
    DataVolumeName0013               13107200   R  /sapdb/GCS/sapdata/data_vol_16
    DataVolumeName0014               13107200   R  /sapdb/GCS/sapdata/data_vol_17
    DataVolumeName0015               13107200   R  /sapdb/GCS/sapdata/data_vol_18
    DataVolumeName0016               13107200   R  /sapdb/GCS/sapdata/data_vol_19
    DataVolumeName0017               13107200   R  /sapdb/GCS/sapdata/data_vol_20
    DataVolumeName0018               13107200   R  /sapdb/GCS/sapdata/data_vol_21
    DataVolumeName0019               13107200   R  /sapdb/GCS/sapdata/data_vol_22
    DataVolumeName0020               13107200   R  /sapdb/GCS/sapdata/data_vol_23
    DataVolumeName0021               13107200   R  /sapdb/GCS/sapdata/data_vol_24
    DataVolumeName0022               13107200   R  /sapdb/GCS/sapdata/data_vol_25
    DataVolumeName0023               13107200   R  /sapdb/GCS/sapdata/data_vol_26
    DataVolumeName0024               13107200   R  /sapdb/GCS/sapdata/data_vol_27
    DataVolumeName0025               13107200   R  /sapdb/GCS/sapdata/data_vol_28
    DataVolumeName0026               13107200   R  /sapdb/GCS/sapdata/data_vol_29
    DataVolumeName0027               13107200   R  /sapdb/GCS/sapdata/data_vol_30
    DataVolumeName0028               13107200   R  /sapdb/GCS/sapdata/data_vol_35
    DataVolumeName0029               13107200   R  /sapdb/GCS/sapdata/data_vol_36
    DataVolumeName0030               13107200   R  /sapdb/GCS/sapdata/data_vol_37
    DataVolumeName0031               13107200   R  /sapdb/GCS/sapdata/data_vol_38
    DataVolumeName0032               13107200   R  /sapdb/GCS/sapdata/data_vol_39
    DataVolumeName0033               13107200   R  /sapdb/GCS/sapdata/data_vol_40
    
    ---
    dbmcli on gcs>db_state
    OK
    State
    OFFLINE
    
    ---
    dbmcli on gcs>db_admin
    OK
    
    ---
    dbmcli on gcs>db_state
    OK
    State
    ADMIN
    
    ---
    dbmcli on gcs>db_online
    OK
    
    ---
    dbmcli on gcs>db_state
    OK
    State
    ONLINE
    
    ---
    dbmcli on gcs>exit
    OK
    
    ---
    dms-prd01:sqdgcs> exit
    logout
    
    

    相关文章

      网友评论

          本文标题:2019-05-09 sap maxDB日常运维

          本文链接:https://www.haomeiwen.com/subject/rjvwoqtx.html