Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread backup job into server??
Fri, Oct 5 2018 8:37 PMPermanent Link

Ian Branch

Avatar

Hi Team,
   Per the Customer's specific request, the Database is currently being used/accesssed in Local mode only.  The EDB
Server is running but not being used att.

   I have created the following Job using Manager.

{sql}
CREATE JOB "WF Backups"
RUN AS "Administrator"
FROM DATE '2018-10-06' TO DATE '2018-10-09'
DAILY
ON MON, TUE, WED, THU, FRI, SAT, SUN
BETWEEN TIME '11:30:00.345' AND TIME '11:59:00.345'
CATEGORY ''
BEGIN
EXECUTE IMMEDIATE 'BACKUP DATABASE "DBiWorkflow" AS "DBiWorkflow-Backup-' + CAST(CURRENT_DATE AS VARCHAR(10)) + '" TO
STORE "Backups" INCLUDE CATALOG';
END
VERSION 1.00
{sql}

   But, by my perception, this is in Local mode and may only run while Manager is running.  Is this the case?

   My objective is to only have this 'Job' running in the Server which is running 24x7 and therefore not be dependant on
any Apps running.

   What do I need to do to achieve this please?

Regards & TIA,
Ian
Sat, Oct 6 2018 3:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian

CAVEAT: local mode = file/server


My understanding is that jobs are run by the server. If you want a file/server equivalent you have to write your own. The reason you can run it in EDBManager is that Tim converts it to a script and runs it.

The only thing stopping you running c/s & f/s simultaneously is the ability to find the right directories with the config / catalog files.

Hence to answer your question - run the server without any clients connected but pointing to the database.

You might want to try this job since it gives you a backup a day - just in case something goes wrong and they've screwed the backup. I also did a once a week (when I remembered)  copy to DVD.


CREATE JOB "Backup TfR"
RUN AS "System"
FROM DATE '2015-09-09' TO DATE '3000-10-21'
DAILY ON MON, TUE, WED, THU, FRI, SAT, SUN
BETWEEN TIME '18:44:45' AND TIME '19:44:45.999'
BEGIN
DECLARE BackupCmnd VARCHAR DEFAULT '';
DECLARE ThisDay VARCHAR DEFAULT '';
DECLARE DBCursor CURSOR FOR DBStmt;
DECLARE StorePath VARCHAR DEFAULT '';
DECLARE StoreName VARCHAR DEFAULT 'buTfR';
DECLARE InfoCursor SENSITIVE CURSOR FOR InfoStmt;
PREPARE InfoStmt FROM 'SELECT * FROM Configuration.Stores WHERE Name=?';

USE TfRData;

SET ThisDay = 'TfR - ' + CASE EXTRACT(DAYOFWEEK FROM CURRENT_DATE)
                   WHEN 1 THEN 'Monday'
                   WHEN 2 THEN 'Tuesday'
                   WHEN 3 THEN 'Wednesday'
                   WHEN 4 THEN 'Thursday'
                   WHEN 5 THEN 'Friday'
                   WHEN 6 THEN 'Saturday'
                   WHEN 7 THEN 'Sunday'
                  END;

SET BackupCmnd = 'BACKUP DATABASE "TfRData" AS "' + ThisDay + '" TO STORE "buTfR" INCLUDE CATALOG';
    
OPEN InfoCursor USING StoreName;
IF (ROWCOUNT(InfoCursor) = 0) THEN
 PREPARE DBStmt FROM 'SELECT _ParamData FROM Config WHERE _ID = ''BackupPath''';
 OPEN DBCursor;
 IF (ROWCOUNT(DBCursor) = 1) THEN
  FETCH FIRST FROM DBCursor ('_ParamData') INTO StorePath;
  EXECUTE IMMEDIATE 'CREATE STORE "buTfR" AS LOCAL PATH '+QUOTEDSTR(StorePath);
 ELSE
  EXECUTE IMMEDIATE 'CREATE STORE "buTfR" AS LOCAL PATH '+QUOTEDSTR('C:\TfR Backups');
 END IF;
END IF;
CLOSE DBCursor;
CLOSE InfoCursor;

EXECUTE IMMEDIATE 'SET FILES STORE TO "buTfR"';
EXECUTE IMMEDIATE 'DELETE FILE "' + ThisDay  + '.EDBBkp" FROM STORE "buTfR"';

EXECUTE IMMEDIATE  BackupCmnd;

END

Roy Lambert
Sat, Oct 6 2018 12:48 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/5/2018 8:37 PM, Ian Branch wrote:
>    Per the Customer's specific request, the Database is currently being used/accesssed in Local mode only.  The EDB
> Server is running but not being used att.

That's OK - as long as EDB server runs it can execute jobs.

The only downside to such mixed mode access can be slower performance
(assuming local mode is using windows file sharing) and of course you
cannot use the new global file I/O buffering.


>    But, by my perception, this is in Local mode and may only run while Manager is running.  Is this the case?

What makes you think that ?

You are creating a job and not running any backup yet.

Jobs are stored in the catalogue and as long as server is configured to
run jobs (INI setting) it should be happily executing them.

AFAIK EDB manager does not runs any job automatically so unless you
execute the job yourself nothing happens.

"local mode" refers to the how *your* session accesses data - EBD Server
itself is simply another app that uses "local model" to access local
data except it has capability to run jobs and do number of other things
like providing C/S capability to remote clients etc.



>    My objective is to only have this 'Job' running in the Server which is running 24x7 and therefore not be dependant on
> any Apps running.
>
>    What do I need to do to achieve this please?

Create the job and make sure server is enabled to run jobs and actually
running 24x7

Raul
Image