Shall I use Zones or LDOMs ?
筆記一下
Shall I use Zones or LDOMs?
By Karoly Vegh on Feb 16, 2012
https://blogs.oracle.com/orasysat/entry/shall_i_use_zones_or
.
How to Create a VxVM Snapshot from a mirror volume
VxVM 的 Volume Instance Snapshot 功能
Require: Storage Foundation Enterprise Version
有三種方式:
* Third-mirror break-off snapshots
* Full-sized snapshots
* Space-optimized snapshots
這兒介紹的就是第一種,範例如下
# vxrpint -th -g dg1
1. enable FastResync
# vxsnap -g dg1 prepare oracle_vol ndcomirs=1 alloc=dg101
# vxprint -th -g dg1
2. create a break-off snapshot volume
# vxsnap -g dg1 make source=oracle_vol/newvol=SNAP-oracle_vol/plex=oracle_vol-02
# vxprint -th g dg1
3. check snapshot status
# vxsnap -g dg1 -xv list
4. split dg
# vxdg split dg1 dg2 SNAP-oracle_vol
# vxprint -th
5. join dg (snap vol refresh reattach must in the same dg)
# vxdg join dg2 dg1
6. Refresh snapshot (source vol, snapshit vol must in the same dg)
# vxsnap -g dg1 refresh SNAP-oracle_vol
7. Reattach, (source vol, snapshit vol must in the same dg)
# vxsnap -b -g dg1 reattach SNAP-oracle_vol source=oracle_vol
.
Require: Storage Foundation Enterprise Version
有三種方式:
* Third-mirror break-off snapshots
* Full-sized snapshots
* Space-optimized snapshots
這兒介紹的就是第一種,範例如下
# vxrpint -th -g dg1
dg dg1 default default 27000 1253797071.15.t2000 dm dg101 c1t2d0s2 auto 65536 143283520 - dm dg103 c1t3d0s2 auto 65536 143283520 - v oracle_vol - ENABLED ACTIVE 83886080 SELECT - fsgen pl oracle_vol-01 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg101-03 oracle_vol-01 dg101 41943040 83886080 0 c1t2d0 ENA pl oracle_vol-02 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg103-01 oracle_vol-02 dg103 0 83886080 0 c1t3d0 ENA
1. enable FastResync
# vxsnap -g dg1 prepare oracle_vol ndcomirs=1 alloc=dg101
# vxprint -th -g dg1
v oracle_vol - ENABLED ACTIVE 83886080 SELECT - fsgen pl oracle_vol-01 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg101-03 oracle_vol-01 dg101 41943040 83886080 0 c1t2d0 ENA pl oracle_vol-02 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg103-01 oracle_vol-02 dg103 0 83886080 0 c1t3d0 ENA dc oracle_vol_dco oracle_vol oracle_vol_dcl v oracle_vol_dcl - ENABLED ACTIVE 6304 SELECT - gen pl oracle_vol_dcl-01 oracle_vol_dcl ENABLED ACTIVE 6304 CONCAT - RW sd dg101-01 oracle_vol_dcl-01 dg101 125829120 6304 0 c1t2d0 ENA
2. create a break-off snapshot volume
# vxsnap -g dg1 make source=oracle_vol/newvol=SNAP-oracle_vol/plex=oracle_vol-02
# vxprint -th g dg1
v SNAP-oracle_vol - ENABLED ACTIVE 83886080 ROUND - fsgen pl oracle_vol-02 SNAP-oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg103-01 oracle_vol-02 dg103 0 83886080 0 c1t3d0 ENA dc SNAP-oracle_vol_dco SNAP-oracle_vol SNAP-oracle_vol_dcl v SNAP-oracle_vol_dcl - ENABLED ACTIVE 6304 SELECT - gen pl SNAP-oracle_vol_dcl-01 SNAP-oracle_vol_dcl ENABLED ACTIVE 6304 CONCAT - RW sd dg103-02 SNAP-oracle_vol_dcl-01 dg103 83886080 6304 0 c1t3d0 ENA sp oracle_vol_snp SNAP-oracle_vol SNAP-oracle_vol_dco v oracle_vol - ENABLED ACTIVE 83886080 SELECT - fsgen pl oracle_vol-01 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg101-03 oracle_vol-01 dg101 41943040 83886080 0 c1t2d0 ENA dc oracle_vol_dco oracle_vol oracle_vol_dcl v oracle_vol_dcl - ENABLED ACTIVE 6304 SELECT - gen pl oracle_vol_dcl-01 oracle_vol_dcl ENABLED ACTIVE 6304 CONCAT - RW sd dg101-01 oracle_vol_dcl-01 dg101 125829120 6304 0 c1t2d0 ENA sp SNAP-oracle_vol_snp oracle_vol oracle_vol_dco
3. check snapshot status
# vxsnap -g dg1 -xv list
NAME DG OBJTYPE SNAPTYPE PARENT PARENTDG SNAPDATE CHANGED_DATA SYNCED_DATA oracle_vol dg1 vol - - - - - - - 40G (100%) SNAP-oracle_vol dg1 vol fullinst oracle_vol dg1 2011/07/31 02:57 64K (0.0%) 40G (100%)
4. split dg
# vxdg split dg1 dg2 SNAP-oracle_vol
# vxprint -th
dg dg1 default default 27000 1253797071.15.t2000 dm dg101 c1t2d0s2 auto 65536 143283520 - v oracle_vol - ENABLED ACTIVE 83886080 SELECT - fsgen pl oracle_vol-01 oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg101-03 oracle_vol-01 dg101 41943040 83886080 0 c1t2d0 ENA dc oracle_vol_dco oracle_vol oracle_vol_dcl v oracle_vol_dcl - ENABLED ACTIVE 6304 SELECT - gen pl oracle_vol_dcl-01 oracle_vol_dcl ENABLED ACTIVE 6304 CONCAT - RW sd dg101-01 oracle_vol_dcl-01 dg101 125829120 6304 0 c1t2d0 ENA sp SNAP-oracle_vol_snp oracle_vol oracle_vol_dco dg dg2 default default 7000 1312053225.56.t2000 dm dg103 c1t3d0s2 auto 65536 143283520 - v SNAP-oracle_vol - ENABLED ACTIVE 83886080 ROUND - fsgen pl oracle_vol-02 SNAP-oracle_vol ENABLED ACTIVE 83886080 CONCAT - RW sd dg103-01 oracle_vol-02 dg103 0 83886080 0 c1t3d0 ENA dc SNAP-oracle_vol_dco SNAP-oracle_vol SNAP-oracle_vol_dcl v SNAP-oracle_vol_dcl - ENABLED ACTIVE 6304 SELECT - gen pl SNAP-oracle_vol_dcl-01 SNAP-oracle_vol_dcl ENABLED ACTIVE 6304 CONCAT - RW sd dg103-02 SNAP-oracle_vol_dcl-01 dg103 83886080 6304 0 c1t3d0 ENA sp oracle_vol_snp SNAP-oracle_vol SNAP-oracle_vol_dco
5. join dg (snap vol refresh reattach must in the same dg)
# vxdg join dg2 dg1
6. Refresh snapshot (source vol, snapshit vol must in the same dg)
# vxsnap -g dg1 refresh SNAP-oracle_vol
7. Reattach, (source vol, snapshit vol must in the same dg)
# vxsnap -b -g dg1 reattach SNAP-oracle_vol source=oracle_vol
.
VxVM Cross-Platform filesystem, linux to sparc
http://www.symantec.com/docs/TECH147697
我的實際案例
是要把 Linux 的 data, 掛到 sparc 主機
1) Linux Production SFCFS P-Vol -> clone disk (S-Vol)
2) -> another Linux VxVM dg import S-Vol -> fscdsconv to sparc
# /opt/VRTS/bin/fscdsconv -e -t os_name=SunOS -f /var/tmp/recovery_vol01 /dev/vx/rdsk/oraracdg/oradata01-vol
# vxdg deport oraracdg
3) -> Solaris Sparc VxVM import S-Vol mount -> Backup
# vxdg -Cf import oraracdg
# vxvol -g oraracdg startall
# mount -F vxfs /oradata01 /dev/vx/rdsk/oraracdg/oradata01-vol
若沒有做 fscdsconv 的話
sparc 直接 import/mount 則會出現錯誤
#/opt/VRTS/bin/mount /dev/vx/dsk/oraracdg/oradata01-vol /oradata01
> UX:vxfs mount: ERROR: V-3-20012: not a valid vxfs file system
> UX:vxfs mount: ERROR: V-3-24996: Unable to get disk layout version
.
我的實際案例
是要把 Linux 的 data, 掛到 sparc 主機
1) Linux Production SFCFS P-Vol -> clone disk (S-Vol)
2) -> another Linux VxVM dg import S-Vol -> fscdsconv to sparc
# /opt/VRTS/bin/fscdsconv -e -t os_name=SunOS -f /var/tmp/recovery_vol01 /dev/vx/rdsk/oraracdg/oradata01-vol
# vxdg deport oraracdg
3) -> Solaris Sparc VxVM import S-Vol mount -> Backup
# vxdg -Cf import oraracdg
# vxvol -g oraracdg startall
# mount -F vxfs /oradata01 /dev/vx/rdsk/oraracdg/oradata01-vol
若沒有做 fscdsconv 的話
sparc 直接 import/mount 則會出現錯誤
#/opt/VRTS/bin/mount /dev/vx/dsk/oraracdg/oradata01-vol /oradata01
> UX:vxfs mount: ERROR: V-3-20012: not a valid vxfs file system
> UX:vxfs mount: ERROR: V-3-24996: Unable to get disk layout version
.
Sun Cluster 3.3 + MySQL 5.5.x problem
Sun Cluster 3.3 文件寫到,似乎只支援到 MySQL 4.X
我用到 MySQL 5.X 上果然出了些問題
似乎是 MySQL create table 的 key 換了
於是乎 Sun Cluster MySQL Agent 在 create test table 時就出現了此訊息
Feb 17 12:56:27 TPDBDSS2 SC[SUNWscmys.probe_mysql]:BDSS:mysql-rs: [ID 986150 daemon.error] check_mysql - Sql-command USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) TYPE=MyISAM;COMMIT returned error (ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 1)
debug 一番,找到 SUNWscmys/function
修改這行
for cmd in 'USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) TYPE=MyISAM;COMMIT' \
把 TYPE 換成 ENGINE
for cmd in 'USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) ENGINE=MyISAM;COMMIT' \
ok, work fine now
--
update: a patch release
Patch-ID# 145646-03
Keywords: oracle ha-mysql patch
Synopsis: Oracle Solaris Cluster 3.3: HA-MySQL Patch for Oracle Solaris 10
Date: Jul/11/2011
Add support for MySQL 5.X
---------------
if (( ${MYSQL_VERSION} >= 5 ))
then
ENGINE="ENGINE=MyISAM"
else
ENGINE="TYPE=MyISAM"
fi
---------------
我用到 MySQL 5.X 上果然出了些問題
似乎是 MySQL create table 的 key 換了
於是乎 Sun Cluster MySQL Agent 在 create test table 時就出現了此訊息
Feb 17 12:56:27 TPDBDSS2 SC[SUNWscmys.probe_mysql]:BDSS:mysql-rs: [ID 986150 daemon.error] check_mysql - Sql-command USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) TYPE=MyISAM;COMMIT returned error (ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 1)
debug 一番,找到 SUNWscmys/function
修改這行
for cmd in 'USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) TYPE=MyISAM;COMMIT' \
把 TYPE 換成 ENGINE
for cmd in 'USE sc3_test_database; CREATE TABLE sc3_test_table ( Number int(5) NOT NULL, PRIMARY KEY (Number)) ENGINE=MyISAM;COMMIT' \
ok, work fine now
--
update: a patch release
Patch-ID# 145646-03
Keywords: oracle ha-mysql patch
Synopsis: Oracle Solaris Cluster 3.3: HA-MySQL Patch for Oracle Solaris 10
Date: Jul/11/2011
Add support for MySQL 5.X
---------------
if (( ${MYSQL_VERSION} >= 5 ))
then
ENGINE="ENGINE=MyISAM"
else
ENGINE="TYPE=MyISAM"
fi
---------------
Solaris 10 Resource Management - project.cpu-cap
Solairs 10 7/08 add project.cpu-cap to limit cpu usages
add a project fraud, and assign user to this project
# projadd -U user1 user.test
change user user1 default project:
add a line to the end of /etc/user_attr
=> user1::::project=user.test
# id -p user1
uid=109(user1) gid=201(users) projid=100(user.test)
==> project.cpu-cap
==> a value of 100 means 100% of one CPU
add a project attribute:
# projmod -aK "project.cpu-cap=(priv,800,deny)" user.test => 50%
(it's a 16 cpu system)
# prctl -n project.cpu-cap -i project user.test
move a process to a project task
# newtask -v -p user.test -c [pid]
.
add a project fraud, and assign user to this project
# projadd -U user1 user.test
change user user1 default project:
add a line to the end of /etc/user_attr
=> user1::::project=user.test
# id -p user1
uid=109(user1) gid=201(users) projid=100(user.test)
==> project.cpu-cap
==> a value of 100 means 100% of one CPU
add a project attribute:
# projmod -aK "project.cpu-cap=(priv,800,deny)" user.test => 50%
(it's a 16 cpu system)
# prctl -n project.cpu-cap -i project user.test
project: 100: user.test
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.cpu-cap
privileged 800 - deny -
system 4.29G inf deny -
# prstat -J
PROJID NPROC SWAP RSS MEMORY TIME CPU PROJECT
100 18 7040K 8000K 0.0% 1:08:50 49% user.test <=== 50% CPU
3 90 6880M 6910M 21% 168:18:24 8.5% default
1 25 144M 154M 0.5% 12:31:05 0.7% user.root
0 60 197M 203M 0.6% 41:03:22 0.0% system
move a process to a project task
# newtask -v -p user.test -c [pid]
.
訂閱:
文章 (Atom)