Skip to main content

Posts

Showing posts from 2015

Unix shell: print out a few lines before and after the finding of an output line

when I search an IP from the ifconfig output, I want to search for which NIC has this IP, so I use this shell command to achieve so: the command below print out totally 10 lines, 4 lines before and 5 lines after ifconfig -a|grep -A 5 -B 5 10.250.7.40 linenum=`ifconfig -a|awk '{if ($0~ /10.250.7.40/)   print NR;}'`;ifconfig -a|head -`expr $linenum + 5`|tail -10 linenum=`ifconfig -a|grep -n 10.250.7.40|awk -F":" '{print $1}'`;ifconfig -a|head -`expr $linenum + 5`|tail -10 the command below print out 5 lines before and 10 lines after the matching line. ifconfig -a|grep -C 5 -10 10.250.7.40 the command below print out 5 lines before and 5 lines after the matching line. ifconfig -a|grep -C 5  10.250.7.40

Clone database using Oracle 12c CloudFS Copy-On-Write snapshot without multitenant feature

Clone database using Oracle 12c CloudFS Copy-On-Write snapshot without multitenant feature Three Goals:          1.         Time Saving                     :                Clone big database in a few minutes, not hours. 2.         Storage saving                                 :                Clone database using less than 1% of original database space 3.         License Cost saving          :                Achieve the two goals above without Oracle multitenant feature Solution: Use Oracle 12c CloudFS Copy-On-Write snapshot feature and manually create clone database without using pluggable database feature. Pre-requisite requirement                :                Oracle ACFS 12.1.   How to create ACFS is covered by another document. This POC was done on Oracle 12c RAC flexible cluster on RedHat Linux server vdclracdev01 Reference : The two Oracle documents below are about how to do this using multitenant feature. http://www.oracle.com/techne