0
votes
1answer
2k views

Insert blank row in the postgres query result

I have below table after run a postgres query select * from tbl 1 type_1 name-1 2 type_1 name_2 3 type_2 name_3 4 type_2 name_4 5 type_3 name_5 how can I add a blank line in between each type so I ...
4
votes
1answer
7k views

Postgres function assign query results to multiple variables

I need to assign values to 2 variable as below in Postgres function. a := select col1 from tbl where ... b := select col2 from tbl where ... How can I assign 2 values to 2 variables in one line ...
1
vote
1answer
580 views

Finding rows where a column contains [ and ] characters

I need to get results where the column contains a string that includes [ ]. When I use LIKE, it takes the [] as a wildcard sequence, and doesn't work as I need. For example, I want to search through ...
0
votes
1answer
5k views

Mysql backup from ibdata1, ib_logfile1, ib_logfile0

I accidentally deleted my word press mysql DB. Below is the list of log files that i see in my directory where i am hoping i can get back some of my data. I actually converted the first file ...
0
votes
1answer
367 views

Unique key in SQL Power Architect? Forward Engineering

I want to know if there is a way to create unique keys (not PKs) in SQL Power Architect using forward engineering. I've searched google, saw the tutorials by the software vendor, and checked out in ...
1
vote
1answer
62 views

Open a Oracle 7.3.x database in Oracle 11

Is there any way to open or convert an old Oracle 7.x database into Oracle 11g? Thanks in advance!
0
votes
1answer
211 views

Convert or open Oracle 7.3.x database in Oracle 11 [duplicate]

I have a very old Oracle 7.x database that I need to open or convert to a new Oracle 11g. Here's the content of the old database: control01.ctl control02.ctl control03.ctl findata01.ora finind01.ora ...
2
votes
2answers
3k views

Unable to access sql database with login and password [closed]

I'm writing Windows Service in C# and inside of it I'm unable to connect to the database. This is the question I've asked recently: SqlException: Cannot open database "path\db.mdf" requested by the ...
3
votes
2answers
198 views

Prevent SysAdmin from doing a Database Restore

I am a sysadmin on my SQL Server 2008, and I need to be, but I would like to setup my security on the Production server to prevent me from accidentally restoring to the production database. I ...
0
votes
0answers
36 views

Have a lot of customers -> which design in SQL Server 2008R2 should be chosen [closed]

I have a task and I don't know how solve it :) So, we have a lot of customers who should use SQL Server for their applications. Design is standard and simply: Customer -> Remote Desktop -> ...
2
votes
2answers
2k views

Update one instance of Sql Server 2008 R2 Standard to SP2?

We have one server with multiple Sq Server 2008 R2 instances installed. To support an application we need to upgrade to one instance to SP2. Can we only apply the service pack to the specific ...
0
votes
1answer
249 views

Would you use MongoDB in high-transaction environment? [closed]

using other words: does the one-write-lock-per-database policy (it's not a "bug" but a "feature" by design) affect contention making its usage in certain kind of workloads less then optimal? if not ...
0
votes
1answer
504 views

Select values from 2 tables with same properties

I am using SQL server 2012, running on windows data-center 2012, under windows azure cloud platform virtual machine. I have the following situation : I have a base settings table lets say as ...
1
vote
1answer
783 views

Postgresql streaming replication and wal archive?

We have postgresql 9.1 configured for streaming replication with a WAL archive, and this works great. We would like to use a shared WAL archive so we can restore from periodic base backups. The ...
0
votes
2answers
1k views

High Disk I/0 Issues

Our database has been giving this error occassionally... "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> ...
1
vote
0answers
756 views

DDL trigger AFTER ALTER ON SCHEMA behavior

Can anyone please tell me what's going on here: CREATE TRIGGER afr_alt_trig AFTER ALTER ON SCHEMA cols ora_name_list_t; BEGIN IF (ora_dict_obj_type = 'TABLE') THEN select column_name bulk ...
0
votes
1answer
267 views

Is that possible to group result on 3 months period basis?

I am trying to group results by 3 months period starting by the current month as shown below: row1 15 -- This should contain November, September and October row2 25 -- This should contain ...
2
votes
1answer
400 views

SQL Server Full-Text Search: combining proximity term and thesaurus

Scenario I am developing a full-text search over a products table. The full-text indexed field of th table contains a brief description of the product, the name of the category and the product code. ...
0
votes
1answer
82 views

Is it any good for performance to have master and slave on the same server

There are similar questions on this site, but they mostly cover server failure and data backup aspects. I'm concerned only as far as query performance. If master and slave share the same resources, ...
3
votes
2answers
159 views

Mongodb restrict access on collections level

I'm building a backend system using MongoDB. Now I want to restrict access on certain numbers of database collections to this system. For example I have users, admin_users, pageviews and I want this ...
1
vote
1answer
1k views

Store equations/formula in mysql db table

I want to know what is there a way for storing equations or formula in a DB column. Below is the table where I am storing the machines details(master table). But the last column is what I am worrying. ...
0
votes
2answers
191 views

mysql need help optimizing query

I have a table containing servers logs, and another table containing rules to match certain and drop them. The logs tables contains around 1 million rows, and there are about 20-30 rules. The ...
3
votes
2answers
128 views

Is it suitable innodb_buffer_pool_size for MySQL Master-Slave

I am wondering how to decide the value of innodb_buffer_pool_size for my Master-Slave style database. I have a set of MySQL, 1 x master + 1 x slave. As I know that the innodb_buffer_pool_size is ...
0
votes
1answer
93 views

How to restore SQL Server database to a specific day? [closed]

Suppose I have an SQL Server 2008 which is installed on windows 2008. There is a db MyDb under the instance. MyDb is have full backup every night. Because of storage space on hard driver, only 7 days ...
3
votes
2answers
10k views

SQL Server 2012 Express with Reporting Services

Everywhere I search for SQL Server 2012 Express with Advanced Services, I ended up with this link, http://www.microsoft.com/en-us/download/details.aspx?id=35579, and every time I install it, I do not ...
1
vote
2answers
8k views

How do I get the difference in minutes from 2 timestamp columns?

Can't seem to figure this out. Just need the difference in minutes between 2 oracle timestamp columns. END_TS START_TS ...
1
vote
1answer
654 views

Removing Secondary Replica from SQL Availability Group Causs Large Log File

Due to an unforeseen hardware error, I had to take our secondary replicas down for maintenance. This was really due to a storage issue and, it was decided at a higher level, to purchase a new storage ...
0
votes
1answer
169 views

How to get names form 3 different tables

I have 4 tables to proceed. In table A I have the parameters of columns in tables B,C,D and the names are there. TB_A ...
0
votes
1answer
44 views

Unable to login to MySQL with new user

I currently have a MySQL database which I have added a new user (abbvs) to identified by a password. The users I have: mysql> select user,host from mysql.user; +-------+-----------+ | user | ...
1
vote
1answer
3k views

PG: permission denied for relation <table>

I have ran the following SQL: CREATE USER bspu LOGIN; CREATE DATABASE bsp OWNER bspu; GRANT ALL PRIVILEGES ON DATABASE bsp TO bspu; \c bsp CREATE TABLE users ( id SERIAL PRIMARY KEY, ...
3
votes
3answers
214 views

Joining and filtering two sets of the same table

I guess this is an easy and stupid question. Consider this MySQL purchase table (where p_id is autoincremented): +---------+-------------+---------------+---------+ | p_id | item_id | user_id ...
4
votes
1answer
127 views

SQL Server's BACKUP DATABASE - how to access the original exception?

DECLARE @DbName SYSNAME; SET @DbName = 'MyDatabase'; BACKUP DATABASE @DbName TO DISK = 'C:\MyDatabase.bak' WITH INIT, NAME = 'MyDatabase-FullBackup', STATS = 5; This, sure enough, ...
0
votes
1answer
159 views

Complex Oracle SQL to sum data

I am building a SQL query in Oracle 10g that needs to sum overtime hours for the base table, but needs fields from the parent tables as well. I am looking for the fastest way to build the query. The ...
1
vote
1answer
852 views

SQL Server performance for tables having large number of columns [closed]

I have a requirement where I need to create a table with about 600 columns. Out of 600 columns about 200 columns will be XML columns. Other column will be of other datatypes such as int, varchar, ...
1
vote
0answers
108 views

Migrate from Interbase to MySQL

I need to migrate a big database from Interbase to MySQL, I'd like to have suggestions about free and non-free tools to perform this task. I've found this one: ...
4
votes
2answers
392 views

SQL Server 2012 autoupdate statistics default behaviour

I found, that since SQL Server 2008 R2 there is a trace flag 2317 available. It turns on dynamical autoupdate statistics threshold, instead of default threshold of 20%. So, it greatly improves ...
-1
votes
1answer
83 views

MySQL Replication

i try to search around the internet to find out what's a "Master -> Slave" Replication of MySQL want to do? Can sombardey maby explain it for me? what i can read is what happen are when i have a ...
0
votes
1answer
103 views

mongodb on-premise: will it work?

We are planning to package MongoDB-PostgreSQL hybrid solution in our application that will be deployed on customer site on-premise. It will be packaged as a software virtual appliance. Our reason for ...
2
votes
5answers
3k views

Autogrowth - Percentage Use?

Is it best not to use Percentage file growth for autogrowth settings? The below recommends using percent value growth for databases under 500GB but is this recommended? ...
0
votes
2answers
5k views

MySQL relay log corrupted, how do I fix it? Tried but failed

A MySQL v5.1.61 relay got corrupted when the machine suddenly shut down. I tried to fix it but it didn't work. — How do I fix it? Did I do something wrong? As far as I've read, corrupted MySQL relay ...
1
vote
1answer
194 views

Using OLE DB Source SQL command vs desinging the query using the object tools

In SSIS, we can use the OLE DB Source SQL command to run a T-SQL script on the database and then use the output as the source. For example the a complex query can be wrapped in the OLD DB source SQL ...
1
vote
3answers
582 views

Normalization: 'zip code' as a primary key

I've seen frequently that you should not have all address fields (zip, street, city, state, country, etc) in the same table as your user info table (pk_id, name, email... ). This would be in ...
0
votes
1answer
1k views

How to set up simple database replication using WAMP server?

Just need a little help here about replication. I have an intermediate knowledge in Mysql. And I can't find any simple solutions on web how to establish a database replication in Mysql. All I need to ...
0
votes
2answers
63 views

Amount of memory used by postgres

I am curious as to whether the performance of postgres depends on the amount of RAM available. i.e. will postgres performance(during reads) on several runs get affected by the amount of RAM that is ...
0
votes
1answer
70 views

Creating a MySQL Trigger

I want to create a trigger such that whenever a user is inserted in TABLE A(userid,type) then his "userid" along with some predefined value, depending in his "type", is inserted in TABLE ...
1
vote
1answer
383 views

How to run stored procedure in another database on the same server using a different login?

I have 2 databases (A and B) on the same server. Database A has user ua defined, and database B has user ub defined. I have a stored procedure in A, running as ua, that needs to run a stored ...
1
vote
0answers
207 views

Does a high CPU usage -say 98%- necessary mean the database will be slower?

I have 4 python scripts each running in their own virtual machine. The scripts are accessing a central postgresql database. All scripts are reading from the same table but posting to different tables ...
1
vote
1answer
212 views

Precautions when designing database schema if tables are going to have billons of rows

I am about to start work on telephone dictionary kind of project. Its confirm that there are going to be billions of records in dictionary table, and each entry from this dictionary table may have ...
0
votes
2answers
804 views

Join in same table

I have a table employee +--------+----------+------------+ | emp_id | emp_name | manager_id | +--------+----------+------------+ | 1 | abc | 2 | | 2 | pqr | 3 ...
1
vote
1answer
2k views

Select next and previous rows

I have the following table: CREATE TABLE post ( id bigint primary key, thread_id bigint, is_notice boolean, title text, content text ) I display the list ...

15 30 50 per page