| « | 一月 2012 | » | ||||
|---|---|---|---|---|---|---|
| 一 | 二 | 三 | 四 | 五 | 六 | 日 |
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
ls -F /usr/share/zoneinfo/
ln -sf /usr/share/zoneinfo/posix/Asia/Shanghai /etc/localtime date
查看全文
sed '/regex/{x;p;x;G;}'
模式空间为sedline中的 pattern space ;保持空间为hold space
步骤1,模式空间取得regex匹配行,保持空间为空
步骤2,x执行,使保持空间和模式空间交换
步骤3,p执行,打印为空的模式空间,此时保持空间为regex匹配行
步骤4,x执行前,因为匹配行找不到,故模式空间为空,保持空间为第一次匹配regex行,
步骤5,x执行后,模式空间为第一次匹配regex行,保持空间为空行
步骤6,G执行后,把保持空间添加到模式空间匹配行之后,
http://www.ixpub.net/thread-1470705-1-1.html
Command | What It Does |
|---|---|
sed –n '/sentimental/p' filex | Prints to the screen all lines containing sentimental. The file filex does not change. Without the –n option, all lines with sentimental will be printed twice. |
sed '1,3d' filex > newfilex | Deletes lines 1, 2, and 3 from filex and saves changes in newfilex. |
sed '/[Dd]aniel/d' filex | Deletes lines containing Daniel or daniel. |
sed –n '15,20p' filex | Prints only lines 15 through 20. |
sed '1,10s/Montana/MT/g' filex | Substitutes Montana with MT globally in lines 1 through 10. |
sed '/March/!d' filex (csh) | Deletes all lines not containing March. (The backslash is used only in the csh to escape the history character.) |
sed '/report/s/5/8/' filex | Changes the first occurrence of 5 to 8 on all lines containing report. |
sed 's/....//' filex | Deletes the first four characters of each line. |
sed 's/...$//' filex | Deletes the last three characters of each line. |
sed '/east/,/west/s/North/South/' filex | For any lines falling in the range from east to west, substitutes North with South. |
sed –n '/Time off/w timefile' filex | Writes all lines containing Time off to the file timefile. |
sed 's/([Oo]ccur)ence/1rence/' file | Substitutes either Occurence or occurence with Occurrence or occurrence. |
sed –n 'l' filex | Prints all lines showing nonprinting characters as nn, where nn is the octal value of the character, and showing tabs as >. |
" 双引号:除Dollar signs($),Back quotes(``),Backslashes()外,所有内容留给应用解释,包括IFS和CR回车。
Backslash():相当于将跟随字符用单引号处理。
Metacharacter | Function | Example | What It Matches |
|---|---|---|---|
^ | Beginning-of-line anchor | '^love' | Matches all lines beginning with love. |
$ | End-of-line anchor | 'love$' | Matches all lines ending with love. |
. | Matches one character | 'l..e' | Matches lines containing an l, followed by two characters, followed by an e. |
* | Matches zero or more characters preceding the asterisk | ' *love' | Matches lines with zero or more spaces, followed by the pattern love. |
[ ] | Matches one character in the set | '[Ll]ove' | Matches lines containing love or Love. |
[^] | Matches one character not in the set | '[^A–K]ove' | Matches lines not containing a character in the range A through K, followed by ove. |
< | Beginning-of-word anchor | '<love' | Matches lines containing a word that begins with love. |
> | End-of-word anchor | 'love>' | Matches lines containing a word that ends with love. |
(..) | Tags matched characters | '(love)ing' | Tags marked portion in a register to be remembered later as number 1. To reference later, use 1 to repeat the pattern. May use up to nine tags, starting with the first tag at the leftmost part of the pattern. For example, the pattern love is saved in register 1 to be referenced later as 1. |
x{m}
x{m,}
x{m,n}[a]
| Repetition of character x: m times, at least m times, or between m and n times | 'o{5}'
'o{5,}'
'o{5,10}'
| Matches if line has 5 occurences of o, at least 5 occurences of o, or between 5 and 10 occurrences of |
1.杀死所有oracle 进程
ps -ef|grep oracle|grep -v grep|awk '{print "kill -9 "$2}'|sh
2.计算CPU idle平均值
vmstat 1 11|sed -e '1,3d'|awk '{sum+=$22};END{print "cpu idle is " sum/10}'
3.
1.创建swappool
zpool create -f swappool mirror c0t1d0s2 c1t1d0s2
2.创建swap volume
zfs create -b 8192 -V 130G swappool/swap
3.添加swap到/etc/vfstab文件中,使该swap能在系统重启的时候自动加载
/dev/zvol/dsk/swappool/swap - - swap - no -
客户的一台44P-270,前几天刚给用备份带恢复的系统。最近客户把270换了个地方,机器的系统就起不来了,停在4BA00830,查了service guide,说是引导失败。
处理过程:
光盘引导到维护模式,重建了下引导块,系统就能起来了
bosboot -ad /dev/hdisk0
最近装了一台P55A,一台P52A,都挺顺利
P55A配置是4*1.9G/8G/2*73G/光纤卡1块
P52A配置是2*1.9G/4G/2*146G
1、不同机型系统迁移,在做rootvg镜像的时候宕机,搞得偶很郁闷
2、H85升级内存的时候,有2G(4*512M)内存没认出来,重插了一遍也不行
明天晚上要做做一个系统的迁移,道理说出来很简单,就是P650上的rootvg和datavg全部迁移到一台M85上。
P650的配置为:
4*1.45G CPU
8G内存
2*73.2G内置硬盘
磁盘阵列是DS4300,4块73G硬盘做RAID5
M85配置为:
6*750M CPU
8G内存
2*36.4G内置硬盘
磁盘阵列是7133,5*36.4G硬盘做RAID5
具体操作步骤为:
1、mkszfile,编辑image.data把镜像信息去掉
mksysb /dev/rmt0用内置磁带机做系统备份
2、装3580磁带机驱动
installp -axXd /tmp/Atape.8.2.5.0.bin Atape.driver
3、smitty savevg备份datavg内容
4、恢复p650 mksysb到M85服务器上,记得选择shrink file system选项
5、恢复P650 savevg到M85服务器上,记得选择shrink file system选项
6、配置系统,smitty hostname配置主机名
smitty chinet 配置网卡IP地址
smitty chjfs 改必要的文件系统大小
smitty chaio启动AIO
chmod改变裸设备属性
7、内核从64位降为32位
ln -sf /usr/lib/boot/unix_mp /unix
ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
bosboot -ad /dev/ipldevices
shutdown -Fr
在下列条件下,DBWn写数据文件:
增量或是正常checkpoint
dirty buffer的数量超过阙值
进程扫描free buffers ,扫描了一定数量以后但并没有找到free buffers
超时
RAC环境下的PING请求
表空间设置为只读模式时
drop或是truncate一个表
ALTER TABLESPACE tablespace_name BEGIN BACKUP;
昨天晚上客户处理电源完成以后,重新启动主机的时候发现两台IBM的机器CDE起不来,一台M85显示启动LEGATO后台DAEMON的时候挂起,telnet 进来以后把nsr进程kill以后还是不好使,检查了一下/etc/hosts文件发现这台机器以前的IP还在/etc/hosts文件中,注释这条以后,kill掉所有的dt进程,然后/usr/dt/bin/dtlogin -daemon以后就可以在控制台用CDE界面登陆了。
另外一台650严重一些,CDE,命令行都登陆不了,正准备拿盘进维护模式的时候,有人碰了一下CDE界面居然出来了个命令行窗口,高兴啊,进去一看,靠,/,/var 区都满了,用smitty chjfs扩了这两个分区以后,一切正常。
84分通过HP-UX CSA认证。
主要遇到了以下几个题目:
1、What are the advantages of Online JFS?select three
a. fast resync
b. fast recovery
c. online resizing
d. secure file deletion
e. automatic resizing
f. dynamic inodes creation
2、What are possible uses of the lanadmin command? Select three
a. enable IP multiplexing
b. resets the network interface card
c. shows IP address for network interface card
d. shows basic I/O error for the network interface card
e. shows operational status of the network interface card
3、What does /etc/default set? Select three
a. password policies
b. default swap space
c. default file system type
d. disk space usage limits
e. system time zone
f. some security settings in the directory
4、Which file is used to automatically check and mount file systems?
a. /etc/mnttab
b. /var/adm/fstab
c. /etc/sbtab
d. /etc/fstab
5、Which files can be used to enable a login without a password? Select three
a. .rhost
b. /etc/allow
c. host.allow
d. host.equiv
e. /etc/password
f. /etc/host.aliases
6、During a run-state change from run level 1 to run level 2, which of the following scripts would be run last?
a./etc/rc2.d/k900nfs.server
b./etc/rc2.d/s565snmpTrpDst
c./etc/rc2.d/S565snmpMib2
d./etc/rc2.d/S100nfs.server
7、Which combination of NFS mount options would most likely provide the best chance of avoiding client hangs?
a. retry=2, hard
b. retry=6, hard, intr
c. retry=3, soft, nointr
d. retry=4, soft
1.vi /etc/rc.config.d/nfsconf
修改参数AUTOFS=1
2.重新启动nfs 服务
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.client start
/sbin/init.d/nfs.server start
3.手动启动autofs 服务
/usr/lib/netsvc/fs/autofs/automountd
/usr/sbin/automount
4.修改/etc/auto_master
vi /etc/auto_master
/net -svr1 -nosuid,nobrowse
/- /etc/auto_direct
vi /etc/auto_direct
/suntest -ro e450:/opt
5. ll /net/serv1
ll /suntest
就可以自动挂载相应的资源。