1
vote
3answers
8k views

Shutdown one node in RAC

I want to shutdown one node in RAC. I did the following steps: Shutdown database instance export ORACLE_SID=mydb1 sqlplus / as sysdba shutdown immediate; shutdown ASM instance . oraenv +ASM1 ...
2
votes
1answer
405 views

Database schema size result differs from file size when exported

I used this query to find out my database size SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY ...
3
votes
2answers
592 views

Scalable DBaaS that can scale to hundreds of terabytes with easy backup and restore

I've gone over many DBaaS solutions, including Xeround (limited to 50G, in memory), NuoDB (currently in beta 7), DrawnToScale (not out yet), MongoDB (in memory), RavenDB (for ASP.NET, but NoSQL) and ...
4
votes
2answers
1k views

SQL Server Memory Paging Issue

We have a dedicated SQL server running Windows Server 2003 R2 Standard x64 SP2 and SQL Server 2005 (64-bit) Standard Edition with 16GB RAM. Every night we're experiencing severe performance issues ...
4
votes
4answers
8k views

How to change a MySQL previous slave to be a master and remove slave status information?

I have a master -> slave configuration where the master failed. I've been able to reset the old-slave to be a master and the old-master to slave from it. Fine. What I can't seem to do is to remove ...
1
vote
0answers
166 views

SQL Server Service seems stuck [closed]

I'm running a stored procedure and it just doesn't finish. Here are a couple of things I have noticed: Normally, the procedure takes 20mins but now it's running for over an hour by now. Normally, ...
4
votes
4answers
10k views

T SQL Table Valued Function to Split a Column on commas

I wrote a Table Valued Function in Microsoft SQL Server 2008 to take a comma delimited column in a database to spit out separate rows for each value. Ex: "one,two,three,four" would return a new table ...
2
votes
2answers
165 views

Which edition of SQL Server express

I am looking to learn SQL server - specifically T-SQL programming, writing stored procedures etc and getting familiar. I had a look at the MS site to download SQL Server express, however it gives me ...
3
votes
1answer
108 views

can sql generate a good plan for this procedure?

I have read that procs that do not always do the same thing per se, will not always have a good plan generated. That is (correct me if I'm wrong), if I have a proc that if the day is even it reads ...
9
votes
4answers
9k views

Aggressive Autovacuum on PostgreSQL

I'm trying to get PostgreSQL to aggressively auto vacuum my database. I've currently configured auto vacuum as follows: autovacuum_vacuum_cost_delay = 0 #Turn off cost based vacuum ...
21
votes
4answers
5k views

Unit testing of stored procedures

I've been considering this for quite a long time now. The basic question is: how to unit test stored procedures? I see that I can set up unit tests relatively easily for functions in the classic ...
1
vote
0answers
179 views

ClientHost for Logon Trigger showing NULL values [closed]

I am trying to create a Logon trigger, in SQL SERVER but EVENTDATA().value ('(/EVENT_INSTANCE/ClientHost)[1]', 'NVARCHAR(15)') is returning NULL values. Why So ?
1
vote
0answers
115 views

XML parsing failed

I'm using a query on a oracle db which extracts values from clobs using the xmltype function and an xpath. Unfortunately the query fails and reports a 'XML Parsing failed'. I assume that one of the ...
2
votes
1answer
307 views

.NET SQL Server Authentication Schema issue

I am currently working on a project for a client. The application is written in ASP.NET C#. The Database used is SQL Server 2008. The project has been to migrate the old Oracle database to a new SQL ...
4
votes
3answers
1k views

Primary key should be chosen so as attributes never change?

I was reading about keys in this DatabaseSystems book - The primary key should be chosen such that its attributes are never, or very rarely, changed. For instance, the address field of a person ...
1
vote
2answers
108 views

Trying to create PostGIS database

I am trying to create a spatially enabled PostGIS database by following the PostGIS documentation. In the short version, i executed, createdb yourdatabase createlang plpgsql yourdatabase But I did ...
10
votes
1answer
9k 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 ...
4
votes
3answers
1k 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 ...
3
votes
0answers
821 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
3k 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
680 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
74 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
288 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
614 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
2k 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
552 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 ...
9
votes
1answer
981 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?
9
votes
3answers
1k 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
265 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
298 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
323 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
213 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
359 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
499 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 ...
5
votes
1answer
3k 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
877 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
829 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
701 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 ...
2
votes
1answer
2k 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
486 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 ...
4
votes
3answers
2k 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?
3
votes
1answer
5k 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
111 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
175 views

AlwaysOn SQL Server setup questions

I just 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 ...
3
votes
1answer
311 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
459 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
246 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
346 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
41 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 ...
2
votes
2answers
3k 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 ...

15 30 50 per page