Skip to main content
Solved

Is it possible to set job_id initial value after install?


revesz
Contributor
Forum|alt.badge.img+15

Before I get my hands dirty

I regularly backup the fme_job_history table for analysis. When I upgrade FME Server I'd like the job_id to remain consecutive instead of restarting from 1.

Is there a way to set the starting job_id after a re-install?

In SQL Server fme_job_history.job_id is not an identity column and I cannot see any hint in sqlserver_createDB.sql

Best answer by larry

The job id of fme_job_history probably comes from the fme_jobs table (and I guess the job row is moved from the fme_jobs to fme_job_history after completion).

If your database is postgres, maybe modifying the sequence fme_jobs_job_id_seq Current Value to what you want should do the trick.

On SQL Server, you should be able reseed the identity column as described here.

On Oracle, simplest way is to drop and recreate the fme_jobs_seq sequence with the correct value.

View original
Did this help you find an answer to your question?

5 replies

david_r
Celebrity
  • October 18, 2017

The job_id attribute in fme_job_history comes from the table fme_jobs, which is an identity column.

From <FMEServer>\Server\database\sqlserver\sqlserver_createDB.sql:

CREATE TABLE fme_jobs (
   job_id INTEGER NOT NULL IDENTITY PRIMARY KEY,
   ...


Forum|alt.badge.img
  • Best Answer
  • October 18, 2017

The job id of fme_job_history probably comes from the fme_jobs table (and I guess the job row is moved from the fme_jobs to fme_job_history after completion).

If your database is postgres, maybe modifying the sequence fme_jobs_job_id_seq Current Value to what you want should do the trick.

On SQL Server, you should be able reseed the identity column as described here.

On Oracle, simplest way is to drop and recreate the fme_jobs_seq sequence with the correct value.


revesz
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • October 24, 2017
larry wrote:

The job id of fme_job_history probably comes from the fme_jobs table (and I guess the job row is moved from the fme_jobs to fme_job_history after completion).

If your database is postgres, maybe modifying the sequence fme_jobs_job_id_seq Current Value to what you want should do the trick.

On SQL Server, you should be able reseed the identity column as described here.

On Oracle, simplest way is to drop and recreate the fme_jobs_seq sequence with the correct value.

Thanks a lot @larry I can prove the SQL Server way. Setting the identity seed of fme_jobs.job_id does the trick.

revesz
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • October 24, 2017
david_r wrote:

The job_id attribute in fme_job_history comes from the table fme_jobs, which is an identity column.

From <FMEServer>\Server\database\sqlserver\sqlserver_createDB.sql:

CREATE TABLE fme_jobs (
   job_id INTEGER NOT NULL IDENTITY PRIMARY KEY,
   ...

Thanks @david_r After all continuing the job_id is simply a little hack in the createDB script:

 

 

CREATE TABLE fme_jobs (
   job_id INTEGER NOT NULL IDENTITY (65487,1PRIMARY KEY,
   ...
to go on with 65487.

 

Might be wort for a knowledge base article with the other databases, too...

 


david_r
Celebrity
  • October 25, 2017
revesz wrote:
Thanks @david_r After all continuing the job_id is simply a little hack in the createDB script:

 

 

CREATE TABLE fme_jobs (
   job_id INTEGER NOT NULL IDENTITY (65487,1PRIMARY KEY,
   ...
to go on with 65487.

 

Might be wort for a knowledge base article with the other databases, too...

 

I agree, hopefully someone from Safe will pick it up (@NatalieAtSafe). Thanks for sharing the solution.

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings