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年11月5日 星期三

oracle 對特定欄位作授權的方式


 SELECT 授權 
The following test granting select access to a specified table column.
connect pubs/pubs;

drop user fred;
create user fred identified by fred;
grant connect, resource to fred;

drop view temp;

create view
   temp
as
select
   price
from
   titles;

grant select on temp to fred;

connect fred/fred

select price from pubs.temp;

http://www.dba-oracle.com/class_audit/select_grant_on_specific_table_column.htm



  INSERT, UPDATE, and REFERENCES

Only INSERT, UPDATE, and REFERENCES privileges can be granted at the column level. When granting INSERT at the column level, you must include all the not null columns in the row.

GRANT  update (emp_name)
ON  edwin.emp
TO  joan;


http://www.dba-oracle.com/concepts/column_privileges.htm

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月15日 星期三

DSM 5.0 開 httpd directory listing



在 DSM 4.0 以前


vi /usr/syno/apache/conf/httpd.conf-user


加入

<Directory "/var/services/web/Folder">
Options Indexes MultiViews
</Directory>

然後
/usr/syno/etc/rc.d/S97apache-user.sh restart


參考 http://itanotomomi.pixnet.net/blog/post/12661105-%E9%96%8B%E5%95%9Fsynology-nas(ds212j-dsm-3.2)%E7%9A%84%E7%9B%AE%E9%8C%84%E7%80%8F%E8%A6%BD


在 DSM 5.0

.htaccess 不能用 即使開了 AllowOverride 也是
其實是要改這邊
/etc/httpd/conf/extra/httpd-userdir.conf-user

-AllowOverride AuthConfig FileInfo Indexes Limit
+AllowOverride Options AuthConfig FileInfo Indexes Limit

然後在該目錄底下放一個 .htaccess
Options +Indexes

改 httpd.conf-user 好像沒有用

/usr/syno/etc/rc.d/S97apache-user.sh 不見了 但是用 'httpd -k stop|start|restart' 好像也沒有用
要用
/usr/syno/sbin/synoservicecfg --restart httpd-user

改完發現 index listing 出來的 charset 是 ISO-8859-1
可以參考
http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html
改 .htaccess 加入 IndexOptions

Options +Indexes
IndexOptions +Charset=UTF-8 +NameWidth=*

參考
http://forum.synology.com/enu/viewtopic.php?f=14&t=83419&start=15
http://forum.synology.com/enu/viewtopic.php?f=20&t=84452
http://forum.synology.com/enu/viewtopic.php?f=232&t=79801


2014年10月8日 星期三

SAMBA follows symbolic links

  follow symlinks = yes
  wide links = yes
  unix extensions = no