How to scp from remote server multiple files

What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Basic syntax of SCP

scp source_file_name username@destination_host:destination_folder

“copy source_file_name” into “destination_folder” at “destination_host” using “username account”.

How to copy single file
$scp -p username@hostname:/u01/local/oracle/db_01/backup/<FileName> .


How to copy multiple files
To use wildcard on the remote host, we must delimit the wildcards with backslash (\)
$ scp -p username@hostname:/u01/local/oracle/db_01/backup/\*.dmp .

The above command will pass “*.dmp”

How to copy Entire folder

$ scp -p username@hostname:/u01/local/oracle/db_01/backup/\* .


1.1 Copy the file “foobar.txt” from a remote host to the local host

$ scp /some/local/directory

1.2 Copy the file “foobar.txt” from the local host to a remote host

$ scp foobar.txt

1.3 Copy the directory “foo” from the local host to a remote host’s directory “bar”

$ scp -r foo

1.4 Copy the file “foobar.txt” from remote host “” to remote host “”

$ scp \

1.5 Copying the files “foo.txt” and “bar.txt” from the local host to your home directory on the remote host

$ scp foo.txt bar.txt

1.6 Copy the file “foobar.txt” from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt
1.7 Copy multiple files from the remote host to your current directory on the local host

$ scp\{a,b,c\} .

Gartner Magic Quadrant Data Integration Tools 2016

Latest Gartner Magic Quadrant Data Integration Tools report for 2016.

Gartner Magic Quadrant Data Integration Tools 2016

Details of the report you can get it by request in the Gartner home page or Informatica

How to DBMS_SYSTEM Package

DBMS_SYSTEM package contains a number of procedures that can be useful. Oracle clearly state that these procedures are not supported so use at your own risk.

The package DBMS_SYSTEM is installed by running the script
This script is internally called by
By default only the SYS user can execute procedures and functions in this package.

To allow other users to execute this package, run the following commands as SYS
CREATE PUBLIC SYNONYM dbms_system FOR dbms_system;

Commonly used procedures or may required for DBA



Used to write messages to the alertlog and/or trace files.

EXEC DBMS_System.ksdwrt(n, message);
EXEC DBMS_System.ksdwrt(2, ‘My Test Alertlog Message’);
Where the value of “n” indicates the destination.

1 – Write to trace file.
2 – Write to alertlog.
3 – Write to both.

To write a message to the trace file use
EXECUTE dbms_system.ksdwrt (1, ‘Output written to trace file’);
To write a message to the alert log use
EXECUTE dbms_system.ksdwrt (2, ‘Output written to alert log’);
To write a message to both the trace file and the alert log use
EXECUTE dbms_system.ksdwrt (3, ‘Output written to both trace file and alert log’);


Used to set trace on or off in another users session.

EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid, serial#, true );
EXEC DBMS_SYSTEM.set_sql_trace_in_session(31, 97, true );

This is the equivalent to enabling event 10046 level 1.

For example to enable trace in a session with SID 9, use:
EXECUTE dbms_system.set_sql_trace_in_session (9, 29, true);
To disable trace in the same session use:
EXECUTE dbms_system.set_sql_trace_in_session (9, 29, false);
The SID and serial# for the session can be obtained from V$SESSION e.g.:
l_sid NUMBER;
l_serial NUMBER;
SELECT sid, serial#
INTO l_sid, l_serial
FROM v$session
WHERE username = ‘User1’;

dbms_system.set_sql_trace_in_session (l_sid, l_serial, TRUE);


Used to set trace on for a specific event.

EXEC DBMS_SYSTEM.set_ev(sid, serial#, event, level, name);
EXEC DBMS_SYSTEM.set_ev(31, 97, 10046, 4, ”);

Where level indicates the following levels of trace.

1 – Standard SQL_TRACE functionality.
4 – As level 1 plus tracing of bind variables.
8 – As level 1 plus wait events.
12 – As level 1 plus bind variables and wait events.


Used to check if a specific event is currently being traced.

EXEC DBMS_SYSTEM.read_ev(event, output);

If output = 1 the event is being traced.

How to rotate log files

We can use simple linux commands to rotate logs. There are some tools also available to rotate the logs.
Method 1: Backup the log and make the log empty without stopping the service.
1.1 Backup the current Log

$ tail -100000 alert_UPGR.log > alert_UPGR.log.bak

$ ls -ltr alert_UPGR.log*
-rw-r—– 1 oracle oinstall 353665 Jul 4 00:41 alert_UPGR.log
-rw-r–r– 1 oracle oinstall 353665 Jul 4 00:52 alert_UPGR.log.bak
1.2 Compress the backed up Log

$ gzip alert_UPGR.log.bak
$ ls -ltr alert_UPGR.log*
-rw-r—– 1 oracle oinstall 353665 Jul 4 00:41 alert_UPGR.log
-rw-r–r– 1 oracle oinstall 33727 Jul 4 00:52 alert_UPGR.log.bak.gz
1.3 Empty the active log

$ >alert_UPGR.log

$ ls -ltr alert_UPGR.log*
-rw-r–r– 1 oracle oinstall 33727 Jul 4 00:52 alert_UPGR.log.bak.gz
-rw-r—– 1 oracle oinstall 0 Jul 4 00:53 alert_UPGR.log
1.4 Confirm the alert log is updated

SYS@UPGR:SQL> alter system switch logfile;

System altered.


$ ls -ltr alert_UPGR.log*
-rw-r–r– 1 oracle oinstall 33727 Jul 4 00:52 alert_UPGR.log.bak.gz
-rw-r—– 1 oracle oinstall 229 Jul 4 00:54 alert_UPGR.log
2. How to rotate Catalina.out log when it is more than 5M?.

2.1. Create this file


2.2. Copy the following contents into the above file

/var/log/tomcat/catalina.out { copytruncate daily rotate 7 compress missingok size 5M }

About the above configuration:
Make sure that the path /var/log/tomcat/catalina.out above is adjusted to point to your tomcat’s catalina.out
daily – rotates the catalina.out daily
rotate – keeps at most 7 log files
compress – compressesthe rotated files
size – rotates if the size of catalina.out is bigger than 5M

How to run shell script in background

We need sometime run the script in background

1. How to execute the script in Background
Let us say you have created script call

Login to remote host with appropricate username and password

$ nohup <scriptname> > <logname> &
$ nohup /home/oracle/mudhalvan/scripts/ > /home/oracle/mudhalvan/scripts/test_bg.log &

2. How to check any background jobs are running in this session
$ jobs

3. Test with example
oracle@localhost:~/mudhalvan/scripts$ cat

find /. -name “test” -print
oracle@localhost:~/mudhalvan/scripts$ ls -ltr
-rwxr-xr-x 1 oracle oinstall 29 May 27 19:43
oracle@localhost:~/mudhalvan/scripts$ nohup /home/oracle/mudhalvan/scripts/ > /home/oracle/mudhalvan/scripts/test_bg.log &
[1] 3865
oracle@localhost:~/mudhalvan/scripts$ jobs
[1]+ Running nohup /home/oracle/mudhalvan/scripts/ > /home/oracle/mudhalvan/scripts/test_bg.log &

4. Why we need to run the scripts in background

1. You may be connected remotely to the server and execute some script which need to be executed for more than few hours. Due to network issue or session security you remote session may disconnect which may cause your running script end at half way.

2. Long running script which will not take your one session of your remote client connection from your client machine.

5. Benifits of running a script in background

1. Disconnect or network disturbance on your remote client will not impact your script execution
2. You can use the current remote session for another process

How to change Windows 10 start screen

Many of us facing problem now once our PC is automatically upgraded to Windows 10. We feel uncomfortable with Start button and the Desktop screen. I also faced the same and below steps to helped to change the Start screen.

1. Click the Start button
2. Click the Settings command.
3. At the Settings window, click the setting for Personalization.
4. At the Personalization window, click the option for Start.
5. In the right pane of the screen, you’ll see a setting that says “Use Start full screen” that’s currently turned off. Turn that setting on so the button turns blue and the setting says “On.

Now click the Start button, and you should see the full Start screen.