10
votes
1answer
16k views

Stored Procedure to return dynamically created table data

Quick back story, we are working with an outside vendor that has a survey system. The system is not necessarily designed the best in that when you create a new survey and the system creates a new ...
5
votes
3answers
2k views

How to concatenate psql variables?

How can I concatenate two psql (PostgreSQL client) variables? I want to generate an absolute path by concatenating a directory path variable and a filename variable. I've tried this: \set path ...
4
votes
1answer
1k views

Initializing Associative Array in PL/SQL

Using PL/SQL, suppose we've declared a nested table type and its instance as follows: type nested_tab is table of pls_integer; tab nested_tab;. We are then able to initialize our nested table ...
3
votes
2answers
5k views

changing float->numeric casts from assignment to implicit, dangerous?

In porting an application to PostgreSQL (9.1), one odd SQL incompatibility I've discovered concerns the round() function, specifically the version that takes a second argument indicating the rounding ...
3
votes
1answer
790 views

AG and SQL Backups

I am using always on in sql 2012 and have an AG setup. I would like to know if i were to backup the primary database and restore it would that be allowed without taking the cluster down etc. ...
4
votes
2answers
75 views

Deleting NULL results

Currently I'm just trying to delete objects with the Name column being Null from a temp table with the following... delete from #PulledData where #PulledData.Name0 = NULL I've also tried = 'NULL', ...
3
votes
1answer
320 views

Slow-running query on clustered MySQL environment

I've got a very simple query, directly equivalent to SELECT * FROM sometable t WHERE somecol = 'somevalue' ORDER BY createdon DESC LIMIT 0,20000; When I run this query on my non-clustered ...
4
votes
1answer
740 views

MongoDB optimization on high data

I have a mongoDB collection with 42M registers with 1M new registers every day. We found a low performance on mongoDB querying. showing in mongostat the fields: qr|qw ar|aw with values of 300-500. ...
3
votes
1answer
3k views

Management Studio all buttons disabled

I get an odd problem in my SQL R2. Although I can attach a new db to my db instance, but all buttons on the tool menu panel are disabled. So I cannot execute any sql query statements. It is really ...
8
votes
2answers
998 views

How does SQL Server store the information in Job Schedule Properties?

I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the ...
10
votes
1answer
2k views

How do you represent VIEWS in an ERD?

Are VIEWS (CREATE VIEW) represented in an ERD? If so, how do you represent them and specify what tables they came from?
10
votes
3answers
2k views

PostgreSQL Initial Database Size

There are 2 parts to my question. Is there a way of specifying the initial size of a database in PostgreSQL? If there isn't, how do you deal with fragmentation when the database grows over time? ...
2
votes
0answers
347 views

Could not allocate space for object 'dbo.History' in database '[path to mdf]' because the 'PRIMARY' filegroup is full

I have a local project i am working on, on my own workstation. I use a local SQL server as well. The project contains alot of data, and as of now, i just need to be able to store all this data in the ...
2
votes
0answers
424 views

SQL Server SSIS issue retrieve data when i enter into login of server side?

can any one try solve my problem here i am facing a problem Failed to retrieve data when i enter into login of server side here is the error message TITLE: Microsoft SQL Server Management Studio ...
3
votes
2answers
352 views

Writing transactions to .MYD file to take Backup

I'm trying to backup MySQL DB by archiving the data directory of required databases. I'm doing FLUSH TABLES WITH READ LOCK before taking the backup, but even then some of the transactions were not ...
1
vote
1answer
266 views

Merge Replication Snapshot Files

I am using Merge Replication with SQL 2012. I look in the snapshot directory, but the largest file in there is a prc file which is 646 KB. I know for sure that the biggest of my replicated tables is ...
0
votes
1answer
473 views

Drop and restore PostgresSQL database without losing settings

This seems like a simple, easy question, but I'm very new to PostgreSQL administration and I'm not sure of the best way to do things. I have a PostgreSQL (9.1) database that somehow got corrupted ...
5
votes
1answer
621 views

MySQL replication - replicate to multiple DBs on slave?

I've got a single table in a master DB that I would like to replicate to multiple databases on one slave server. Like this: masterDB.tableA -> slaveDB1.tableA masterDB.tableA -> slaveDB2.tableA ...
9
votes
1answer
6k views

postgresql: how do I dump and restore roles for a cluster?

Where are roles stored in a cluster, and how do I dump them? I did a pg_dump of a db and then loaded it into a different cluster, but I get a lot of these errors: psql:mydump.sql:3621: ERROR: role ...
2
votes
0answers
1k views

oracle crash - not starting

We have a Windows Server 2008 R2 Enterprise x64 Oracle 10.2.0.3 Adempiere - ERP We had a power breakdown at 03.00 AM. At 07.30 AM we started the server At 08.00 our colleagues observed that the ...
4
votes
2answers
1k views

Change column data type across database

I have a bunch of tables with many columns of data type ntext. I wish to change all such columns in all tables of a particular database to nvarchar(max), because of planned deprecation (EDIT: also ...
1
vote
2answers
1k views

How do I normalize a database with lots of many-to-many relationships?

I am building a database that is based around a business project, in this case called a "Program." Each Program will have multiple Reports, Clients, and Partners. My first thought was to place each ...
4
votes
1answer
3k views

PostgreSQL tree structure and recursive CTE optimization

I'm trying to represent a tree structure in PostgreSQL (8.4) to be able to query the path from the root to a given node or to find all the nodes within a sub-branch. Here is a test table: CREATE ...
3
votes
1answer
804 views

Table was not locked with LOCK TABLES when recreating an index

I have a weird problem when recreating the index. This is what happens. This is done through JDBC, in Java btw. A table 'stuff' is truncated by a process. The application is reinitalizing a cycle ...
6
votes
3answers
6k views

Should I add an arbitrary length limit to VARCHAR columns?

According to PostgreSQL's docs, there's no performance difference between VARCHAR, VARCHAR(n) and TEXT. Should I add an arbitrary length limit to a name or address column?
7
votes
2answers
12k views

Quick look at how much RAM is allocated to SQL Server?

With SQL Server 2005, you could look at the Task Manager and, at least, get a cursory look at how much memory is allocated to SQL Server. With SQL Server 2008, the Working Set or Commit Size never ...
3
votes
0answers
118 views

Tools for maintaining many dev/test environments on the cloud

The company I'm currently working with is "moving to the cloud" (isn't everyone these days?) In this case, they are moving to AWS, and they want a simple and effective way of managing multiple (SQL) ...
0
votes
1answer
204 views

AlwaysOn SQL Server setup questions

I have a few questions regarding the setup of Always On HA, and Clusters. When you setup an AG, and it gets to setting up your IP address for the cluster how can I switch from using DHCP to a static ...
3
votes
1answer
442 views

Will SYSTEM_USER return the unique user id for users authenticated by Active Directory

I want to set up Active Directory authentication for my users, who will be assigned to specific database roles. I also need to log activity and ensure I have captured the IDs of the indivudals ...
1
vote
1answer
659 views

Mysql Commands out of sync; you can't run this command now

I have a script which is heavily doing select and insert nearly every seconds without fail and the total queries varies from a second to another. Below is the results of running the queries and ...
1
vote
1answer
344 views

Ora - 00088 error: command cannot be executed by shared server

I get this error from the database when I run the query: select status, error from v$archive_dest where dest_id=2; It's a dataguard environment. I have never seen this problem before. I'm not ...
2
votes
2answers
473 views

Help with Vehicle Service database

I am using the Desktop Vehicle Maintenance template in access, but i am trying to cater it towards our farms needs. We will be keeping track of the service's done on Trucks, Tractors, Equipment, etc. ...
0
votes
0answers
42 views

Resource to learn writing most efficient and highly optimized sql queries [duplicate]

Possible Duplicate: Learning to Optimize SQL Queries and Understand Execution Plans - Resources? Can some one point me to a great book/great books or some really solid reference/references ...
4
votes
2answers
4k views

Does order matter for composite primary key in Oracle or any database?

I have a Composite Primary key which is combination of Column1, and Column2. What would be the difference if I have Composite key with Column2, and Column1. Does it even really matter which order ...
5
votes
1answer
467 views

SQL Server: Effect of Setting These Index Options

A reindexing script was recently run in our dev environment that set ALLOW_ROW_LOCK = FALSE and ALLOW_PAGE_LOCKS = FALSE on all the indexes in the database. This was done while testing new reindexing ...
2
votes
1answer
2k views

Reducing DB size while restoring

I have DB backup with size approx. 150 Mb. I am trying to restore it and getting an error: "System.Data.SqlClient.SqlError: There is insufficient free space on disk volume 'C:\' to create the ...
1
vote
1answer
7k views

Cannot telnet SQL Server port 1433

I have Windows Server 2008 with SQL Server 2012 Enterprise installed on it. I disabled the Windows firewall and I'm sure that there isn't another firewall. I cannot telnet my server. I enabled ...
4
votes
2answers
759 views

Poor performance after changing SQL Server 2008 R2 database

Need some tips on what I can do to track down this problem. My client has a modest sized SQL Server 2008 R2 database (approx 6 gigs in size). Last week I modified the database to add new a single new ...
0
votes
1answer
589 views

Unable to restore database in Oracle 10g

I created a database backup using the expdp command in Oracle 10g. The backup appears to be created successfully. However, while restoring using impdp command I get the following error message. ...
6
votes
2answers
27k views

way to prevent queries from waiting for table level lock

We've encountered a problem after moving the database of our customer to an extra server. This should have had positive effects on the site's performance, but there is a problem with table locking in ...
1
vote
1answer
2k views

Install db2 express c on Mac OSX

I have posted the question yesterday, then I was able to figure it out by myself. As I haven't found any complete guide, I'm writing down the steps just in case. So the question is: "How do I ...
1
vote
2answers
742 views

LIMIT to one row per ID

This query gives me multiple hits because of each assetid may contain many vb.title. How can I limit the result to only 1 hit for each assetid? 'select DISTINCT v.id, v.purchasedate, ...
2
votes
2answers
119 views

Long JOINS Returns No result all tables have one to many relationship with a particular table [closed]

I have a Table Enterpries with Primary Key 'RCNO'. All other tables have a one to many relationship with Enterprise via it's RCNO column. I make a Join of all the tables and i get nothing. Below is ...
10
votes
2answers
5k views

SQL Server Decimal(9, 0) vs INT

One of our customers uses for some columns the datatype DECIMAL(18,0) in his SQL Server 2008R2 database. Because the columns grow quite slowly, he recently proposed to change the datatype to ...
0
votes
1answer
263 views

postgresql dump and load — need to dump “postgres” db also?

If I pg_dump a db from an 8.4 cluster, and then load it into a different 9.1 cluster, do I need to pg_dump and restore the 'postgres' db as well? (I'm not familiar with what is contained in the ...
2
votes
4answers
233 views

What free database software support sequences [closed]

I have a requirement that a database must support sequences. I know oracle and PostgreSQL support it. Are there any other free database software that support database sequences? it would be great if ...
2
votes
2answers
2k views

Tempdb autogrowth settings

Following on from a recent question that I asked on Tempdb. I was wondering how to correctly set the autogrowth property when adding and moving the tempdb files? I ask because I would like to let SQL ...
2
votes
1answer
103 views

Want to select distinct from 3 fields

I have a mySQL table with a town_id and 3 categories - cat1, cat2, cat3. I need to be able to come up with a distinct list of all the categories in the table selected by town_id, not duplicated and ...
1
vote
1answer
236 views

db2 express c mac osx

I'm experiencing some troubles with the execution of DB2 express c on Mac OSX 10.6 Snow Leopard. I have installed the db system, creating two users, db2 and db2-user. The latter is the instance ...
0
votes
1answer
4k views

Oracle Forms Runtime error

When I am running a form in Forms 11g http://rahulsingh-pc:8888/forms/frmservlet I'm getting an error: Failure of server APACHE bridge: No backend server available for connection: timed out after ...

15 30 50 per page