顯示具有 aix 標籤的文章。 顯示所有文章
顯示具有 aix 標籤的文章。 顯示所有文章

2017年11月24日 星期五

HACMP mirror 回 MISS 的 PV

System Management (C-SPOC)

 Storage

Volume Groups

Unmirror a Volume Group

ldapvg          f7b7_rg                    f7n7,f7n8

   f7n7                  hdisk5 

--
                                                                              Unmirror a Volume Group

Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
  VOLUME GROUP name                                   ldapvg
  Resource Group Name                                 f7b7_rg
  Node List                                           f7n7,f7n8
  Reference node                                      f7n7
  PHYSICAL VOLUME names                               hdisk5
 
  Number of COPIES of each logical                    1                                                                                                                         +
    partition

--

Command: running       stdout: no            stderr: no

Before command completion, additional instructions may appear below.
--
Command: OK            stdout: no            stderr: no

Before command completion, additional instructions may appear below.

--
ibmldap-online:/admin> lsvg -l ldapvg
ldapvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
fslv01              jfs2       1920    1920    1    open/syncd    /home
ibmldap-online:/admin>
--
ibmldap-online:/admin> smitty hacmp
--
System Management (C-SPOC)
 Storage
Volume Groups
Mirror a Volume Group
ldapvg          f7b7_rg                    f7n7,f7n8           2
 f7n7                  hdisk5

--
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
* VOLUME GROUP name                                   ldapvg
  Resource Group Name                                 f7b7_rg
  Node List                                           f7n7,f7n8
  Reference node                                      f7n7
  PHYSICAL VOLUME names                               hdisk5
 
  Mirror sync mode                                    Background                                                                                                                +
  Number of COPIES of each logical                    2                                                                                                                         +
    partition
  Keep Quorum Checking On?                            no                                                                                                                        +
  Create Exact LV Mapping?                            no         
--
Command: running       stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

f7n7: 0516-1804 chvg: The quorum change takes effect immediately.
--

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

f7n7: 0516-1804 chvg: The quorum change takes effect immediately.

--
ibmldap-online:/admin> lsvg -l ldapvg
ldapvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       2       2    open/syncd    N/A
fslv01              jfs2       1920    3840    2    open/stale    /home
ibmldap-online:/admin> lsvg  ldapvg 
VOLUME GROUP:       ldapvg                   VG IDENTIFIER:  00cbfcf500004c000000013773a3c920
VG STATE:           active                   PP SIZE:        16 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      6390 (102240 megabytes)
MAX LVs:            256                      FREE PPs:       2548 (40768 megabytes)
LVs:                2                        USED PPs:       3842 (61472 megabytes)
OPEN LVs:           2                        QUORUM:         1 (Disabled)
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          1                        STALE PPs:      1693
ACTIVE PVs:         2                        AUTO ON:        no
MAX PPs per VG:     32768                    MAX PVs:        1024
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
ibmldap-online:/admin>
--
ibmldap-online:/admin> lsvg -p ldapvg
ldapvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            3195        1274        639..00..00..00..635
hdisk4            active            3195        1274        639..00..00..00..635
ibmldap-online:/admin>
--

2017年11月10日 星期五

AIX LinuxTools 相關問題

下載點

https://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html


用 Gnuls

可是原生的 more 處理色碼會有問題

可以用 GNULS 裡的 less 處理

裝在 /opt/freeware/bin/less

https://major.io/2013/05/21/handling-terminal-color-escape-sequences-in-less/

可以用 -R 處理色碼

~/.profile 
/etc/csh.cshrc

alias ls '/usr/linux/bin/ls --color'
alias less='/opt/freeware/bin/less -R'
alias more='less'

2017年2月8日 星期三

AIX create Oracle instance 問題(AIO未開)

ORA-12547: TNS:lost contact

根據 sqlnet.log

Fatal NI connect error 12547, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/oracle/10g/product/10.2.0/db/bin/oracle)(ARGV0=oraclehisspu)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus@f7n4)(HOST=f7n4)(USER=oracle10))))

  VERSION INFORMATION:
        TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
        Oracle Bequeath NT Protocol Adapter for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
  Time: 07-FEB-2017 12:01:33
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 32


然後使用 sqlplus 時出現

exec(): 0509-036 Cannot load program oraclenam because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 7) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number 8) is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

根據
Symbol resolution failed for /usr/lib/libc.a[aio_64.o] 
問題是出在AIX 的 AIO 沒有啟用 (在跑 LDAP時沒有用到所以沒有問題 ORACLE需要)

根據

0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o]
This error occurs because the Asynchronous I/O are not available.
# lsattr -El aio0
autoconfig defined STATE to be configured at system restart True
fastpath enable State of fast path True
kprocprio 39 Server PRIORITY True
maxreqs 4096 Maximum number of REQUESTS True
maxservers
10 MAXIMUM number of servers per cpu True
minservers 1 MINIMUM number of servers True
You must make the Asynchronous I/O available using smitty
# smitty chgaio
Change this item
STATE to be configured at system restart available
IMPORTANT: Changes will become effective at next system restart
For configure Asynchronous I/O now use:
# smitty aio
Configure Defined Asynchronous I/O
Checking aio0 again
# lsattr -El aio0
autoconfig available STATE to be configured at system restart True
fastpath   enable    State of fast path                       True
kprocprio  39        Server PRIORITY                          True
maxreqs    4096      Maximum number of REQUESTS               True
maxservers
10        MAXIMUM number of servers per cpu        True
minservers 1         MINIMUM number of servers                True
 
另外 依據

使用操作系统命令开启异步I/O(1)确认所需的bos.rte.aio是否安装妥当
# lslpp -l bos.rte.aio
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.rte.aio               5.3.0.62  COMMITTED  Asynchronous I/O Extension

(2)使用如下命令开启AIX操作系统的异步I/O
# mkdev -l aio0
aio0 Available

# chdev -P -l aio0 -a autoconfig='available'
aio0 changed

依據

The ‘minservers’ setting (10) is the total number of aioserver kernel threads that start at boot – this is not a per CPU or per logical CPU value.
The ‘maxservers’ setting (20) is the maximum number of aioserver  per CPU or per logical CPU value.
The ‘maxreqs’ setting (4096) is the maximum number of outstanding or pending requests that the kernel will allow at any one time.
The default value for the minimum number of servers is 1. The default value for the maximum number of servers is 10. These values are usually too low to run Oracle Database on large systems with 4 CPUs or more, if you are not using kernelized AIO( for raw devices).

2016年10月12日 星期三

AIX sudo cfgmgr 0514-603 錯誤...

  1. cfgmgr: 0514-603 Cannot access the Config_Rules object class in the
  2. device configuration database.

原因是 sudo 的時候把環境變數清掉了

visudo

然後加上

Defaults !env_reset




http://superuser.com/questions/232231/how-do-i-make-sudo-preserve-my-environment-variables


http://www.aixhealthcheck.com/blog?id=363


http://mailing.unix.sudo-users.narkive.com/86NcgcIr/sudo-users-fw-sudo-sudo-1-6-9p17-x-aix-5-3

2016年9月26日 星期一

db2 更換 hostname

要改 /home/ladapdb2/sqllib/db2nodes.cfg

2015年4月21日 星期二

AIX 解壓磁帶

找一個夠大的空間

然後

tar xvf /dev/rmt0 .

會把全部都解出來

http://www-01.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.cmds5/tar.htm?lang=en

不太確定怎麼指定單檔或當資料夾解


--
解指定檔案

cd  /temp
tar -xf /dev/rmt0 ./mgt
這樣會等到整捲轉完

--
列表
tar -t /dev/rmt0

2014年12月18日 星期四

ksh for loop

#!/usr/bin/ksh
c=1
while [[ $c -le 100 ]]
do
  # your-unix-command-here
   echo "$c"
   let c=c+1
done
http://www.cyberciti.biz/faq/unix-for-loop-1-to-10/

2014年11月14日 星期五

AIX LVM VG Mirror 操作

Mirror 操作

首先,將新的 PV 加入 VG 。 新的 PV 大小要大於現有的資料量。

extendvg hissp1_v2 hdisk2
extendvg hissp1_v2 hdisk15
extendvg hissp1_v2 hdisk16
extendvg hissp1_v2 hdisk17
extendvg hissp1_v2 hdisk18
extendvg hissp1_v2 hdisk47


smitty vg
選 "Mirror a Volume Group"
sync mode 選 Background
VOLUME names 選剛剛加入的那些 pv
然後 enter 開始

[Entry Fields] * VOLUME GROUP name hissp1_v2 Mirror sync mode [Background] PHYSICAL VOLUME names [hdisk2 hdisk15 hdisk16 hdisk17 hdisk18 hdisk47] Number of COPIES of each logical 2 partition Keep Quorum Checking On? no Create Exact LV Mapping? no
COMMAND STATUS Command: running stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
確認是否搬完的方式 mirror vg 指令還在跑的時候 vg 會被鎖住不能動也不能看 f6n1:/> lsvg -l hissp1_v2 0516-1201 lsvg: Warning: Volume group hissp1_v2 is locked. This command will continue retries until lock is free. If lock is inadvertent and needs to be removed, execute 'chvg -u hissp1_v2'. f6n1:/> 然後因為剛剛是 background sync 所以 mirror vg 指令跑完就可以回到交談式輸入 用 lsvg -l 看 lv 的狀態。正常時應該是 open/syncd 在抄寫時會變成 open/stale 狀態都回到 open/syncd 代表抄完了 另一個方式 lsvg hissp1_v2 看 STALE PPs 降到 0 代表抄完了
UNMIRROR
smitty vg -> Unmirror a Volume Group

> smitty vg
                                     Unmirror a Volume Group

Type or select values in entry fields.
Press Enter AFTER making all desired changes. 
          
                                                        [Entry Fields]               
* VOLUME GROUP name                                   hissp1_v2                      
  PHYSICAL VOLUME names                              [hdisk19 hdisk20 hdisk21 hdisk22 hdisk2> +
  Number of COPIES of each logical                    1                                       +
    partition


COMMAND STATUS Command: running stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
用 lspv -l {HDISK} 看看還有沒有 LV 在要移掉的這些 PV 上面 沒有的話 就可以 reducevg 然後 rmdev 了
--------
補充
要強制斷開的話
直接從來源端把 volumn mapping 抽掉
然後再unmirror
然後再砍

--------
選 UnMirror VG 的時候,選擇 PV 那邊選的是"要移掉的"PV
---------
/usr/sbin/mirrorvg '-S' {VGName} hdisk46 <--要加進去的
/usr/sbin/unmirrorvg {VGName} hdisk7 <--要拿出來的

2014年10月21日 星期二

AIX 的 fcs dar dac


fcsX -> 光纖卡

darX -> Storage , 像是 DS5100 , DS4800  之類

dacX -> Storage  的 Controller . 像是 DS5100 有兩個 Controller  就會長出兩個 dac

hdiskX -> PV

rmdev -dl fcs0 -R 從 fcs 開始一路往下砍

fcs 可以看到好幾個 dar , 每個 dar 又有各自的 dac (當然要 zoning 有串在一起能看得到 ) 然後 dac 底下再有不同的 hdisk


從 fcs 或 dar 砍掉重抓的話 要先把 vg varyoff . 不可以 export  因為 export 之後就沒有 vg 的記錄了

varyoff 之後砍 fac / dar  重抓 .  hdiskX 的數字會變(如果前面有空號的話). 但因為 PVID 沒有變所以 PV <-> VG 的關係還是在。




舊的 Storage  即使每個 Controller 會有兩個 fiber port ,  在做 Zone 的時候也不會把這兩個port串在一起
舊式的接法是

ControllerA1
ControllerA2

ContrallerB1
ContrallerB2

Server1_fcs0
Srever1_fcs1
Server2_fcs0
Server2_fcs1

舊的接法是  
SAN_SW_A : {ContrallerA1 ,  Server1_fcs0 }
SAN_SW_A : { ControllerA2 ,  Server2_fcs0 }

SAN_SW_B : { ContrallerB1 , Server1_fcs1 }
SAN_SW_B : { ControllerB2 ,  Server2_fcs1 }

兩個  Contraller 分開接到兩個 San Switch 上面 然後 Controller 的兩個 fiber port 不會給同一台 server 。是切給不同 server 分散流量用的。

 新的接法會變成

SAN_SW_A : {ContrallerA1 , ContrallerB1 , Server1_fcs0 }
SAN_SW_A : { ControllerA1 , ContrallerB1 , Server2_fcs0 }

SAN_SW_B : { ContrallerA2 ,ContrallerB2 , Server1_fcs1 }
SAN_SW_B : { ContrallerA2 ,ControllerB2 ,  Server2_fcs1 }

ContrallerA , ContrallerB 會串在同一個 SAN switch 上


2014年10月1日 星期三

AIX iSCSI

https://www.ibm.com/developerworks/community/blogs/meyawi/entry/implementing_iscsi_on_aix_with_storwize_v7000u?lang=en meyawi.com@root:/> lsdev|grep iscsi iscsi0 Available iSCSI Protocol Device lsattr -El iscsi0 disc_filename => target file 所在位置 disc_policy file => 指的是target 存在 file 裡 initiator_name 需要改的話 The initiator name could be changed if needed : chdev –l iscsi0 –a initiator_name=iqn…………… 然後到 storage 那邊設定 主機 ,取得 iqn 及 present LUN Now, let’s update /etc/iscsi/targets with V7000U iSCSI target ports information. Each target is defined by 3 fields minimum as follows : HostNameOrAddress PortNumber iSCSIName 192.168.251.121 3260 iqn.1986-03.com.ibm:2145.v7000u.node1 192.168.251.122 3260 iqn.1986-03.com.ibm:2145.v7000u.node2 lsdev -Cc disk cfgmgr -l iscsi0 重抓 lsdev -Cc disk 應該可以看到新的disk lsattr -El hdisk2 可以看細節

2014年8月8日 星期五

AIX 更改"最後更改密碼的時間"

512     cd /etc
513     cd security
514     ls -ltr
515     cat passwd

聽說是文字檔 可以直接用 text editor 改

但是要注意

1 不同區塊中間有空行
2 *切記* 保留一個 root session 連接著. 這個檔改壞會沒辦法登入.
3 *切記* 改之前先另存備份檔

2014年1月21日 星期二

AIX 安裝 SSH

參考 http://blogsendak.pixnet.net/blog/post/91171536-install-ssh-in-aix-5.3

到 這裡 https://www14.software.ibm.com/webapp/iwm/web/reg/pick.do?source=aixbp 下載

要下載 openSSH 跟 openSSL

下載的時候要注意 版本的搭配問題. (openSSH 與 openSSL 的版本搭配 還有各自對 AIX 版本的搭配) 

下載的檔案會是 tar.Z 檔 

用 uncompress 解開變成 .tar 檔

再各自建一個資料夾把 tar 檔丟進去 用 tar xvf 解

查看目前版本用 lslpp -l | grep ssl

先裝 OPENSSL 再裝 OPENSSH


smit install_latest
ACCEPT new license agreements "yes" 

安裝完看看服務在不在
lssrc -a | grep ssh
startsrc -s sshd 
stopsrc -s sshd

2013年6月5日 星期三

AIX下的MPIO、RDAC、SDDPCM多路徑軟件操作

lsattr -El hdisk4
可以看細節

轉自  http://tc.itkee.com/os/detail-2bf3.html

一:查看存儲盤的路徑
1、查看MPIO的存儲盤的路徑
# lspath                                    (適用於所有存儲的MPIO路徑查詢)
# mpio_get_config  -Av              (適用於DS3K/DS4K的MPIO路徑查詢)
2、查看RDAC存儲盤的路徑
# fget_config -Av                       (適用於DS3K/DS4K的RDAC路徑查詢)
3、查看SDDPCM存儲盤的路徑
# pcmpath query device              (適用於DS6K/DS8K和v7000的SDDPCM路徑查詢)
4、查看當前操作系統自帶的支持IBM存儲的多路徑軟件
# manage_disk_drivers
5、將DS4700默認的多路徑軟件更改成RDAC
# manage_disk_drivers -d DS4700 -o AIX_fcparray
二:MPIO路徑的常用操作
1、查看單個盤的路徑
# lspath -l hdisk3
# lspath -F "status name path_id parent connection" | grep -w hdisk3
2、MPIO路徑控制
將fcs0卡下的hdisk2的路徑禁用
# chpath -l hdisk2 -p fscsi0 -s disable
將fcs0卡下的hdisk2的路徑啓用
# chpath -l hdisk2 -p fscsi0 -s enable
3、其它參數
# chdev -l hdisk3 -a queue_depth=1          //如果ODM是1.0.1.0以上可以是任何數字
# chdev -l hdisk3 -a hcheck_interval=60     //鏈路失效檢查時間間隔;如果等0,則不會自檢
# chdev -l hdisk3 hcheck_mode=nonacive
This parameter specifies which I/O paths should be monitored by the path health checking functionality.
nonactive: This mode will check all failed I/O paths and all standby paths of used/opened devices.
failed: This mode with check failed I/O paths only.
enabled: This mode will check all enabled I/O paths which are opened.
Note:
Non-opened devices are not monitored. Also, this attribute is
not being used at this time since path health checking is not
enabled. This attribute can be ignored
4、修改鏈路優先級
lspath -AHE -l hdisk2 -p vscsi3                            //查看鏈路優先級
# chpath -l hdisk3 -p fscsi0 -w 鏈路1 -a priority=1
# chpath -l hdisk3 -p fscsi0 -w 鏈路2 -a priority=2
5、處理故障
1)如果發現有很多路徑是missing的,可以用cfgmgr重新掃描,如果還有missing的,可以用步驟2和2來激活路徑;
2)如果要更換光纖綫,可以該卡上的有的路徑禁用,換完綫後再啓用,避免直接撥綫產生的風險。

2012年12月21日 星期五

AIX 指令

FIND :
AIX 的 find 沒有 maxdepth 可以用。
解法(一)
在  find * 下加上  -prune 可以只抓第一層的結果
解法(二)
從LinuxTools裡面裝 find 來用 -___-|||

uniq :
uniq 指令可以過濾掉重覆行

AWK :
如果沒有明確的 token 可以使用 AWK -F 分割的話 也可以用單行perl處理。例如
find * -prune -mtime +30 -name '*.nmon' | perl -n -e 'm/(f8n1_)(\d{4})(\d{2})(_)(\d{4})(\.nmon)/ && {print " gtar /guardium/$1$2.tgz  $1$2\*.nmon \n"}' | uniq


oslevel -s

lslpp -L | grep sddpcm

sddpcm_get_config -Av



pcmpath query device  查詢 v7000 的 volume
cfgmgr / lsdev / rmdev 一樣
然後 它是一個 pv 要加入 vg 再創 lv 出來掛 fs 才能用
一樣要 veryvgon / veryvgoff


==系統概況==
prtconf

==查網路卡的速度==
#netstat -i
看網卡的名字(如en1 or en2)
#entstat -d en2|grep Speed


==禁止root用telnet登入主機==
方法1.
修改 /etc/security/user檔案 , 設定root區域的 rlogin =false

方法2.
進入smit->security & user ->Login controls -> Change / Show Login Attributes for a User ->修改

== 取得Fiber card的WWN(world wide name) ==
1. 顯示有哪些Fiber Card
#lsdev grep fc

2. 顯示Fiber card詳細內容
#fcstat
ex: fcstat fcs1

or

lscfg -vl fcs0

2011年12月12日 星期一

NFSD , AIX Server , Linux client

Server Side
  1. check nfs service
    lssrc -g nfs  , check nfsd, rpc.mounted is active
    start nfs services group : startsrc -g nfs 
    start single service :  startsrc -s nfsd
  2. 服务器添加需要export的FS
    smit mknfsexp
  3. export服务器的FS
    /usr/sbin/exportfs -a
  4. 检查export的情况
    # hostnamet -e
    APP1
    # showmount -e APP1
    export list for APP1:
  5. 检查服务器端的/etc/hosts
    定义客户端的信息
    172.22.93.26            totoro.pacs.vghtc.gov.tw totoro
  6. restart nfs service
    stopsrc -g nfs
    startsrc -g nfs

Client Side

  1. 加入 /etc/hosts
  2. mount -t nfs f3n3:/worktmp/nmon /worktmp/f3n3 -o nfsvers=2 

Note : 
  • mount.nfs: Remote I/O error
    mount 時需加上  -o nfsvers=2