2017年2月8日 星期三

AIX5.3 rlwrap



參考 http://blog.csdn.net/lqx0405/article/details/5817769

1、首先安装gcc环境
下载gcc相关包

gcc-4.2.0-3.aix6.1.ppc.rpm, 
gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm, 
libgcc-4.2.0-3.aix6.1.ppc.rpm, 
libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm, 
libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm 

(1)用ftp将上述五个rpm文件上传到/usr/opt/freeware/src /packages/SOURCES目录下 

(2)以root身份在/usr/opt/freeware/src/packages/SOURCES执行命令 
# rpm -ivh gcc-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libgcc-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm

2、安装readline 库文件
1)      解压: gunzip  readline-6.1.tar.gz
2)      解包: tar  -xvf  readline-6.1.tar
3)      安装: cd  readline-6.1
       ./configure ; make ; make install
4)      安装完毕后,readline的库文件,安装在/usr/local/lib 目录下
5)      将相关库文件拷贝到/lib 和 /usr/lib 下

3、安装 rlwrap
 下载  rlwrap-0.37.tar.gz
1)    解压 gunzip  rlwrap-0.37.tar.gz
2)    解包:tar  -xvf  rlwrap-0.37.tar
3)    安装: cd rlwrap-0.37
       ./configure ;  make ; make check ; make install
4、配置
  在/home/oracle/.profile 下建立别名:
 alias   sqlplus=‘rlwrap  sqlplus’
 alias   rman=‘rlwrap  rman’



另外 在
http://www.perzl.org/aix/index.php?n=Main.Rlwrap
好像有編好的版本
http://www.perzl.org/aix/index.php?n=Main.Readline
要先裝 readline

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).

2017年2月7日 星期二

Xming

下載 Xming


port: 6000
啟動 x launch , no access controll
-screen 0 1024x768

然後

對方 
export DISPLAY={IP}:0.0


錯誤訊息:
Warning: Cannot convert string "-*-lucida-medium-r-*-*-*-*-*-*-*-*-iso8859-1" to type FontStruct

If the font packages are not installed, install them.
Restart the X server.

安裝 font package

2017年1月20日 星期五

linux mpio



編輯 /etc/multipath.conf
把 blacklist {} 區段註解掉
然後把 default{} 區段打開

chkconfig multipathd on
service multipathd start

然後 fdisk -l 會看到多出 dm-n 的硬碟 但 dm-n 不能直接掛來用
要用 /dev/mapper/mpathNpN
詳細資料待查

引用

#vi /etc/multipath.conf
然後可以看到檔案裡面有這些東西
blacklist {
        devnode "*"
}

把這幾行mark掉吧
另外可以看到有一些本來被mark掉的
#defaults {
#       udev_dir                /dev
#       polling_interval        10
#       selector                "round-robin 0"
#       path_grouping_policy    multibus
#       getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
#       prio_callout            /bin/true
#       path_checker            readsector0
#       rr_min_io               100
#       max_fds                 8192
#       rr_weight               priorities
#       failback                immediate
#       no_path_retry           fail
#       user_friendly_names     yes
#}
這裡是設定一些multipath參數的地方
設定好就拿掉mark吧,如果不會設定的話直接拿掉mark也是可以的
存檔後就可以開啟service了
#chkconfig multipathd on
#service multipathd start
在啟動之前可以看到我硬碟是這樣
Disk /dev/sdb: 997.9 GB, 997999509504 bytes
255 heads, 63 sectors/track, 121333 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1306    10490413+  83  Linux
/dev/sdb2            1307        2612    10490445   83  Linux


Disk /dev/sdc: 997.9 GB, 997999509504 bytes
255 heads, 63 sectors/track, 121333 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1306    10490413+  83  Linux
/dev/sdc2            1307        2612    10490445   83  Linux

啟動之後可以看到多出幾個device
Disk /dev/dm-0: 997.9 GB, 997999509504 bytes
255 heads, 63 sectors/track, 121333 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
/dev/dm-0p1   *           1        1306    10490413+  83  Linux
/dev/dm-0p2            1307        2612    10490445   83  Linux

Disk /dev/dm-1: 10.7 GB, 10742183424 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 10.7 GB, 10742215680 bytes
255 heads, 63 sectors/track, 1306 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-2 doesn't contain a valid partition table

其中dm-0是sdb和sdc的合體,但是因為sdb和sdc有兩個partition,
所以multipath也順便把這兩個合成dm-1和dm-2,
這時候會發現在device下面找不到dm-0p1和dm-0p2可以用,
因為他放到/dev/mapper裡面去了,在裡面可以看到mpath1p1和mpath1p2分別就是兩個partition
如果要更改設定的話除了在multipath.conf裡面更改再重新啟動之外
也可以用multipath指令即時更新,另外"multipath -ll"也可以看到目前path的組成以及狀況





參考

http://tnth.pixnet.net/blog/post/26222957-linux%E4%B8%8A%E7%9A%84mpio

https://access.redhat.com/documentation/zh-TW/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/mpio_setup.html

oracle enable / disable archive_n

相關參數
log_archive_dest_state_n
log_archive_dest_n

alter system set log_archive_dest_state_n=defer scope=both;

alter system set log_archive_dest_state_n=enable scope=both;

可以用  ALTER SYSTEM ARCHIVE LOG CURRENT 出清現有 redo

參考
https://docs.oracle.com/cd/B14117_01/server.101/b10755/initparams102.htm

LOG_ARCHIVE_DEST_STATE_n = { alternate | reset | defer | enable }


The LOG_ARCHIVE_DEST_STATE_n parameters (wheren = 1, 2, 3, ... 10) specify the availability state of the corresponding destination. The parameter suffix (1 through 10) specifies one of the ten corresponding LOG_ARCHIVE_DEST_n destination parameters.
Values:
  • enabled
    Specifies that a valid log archive destination can be used for a subsequent archiving operation (automatic or manual). This is the default.
  • defer
    Specifies that valid destination information and attributes are preserved, but the destination is excluded from archiving operations until re-enabled.
  • alternate
    Specifies that a log archive destination is not enabled but will become enabled if communications to another destination fail.
The LOG_ARCHIVE_DEST_STATE_n parameters have no effect on the ENABLE state for the LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST parameters.


The V$ARCHIVE_DEST dynamic performance view shows values in use for the current session. The DEST_ID column of that view corresponds to the archive destination suffix n.