Tag Info

Hot answers tagged

5

This is a terrible way to take a backup. Why aren't they using, uh, backups? Not just because they don't require that you take down the entire instance. If you just stop the instance, there isn't really a guarantee that the MDF/LDF files will be detached gracefully. So just because you are able to copy them, does not mean they are good. Having the service ...


3

Congratulations, someone has reinvented EAV (Entity Attribute Value). Please study up on the subject with them. The short form is: one or more EAV tables can be useful in certain specific cases, usually when accompanied by other tables, but you lose most of the benefit of a relational database when you move to them. I would also ask: If someone wants to ...


3

As you found, you have to use '' to represent a single quote ('). You do not need to use the SPACE() function: select replace(character_column, '''', '') from your_table Note: Using SPACE() could actually create an issue as it returns VARCHAR(4000).


3

Redundancy does not mean: Columns that have the same data type Columns (or rows) that have the same data value (if this is coincidental) Columns that are foreign keys that link a child table to its parent (including the same data value as FK and PK in the respective tables) Redundancy is not about columns or rows for that matter. Redundancy is about ...


2

Check out Brent Ozar's sp_blitz. Also check out Glenn Berry's SQL Server 2012 Diagnostic Information Queries


2

If you've dropped all the tables, you could just drop the database and re-create it. It will be created with the default sizes and growth rates as defined by the model database. These may not be ideal (I don't find the defaults particularly useful in most scenarios), but you can change them. Unless you have a lot of things set up on this database (like ...


2

If audit is enabled, you can check DBA_AUDIT_SESSION/USER_AUDIT_SESSION (More info about auditing - Audit doc). Another option is to check dba_hist_active_sess_history - you will need to write a query that counts distinct serials/sessions to get rough number of user logins assuming user did anything during the session. Also, you won't be able to go too far ...


2

If you have locked yourself out then you need to do the following: Stop your MongoDB instance Remove the --auth and/or --keyfile options from your MongoDB config to disable authentication Start the instance without authentication Edit the users as needed Restart the instance with authentication enabled


1

You've left out so much that your chances of recovering useful data are negligible. pg_clog contains the commit/rollback logs. Without these, the system doesn't know which parts of the database files are valid and which are not. (gross oversimplification, but hey). pg_xlog, the write-ahead logs. Without these, the database can't handle incomplete writes, ...


1

to deiced if schema design is good or bad what you should ask yourself is "what different types of query i will use against schema to access this data". good or bad is very subjective and based on our own experience we can do educated suggestions but most accurate thing will be what is your business requirement. start from looking at most frequent ...


1

Relational databases are designed to ensure data structure complexity and flexibility. Having all records in a single table can IMHO mean two things - a bad design, or you don't need a database at all. Why not just use an Excel table then? The example you provided shows that you want to store people and their houses, colors, etc in the same table. Having ...


1

In your attempt: SELECT id FROM "players" where "players".born_on < "1950-01-01"; Then DELETE FROM "players" WHERE "players".id = 5; DELETE FROM "stats" WHERE "stats".player_id = 5; DELETE FROM "photos" WHERE "photos".player_id = 5; ... repeat First, I don't understand the "...= 5;" one each the subsequent deletes. What is the 5? But....what if ...



Only top voted, non community-wiki answers of a minimum length are eligible