[Shell] 脚本案例(1)--while,for,RANDOM,case
[/tmp/test]# more ss1#!/bin/sh#i=0i=`tail -1 ss1.log | awk '{print $NF}'`while(true)doyear=`date +%Y`month=`date +%m`day=`date +%d`hour=`date +%H`minute=`date +%M` second=`date +%S` let i=$i+1week=`date +%a`weekno=`date +%w`echo $$" "$year" "$month" "$day"&nbs...
[RAC] 11.2.0.4 RAC Grid 提示INS-30510
ORACLE 11.2.0.4 RAC Grid 安装提示 INS-30510: Insufficient number of ASM disks selected.错误的原因是由于磁盘数和冗余层级不匹配:如果创建用来存放OCR和VOTEDISK的ASM磁盘组,那么External、Normal、High三种冗余级别对应的Failgroup个数是1、3、5。也就是说,创建这三种冗余级别的磁盘组至少分别需要1、3、5个...
[RAC] Vcenter中共享磁盘的建立
Vcenter中共享磁盘的建立有几个要注意的地方:1.SCSI 控制器1 是添加磁盘后显示出来的.2.SCSI 控制器类型选择 “LSI Logic并行”,SCSI总线共享 选择“物理”3.硬盘n(2~7)的类型选择“厚置备置零”,虚拟设备节点选择“SCSI(1:n)” 其中n是0,1,2,3,4,5,6.....具体显示可以参照下图....
[Oracle] 查看tablespace的使用率(Including temp tablespace)
以前也写过查看tablespace的sql,下面写的sql包含temp tablespace的使用率的将permanent和temporary的使用率包含在一起的.select * from(select x.tablespace_name,x.contents,x.status,x.extent_management,x.all_bytes/1024/1024 "ALL_SIZE(MB)",y.free_bytes/1024/1024 "FREE_SIZE(MB)",(x.all_bytes-y.free_bytes)...
11.查看tablespace的使用率(Including temp tablespace)
以前也写过查看tablespace的sql,下面写的sql包含temp tablespace的使用率的将permanent和temporary的使用率包含在一起的.select * from (select x.tablespace_name,x.contents,x.status,x.extent_management,x.all_bytes/1024/1024 "ALL_SIZE(MB)",y.free_bytes/1024/1024 "FREE_SIZE(MB)",(x.all_bytes-y.free_bytes...
[Linux] device eth0 does not seem to present
虚拟机service network restart提示device eth0 does not seem to present需要如下动作:[root@iphone ~]# more /etc/udev/rules.d/70-persistent-net.rules # This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can...
[AWK] 数字太大显示为科学计数法,需要显示全部数字
awk 数字太大显示为科学计数法了,需要显示全部数字[root->/tmp/test]# cat ff21234 1320987 43244567 432432345 24217654 53225678 54339876 323456 577456...
[Linux] mutt /xxxx/xxxx/sent is not a mailbox.
[mon@oracle6 source]$ echo "xxxxxxxxxsfds" | mutt -s "dssssssssssssssssssss" xxxxxxxx@163.com/home/mon/sent is not a mailbox.Could not send the message.想起之前做过了 echo > /home/mon/sent ,可能和这个有关系。只能baidu了,发现了如下方法:[mon@oracle6 ~]$ cp /var/mail/mon sent &...
10.monitor web data script
定时监控网页数据的简单脚本[mon@oracle6 ~]$ more /home/mon/source/mon_data#!/bin/bash export ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=xxxxxdbres=`curl xxxx.xxxxx.xxx/xxxxxxxx | grep "xxxxxxxxxx" | grep "xx" | awk '{print $2}'`datetime=`d...
[Oracle] oracle 11g dataguard (one instance)
oracle 11g standby (one instance)primary xx.xx.xx.100 (node2)standby xx.xx.xx.35 (oracle)1.standby server add listener and tnsnames[oracle@oracle6 admin]$ more listener.ora SID_LIST_LISTENER2 = (SID_LIST = (SID_DESC = &...
[Oracle] oracle 11g database install(linux)
1.create user oracle[root@node2 ~]# groupadd oinstall[root@node2 ~]# groupadd dba[root@node2 ~]# useradd -g oinstall -G dba oracle[root@node2 ~]# passwd oracleChanging password for user oracle.New password: BAD PASSWORD: it is based on a dictionary wordRetype new password: passwd: all authe...
[SQLSERVER] sqlserver T-SQL 执行detach/attach,copy 命令
declare @backupdb nvarchar(200)declare @dfstr nvarchar(200)declare @dfdesstr nvarchar(200)declare @lgstr nvarchar(200)declare @cmdstr nvarchar(200)set @backupdb='xxxx_LOG_' + convert(varchar(30),getdate()-2,112) + '_000000'set @dfstr ...
[Oracle] oracle11g scan ip relocate
[root@xxxxxdb2 ~]# crsctl stat res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER  ...
[Linux] x-manager 连接linux桌面
x-manager 安装之后会有 Xbrowser 这个选项右键 new --> xstart sessionsession:输入一个名字host: 172.16.99.35 #输入ip protocol: SSH username: rootpassword: root的密码execution...
[Oracle] crsctl stat res -t
oracle10g的时候查看resource用 crs_stat -t比较多.到了oracle11g后查看resource 用 crsctl stat res -t[root@xxxxxdb2 ~]# crsctl stat res -t--------------------------------------------------------------------------------NAME TARGET STA...
[Linux] Mount windows共享给linux使用
mount windows共享磁盘给linux使用[root@oracle etc]# mount -t cifs -o username=administrator,password='xxxxxxxx' //172.16.xx.xx/software /mnt/fs3[root@oracle fs3]# dfFilesystem 1K-blocks Used Available Use% ...
[Linux] PV,VG,LV相关
2016.5.21pv,vg,lv[root@iphone dev]# rpm -qa | grep lvmlvm2-2.02.98-9.el6.x86_64lvm2-libs-2.02.98-9.el6.x86_641.pvcreate --physical volume create[root@iphone dev]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created[root@iphone dev]# pvcreate /dev/sdc Physic...
[Oracle] Raw device上Create Tablespace
[root@iphone ~]# vgdisplay vg00 --- Volume group --- VG Name vg00 System ID Format &nb...
[Shell] awk初学之常见问题
awk初学之常见问题 (转载)http://bbs.chinaunix.net/thread-2309494-1-1.html1. awk ‘{code}1’ 中的“1”是干什么的?一个完整的awk语句为:Awk ‘[patten]{action}……’, 其中pattern缺省为1,action缺省为{print}.那么awk ‘1’完整的写法就是awk ‘1{print}’; 同理,awk ‘{print}’完整的写法也是awk ‘...
[Shell] 99乘法表
打印9*9乘法表[root@oracle6 ~]# awk 'BEGIN{for(i=1;i