How to apply the constraint ONLY to new rows

Hi, Gurus:
   I have one question as follows:
   We need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and  I should apply not null constraint to the columns . However, since legacy system already has data for every table, and old data does not have value for the 2 new columns. If we apply the constraint, all of existing rows will raise exception. I wonder if there is possibility to apply the constraint ONLY to new rows to come in future.
Thanks.
Sam

   We need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and  I should apply not null constraint to the columns .
The best suggestion I can give you is that you make sure management documents the name of the person that came up with that hair-brained requirement so they can be sufficiently punished in the future for the tremendous waste of human and database resources they caused for which they got virtually NOTHING in return.
I have seen many systems over the past 25+years that have added columns such as those: CREATED_DATE, CREATED_BY, MODIFIED_DATE, MODIFIED_BY.
I have yet to see even ONE system where that information is actually useful for any real purpose. Many systems have application/schema users and those users can modify the data. Also, any DBA can modify the data and many of them can connect as the schema owner to do that.
Many tables also get updated by other applications or bulk load processes and those processes use generic connections that can NOT be tied back to any particular system.
The net result is that those columns will be populated by user names that are utterly useless for any auditing purposes.
If a user is allowed to modify a table they are allowed to modify a table. If you want to track that you should implement a proper security strategy using Oracle's AUDIT functionality.
Cluttering up ALL, or even many, of your tables with such columns is a TERRIBLE idea. Worse is adding triggers that server no other purpose but capture useless infomation but, because they are PL/SQL cause performance impacts just aggravates the total impact.
It is certainly appropriate to be concerned about the security and auditability of your important data. But adding columns and triggers such as those proposed is NOT the proper solution to achieve that security.
Before your organization makes such an idiotic decision you should propose that the same steps be taken before adding that functionality that you should take before the addition of ANY MAJOR structural or application changes:
1. document the actual requirement
2. document and justify the business reasons for that requirement
3. perform testing that shows the impact of that requirement on the production system
4. determine the resource cost (people, storage, etc) of implementing that requirement
5. demonstrate how that information will actually be used EFFECTIVELY for some business purpose
As regards items #1 and #2 above the requirement should be stated in terms of the PROBLEM to be solved, not some preconceived notion of the solution that should be used.
Your org should also talk to other orgs or other depts in your same org that have used your proposed solution and find out how useful it has been for them. If you do this research you will likely find that it hasn't met their needs at all.
And in your own org there are likely some applications with tables that already have such columns. Has anyone there EVER used those columns and found them invaluable for identifying and resolving any actual problem?
If you can't use them and their data for some important process why add them to begin with?
IMHO it is a total waste of time and resources to add such columns to ALL of your tables. Any such approach to auditing or security should, at most, be limited to those tables with key data that needs to be protected and only then when you cannot implement the proper 'best practices' auditing.
A migration is difficult enough without adding useless additional requirements like those. You have FAR more important things you can do with the resources you have available:
1. Capture ALL DDL for the existing system into a version control system
2. Train your developers on using the version control system
3. Determining the proper configuration of the new server and system. It is almost a CERTAINTY that settings will get changed and performance will suffer even though you don't think you have changed anything at all.
4. Validating that the data has been migrated successfully. That can involve extensive querying and comparison to make sure data has not been altered during the migration. The process of validating a SINGLE TABLE is more difficult if the table structures are not the same. And they won't be if you add two columns to every table; every single query you do will have to specify the columns by name in order to EXCLUDE your two new columns.
5. Validating the performance of the app on the new system. There WILL BE problems where things don't work like they used to. You need to find those problems and fix them
6. Capturing the proper statistics after the data has been migrated and all of the indexes have been rebuilt.
7. Capturing the new execution plans to use a a baseline for when things go wrong in the future.
If it is worth doing it is worth doing right.

Similar Messages

  • How to use the "identify" feature in new 6.3.1 airport utility?

    how to use the "identify" feature in new 6.3.1 airport utility?
    so you can find the basestations in larger networks?

    There is a workaround, which is to use Airport Utility 5.6.
    I can confirm that 5.6 will run on 10.8.4 Mountain Lion, it will recognize the new 2013 Airport Extreme Base Station (A1521) running firmware 7.7.1, and it will give you access to view the device's Log & Statistics, DHCP Clients, and Profiles.
    Four caveats:
    1) The easiest way to install it is to download the app itself, not an installer or through the App Store. There is a page here where you can download the app: http://coreyjmahler.com/2013/03/08/airport-utility-5-6-on-os-x-v10-8-mountain-li on/ This way, you still have both versions, Airport Utility 6.x.x and 5.6.
    2) When you launch 5.6, you'll get a message saying a newer version is available and asking if you want to update. Click Cancel to proceed into the utility.
    3) When you click the Manual Setup button in 5.6, you'll get a warning dialog that "This version of AirPort Utility doesn't support this AirPort wireless device and might improperly configure the device if you continue to use it. Check www.apple.com/support/airport for the latest version of AirPort Utility." You can click Continue to get into the utility without issue.
    4) You should probably only use 5.6 to view the additional status details. I have not tried to modify and save any AEBS settings using 5.6. There are other discussions here in the forums indicating that attempting to save settings via 5.6 that are no longer available in 6.3.1 will not actually save the settings to the AEBS even if both utilities indicate that the settings are changed. See https://discussions.apple.com/message/22677993#22677993
    So, even though you can't use it to modify settings no longer available in Airport Utility 6.3.1, using Airport Utility 5.6 to view DHCP clients, Logs and Statistics is very useful for troubleshooting network issues.
    PS - There are two ways to get to the DHCP Clients list, neither of which is obvious The first is to go to the Airport pane -> Summary tab and click on the "Wireless Clients:" label in the Summary display. All of the labels from "Wireless Mode:" down on the Summary display operate as links to view/edit the corresponding info/settings, which is also not obvious at first glance. Also not obvious, clicking on "Wireless Clients:" actually brings up a new pane with three tabs: Logs, Wireless Clients, and DHCP Clients. You can also get to the same pane by going to the Advanced pane and clicking on the Logs and Statistics button.
    I hope this is helpful information. Took me a while to find out how to do this.

  • FillBy always fills in the same row in data grid view. How to make it fill in a new row for each click of the Fillby Button? VB 2010 EXPRESS?

    Hi there, 
    I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
    database using the fillby query. 
    It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
    each click of the fillby button. 
    also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered. 
    so actually 2 questions here: 
    1. how to populate a new row for each click of the fillby button 
    2. how to delete records from data grid view after an item has been entered 
    Thanks 
    Vishwas

    Hello,
    The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
    Some examples
    Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
    to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
    The following article with code shows this but does not address adapters.
    Conceptually speaking the code in the second code block shows how to get the new key
    Public Class Form1
    Private Sub StudentsBindingNavigatorSaveItem_Click(
    sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.StudentsBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
    Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
    End Sub
    End Class
    Get new key taken from
    this article.
    Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
    Dim Success As Boolean = True
    Try
    Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
    Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
    cmd.CommandText = InsertStatement
    cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
    cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
    cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
    cn.Open()
    cmd.ExecuteNonQuery()
    cmd.CommandText = "Select @@Identity"
    Identfier = CInt(cmd.ExecuteScalar)
    End Using
    End Using
    Catch ex As Exception
    Success = False
    End Try
    Return Success
    End Function
    In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
    Additional resources
    http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to change the url of "Add New Item" of a particular list in SharePoint 2013???

    Hi Guys,
    How to change the url of "Add New Item" of a particular list in SharePoint 2013???
    I need to redirect it into the page where I have created my Visual web part.
    Please suggest
    Warm Regards,
    Tony Joy

    Hi,
         There are multiple ways to change the form url like javascript, SharePoint designer, custom code, editing default form to have custom web part etc, Please follow the url below that describe diffent methods and steps
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/ec2769a0-683c-4023-8804-b596e4f92a3a/change-default-forms-on-custom-list?forum=sharepointcustomizationlegacy
    Hope it helps!!!
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. Thanks, Ajeet

  • I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    Ntenich,
    If your table has a Header and your Legend text is in the header, it will be picked up by the table.
    Jerry

  • How to apply the Patchset 7 to Forms 6i

    Hi all !!!
    I need install the PatchSet 7 in the iAS Server 1.0.2.2.2 (concrectly at the Forms Server Service).
    I had stopped all services of Oracle, and had applied the patch. But the services of Forms and Reports is missing after.
    Any idea.
    How to appplies the patch?
    Thanks and best regards.
    Carlos Hernandez
    Barcelona (Spain)

    848478 wrote:
    How to apply the latest patch set for all the Installed Modules in 11.5.10.2 along with the Roll up's if any.https://forums.oracle.com/forums/search.jspa?threadID=&q=Latest+AND+Patchsets&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Latest+AND+Patches&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Same shooting, multiple lenses, how to apply the appropriate lens correction when importing ?

    Hello everyone,
    How do you handle this:
    For each camera, i have a default preset i'm choosing manualy and applying when importing my raw files into lightroom.
    I'd like to also add some default lens correction to those presets.
    The problem is that multiples lenses (meaning different corrections) may be applied.
    How to apply the correct lens correction for each file, in the batch import ?
    Thanks for your ideas ...
    Aymeric

    Update your existing develop presets so that the Lens Corrections are checked (see attached screen shot). Select the develop preset in Import dialog. Lr will automatically apply the appropriate default lens profile to each individual image during import.

  • How to relax the constraints of the dependent package

    Updating Multiple Packages
    Packages might have cross-dependencies and, thus, require updating at the same time. The packaging software will enforce a consistent image on the system: If it cannot satisfy the dependencies, the packages will not be modified. If such a dependency exists, you need to relax the constraints of the affected packages.
    The message reported by the packaging software will be of the following form:
    # pkg update [email protected]
    Creating Plan \               
    pkg update: No matching version of package_name can be installed:
       Reject:  pkg://solaris/[email protected],5.11-0.175.0.2.0.3.0:...
       Reason:  All versions matching 'require' dependency
       pkg:/[email protected],5.11-0.175.0.2.0.3.0 are rejected
    how to relax the constraints of the dependent package

    You might also want to review the Solaris 11 documentation:
    Relaxing Version Constraints Specified by Incorporations - Adding and Updating Oracle Solaris 11.1 Software Packages
    -- Alan

  • HT201272 How to reinstall the previous version from new vesion

    How to reinstall the previous vesion from new version?

    Previous version of what ? If you mean iOS then downgrading it is not supported.
    If you mean a particular app then have got the previous version of it anywhere ? If you have then you can delete the current version of it from your iPhone and computer's iTunes, then add the old version to your computer's iTunes via File > Add To Library and then sync it to your iPhone.

  • How to apply TD style only to cells in one particular table

    The "schedtable" class below is applied to a nested table,
    but my syntax for
    the TD applies the rule to the outer table cells as well.
    What would the correct syntax be to limit the rule to only
    the cells in the
    "schedtable"
    Please take a look -
    <style type="text/css">
    <!--
    .schedtable {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-variant: small-caps;
    line-height: 2em;
    border-collapse: collapse;
    .td {
    padding-left: 10px;
    border-bottom-style: inset;
    border-bottom-color: #FF0000;
    border-bottom-width: 1px;
    Thanks

    I owe you one more Os,
    much appreciated.
    "Osgood" <[email protected]> wrote in
    message
    news:fp4fr0$7dq$[email protected]..
    > Ken Binney wrote:
    >> The "schedtable" class below is applied to a nested
    table, but my syntax
    >> for the TD applies the rule to the outer table cells
    as well.
    >> What would the correct syntax be to limit the rule
    to only the cells in
    >> the "schedtable"
    >>
    >> Please take a look -
    >>
    >> <style type="text/css">
    >> <!--
    >> .schedtable {
    >> font-family: Arial, Helvetica, sans-serif;
    >> font-size: 11px;
    >> font-variant: small-caps;
    >> line-height: 2em;
    >> border-collapse: collapse;
    >> }
    >> .td {
    >> padding-left: 10px;
    >> border-bottom-style: inset;
    >> border-bottom-color: #FF0000;
    >> border-bottom-width: 1px;
    >> }
    >
    >
    >
    > .schedtable td {
    > Blah: Blah;
    > }

  • How to apply effects to only a portion of a track?

    I recorded drums through a presonus firepod audio interface and my 2,16Ghz MacBook Pro on 4 different tracks.
    There are some parts on the tracks where i'd like to apply some effects (like am radio kind of effects) but i can't seem to apply it on only the selected part. It seems to apply to the whole track...
    Anyone wants to tell me how to do that?

    To further expand on John's advice...
    One way to do this with automation, is to send the outputs of your drum tracks to an Aux. Then set that Aux track as an input to another Aux track.
    Put the radio effect plug-in on that second aux track, and mute it.
    Using automation, you leave the first Aux track unmuted for the majority of the song, but when that section comes up, you unmute the second aux track, while you mute the first aux track. After the section passes, revert the mute status back to the way it was originally.
    Using automation, you can fine tune this so it becomes seamless...
    Just one of many ways to skin this proverbial cat...

  • How  to find the current item is new

    I create a item ,and diaplay "new" .so I want to know which table I can find the
    "new" identifier. if anyone konw this please contract me .my Email :[email protected]

    If you are referring to where to find the new image itself, that is in the middle tier in the images directory. You can access it by adding /images/new.gif to your base portal URL.
    If you are looking for how to add the new icon to a region, edit the region settings by clicking the pencil in the region heading and go to the attributes tab. Double-click the "new item" in the left selector box to move it to the right selector box then hit Apply and OK.
    If you are looking for the logic where it is displayed, there is a setting on the page group level that determines how many days to display the New icon. The portal then dynamically uses the modify date of the item to determine if the new icon should be rendered. You can query the item views yourself if you want to create your own New logic.
    Rgds/Mark M.

  • How to transfer the information to two new Tungsten E2s

    My husband and I both have Palms.  My husband's Z22 died, and my Tungsten E2 is old and not holding a charge very well anymore.  I have purchased 2 new (used) Tungsten E2s.  I tried synching the new ones to the old ones just by plugging them in and hotsynching but obviously that didn't work....  Now I have 4 accounts on my computer. 
    First, how do I get my husband's information onto his new E2 and how do I get mine onto my new E2 without mixing them all together?  A step by step would be great.  I did this about 3 yrs ago when I switched from my old M model to the E2 but can't remember how to do it and can't find anything on the forum that really applies to this situation.  I've found bits and pieces of the process but I need it all in one place in the right order.  :-)  I know I have to make a copy of something (I'm not sure what or how or where).  What is the step-by-step?
    Then, how do I delete the 2 new blank accounts I set up?  I am just trying to get a clean start for our two new ones.  
    Thanks for your help.
    Post relates to: Tungsten E2

    A little more information for my previous post:
    These "new" devices had been used for teaching purposes and if possible I'd like to retain the applications that are on them, just get our data added into the contacts and calendar.  

  • How to change the constraints?

    I add a JPanel to a JFrame using:
    this.getContentPane().add(jPanel2, new GridBagConstraints(0, 1, GridBagConstraints.REMAINDER, 1, 1.0, 1.0
    ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(110, 10, 10, 10), 0, 0));
    Is it possible to change the properties of the constraint later? How can I change this?
    Thanks on advance!
    P.S. I'm interested on change the Insets.

    One way to do the grid bag thing is:
    <code>
    //I think make clearer objects like
    GridBagLayout gridbag = new GridBagLayout();
    // Create constraints object
    c = new GridBagConstraints();
    //then put in panel
    jPanel2.setLayout(gridbag);
    //or content pane
    getContentPane ().setLayout (new GridBagLayout ());
    //then call adjustments
    c.fill = GridBagConstraints.NORTHEAST;
    c.weightx = 20;
    c.weighty = 100;
    c.gridx = 0;
    c.gridy = 0;
    //So on and so forth
    //Ive never used Insets before but I guess
    //it would go like
    c.insets = new Insets(7,7,7,7);
    //or
    Insets inset = new Insets(7,7,7,7);
    c.insets = inset;
    //hopefully like that
    // then when you put stuff in use
    // something like
    getContentPane ().add (jPanel2, c);
    </code>
    I think you will find this approach alot
    easier to understand and read than the way you were doing it.
    GridBag is fascinating isn't it.
    alot of people avoid it
    but it will really will do lots of wild stuff
    if you have the time to toy with it.

Maybe you are looking for