Questions tagged [data-integrity]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
6answers
2k views

How to prove the lack of implicit order in a database?

Recently I was explaining to colleagues the importance of having a column by which to sort data in a database table if it is necessary to do so, for example for chronologically-ordered data. This ...
17
votes
1answer
15k views

How do I store phone numbers in PostgreSQL?

Let's assume I want to store phone numbers in a database. I may accept phone numbers from outside of the United States. How would I go about storing these phone numbers?
14
votes
2answers
2k views

Modelling constraints on subset aggregates?

I am using PostgreSQL but I figure most of the top-end db's must have some similar capabilities, and moreover, that solutions for them may inspire solutions for me, so don't consider this PostgreSQL-...
14
votes
1answer
30k views

Use of log_bin_trust_function_creators in MySQL

What is the use of log_bin_trust_function_creators? Also, Is the value of the parameter dynamic? Will it change if I restart my MySQL service?
13
votes
5answers
6k views

eCommerce orders table. Save prices, or use an audit/history table?

Im designing my first eCommerce schema. I've been reading around the subject for a little while, and am a bit confused about the relationship between an order_line_item and a product A product can ...
11
votes
1answer
1k views

What is the actual lowest possible positive REAL number

MSDN says that the range of REAL numbers is - 3.40E + 38 to -1.18E - 38, 0 and 1.18E - 38 to 3.40E + 38. Apparently the true lower limit is much lower. The following script populates a REAL column ...
9
votes
2answers
5k views

How to add a check constraint in Postgres without locking the table?

I would like to add a check constraint to a very large table. Something like: ALTER TABLE "accounts" ADD CONSTRAINT "positive_balance" CHECK ("balance" >= 0); Unfortunately PostgreSQL 9.3 blocks ...
7
votes
4answers
20k views

When is it safe to disable InnoDB doublewrite buffering?

MySQL InnoDB allows us to disable doublewrite buffering by setting innodb_doublewrite = 0. Other databases doesn't seem to allow this setting to be tweaked. How could InnoDB still be able to maintain ...
7
votes
2answers
996 views

What is the difference between integrity and consistency?

Whether I read about CAP or ACID, I see that consistency is referred to ensure the DB integrity constraints. So, I do not understand, why two terms are used to refer the same thing or there is a ...
5
votes
1answer
4k views

Cross-database foreign keys vs. database design best practice

MySQL allows to create cross-database foreign keys - but is it a good method of ensuring data integrity? Is it possible to give a general answer or is it project-dependent? What are the advantages and ...
5
votes
3answers
76 views

Constraining data based on related data in a different table. Should this be done on the database level or the application level?

I am working on a database that contains our customer information as well as information about our vendors. Part of that includes matching our customers with our vendors, the account numbers those ...
4
votes
3answers
254 views

Maintaining integrity between 3 tables when reference could be through or direct

Say we have the following 3 tables: tUsers (ID, name, countryID, regionID) ------ 1 | Joe | 1 | 1 2 | Sue | NULL | 2 3 | Bob | 2 | NULL 4 | Amy | NULL | NULL tCountries (ID, ...
4
votes
2answers
85 views

A table with all fields NULLable with important, sensitive data

I have a requirement for a database table to hold sensitive patient information about their lifestyle (alcohol/ drug use / injecting etc). On screen the information is sectioned into tabs - "alcohol",...
4
votes
1answer
3k views

Complex constraint across all data in a table

We have a table to record processing that occurs on a system and we need to ensure that only a single row has an 'in process' status. I want to ensure that the result of this is always either zero or ...
4
votes
3answers
5k views

Verify that postgres 9.3 db has no corruption

I have a postgres 9.3 db running on ubuntu server. About a month ago we've had some problems with the hardware on the server which was resolved by our VPS hosting company. The problem was resolved ...
4
votes
1answer
209 views

How can I enforce data integrity in this model with a M:2 relationship?

This model describes a part of my database (somewhat simplified): A "Tumor model" describes an experiment a researcher does on animals. The "Animal line" is a breed of lab animals, e.g. a Black 6 ...
3
votes
1answer
155 views

Is there any name for common sense / knowledge integrity constraints?

The Wikipedia page on data integrity lists 4 types of integrity constraints: entity integrity, referential integrity, domain integrity, and user-defined integrity. Is there a name for integrity ...
2
votes
1answer
935 views

How to conduct integrity test on SQL Server database backup file?

I was assigned to check the integrity of database backups from sql server every two weeks. I'm new in this field so I don't know how to correctly do this task. If someone(hacker) modified the data ...
2
votes
1answer
88 views

How to guarantee rows order

I'm trying to implement a methodology to check the integrity of a restored database. It goes as following: Create a snapshot of the database. Gather various metadata: On disk used space. Name of ...
2
votes
1answer
1k views

PostgreSQL 9.2 tstzrange null/infinity CONSTRAINT CHECK

I'd like to limit a PostgreSQL 9.2 tstzrange to valid dates at both ends. No NULLs nor 'infinity'. Various revisions of this SQL isn't constraining '-/+infinity' input: CREATE TABLE bill ( id ...
2
votes
1answer
1k views

CheckDB error 9003 SQL server 2014

Currently I am restoring SAN snapshots to another server nightly and running weekly checkdbs on that test server. The checkdb is throwing the following errors. The log scan number (105217:402:0) ...
2
votes
1answer
153 views

Is there any point in specifying the precision and scale of a number for a foreign key?

I am running Oracle 11gR2 11.2.0.3. I have two tables: table1 contains a column named SUBJECT_ID, whose datatype is NUMBER(7,0) (numbers range from 13 to 48480) table2 contains a a column named ...
2
votes
1answer
1k views

How to verify a SSAS Backup and how to perform Integrity Checks in SSAS?

I have a procedure to backup SSAS Databases that is working successfully. I also delete the SSAS backup files that are older than 2 days. What I am looking forward to implement is: 1) How to verify ...
2
votes
1answer
196 views

Reformatting master MySQL server and temporary solution

We have MySQL master and replication servers both running on different machines. We have noticed some system files showing integrity issues in the master machine. Temporarily we would like to make the ...
2
votes
1answer
854 views

How do I ensure consistent MySQL backups?

How can we ensure MySQL backups are consistent when they are taken as full backups as well as incremental backups using binlogs? According to me, I record the COUNT(*) from random tables after ...
2
votes
1answer
1k views

How do you verify that all InnoDB tables are in good shape?

Without using a script, Is there a way to get mysql to check all the tables at once to make sure they're not corrupted?
2
votes
0answers
45 views

Can a database for teams, activites, markers and outputs be structured without data redundancy?

There are many TEAMS that engage in ACTIVITIES in a many-to-many relationship with TEAM_ACTIVITIES as a joining table. Each ACTIVITY has a set of MARKERS that are used to track each team's progress in ...
2
votes
0answers
266 views

How to verify replication data integrity in SQL Server when using external replication engine

I am looking for a way to verify that data I am replicating between SQL Server databases is making it to the destination OK. Data is being replicated using an external replication engine, no built-in ...
1
vote
2answers
40 views

What can cause what appears to be missing data in a single table [duplicate]

I have a situation where it appears as if I've lost data in a single table. I have a .NET Core API, with a logging middleware. This middleware takes the entire request and response and stores in the ...
1
vote
1answer
104 views

How to prevent null foreign key during database normalization?

I'm rather new to databases and am having a hard time trying to figure out how to structure my database. This database contains students, classes and all their grades both overall and in categories (...
1
vote
1answer
79 views

Enforce Data Integrity without a direct Foreign Key relationship

I have a new table that will have a column named County_Codes. I would like to enforce that data to a list of County_Codes from another table named Institutions. However, due to this being a legacy, ...
1
vote
1answer
63 views

Understanding how relationship sides works

So, I have this relations on my tables (see image) and I need to understand some things. I'll enumerate what I understand and what I need from yours is to say if I'm right or not and in case I'm not ...
1
vote
1answer
33 views

Data Deplucation and relationship integrity [closed]

I apologize in advance as this question is likely to be more on the theoretical side, with (hopefully) a fair bit of discussion. This is the scenario: We have Salesforce and a multiple local ...
1
vote
1answer
44 views

Alternative to MS Acess for in-house user database [closed]

I am a working student at a bank and my current task is to create an in-house database for customer-specific lookups which often rely on complex underlying data aggregation from different sources. I ...
1
vote
1answer
104 views

How to Remedy Inconsistent MySQL Replication SYSDATE Value

When using master-master/master-slave replication in a MySQL environment, there's a possibility of creating inconsistent data when SQL statements use the sysdate instead of a hardcoded time in their ...
1
vote
1answer
910 views

Diffrences between master and slave replication in mysql?

In a database named asterisk, there is a table named cdr which was partitioned on the time field. mysql> show create table cdr; Create Table: CREATE TABLE `cdr` ( `gid` bigint(20) NOT NULL ...
1
vote
1answer
58 views

How can i enforce data integrity in this setup? [duplicate]

I have these tables: |-------------tblSchool -------------| | + ID | | + Name | | | | ...
1
vote
1answer
968 views

Is SET INTEGRITY of any use after IMPORT statements, or just after LOAD statements?

I'm getting the feeling, both from documentation and empirically, that you can only put SET INTEGRITY to good use after a LOAD, not after an IMPORT. LOAD is mentioned for SET INTEGRITY, but not IMPORT....
1
vote
2answers
57 views

Association Tables and Data Integrity

I'm developing a solution related to classroom materials. The hierarchy for classes is as follows: Course Type (e.g., Car Courses) Course (e.g., Fixing Cars, Driving Cars) Class (e.g., Fall ...
1
vote
1answer
31 views

Data integration name of best practices to avoid corruption, caused by becoming out of sync?

I have identified an issue in the design of a system and I am trying to find the right language to describe the cause of the issue so I can report it to managers, and get the issue fixed. The problem ...
1
vote
1answer
251 views

MySQL: Overlay modifications on original data while indexing on a field that itself has modifications

I have a MySQL table of original_data that is important for historical/auditing purposes and should not ever be changed. I want to be able to mark up these data with modifications, e.g. to correct ...
1
vote
0answers
213 views

MySQL: Fixing Unique key constraint violation

I have a database with an unique key constraint. When I import this database from a dump created by mysqldump I get '14698-3' for key 'UNQ_CATALOGS EARCH_FULLTEXT_PRODUCT_ID_STORE_ID' But when I ...
0
votes
1answer
258 views

Changing a column datatype from INT to BIGINT

I have a large, partitioned table with a field in that needs to upgraded from INT to BIGINT. My intention is to detach each partition, make the change and then re-attach, using something like this: ...
0
votes
1answer
542 views

how I can create check sum to validate no changes at int string pairs on table

Business case is. 1)Users print document on paper 2)users carry printed paper to Boss, Boss sing on paper 3)after that users going to administrator to digitally sign that paper. My task is to help ...
0
votes
1answer
24 views

Database system checksumming to prevent network corruption not caught by TCP checksumming

Since TCP checksumming is not sufficient to detect/prevent all corruption, do modern database systems (e.g. SQL Server, MariaDB / MySQL, Oracle, etc.) use any additional checksumming of network ...
0
votes
1answer
37 views

Database design - logging of same value when recorded in multiple tables

I need to record changes to a particular value, which is read as part of multiple events that are all separately tracked, and be able to view a log of all of the values later. I think an example will ...
0
votes
2answers
130 views

Test/Verify Log-Shipping Backup

We recently suffered a power/connectivity outage at a data center housing two PostgreSQL 8.4 secondary servers, that remotely back up our two primaries via log-shipping replication. Backup power kept ...
0
votes
1answer
137 views

Check and trigger constraints [closed]

Suppose a DB contains two tables A and B as given below: A --------------------- id SERIAL id_b INTEGER -- NOT NULL reference to B.id ts_update TIMESTAMP B --------------------------...
0
votes
2answers
86 views

Is unique index combined with a “not null” constraint equivalent to a PK constraint?

I have these legacy table definitions (from here): CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, -- lots of other columns CONSTRAINT [PrimaryKey_GUID_HERE] ...
0
votes
1answer
125 views

Is it safe to use “NOT BLOCKING” option on HSQL backup?

The HSQL documentation has the following to say about the "NOT BLOCKING" option on backups: Hot backup is performed if NOT BLOCKING is specified. In this mode, the database can be used during ...