Skip to content

常用命令(AIX)

工作原因需要进一步了解AIX操作系统,记点基础的

文件管理 ​

文件系统 ​

  • 查询使用状态df
    • -g -k显示单位
    • iused
  • 配置文件系统
    • smitty crjfs创建
    • smitty chjfs修改
  • 检查文件系统
    • fcsk
    • 危险操作

页面文件(虚拟内存) ​

  • 查询lsps

    • -a详情
    • -s概况
  • 增加页面文件smitty mkps

磁盘及分区 ​

  • lsvg查询 Volume Group
    • -l Logical Volume 信息
    • -p Physical Volume 信息
  • lspv 查询 Physical Volume 信息
    • -l Logical Volume 信息
    • -p Physical Volume 信息
  • lslv 查询 Logical Volume 信息
  • lspath链路信息
  • bootinfo -s hdisk*磁盘容量

dump ​

  • sysdumpdev -l 概况
    • dump 文件位置、dump 属性
  • dump 可用情况(estimated)
    • 预估大小sysdumpdev -e
    • 通常预留空间为双倍?
  • 不够时,使用extendlv lg_dumplv 2(2 为 PP 数)进行扩容

数据库 ​

  • 需要定时进行备份
  • crontab -e
    • 55 23 1 * * \oracle\backup\backup.sh1 号 23:55 备份

系统信息 ​

AIX 系统版本 ​

  • oslevel -s

详情 ​

  • prtconf
    • 系统底层、磁盘文件、网络、安装设备信息
  • prtconf -v
    • VPD 信息

监控 ​

  • topas

运行时间 ​

  • uptime

时区 ​

  • date
  • smitty chtz修改时区
  • ntpq -p查询

网络 ​

  • smitty mktcpip配置网卡 IP
  • netstat网络信息
    • -rn路由表
    • -i已配置的端口
    • -v显示每个网络物理端口的情况,可以通过关键词VLAN筛选出VLAN信息
  • ifconfig
    • -a网口配置详情

用户 ​

  • 创建修改用户等smit user
  • 修改用户密码echo "user:passwd"| chpasswd -c
    • 加密后的本地密码位于*/etc/security/passwd*中,若只有加密后密码的情况下要将对端修改为相同密码,可以在chpasswd后使用-e参数

启动引导相关 ​

  • bosboot创建引导映像
    • bosboot -ad hdisk*指定设备创建完整映像,镜像过的多个盘都需要加入
  • bootlist显示/修改引导顺序
    • 通常使用 normal 模式bootlist -om -normal
    • bootlist -om -normal查看当前引导列表
    • bootlist -om -normal hdisk0 hdisk1更改引导顺序为 hdisk0 hdisk1

终端 ​

  • 防止会话过期:TMOUT=0

AIX 硬件信息 ​

微码版本 ​

  • lsmcode -c

  • VIOS 环境下,lsfware

  • AIX 环境下,prtconf

报错信息 ​

  • errpt

    • -a详情
    • -j指定错误 ID 信息
  • errclear删除 error

    • *指定日期前,常用 0

设备信息 ​

  • lsdev列出所有设备

    • -Cc按设备类型
  • lscfg设备信息

    • -vpl设备名称和 VPD
  • lsattr设备属性

    • -El 指定设备详细属性

网卡 ​

  • ent以太网卡:entstat -d详情
  • fcs光纤网卡:fcstat -d详情

软件 ​

EMC powerpath ​

是否有 error 和 died

  • powermt display

  • powermt display dev=all

  • powermt display dev=all|grep -p hdiskpower*

  • 清理died链路powermt check -> a

  • 清除errorpowermt restore后powermt save

gunzip ​

解压tar.gz为**.tar**,和linux直接可以解压tar.gz不同

  • gunzip -c file.tar.gz

ifix ​

  • emgr -l 查看安装的ifix补丁
  • emgr -e安装

PowerHA ​

  • 查询HA集群是否存在
    • 通过查询vglspv |grep caavg,lsvg -o是否激活(通常激活的为当前主节点)
    • 查询集群状态lscluster -i,root权限下clstat
    • /usr/es/sbin/cluster/utilities/clRGinfo