If ever you need to re-construct the directory structure on Linux/Unix on a different machine you can just run this command.
# Generates a list of mkdir commands to re-construct the directory structure from current location
find . -type d| while read -r line; do echo "mkdir -p $line"; done
If you are wanting to copy files as well, just use scp or rsync
The use case for these kind of commands nowadays is greatly reduced, if you are using DevOps tools such as puppet or chef, they will do this kind of thing automagically out-of-the-box. If you are running your databases on VMs (datafiles within the VM), most of the time you could clone the image and everything is the same.
The aim of all those tools is to make the job of Sysadmins and DBAs easier whilst producing a environment where the state is consistent/known.
Have Fun
Tuesday, November 13, 2012
Re-constructing directory structure on Linux
Posted by
roobaron
at
7:31 PM
1 comments
Links to this post
Labels: linux
Sunday, November 6, 2011
Oracle Fun with Predicate pushdown
I had some fun recently with a Oracle database choosing a poor execution plan.
The problem was with a view which had a column which was explicitly cast to a value.
For example:
create table vw_temp
as
select
cast(ID) as NUMBER(19,0) as ID,
Name varchar2(50)
from very_large_table a
join large_table b on a.ID = b.ID
where Name = 'whatever' ;
Oracle in this case was unable to use the ability to push predicates down and make the joins more optimized.
So the moral of the story is be careful if you are doing casts/converts or any function which will change the column in a view.
Have Fun
For more info about predicate push down have a read of this blog entry
https://blogs.oracle.com/optimizer/entry/basics_of_join_predicate_pushdown_in_oracle
Or this short entry in the documenation
http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14211%2Foptimops.htm%23i55050
Posted by
roobaron
at
12:57 AM
0
comments
Links to this post
Labels: Oracle