sql - Preventing duplicate jobs in Oracle -
One of our small customers has their own database in which they maintain a small IT team. Occasionally, this small team of IT has to make amendments in their database, but occasionally, they do not verify our script which our company provides for them - and they want to re-create their wish : Use this sometimes leads to a job duplicate, where a member of this team executes the same script as another member.
In my view, even this is due to our client's professionals, it is our responsibility to provide this solution, how can we stop such indignation for our customer?
I have not experienced at all in Oracle I am a JavaScript and a net developer, so you can guess that I have largely lost the problem. But I wanted to do something out of my area, because most people are not really concerned about it here. We lose a good time to fix this database every month; Manually extracting duplicates
Thank you!
A simple log table and a standard script header and footer can help to control database changes Are there.
Add a product to your table like this:
Create a table script_log (id number, description varchar2 (4000), was_successful varchar2 (1) default 'n', create_date Default default sysdate, create_by varchar2 (30) default user, constrained script_log_pk primary key (ID), barrier script_log_ck1 check ('y', 'n'))
All changes are standard tools and Should run using the template. SQL * Plus is usually the best tool for database changes. It is not fancy, and it certainly has some quirks but it can run anywhere and every Oracle professional knows it.
- The header, which probably accepts in a SQL file. Whenever sqlerror exit variable script_id number exec: script_id: = 1; Enter script_log (id, description) values (: script_id, 'first script.'); Committed; & Lt; Add changes here & gt; --Footer, one. The SQL file can also be in. Set script _log is_successful = 'Y' where id =: script_id; Committed; Quick script did
If someone else tries to run another script it will fail with the error:
* Error 1 line In: ORA-0000: Unique obstacle (JHELLER.SCRIPT_LOG_PK) was violated
Going a long way to help manage a simple process and a small scripting changes Could.
But if there is a simpler solution like this in your company, due to the reasons I still do not understand this type of system is not part of the oracle culture.
Comments
Post a Comment