How Not to Use Shell Commands
Jun 20, 2007 / By Alex Gorbachev
Here are a few nice typos that had quite disastrous consequences.
After having fought some network problems to get a distribution of Oracle installation binaries from OTN to a Linux box, a colleague found a revolutionary way to unpack a cpio archive:
$ cpio -idmv > ship.db.lnx32.cpio
We saved few gigs of space, by the way, but the installer didn’t work —
ksh: ./runInstaller: not found. Weird.
Another interesting case involves changing permissions on a directory tree starting from current working directory:
/opt (root)# chown -R oracle:dba .*
Hm… it turned out that it wasn’t necessary — the whole OS was owned by oracle anyway.
Now more serious one. The best way to tar your database files:
/oracle/opt/oradata/ORCL> ls control01.ctl logmnr_tbs01.dbf system01.dbf control02.ctl redo01.log temp01.dbf control03.ctl redo02.log temp02.dbf dbmd01.dbf redo03.log tools01.dbf dbmd_idx01.dbf strmtbs01.dbf undotbs01.dbf dbvb01.dbf sysaux01.dbf users01.dbf /oracle/opt/oradata/ORCL> tar cvf * ../ORCL.tar
Right, a controlfile is good but a “stuffed” controlfile is much better! Now you know why controlfile multiplexing is good even within the same directory.
One Response to “How Not to Use Shell Commands”
Leave a Reply