2017-11-04

Comparison of "Paragon Hard Disk Manager 16" vs. "Acronis True Image 2018" Backup / Imaging

This article contains a comparison of my experiences with 
"Paragon Hard Disk Manager 16" (Paragon) and "Acronis True Image 2018" (Acronis)
backup / system imaging software.


This article does not compare all their features.

There are already many other sources / reviews where the features are listed side by side.
However, these overviews lack descriptions of specific limitations in daily use or of errors.

After reading a lot of such reviews, I decided to test these two programs as the two most promising.

With this short report I am documenting the main findings for myself and hope to save you some time.

What I can tell for now is, that both Paragon and Acronis work:
  • The creation of "Image Backups" and restoring several files from these Images worked.
  • I could even create virtual maschine disks from the "Image Backups" of my Windows 10 notebook and start this image on a VirtualBox unter an Ubuntu Linux host.
  • After a bigger problem with my Win 10 notebook, I could restore it from a Paragon "Image Backup".

I read a lot of bad comments about Acronis that I could not confirm until now after two weeks of dally backups.


1. Rescue Media: Image Creation of a BitLocker encrypted Disk


  • Paragon: Is able to create an Image of a BitLocker encrypted internal Hard Disk. But the bit locker must be previously temporarily stopped from Windows. After the Image is done, BitLocker can be resumed. If the encrypted disk is an external disk - protected by a password - is seems to be possible without previously stopping BitLocker. 
  • Acronis: Does not support this.
  • Since both can backup / "create images" of encrypted disks from the running Windows, this criteria is not very relevant for me.

2. Rescue Media: Keyboard Customization to own Keyboard

Both products creates a WindowsPE rescue media. And the default keyboard layout is English. If you do not use an English keyboard, it is important to be able to change the its' layout in order to match with your keyboard. For example, if you need to enter a password in order to access a network drive (your NAS - for example - containing your disk Images) from your rescue media.
  • Paragon: Does not support this. I have opened a service request and they simply answered that I have to accept this as it is.
  • Acronis: Describes how to change the layout.

3. Support Quality
  • Paragon: They tell that they will give an answer in max. three days and they kept their promise. I opened six service requests in my first week of tests and I always received an answer before the three days. Five of the answers were good (the only one I did not like was about the keyboard customization in WinPE).
  • Acronis: I can not tell, because I had no issues until now.

4. Incremental / Differential Backup to Network Target
  • Paragon: Does not support this. In the documentation it is written, that only full backups are supported to network targets.
  • Acronis: Works without problem

5. Active Protection Against Ransomware
  • Acronis: Works. When I built my App, after installing Acronis, it warned me about suspicious behavior of javac and if this was Ok. So, Acronis detected that my java compiler was trying to modify a lot of files.
6. Testing from within a VirtualBox Client
  • At the beginning, I tried to test both software from within a VirtualBox client.
    This worked, but I had some difficulties in creating the rescue media and accessing network clients, specially with Paragon.
  • When running on a real computer I had no such difficulties any more.

Summarizing

First I have bought Paragon because of a good promotional price and because "it saved my computer" once.
But after having detected several small bugs and especially because of point 4., I decided to buy Acronis.
Point 4. is crucial for me, because I do not want to permanently "mount" my NAS in order to avoid that some ransomware can access it.

Update on 04.02.2018
After re-testing the Backup again today, the Acronis Version 2018 to Build:10640, Acronis is again able to prevent the computer from going to sleep during the backups.

2017-06-02

Example: How to Extract Parts of Lines With Regexp in AWK


Here I am describing how to extract parts (elements) of text file lines using AWK's regular expression.

In this example I need to extract DB names and their DB-service names from a text file:
  • the source file is HostsDBs.lst
  • the relevant lines (containing the DB-name and DB-service) start with "::DB:"
  • the DB-name is followed by "[P]" or by "[S]"
  • the DB-services for a given DB are surrounded by "()"

Here how the last five relevant lines are listed with AWK:
OS> awk '/^::DB:/{ print }' HostsDBs.lst | tail -5
::DB: host0033 EE DW1[P]
::DB: host0192 EE DB01T_SITE1[P](DB_SERVICE_01)
::DB: host0284 EE DB02T_SITE1[P](DB_SERVICE_02)
::DB: host0285 EE DB02P_SITE2[P](DB_SERVICE_02)
::DB: host0286 EE DB02P_SITE1[S]

In awk (here I am using the gnu variant of awk, gawk) elements are per default separated by withespaces.
So, below, the fourth element ($4) is given to the AWK function "match()".  (For example: DB01T_SITE1[P](DB_SERVICE_01))
The second parameter of "match() " delimited by "//" is the regular expression.
It matches only elements that:
  • start with a sequence on non whitespace characters (specified by ".+")
  • followed by "[" (specified by "\[")
  • followed by a sequence on non whitespace characters (specified by ".+")
  • followed by a sequence on non whitespace characters in parenthesis (specified by "\(.+\)")
If the regular expression matches, the parts of the expression in non escaped parenthesis (specified by "(.+)") are written into the array "arr".
If the regular expression matches, "match() " returns true and the two elements of the array (arr[1] and arr[2) are printed

Here the lines were the DB-service is given (for example DB_SERVICE_01) are listed:
OS> gawk '/^::DB:/{ if(match($4, /(.+)\[.+\((.+)\)/, arr)){ print arr[1]" "arr[2]} }' HostsDBs.lst | tail -5
DB01T_SITE1 DB_SERVICE_01
DB02T_SITE1 DB_SERVICE_02
DB02P_ SITE2 DB_SERVICE_02


2017-01-25

ORA-01157: cannot identify/lock data file NN - see DBWR trace file

After creating a DB as copy of another DB via RMAN restore, some applications accessing the DB received the following error (or I, when trying to list the tablespaces via Toad):
ORA-01157: cannot identify/lock data file 1023 - see DBWR trace file
ORA-01110: data file 1023: '+U01'

Remarkable is, that in our DB there is no file with number 1023.
The error from above is also displayed in the alert log.

Performing . . .
ALTER SYSTEM CHECK DATAFILES

. . . also wrote the ORA-01110 error in a trace file:
OS> more /u00/app/oracle/diag/rdbms/<Host>/<SID>/trace/<SID>_ora_<NNNN>.trc
. . .
*** 2017-01-25 08:19:37.976
DDE rules only execution for: ORA 1110
----- START Event Driven Actions Dump ----
---- END Event Driven Actions Dump ----
----- START DDE Actions Dump -----
Executing SYNC actions
----- START DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK' (Async) -----
Successfully dispatched
----- END DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK' (SUCCESS, 0 csec) -----
Executing ASYNC actions
----- END DDE Actions Dump (total 0 csec) -----
DDE: Problem Key 'ORA 1110' was flood controlled (0x1) (no incident)

*** 2017-01-25 08:25:50.404
ORA-01110: data file 1023: '+U01'


CAUSE

The original cause of the problem was, that on the target host (where the new DB was created) there was not enough space (for two DBs instead of only one like on the source host).
Because of this, not all files for the temporary tablespaces could be created.

Listing the temporary files:
SQL> select * from v$tempfile;

     FILE# CREATION_CHANGE# CREATION_TIME              TS#     RFILE# STATUS  ENABLED         BYTES     BLOCKS CREATE_BYTES BLOCK_SIZE Tablespace Name
---------- ---------------- ------------------- ---------- ---------- ------- ---------- ---------- ---------- ------------ ---------- ----------------
         1             3244 17.10.2016 17:21:25          3          1 ONLINE  READ WRITE          0          0   1.3422E+10       8192 +U01
         2       1.7714E+12 18.10.2016 11:32:27         18          1 ONLINE  READ WRITE          0          0   3.4359E+10       8192 +U01
         3       1.7714E+12 18.10.2016 11:32:27         18          2 ONLINE  READ WRITE          0          0   2.1475E+10       8192 +U01
         4       1.7714E+12 18.10.2016 11:32:27         18          3 ONLINE  READ WRITE          0          0   1.8254E+10       8192 +U01
         5       1.7714E+12 18.10.2016 10:39:43          3          2 ONLINE  READ WRITE 2.1475E+10    2621440   2.1475E+10       8192 +U01/<DB_UNIQUE_NAME>/tempfile/temp.382.934186047
         6       1.7714E+12 18.10.2016 11:32:28          3          3 ONLINE  READ WRITE 2.1475E+10    2621440   2.1475E+10       8192 +U01/<DB_UNIQUE_NAME>/tempfile/temp.383.934186047


SOLUTION

Recreate the temporary tablespaces.
Do not forget to create the new tablespaces with the same max. size as the original ones.
(Since my tablespace max. size is bigger than the limit of 32GB for a file, I has to add several files in my example bellow.)

Steps in short
  1. Make sure, that no applications can access the DB and disable the jbobs:
    -- Get the original value
    show parameter job_queue_processes
    -- Set the value to 0
    SQL> ALTER SYSTEM SET job_queue_processes=0;
  2. When recreating the default temporary tablespace:
    • Create a new temp. temporary tablespace (for example tmp_temp) (i can be small)
    • Set this tmp_temp tablespace as default 
    • Drop the original tablespace (temp)
    • Recreate the original temp tablespace
    • Set the recreated temp tablespace as default 
    • Drop the tmp_temp tablespace
  3. When recreating temporary tablespace belonging to an application:
    • Drop the original tablespace (for example: ts_app_temp)
    • Recreate the original ts_app_temp tablespace
  4. At the end, reset the job_queue_processes


Steps in detail

2. When recreating the default temporary tablespace

Create a new temp. temporary tablespace (for example tmp_temp) (i can be small)
CREATE TEMPORARY TABLESPACE tmp_temp TEMPFILE '+U01' SIZE 100M AUTOEXTEND ON NEXT 512M MAXSIZE 1G;

Set this tmp_temp tablespace as default
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tmp_temp;

Drop the original tablespace (temp)
DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

Recreate the original temp tablespace
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 20G;
ALTER TABLESPACE TEMP ADD TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 20G;
ALTER TABLESPACE TEMP ADD TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 20G;

Set the recreated temp tablespace as default 
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

Drop the tmp_temp tablespace
DROP TABLESPACE tmp_temp INCLUDING CONTENTS AND DATAFILES;


3 . When recreating temporary tablespace belonging to an application

Perhaps you will need to open the DB in restricted mode, in order to perform the following steps.
(In my case, this was not necessary.)

Drop the original tablespace (for example: ts_app_temp)
DROP TABLESPACE ts_app_tmp INCLUDING CONTENTS AND DATAFILES;

Recreate the original ts_app_temp tablespace
CREATE TEMPORARY TABLESPACE ts_app_temp TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 32767M;
ALTER TABLESPACE ts_app_temp ADD TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 32767M;
ALTER TABLESPACE ts_app_temp ADD TEMPFILE '+U01' SIZE 1G AUTOEXTEND ON NEXT 512M MAXSIZE 32767M;


Tags: Oracle, ASM, Tablespace, Publish, Temporary Tablespace, Data files, ORA-01157
January 25, 2017 at 10:43AM

2017-01-20

Using sed to replace parts of specific lines in a file

In this example we are using the following test file test.tmp (here listed, part of it) where we will replace the Oracle DB Version (the 11.2.0.4.0 below) between the path (/u00/app/oracle/product/) and . P0_EE in the line for DB  DB00001 by a new version string "--.-.-.-.-"
#SID;ORACLE_HOME;Position;Type;Standby;Cluster;DB-instances
. . .
DB00001;/u00/app/oracle/product/11.2.0.4.0.P0_EE;60;I;N;S;
DB00002;/u00/app/oracle/product/11.2.0.4.0.P0_EE;70;I;N;S;

This tests are performed under Linux in the bash shell.

In order to be flexible, we are using the following variables:
OS> DB=DB00001
OS> V=--.-.-.-.-

Here the sed command with the regular expression:
OS> sed 's|\('${DB}';/u00/app/oracle/product/\).*\(.P0_EE\)|\1'${V}'\2|g' test.tmp
The output:
#SID;ORACLE_HOME;Position;Type;Standby;Cluster;DB-instances
. . .
DB00001;/u00/app/oracle/product/--.-.-.-.-.P0_EE;60;I;N;S;
DB00002;/u00/app/oracle/product/11.2.0.4.0.P0_EE;70;I;N;S;

Explanation of the regular expression:
The first character after "s" (here the "|") defines the parts separator.
(Slashes (/) are commonly used, but since a big part of our expression is a UNIX path containing slashes, I decided to use another character in order to simplify the interpretation.)
The first part of the expression between the first two "|" (i.e. \('${DB}';/u00/app/oracle/product/\)\(.*\)\(. P0_EE\) ) defines what must match.
The escaped brackets "\(" and "\)" define back references that are referenced by \1 and \3 in the second part of the e.
The value of the variable ${DB} is concatenated with ";/u00/app/oracle/product/ ", forming the first "back reference block" that is referenced by the \1 after the "|".
The expression ".* " matches anything in between blocks one and two. It is not referenced, since if will be replaced by "${V}".
The second "back reference block" (.i.e. "\(.P0_EE\)") matches only ".P0_EE". It is referenced by the \2.

So, in our example, only lines matching the regular expression "DB00001;/u00/app/oracle/product/.*P0_EE" are changed and replaced by the string specified through "\1'${V}'\2" (between the second and third "|").

Another variant - more general and simpler - of the command (ignoring the ".P0_EE" part):
OS> sed 's|\('${DB}';/u00/app/oracle/product/\)\([^;]*\)|\1'${V}'|g' test.tmp

Output:
#SID;ORACLE_HOME;Position;Type;Standby;Cluster;DB-instances
. . .
DB00001;/u00/app/oracle/product/--.-.-.-.-;60;I;N;S;
DB00002;/u00/app/oracle/product/11.2.0.4.0.P0_EE;70;I;N;S;

January 20, 2017 at 10:47AM

2017-01-19

HowTo Stop/Kill Oracle Data Pump Jobs

When running Oracle Data Pump, the prompt (interactive mode) can be accessed by pressing the Ctrl-C Keys.
Here the import case as an example:
Import> stop_job=IMMEDIATE

If you are not in the interactive mode of Data Pump (you are in the OS level on the console), you can reattach to the export / import job running in background by recalling the correspontent binary (i.e. If you was performing an import, call impdp. If you was performing an export, call expdp.) and give the name of the Data Pump job as parameter to "ATTACH=":
OS> impdp ATTACH=SYS_IMPORT_SCHEMA_01

Import> stop_job=IMMEDIATE
or
Import> kill_job

If you do not know the name of the Data Pump job, you can perform the following query on the DB:
SQL> SELECT * FROM dba_datapump_jobs WHERE state <> 'NOT RUNNING';
=> JOB_NAME: SYS_IMPORT_SCHEMA_01


How To Cleanup Orphaned Data Pump Jobs

List Data Pump jobs:
set lines 999

SELECT owner_name, job_name, operation, job_mode, state, attached_sessions
  FROM dba_datapump_jobs
 WHERE job_name NOT LIKE 'BIN$%'
 ORDER BY 1,2;
-- Query 1 --

List the Data Pump master tables:
SELECT o.status, o.object_id, o.object_type, o.owner||'.'||object_name "OWNER.OBJECT"
  FROM dba_objects o, dba_datapump_jobs j
 WHERE o.owner=j.owner_name AND o.object_name=j.job_name
   AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;
-- Query 2 --

Drop the correspondent table:
DROP TABLE xxxx;

Re-run the query on dba_datapump_jobs and dba_objects.
If there are still jobs listed in dba_datapump_jobs, and these jobs do not have a master table anymore, cleanup the job while connected as the job owner. (Adapt the highlighted parameter) E.g.:
SET serveroutput on
SET lines 100
DECLARE
   h1 NUMBER;
BEGIN
   h1 := DBMS_DATAPUMP.ATTACH('xxxx','SYSTEM');
   DBMS_DATAPUMP.STOP_JOB(h1);
END;
/
-- PL/SQL 1  --


Killing all Data Pump jobs listed by -- Query 1 -- by using -- PL/SQL 1  --  (But take care!):
DECLARE
   h1    NUMBER;
   l_cur SYS_REFCURSOR;
BEGIN
   FOR l_cur IN (SELECT owner_name, job_name, operation, job_mode, state, attached_sessions
                      FROM dba_datapump_jobs
                     WHERE job_name NOT LIKE 'BIN$%')
   LOOP
     BEGIN
      DBMS_OUTPUT.PUT_LINE('Kill job '||l_cur.job_name||'  owner: '||l_cur.owner_name||'  state: '||l_cur.state);
      h1 := DBMS_DATAPUMP.ATTACH(l_cur.job_name, 'SYS');
      DBMS_DATAPUMP.STOP_JOB(h1);
     EXCEPTION
       WHEN OTHERS THEN
         DBMS_OUTPUT.PUT_LINE('EXCEPTION:'||sqlerrm);
     END;
   END LOOP;
END;
/
-- PL/SQL 2  --


Generates UNIX statements to kill Data Pump Linux/UNIX processes:
SELECT 'kill -9 ' ||spid , s .action , s .program, s .machine , s .osuser , s.module
  FROM v$process p, v$session s
WHERE s. paddr = p. addr
  AND (action LIKE 'CP_%' OR UPPER(module) LIKE '%PUMP%');

2017.01.19

2017-01-10

Beware booking Michel Residence in Camaguey - Cuba

For once, not a computer science theme.

Last December we traveled around Cuba and visited lots of very picturesque places.

On of these historical places that pleased me most was Trinidad with its beautifully restored colonial buildings. 

On the other hand, Camaguey was not worth visiting it.
One disappointing experience there was Michels Residence (Calle Bembeta 571). Inside is not bad, it has even beautifully decorated rooms in an old building.

The prize for the room was a little bit high (25-. CUC for one night no breakfast) comparing to other casas particulares. (The air conditioner was not usable and the bed was awful.)

What disappointed us more, was the price charged for the meal and breakfast (60.- CUC).
A high price for that kind of meal in Cuba.
(Since this casa belonged to a friend of a relative of friend of us here in Europe, we did not ask for the prices in advance.)