Link to home
Start Free TrialLog in
Avatar of sakthikumar
sakthikumar

asked on

Getting the connected users out.

Hi,

I have an ETL process, that does
disables the triggers in target schema,
completes the ETL process and
enables all the triggers.

My question is, If I disable the triggers, there could be any user, who might
insert some junk data. we need to prevent this.

So, for this situation, what could be the best solution?
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

The only way I know of to guarantee this is to not let users connect during the ETL process.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sakthikumar

ASKER

sdstuber,

you could lock the tables so only the etl process can manipulate them

how to achieve this?
to lock a table so nobody else can do anything
     lock table your_schema.your_table in exclusive mode

to lock a table so nobody else can lock it or modify but can still read it
     lock table your_schema.your_table in share row exclusive mode


for more information,  see the "lock table" command

http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9015.htm#i2064405
We should also point out that you can only lock a table if/when there are no active (uncommitted) transactions.

You may or may not be able to get the lock immediately.  Depending on the apps using the database, it might be almost impossible.
1) Restart database in restrict mode
2) Do ETL
3) Restart db in normal mode

How to do this? Mean,  what commands?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial