Protect an auto trail trigger in a database

Let's say i have created a database and i want to distribute a copy of that database to a third party company, in order to fill in some data but not to delete any existing records. If the database contains a trigger, is it possible to protect that trigger
from modifying or deleting it by the third party company? Is it possible to protect the database from deleting any existing records? I guess, if i can protect a trigger, then it is possible.
What is the appropriate way to give a database copy to the third party company? Can i just give them a copy of the mdf and ldf files?

Hi ileve,
According to your description, you want to copy the database to a third party company and prevent the trigger and the data records from being modified or deleted in the third party company side.
If you just want to copy the database once, besides your method of attaching the mdf and ldf files to the server of third party company, you could also back up the database from your server side and restore the database on the server of third party company.
However, if you want to copy the database continuously, you could use transactional replication by setting the property of 'Copy user Triggers' to be 'True' on the articles page of the
publication properties. Besides, you do not have to worry about the modification of database(including the triggers) in the third party company's side since the database will
be replaced with the new database from your side intermittently if you
schedule the snapshot agent to run at a small internal when creating the publication and also
schedule distribution agent to run continuously when create the subscription. For how to set up transactional replication, please refer to the article:
http://sqlserverscribbles.com/2013/06/26/how-to-create-transactional-replication-in-sql-server/
In addition, besides Satish's post, you could also prevent triggers and data records from being modified or deleted by granting specific login accounts only 'public' database role, or just add the database role db_datareader besides 'public' as the following
steps.
1. On the server of third party company's side, open SQL Server Management Studio. In Object Explorer, expend 'Security' folder, and then expend 'Login' folder. Right-click the login, and click 'Properties'.
2. In the 'User Mapping' tab, check the checkbox for the database in the frame 'users mapped to this login' and meanwhile in the frame 'database role membership', make sure that only the checkbox for the database roles(public or public and db_datareader)
are checked.
Regards,
Michelle Li

Similar Messages

  • IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan

    Hi Experts,
    IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
    Vinai Kumar Gandla

    Hi Vikki,
    Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
    changes in distribution often require manual statistics updates as the following explanation.
    1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
    this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
    manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
    2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
    however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
    3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
    every insert.
    So in the case above, we could perform manual statistics updates by
    creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
    https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
    Regards,
    Michelle Li

  • Sys log trigger in cluster database

    Hi Experts,
    We have 3 nodes cluster database. How do we create a sys log trigger in cluster database?
    Do I need to create a system log trigger at each database instance in 3 node(instance) cluster database? or only create one system log trigger in one instance?
    Thanks
    Jin

    A RAC database is a single database with many instances: one database means one logon trigger.
    You just need to create the logon trigger when connected to any instance of the same database.

  • Protect from Auto Clean limit

    On new vision.
    There appears to a limit on how many recordings you can protect from auto clean.
    Anyone know whether this is a (disc) size limit or a number of files limit and if so what it is set to ?

    The message
    Attention!
    Keep your favourite recordings safe by protecting them from auto clean-up.
    You can do this for all programmes and episodes.
    Auto clean deletes old recordings you have watched in order to make room for new content.
    However too many protected items leaves little room for you new ones
    OK
    appears when attempting to project a recording and you cannot protect it.

  • Does anyone know the difference between the Applecare Warranty for the Macbook Pro and the Applecare Protection Plan Auto Enroll 607-8192-B APP FOR MacBook

    Does anyone know the difference between the Applecare Warranty for the Macbook Pro and the Applecare Protection Plan Auto Enroll 607-8192-B APP FOR MacBook

    AFAIK, the difference is that the auto-enroll occurs automatically when you purchase the device and you will have to disburse the cost right there and then. Whereas the other comes in a box, can be purchased separately later and you must manually enroll your device into the system to activate the additional protection. This must occur before the base one year warranty is over.
    So, if you don't want to pay up at the moment you buy the computer, you can wait up to say 11 months and buy the AppleCare warranty extension later. Just be sure to complete the enrollment BEFORE the base warranty is over, else Apple will not honor the extension (all in the fine print). This applies to all devices that offer an AppleCare option: notebooks, desktops, iStuff, etc.

  • Insert, update and delete trigger over multiple Database Links

    Hello guys,
    first of all I'll explain my environment.
    I've got a Master DB and n Slave Databases. Insert, update and delete is only possible on the master DB (in my opinion this was the best way to avoid Data-inconsistencies due to locking problems) and should be passed to slave databases with a trigger. All Slave Databases are attached with DBLinks. And, additional to this things, I'd like to create a job that merges the Master DB into all Slave DB's every x minutes to restore consistency if any Error (eg Network crash) occurs.
    What I want to do now, is to iterate over all DB-Links in my trigger, and issue the insert/update/delete for all attached databases.
    This is possible with the command "execute immediate", but requires me to create textual strings with textually coded field values for the above mentioned commands.
    What I would like to know now, is, if there are any better ways to provide these functions. Important to me is, that all DB-Links are read dynamically from a table and that I don't have to do unnecessary string generations, and maybe affect the performance.
    I'm thankful for every Idea.
    Thank you in advance,
    best regards
    Christoph

    Well, I've been using mysql for a long time, yes, but I thought that this approach would be the best for my requirements.
    Materialized View's don't work for me, because I need real-time updates of the Slaves.
    So, sorry for asking that general, but what would be the best technology for the following problem:
    I've got n globally spread Systems. Each of it can update records in the Database. The easies way would be to provide one central DB, but that doesn't work for me, because when the WAN Connection fails, the System isn't available any longer. So I need to provide core information locally at every System (connected via LAN).
    Very important to me is, that Data remain consistent. That means, that it must not be that 2 systems update the same record on 2 different databases at the same time.
    I hope you understand what I'd need.
    Thank you very much for all your replies.
    best regards
    Christoph
    PS: I forgot to mention that the Databases won't be very large, just about 20k records, and about 10 queriees per second during peak times and there's just the need to sync 1 Table.
    Edited by: 907142 on 10.01.2012 23:14

  • How to read a passward protected excel file with the help of database connectivity tool kit

    hi, i was reading an excel file with the help of database connectivity tool kit in labview 8.0
    i made tabels in the excel file nand made odbc connection and specified the workbbok name.
    now my problem is how to read the same file if i specife a pasword to that excel file ?

    Hi,
    Check out this thread about opening a password-protected Excel file using ActiveX. This should take care of it for you!
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • How to protect password with pdf file in oracle database

    hiiii,,,,i have a form in 6i where i am sending pdf file(by running report) to the other clients in the network,,now my requirement is that i want to protect a password with this pdf file whenevr i run new report ,,wat should i do..
    plz help
    lovely sethi

    [email protected] wrote:
    hiiii,,,,i have a form in 6i where i am sending pdf file(by running report) to the
    other clients in the network,,now my requirement is that i want to protect a
    password with this pdf file whenevr i run new report ,,wat should i do..Why not just rely on OS security withing the server? If you email it to a
    particular individual, then it's protected as far as you trust that individual
    anyway!
    Those who are in the dba group on the server can get at the data
    in any case.
    I just don't see the point in trying to do what you're asking - unless
    I've missed something?
    BTW, you haven't mentioned OS or db version (see .sig).
    Paul...
    lovely sethi--
    When asking database related questions, please give other posters
    some clues, like OS (with version), version of Oracle being used and DDL.
    Other trivia such as CPU, RAM + Disk configuration might also be useful.
    The exact text and/or number of error messages is useful (!= "it didn't work!"). Thanks.
    Furthermore, as a courtesy to those who spend time analysing and attempting to help,
    please do not top post and do try to trim your replies!

  • Not authorised to have auto increment trigger on server

    Hello all. I need a few triggers set up, I have no problems setting up sequences and "before insert" triggers on my home PC setup but on the live server where I study I do not have the authority.
    I got around this before by using Forms so I set the trigger at Form level.
    I am developing a DB system that will at some stage in the future use Forms, but for now it will use HTML forms via a web browser.
    I need to have the primary key for user accessible tables to be auto incremented (on the server where I study), but how can get around the authority issue ??
    Any ideas are extremely welcome !!

    Hello all - yeah I am on a course. I too have no idea why they will not allow the students to create triggers at table level.
    The 1st system I developed at home I had auto incremented primary keys. It was using Oracle Forms as the front end. Because I am the admin on my home setup I didn't have any problems.
    When I went to the course site to implement exactly what I had at home (which worked 100% properly) inserting data via the forms was not working. I had no idea why. the lecturer guy took a look at my code and told me its because of the trigger, I do not have authority to create triggers on the server.
    "create or replace trigger cust_trg
    before insert on customer
    for each row
    begin
    select cust_seq.nextval into :new.cust_id
    from dual;
    end;"
    The above code works fine on my home PC. I used Pre Insert triggers on the block on the Form instead to get around the problem (I presumed it was because they wanted us to learn Forms more thoroughly).
    This next project does not involve forms but they will not change my access rights so I don't have a clue as to how to get an auto incremented primary key whilst using a HTML form.
    Kevin

  • Auto increment trigger

    I have a table with an index and two other columns. The first column is called index.
    What I would like to do is to auto increment the index column on every insertion. I have read some of the documentation and can't make sense of what I am trying to do. Please point me to an example.
    WBR

    I tried these 3 statements to create a auto update column:
    CREATE TABLE TIME_TABLE (
    RECORD_NUM INTEGER NOT NULL,
    DATE_FIELD DATE,
    DESCRIPTION VARCHAR(1000));
    CREATE SEQUENCE TIME_SEQ START WITH 1 INCREMENT BY 1;
    CREATE OR REPLACE
    TRIGGER TIME_TRIGGER BEFORE INSERT ON TIME_TABLE
    FOR EACH ROW
    BEGIN
    SELECT TIME_SEQ.NEXTVAL INTO :NEW.RECORD_NUM FROM DUAL;
    END
    When I execute an insert statement I get the following error:
    An error was encountered performing the requested operation:
    ORA-04098: the trigger ‘TIME.TIME_TRIGGER’ is invalid and failed re-validation.
    So my question is what is wrong with the three statements. I would appreciate some help.

  • Applecare Protection plan - Auto enroll ????

    I have a Brand New Applecare Protection Plan..
    It has 'APP FOR MAC - AUTO ENROLL ONLY' wrote on the underside of the packaging..
    What does this mean?
    Can i register this on a new Mac?

    it might mean you can only use it if your mac is fairly new. im not sure though

  • Trigger - Execute once database started.-

    Hi, It's possible to start trigger once database started even before any DML activity take place.
    Basically I need to check & update existing record for with certain condition then update the data.
    I should not do this manually using a procedure,... but instead a trigger have to do it automatically.
    Is this possible,... does Oracle update any table when it starts up.? Maybe I can use that.
    Please help..
    Thanks in advance.
    E.G
    CREATE OR REPLACE TRIGGER check_warehouse
    AFTER UPDATE
    FOR EACH ROW
    DECLARE
    BEGIN
    IF :new.employee > '4000' THEN
    .. ...update... ok='false'
    else
    ... set ok='True'
    END IF;
    END;

    I don't think you need this at the database level. You may want to do this check in BEFORE UPDATE or BEFORE INSERT Table level trigger

  • Creating a Trigger and some Database Design

    Here is the scenario, we have the following tables
    Orders, OrderDetails, Products, ProductsToInventory, Inventory, and InventoryDetails
    Orders is where the orders are saved and their details are in OrderDetails (orderdetails has a column called Type and that type can either be a product, inventory, shipping, fee, so that we can distinguish what each one is in the order)
    Products are the products we sell and ProductsToInventory refers each product to the inventory items required for it.
    Inventory lists the the name, size, and weight of the item
    then InventoryDetails stores the cost, original quantity received, and the current quantity (since the company receives different quantities of the same product at different pricing all the time)  (I would appreciate all the comments on this, this is
    the best way I thought of doing this but if you have another way i'd appreciate it)
    So that's the design, now we created a trigger that basically does this...
    When an order is created and a PRODUCT is inserted into the the orderdetails, we will, using trigger, run the following query to insert the INVENTORY into the orderdetails
       INSERT INTO OrderDetails (...., OrderDetailPrice)
       SELECT ..., OrderDetailPrice?
        FROM inserted i INNER JOIN ProductToInventories pt
        ON i.productid = pt.id
        INNER JOIN Inventories inv
        ON pt.InventoryID = inv.InventoryID
        LEFT JOIN InventoryDetails idet
        ON inv.InventoryID = idet.InventoryDetailInventoryID
        WHERE OrderDetailType = "PRODUCT"
    This works perfectly fine, however... for the price, we don't know what to do here, since the price is not in the inventory, the price is  under the inventorydetails and we will have to look up to that table to see which one has quantity > the quantity
    needed here and then grab the price for that and then we need to update the quantity on that as well.

    Here is the scenario, we have the following tables
    Orders, OrderDetails, Products, ProductsToInventory, Inventory, and InventoryDetails
    Orders is where .....
    Good day TheSQLNewb,
    I did not read more than I quote above... This is a starting of a nice story :-) but in the forum and in DBA's life we prefer to get DDL+DML instead of stories.
    Please post queries to create the relevant tables (this is DDL by the way), and queries to insert some sample data (DML). with this information we will be able to reproduce the tables in our server and work on them.
    Thanks :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Auto format textfile exported from database

    Hello, Im working as a graphic designer and I just got a hard assignment. Im making sort of a catalogue with lots and lots of diffrent clubs listed. I get a textfile with all the information delivered like this:
    2320#CITY#1#Number#CLUB
    2320#CITY#1#Chartrad#Mars 1953
    2320#CITY#1#Charterpresident#53-54 N Lastname
    2320#CITY#1#Address#Location#Street1###zipcode#City
    2320#CITY#1#Meeting time#Day#12:00
    2320#CITY#1#Phone#xxxx#xxxxxx
    [email protected]
    2320#CITY#1#Webpage#http://www.gamlegamle.com
    2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
    2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
    2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
    2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
    The goal is to automate the process of formatting it. The first three columns are not going to be in the catalogue (2320#CITY#2#).
    This is what I want to achieve:
    http://forumbilder.se/DC7GU/formattest
    I´ve managed to import it to excel and get it a bit less overwhelming. The idea Im working on right now is to try and format it in excel and then import to indesign and link the styles.
    Any ideas?
    //Oscar Norling

    Normally you can export data from a data base and transform it, like adding or trunceting text elements, formatting numbers, time and day and such things are best done upon file export from FileMaker or Access or whatever you use.
    Another possibility is exporting from a DB as XML. For InDesign you will need to transform that information with a XLST rule and you can import that transformed XML file into InDesign and tag XML tags to text styles in InDesign. If you cannot handle the export from the DB of the client I would choose this way.
    If you are the owner of the DB or at least have direct access to it you could consider the use of a special plugin which connects InDesign to the DB. With this solution you could rewrite changes from InDesign to the DB. This could be useful as you detect errors or you can make changes in the document and you want to repair that information in the DB for later use.

  • Auto triggering trigger

    How can I create a trigger that executes on a certain day of a month?

    what would the trigger be on and do?
    I guess you will need the get the day from sysdate and only execute the code if it was the required date, but it would still fire each time the action occurs.

Maybe you are looking for

  • Can i get current date in XSL FO customized file with Apex 3.0??

    Hi Oracle staff, i have a problem with the insert of current date in customized layout's XSL FO file.. I have just tried to insert current-time() function and js scripts....but nothing.....PDF,Word or HTML output file that's printed by Bi Publisher d

  • Down load webi report in excel with images

    Post Author: anshubit CA Forum: WebIntelligence Reporting Hello Everybody, I am facing issue in downloading webi report in excel with images. I am not getting any image in the wei report which are there in ANY part of it . like header, body and foote

  • Adding to an Existing Group

    Hi I need to add a frame to a group without altering the group's UID. At the moment I can only do it by ungrouping first and then creating a new, bigger group, which of course has a different UID. The documentation for kGroupCmdBoss shows that it has

  • Select only the last 12 months

    Hi all I need to write a query that will select only records from the last 12 months, order them by customer ID, and show one column per month, and a Total column where I need to add monthly Values. The table has the following fields •     YearMonth

  • How to get iTunes to auto delete TV episodes that have been watched?

    Never had a problem with this until recently, so I'm wondering if the recent iOS update or iTunes updates changed it. I buy episodes of TV shows via iTunes. When I sync my iPad, the oldest 5 unwatched episodes of a show are copied to my iPad because