terça-feira, 25 de março de 2014

Unix Command - How can you get the subdirectories of an existing directory in *Unix? - find


You can use the find command in *Unix.

Go to the directory that you want to get the subdirectories and do this command:

 find . -type d 


Types:
   d - directory
   f - file
   l - symbolic link


----------------------

other way:

In the directory that you want, do this command:

 ls -ltr | grep ^d 

*this command does not get all existing subdirectories.

terça-feira, 18 de março de 2014

Oracle - How to copy a table to another server?

You can copy a table to another server/database, in Oracle, using this command:

Sqlplus:
 SQL> COPY FROM username1/password1@tnsname1 
           TO username2/password2@tnsname2
      INSERT table_name (*) USING (SELECT * FROM table_name); 


Other way is using dump file in Unix:

Export:
 exp username/password@tnsname FILE=filename.dmp \
    TABLES=owner.table_name COMPRESS=y  


Import:
 impdp username/password dumpfile=filename.dmp