All Questions

-1
votes
0answers
82 views

script to startup oracle database [closed]

I found out below script that helps me to start up a Oracle database: set serveroutput on; WHENEVER SQLERROR EXIT SQL.SQLCODE STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "MY_DB" NORESETLOGS ...
2
votes
1answer
218 views

BLOBs storage in a dedicated table

I have a database that has several BLOB columns scattered across multiple tables. Since I am a developer and am looking at making application code writing easier, I wanted to turn these columns into ...
2
votes
1answer
2k views

where is oracle session timezone set?

I have a logging table CREATE TABLE EMAIL_LOGGING ( ID NUMBER(9) NOT NULL, SEND_DATE TIMESTAMP(6) DEFAULT LOCALTIMESTAMP NOT NULL, ...
2
votes
3answers
2k views

How to automate Oracle DB installation (like a 'hands-free' install)?

I installed the Oracle 11g2 'standard' edition using the following zip-files: linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip I used the installation guide by Oracle which I ...
4
votes
2answers
1k views

Postgresql function to create table

I want to create a function in order to create a table with a specific structure pasing part of the name of the table as an argument so the name of the table is t_ . Similar to this: CREATE OR ...
1
vote
2answers
403 views

How can I run a T-SQL Script using SQL Credentials?

I need to develop a T-SQL insert script for use on a remote SQL 2005 Express instance but I would like the script to include the necessary SQL credentials so all the user has to do is execute the ...
3
votes
2answers
125 views

MySql is not optimizing the query properly

I have a table structure as follows : CREATE TABLE `sale_product_inventories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sale_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `size` ...
3
votes
1answer
73 views

Workaround the snapshot isolation in a writable CTE

The postgres docs say: The sub-statements in WITH are executed concurrently with each other and with the main query. Therefore, when using data-modifying statements in WITH, the order in which the ...
2
votes
1answer
188 views

Filter on a window function without writing an outer SELECT statement

Since window functions cannot be included in the WHERE clause of the inner SELECT, is there another method that could be used to write this query without the outer SELECT statement? I'm using Oracle. ...
0
votes
0answers
970 views

Server doesn't listen

I try in Win7 by means of PGAdmin 3 to be connected to a host 192.168.1.8 with the virtual machine with linux. Already which time I receive the message Server doesn't listen The server doesn't accept ...
1
vote
0answers
114 views

How can I generate a usage log? [closed]

I'm trying to automatically generate an events log report in SQL Server that records events including successful login, Create/Delete Account, An Account was Unlocked, Account locked due to maximum ...
2
votes
3answers
239 views

Which is better: one database per application, or just one database? [duplicate]

I ask this specifically for SQL Server, the advantages that I can see for multiple databases are: Logs are smaller (so one runaway transaction cannot cause others (replication etc) to stall) A page ...
1
vote
0answers
237 views

Search for multiple keywords related to separate columns on a single table

Imagine I have a table with the schema shown. Each of the columns represent a searchable collection that I would like to be picked up in the search. I am looking for a method that would derive the ...
4
votes
4answers
5k views

SQL Server 2012 installation silently fails

I am trying to install SQL Server 2012 running setup.exe on 64-bit windows 8. After the "please wait" dialog, the installation center comes up. I chose "New SQL Server stand-alone installation", ...
2
votes
4answers
158 views

When should I use the shrink option

I have seen a lot of blogs stating that shrinking is not a good habit as it will reduce the performance of the system. I agree with all those things it will lead to side effects like fragmentation, ...
3
votes
2answers
614 views

Can I trust the Database Engine Tuning Advisor recommendations?

Our database has become large, and we are trying to optimize performance. Can we follow the recommendations provided by the Database Engine Tuning Advisor by supplying it a .trc file generated with ...
-1
votes
4answers
140 views

Dropping and recreating indexes [closed]

I most often come in a situation where the users move there database from one server to another and immediately after they move they face performance problems(slowness). I somehow manage to rebuild ...
2
votes
3answers
215 views

Drop tables where the last update is over 1 week ago

I can see in PMA that it stores information for every table. I was wondering if there was an SQL query to drop any table in the database that have a last update time of more than 1 week ago?
1
vote
2answers
150 views

Where condition execution sequence in MySQL

I am using MySQL 5.0.88. I have a query like: select DISTINCT party.­id FROM party­ LEFT join party_­identifier AS pi ON pi.­party_­id = party.­id­ WHERE ­(pi.­source_­note=? AND ...
0
votes
2answers
2k views

How to forcibly flush the undo log/tablespace of UNDOTBS1

I'm looking for a way to flush the undo logs so that the UNDOTBS1 doesn't give me an error saying that my tablespace isn't large enough. I tried using a commit, but without success, it still gives me ...
0
votes
0answers
19 views

Where condition execution sequence in MySQL [duplicate]

I am using MySQL 5.0.88. I have a query like select DISTINCT party.­id FROM party­ LEFT join party_­identifier AS pi ON pi.­party_­id = party.­id­ WHERE ­(pi.­source_­note=? AND first_­name LIKE ? OR ...
0
votes
2answers
334 views

mysqlcheck: unknown variable 'max_allowed_packet=100M'

I get the following error when I try to use mysqlcheck, mysqlrepair or mysqlanalyze: mysqlcheck: unknown variable 'max_allowed_packet=100M' I am trying to find whether there are any corrupt tables ...
6
votes
4answers
568 views

How can a database be normalized when an optional field causes denormalization?

Suppose you have a warehouse full of widgets. Each widget in the warehouse is stored in a specific identifiable location within the warehouse. You might have a schema which looks like this: A ...
6
votes
2answers
213 views

Does an index with multiple columns make a similar index redundant?

Let's say I have a table that looks like this: CREATE TABLE Activity ( ActivityID int primary key identity(1,1) , ActivityName nvarchar(10), InactiveFlag bit ) with an index that looks ...
1
vote
1answer
321 views

Percona xtrabackup Prepare Fails

I made a backup and according to Percona it completed successfully. Now I'm trying to prepare it and having the following issue: ./xtrabackup_55 --defaults-file="/etc/my.cnf" ...
2
votes
2answers
1k views

Postgres 9.2 select multiple specific rows in one query

I have a table with three columns, Id Serial. Value real. timein Timestamp. I want to select the values based on a range of days ie. from two days ago until now. The table may contain one or two ...
0
votes
1answer
315 views

Managing version control of Erwin file changes with multiple environments

What is the easiest way to manage three environments (DEV, QA and PROD) within a single Erwin file or multiple Erwin files? The Erwin file is separated by subject area, so I'm not sure reverse ...
1
vote
1answer
42 views

JOIN to read first table and get possible relationship in the second table

Consider a main table as CREATE TABLE groups ( group_id int(11) NOT NULL AUTO_INCREMENT, group_title varchar(255), PRIMARY KEY(group_id) ) ENGINE=InnoDB and a second table for relationship as ...
4
votes
1answer
235 views

How to get a row_number to have the behavior of dense_rank

I have a stored procedure will be used to page through data. One of the requirements of the procedure is to have a parameter that will be used to sort two columns of data, the sorting should be used ...
4
votes
1answer
193 views

Can I decrypt TDE transaction log files for use with 3rd party software?

Is there a way to decrypt TDE log files on disk for use with 3rd party software? I have the original key and certificates. I am trying to use the transaction files with a 3rd party tool in order to ...
6
votes
3answers
3k views

Why do linked servers have a limitation of 10 branches in a CASE expression?

Why does this CASE expression: SELECT CASE column WHEN 'a' THEN '1' WHEN 'b' THEN '2' ... c -> i WHEN 'j' THEN '10' WHEN 'k' THEN '11' END [col] ...
1
vote
1answer
56 views

Generate List of Missing Relationships

I have two tables, CLUSER and CLUSERRX. CLUSER contains all the employees at my company and CLUSERRX contains a list of all the people in CLUSER with a specific workgroup and all of the users from ...
2
votes
2answers
523 views

View column has an 8000 character limit?

In SQL Server 2008 R2 we are using an updateable view to update a varchar(max) column. When we update the column with text and then check the number of characters, it is showing a length of 8000 ...
5
votes
1answer
3k views

Troubleshooting SOS_SCHEDULER_YIELD wait

Running our corporate ERP (Dynamics AX 2012), I noticed our production environment seemed much slower than our development systems. After performing the same activities in both the development and ...
1
vote
2answers
146 views

Is it possible to remove a database server from a cluster resource, but keep it running on the node

I was wondering if anyone knew whether it was possible to delete the cluster resource, but keep all of the disks and sql instance running on the node instead? So if I was to delete the cluster ...
0
votes
0answers
38 views

Cannot run job NT Authority\System error [duplicate]

Executed as user: NT AUTHORITY\SYSTEM. Login failed for user 'domainname\servername$'. I receive this error when I try to run the job. I have full permissions; I have also tried to run this job under ...
2
votes
2answers
231 views

Performance effect of indexing foreign keys

My database is for an HR application with performance reviews and I am interested in whether I should index my foreign key. There are two tables involved. The first is a ratings table with 2 columns: ...
0
votes
1answer
2k views

How to do an in-place upgrade of SQL Server 2005 Express to SQL Server 2008 R2 Express

I would like to upgrade my SQL Server 2005 Express instance which is installed using this command: SQLEXPR.EXE/qs /action=INSTALL /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine ...
2
votes
2answers
290 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
2
votes
2answers
636 views

MySQL version confusion

How is this possible: I installed mysql-5.6.11-osx10.7-x86.dmg which is supposed to be version Mac OS X ver. 10.7 (x86, 32-bit), DMG Archive (32 bit!) But upon SHOW VARIABLES LIKE "%version%"; I get ...
0
votes
1answer
40 views

dimension table with “like” condition

In an effort to scale some existing code, we are removing logic from CASE statements and putting it in dimension/lookup tables. Thus instead of CASE WHEN 'F' THEN 'Female' WHEN 'M' THEN 'Male' is now ...
4
votes
2answers
520 views

How do I turn off ALTER DATABASE script output in VS 2012?

I am using SQL Server 2005 in conjunction with Visual Studio 2012 and a SSDT database project. When I publish my VS project and generate the script to run against my database, VS includes the ...
1
vote
2answers
274 views

Jobs view is not visible to read-only account users

I am the admin of one of the database, and I have created a view in SYS schema using below code which returns the status of the running jobs: CREATE OR REPLACE VIEW CAF_DB_REFRESH AS SELECT * FROM ...
1
vote
1answer
112 views

How would I change this relational model to fit a nosql database?

Because of things beyond my control, I have to switch from a relational database to MongoDB for the advertising platform I'm helping to build. I've got a relational schema sketched out, but I'm unsure ...
2
votes
1answer
50 views

How can I include more query in one query?

These are my tables: tbl_answers => aid qid answer uid dateposted emailnotify namedisplay status isbestanswer tbl_questions => qid question ...
0
votes
1answer
28 views

Separate table by often changed / not often changed data?

I have a application which querys different gameservers, and stores for example if the server is online, and how many players are connected. But of course there is also data which is changed rarely. ...
1
vote
0answers
99 views

Is there a way to generate an execution plan for a stored procedure before executing it?

We have a very large (many millions of rows) table that contains some (few million) rows with invalid values in particular columns. A stored procedure exists to correct the invalid records but it ...
0
votes
1answer
200 views

Does MySQL reserve memory for MEMORY tables based on max_heap_table_size

Currently I have a set of large MEMORY tables, and have previously calculated how much space I believe each will require and assigned max_heap_table_size accordingly so that the sum is not greater ...
1
vote
1answer
148 views

How to achieve this sql server replication scenario?

I want to achieve below illustrated scenario via sql server replication. Client A and Client B are client databases containing same article Table A. This article needs to be published by Client A ...
1
vote
1answer
99 views

Migration of create statement from SQL Server to MySQL

I have a table that have the following table structure CREATE TABLE [dbo].[ASAT]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ASATID] AS ('ASAT'+right('00000000000000000000' ...

15 30 50 per page