HANA无法连接,share目录满

情况:SAP Gui无法登陆、重启不了SAP应用、Hana studio也连接不上。
原因:磁盘的某个目录满了,极有可能是log目录。
HANA无法连接,share目录满

解决办法:
cd /hana/shared/HBD/HDB00/backup/log
查看下都是些什么文件。
参考:
https://archive.sap.com/discussions/thread/3630258
http://service.sap.com/sap/support/notes/2083715

本文作者: GavinDong

版权属于: GavinDong博客

文章链接: https://gavindong.com/457.html

如果使用过程中遇到问题,可 **点击此处** 交流沟通。

版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

(0)

相关文章

回复 ag

登录后才能评论

评论列表(10条)

  • ag的头像
    ag 2017.05.17 22:27

    启动SAP:
    find / -name sapstartsu bwqadm
    cd /usr/sap/BWQ/ASCS03/exe
    ./sapstart r3

  • ag的头像
    ag 2017.05.17 22:26

    HANA这些目录的权限必须是这样设置,否则会无法启动:
    chmod 755 /hana/*
    chown -R hbqadm:sapsys log/HBQ
    chown -R hbdadm:sapsys shared/HBD
    chown -R hbdadm:sapsys data/HBD

  • ag的头像
    ag 2017.05.17 22:26

    总体来说 并不复杂,只需要确定一点:先备份、再删除关键文件、勇于尝试。
    command not found的情况:
    1.使用命令的绝对路径;
    2.使用./HDB的形式运行命令。

  • ag的头像
    ag 2017.05.17 22:25

    Each log volume contains the file logsegment_directory.dat and one or more log segment files (logsegment__.dat). Currently only one log partition is supported for each service, so the default file names are logsegment_000_directory.dat and logsegment_000_00000000.dat, logsegment_000_00000001.dat, logsegment_000_00000002.dat and so on. Log segment files are cyclically overwritten depending on the log mode. The log mode determines how logs are backed up. Log volumes only grow if there are no more segment files available for overwriting. Log segment files that are available for overwriting have been backed up and are not required for a database restart. If necessary you can remove these files to free up space in your file system by executing the SQL statement ALTER SYSTEM RECLAIM LOG. Note that new log segment files will need to be created later and this will affect performance.

    上述是HANA DB administration guide中的话。(log mode默认是normal)

    修改log mode,清空之前的log segment语句如下:
    Start the database (HDB start) and set the log_mode to ‘overwrite’ using the following SQL-Statement:
    ALTER SYSTEM ALTER CONFIGURATION (‘global.ini’, ‘SYSTEM’) SET (‘persistence’, ‘log_mode’) = ‘overwrite’ WITH RECONFIGURE;
    Restart the database (HDB restart) and use the following SQL-Statement to clean up the log volume:
    ALTER SYSTEM RECLAIM LOG;
    Set back the log_mode to ‘normal’ (you should consider switching to log_mode = normal; see note 1645183 for more information): ALTER SYSTEM ALTER CONFIGURATION (‘global.ini’, ‘SYSTEM’) SET (‘persistence’, ‘log_mode’) = ‘normal’ WITH RECONFIGURE;
    – See more at: http://www.saptechies.org/log-volume-full-log-mode-legacy-database-doesnt-accept-an/#sthash.bpAUNXBq.dpuf

    然后查询视图,SYS.M_LOG_SEGMENTS,可以将不用的log segments文件移除,腾出空间。(期间旧的log segments状态由Truncated变为Free)

    SELECT * FROM SYS.M_LOG_SEGMENTS ORDER BY SEGMENT_ID;
    其中log segments的state字段,包含值意义如下:
    Formatting – The log segment is being formatted and not yet used.
    Preallocated – The log segment has been preallocated, but never used.
    Writing – The log segment is currently being written.
    Closed – The log segment is closed, not backed up and is still required for restart.
    Truncated – The log segment is not required for restart, but has not been backed up.
    BackedUp – The log segment has been backed up, but is still required for restart.
    Free – The log segment has been backed up, it is not required for restart and can be reused.

    详细请看链接:http://help.sap.com/hana/html/_m__l_o_g__s_e_g_m_e_n_t_s.html

    1. 以上操作,可以类比下MSSQL(将recovery model由FULL,改为SIMPLE,然后shrink log文件,再改回FULL)或者ORACLE(disable archive log,清掉以前的log,再开启)
    2. 也可以不使用ALTER SYSTEM语句修改log mode,使用修改配置文件global.ini
    3. 假如重启HDB无法启动,可能产生core文件,导致/usr/sap(SPS05)和/hana/shared(SPS07)文件系统无空间,直接删掉core文件
    4. 节省空间,可以保持overwrite模式使用
    5. 任何操作之前,先做好数据备份

  • ag的头像
    ag 2017.05.17 22:25

    注意:
    操作HANA数据库一定要用hana用户、不要用linux系统用户;
    操作SAP服务一定要用SAP用户、不要用linux root用户,因为启动过程中会调用sapadm下的一些文件、使用root用户会报各种错误;

  • ag的头像
    ag 2017.05.17 22:25

    目录权限:
    chmod 777 /templog
    chown -R hbdadm /templog

  • ag的头像
    ag 2017.05.17 22:25

    find / -name HDB
    /hana/shared/HBD/HDB00/HDB stop
    find / -name mnt00001
    cd /hana/log/HBD/mnt00001
    du -sh ./*
    df -h
    找一个空间比较大的盘,创建一个临时文件夹,例如:
    mkdir -p /templog
    cp -rf hdb00003 /templog/
    ll /templog/
    rm -rf ./hdb00003
    cd ..
    ln -s /templog/hdb00003 /hana/log/HBD/mnt00001/hdb00003
    /hana/shared/HBD/HDB00/HDB start
    然后用hana studio链接数据库,执行下面的SQL:
    ALTER SYSTEM RECLAIM LOG;
    然后停止数据库
    /hana/shared/HBD/HDB00/HDB stop
    移除软连接
    rm -f /hana/log/HBD/mnt00001/hdb00003
    cp -rf /templog/hdb00003 /hana/log/HBD/mnt00001ll /hana/log/HBD/mnt00001
    rm -rf /templog/hdb00003
    /hana/shared/HBD/HDB00/HDB start

    此外,可以使用hana studio登录数据库后清理掉一些比较早的备份文件和备份日志,这样能节省很多空间。

  • ag的头像
    ag 2017.05.17 22:24

    HDB stop提示command not found。 可能是环境变量没有配置。
    用root执行source /etc/profile之后再su到hana管理员运行HDB stop命令,如果还是命令不存在,则切换到root用户搜索HDB命令的文件究竟在哪。
    find / -name HDB
    然后执行绝对路径的命令和参数即可:
    /hana/shared/HBD/HDB00/HDB stop

  • ag的头像
    ag 2017.05.17 22:24

    su hdbadm提示用户不存在,可能是创建的用户名不是这个,cat /etc/passwd看一下。

  • ag的头像
    ag 2017.05.17 22:24

    具体的操作:https://launchpad.support.sap.com/#/notes/0001679938