1
vote
1answer
6 views

Finding opening and closing price using sqlite GROUP BY statement (accessing main query alias in subquery)

I want to preface this post by saying that I am a SQL(ite) newbie. My main goal is to find the opening/closing/high/low/average prices of each 5 minute interval of these stock prices. I can get the ...
12
votes
8answers
2k views

T-SQL : Is string a Palindrome?

I am a beginner in T-SQL. I want to decided whether an input string is a palindrome, with output =0 if it is not , output =1 if it is. I am still figuring out the syntax. I am not even getting an ...
1
vote
5answers
312 views

Replication in same server within different databases. Mysql 5.6

What I have : a windows machine with one instance of MySQL 5.6 Server. two database named test and test2. Test database has a table called activity with columns id and class What I need : ...
2
votes
1answer
652 views

SQL Server 2014 Avaliability Group DbMgrPartnerCommitPolicy

I have an environment with 2 Windows Server 2012 R2 servers, both with SQL Server 2014 Expensive edition. Whenever a change happens in the AGs (such as: AlwaysOn Availability Groups connection with ...
0
votes
1answer
24 views

comparing left join and outer apply doing the same thing

I have an update trigger on a table that that insert rows in another database/table the query look like insert into otherdb.table select manyfield from inserted left join (select id, ...
0
votes
0answers
8 views

Tools to compare two versions of the same database

Does anyone know of other open source tools similar to sqldiffframework that are either in active development or that are written in Java? The assumption is that the schemas are identical but the ...
0
votes
0answers
20 views

Not able to see systemViews

I recently installed SQL 2016 RC3 and latest version of SSMS (april 2016 preview).Today i subsribed to Azure S0 database .When i tried to check system views in Azure and in my local database ,i am not ...
1
vote
1answer
807 views

Sync MySQL with SQL Server 2008

My current project requires a form on my website to populate a table in a MySQL database with data a user submits via the form. This will work great but my complete goal involves getting that data ...
0
votes
0answers
5 views

How to set mysqldump using /*!40101 SET character_set_client = utf8mf4 */;?

When I use mysqldump to export mysql database, it always produce a dump.sql containing ...some other things... /*!40101 SET character_set_client = utf8*/; ...some other things... This is the ...
0
votes
0answers
2 views

Cant initialize MySQL. “mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended”

I am doing a fresh install of MySQL on Fedora 22. After I run mysql_install_db I try to start the daemon using mysqld_safe but it does not work. The system says: mysqld_safe Logging to ...
0
votes
1answer
157 views

pg_get_viewdef error while running pg_dump in PostgreSQL

Occasionally, I get the following error while doing a simple pg_dump ( pg_dump -U postgres -Fc -f mybackup.dmp mydb): pg_dump: [archiver (db)] query failed: ERROR: could not open relation with OID ...
1
vote
1answer
15 views

Add variable value in single quoted string. Expand variable within single quotes

I have tried different variations of the below commands but non work. I simply want to run the following command using a variable within the location string: CREATE TABLESPACE data OWNER appuser ...
1
vote
1answer
40 views

Two tables with the same primary keys

Can two tables have the same primary keys? For instance:
-2
votes
1answer
15 views

pick data from multiple tables

I am new to MySQL. My question is how to make a filter like amazon product. I made a matrimony site with filter. I wrote a query to access data from multiple tables. I give foreign key to another ...
0
votes
2answers
59 views

Mongodb monitoring

I am using a mongodb in my application and i would like to ask if someone here has some tested tools to monitor the servers (similar to tools like heidi sql or mysql workbench). My main needs are ...
0
votes
1answer
102 views

Oracle: Replace corrupted first datafile

A datafile associated with a tablespace has been corrupted (got truncated to size 0). I don't mind losing the data, because I have a full DB dump which I can import. Now I want to replace this ...
2
votes
1answer
202 views

Opening an Oracle database with a corrupted redo log

I have a database that is not open. And I have a redo log that is corrupted. What would be the best way for me to open the database? This is a testing db and I am not concerned with data loss - but I ...
0
votes
3answers
42 views

How to check if range between two numbers is available in table of ranges

I have following table of number ranges Create table Ranges { Id int identity(1,1) primary key, RangeFrom int not null, RangeTo int not null } Insert into Ranges(RangeFrom, RangeTo) VALUES ...
1
vote
2answers
194 views

Recovery from datafiles

Thanks to the recent weather/floods, we lost many of our servers. This included our central database server as well as the server that holds our backups. The database server was running Oracle 12c ...
0
votes
2answers
199 views

ORA-01113: file 1 needs media recovery — system01.dbf

The only way to recover is from media backup? I know I cannot "rebuild" system datafile, but if I don't have a backup - I know shame on me! - Is there anyway to recover database?
2
votes
2answers
3k views

Recovering a lost datafile with no backup available

How do you recover a lost datafile if: the database is running in archivelog mode there is no backup is available
0
votes
1answer
34 views

Cassandra in a Public Cloud - Which Snitch?

I am planning on deploying Cassandra in a public cloud (like Amazon AWS). The cluster will span multiple zones and regions. The cluster will also require logical DC separation within a given region. ...
0
votes
0answers
7 views

Table data is not getting dumped

This is just for test purpose. I'm taking backup (INNODB DB) with --single-transaction and from another terminal I'm running alter table on one of the table of same DB on which dump command is ...
2
votes
3answers
86 views

UNION ALL or other ways to return first row of result-set

I am writing a table valued function to geocode an address based on its Suburb, State and Postcode. I try to geocode the address using different methods, in order of decreasing accuracy: Exact match ...
0
votes
0answers
12 views

Slot Time Challenge - Doctor Appointment database schema

I am trying to make a doctor appointment system where patient online will have two options: First time visit (this visit should be 20 mins) Follow up visit (this visit should be 10 mins) ...
0
votes
1answer
168 views

“Credential retrieval failed” during recovery of an Oracle database

When starting up automatic instance INSTANCE: RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== ...
0
votes
1answer
52 views

SQL server auto update column

I am trying to change the value of defaults column from Y to N if a new value is inserted. The default column is now only restricted to have only 1 Y based on the different membershipType. The ...
0
votes
1answer
25 views

Query distinct emails not logged in within a period of time

I need help in writing a query to return distinct emails that have not logged into ABC database in the past 5 months. The exact task I have been asked is as following: Create a table in ABC ...
0
votes
0answers
15 views

Database got corrupted and I want to recover only data from it

I have Oracle Database 10g Express Edition. The database has some important data and has got corrupted. I don't have a backup of it and want to recover the data from it. Can anybody help me out?
0
votes
0answers
8 views

How to upgrade PostgreSQL 7.3 to 9.3?

I want to upgrade the PostgreSQL database from 7.3 to 9.3. Please help me how to perform the upgrade.
4
votes
2answers
72 views

Queries without Good Enough Plan Found

I have a SQL Server 2012 database. I noticed value of Reason for early termination of statement optimization for some queries and all gave Good Enough Plan Found. Now my questions are: What are all ...
3
votes
1answer
19 views

What normal forms are these two relations in?

I have a set of relations {A, X, Y, Z}: Given that the functional dependencies: AX→Y, AX→Z, Y→A, Z→X, I would think that this relation would be in the normal form 1NF, because there is a partial ...
2
votes
2answers
1k views

pg_basebackup giving “could not receive data from client: Connection reset by peer”

I'm trying to get data to a new slave box from my new master (previously the slave). I've tried the steps already and it worked previously. Now when I run the following command: pg_basebackup -h ...
0
votes
0answers
6 views

Could not connect to the specific instance. MySQL error number 1045. Access denied for user 'root'@'my public ip' (using password:YES)

I was using MySQL query Browser in my system and type the IP address of the remote Server and log in. I tried to create a store procedure and scheduled an event to call the procedure every two ...
0
votes
0answers
9 views

MySql Error : Database page corruption on disk

Recently Ive setup a xampp in my store location. on Windows 7 32 bit, 2GB RAM - Pentium PC. (XAMPP) xampp-win32-5.5.19-0-VC11 PHP application is Point of Sale. With latest mysql server and PHP 5.5. ...
0
votes
1answer
9 views

SQL Server 2016 Install ERROR (Pictures and logs provided)

Can't install, updated Windows Server 2012 R2 fully with all Optional and Important Updates. I enabled a proxy to gain outside access which works (since Windows updates work). There is no anti-virus ...
0
votes
1answer
129 views

mysqlslow - excluding queries from mysqldump

I would like to ignore the queries in my mysql-slow log that originate from mysqldump using SQL_NO_CACHE as the trigger word. My experiences using regex are limited at best and I'm unable to find any ...
0
votes
1answer
44 views

Locking in Stored Procedures [on hold]

If a stored procedure has multiple statements,will the lock acquired for the first statement be released once its executed or will it hold on till entire SP is complete? I am running an SP under ...
3
votes
1answer
165 views

drop table from outside?

A poorly designed script ran on my MySQL 5.6 instance for 24 hours before I stopped it by killing the MySQL command line client and rebooting the machine while the script was still running. The ...
4
votes
1answer
2k views

How to import export.sql in sql developer?

In SQL Developer, from the top menu choose Tools > Data Export. This launches the Data Export wizard. So that is export. It creatres export.sql file. Now how to do import ? I am usgin SqlDeveloper ...
0
votes
1answer
23 views

extract values from different stored procedures and create one report

At the company I work, the third party taking care of the database. So there is giant complex stored procedure that produces the result for one parameter only. When management needs a desirable ...
2
votes
2answers
4k views

scramble the value of one column and unscramble it?

I want to change all the values in one column, as it is a production database and I don't want to give the data to testers without obfuscation. Example: Name Name ---- --> ...
0
votes
2answers
16 views

Quick and easy ways to check SQL/DB performance

We host a web application for customers, sometimes they call in and complain of slowness. I was asked to have a list of things to check from network down to the application. For SQL, can any suggest ...
1
vote
2answers
138 views

Overwhelmed with Sensor Data - Excel to SQL Server fails

I'm managing a lot of sensor data and need to do charting, smoothing, stats over time on the data. Currently I import the data from flat files using VBA to do ETL into Excel. The format of the data ...
1
vote
1answer
17 views

MySQL datetime to just date

Currently I have a table containing a column of type datetime. I have no need for the use of the HH:MM:SS that trail the variables stored in this column. I just need the YYYY-MM-DD. Is there any way ...
12
votes
3answers
132 views
+100

Keeping (Partial) Backups Small when using SQL Server FILESTREAM

I have a database with nearly 1TB of FILESTREAM data that I don't need backed up (if the data was deleted it'd be recreated automatically in a couple of hours, so it just isn't important). Most of the ...
4
votes
1answer
47 views

Transposing hierachical data from one VARCHAR to two INTs

THE PROBLEM The table where the data is recorded is CREATE TABLE [dbo].[Almoxarifado]( [idAlmoxarifado] [varchar](20) NOT NULL, [tipoAlmoxarifadoId] [varchar](30) NOT NULL, [entidadeId] ...
1
vote
1answer
26 views

how do I change regexp_substr(to_char(bar), '^.*?$', 1, 1, 'm') to only read 132 characters each time

how do I change the query below so it only reads and displays 132 characters each line with w(id, line#, line, rest) as ( select id, 1, regexp_substr(to_char(bar), '^.*?$', 1, 1, 'm'), ...
1
vote
0answers
15 views

Materialized Views and Indexes

Is there any way to force PostgreSQL to use an index that I created on a materialized view table? I tried every combination possible of moving the column attributes around to make Postgres to use my ...
0
votes
1answer
20 views

ORA-00932 on subquery join from subquery join

The only guess I have is that perhaps the size of the subquery is considered a CLOB? I have no null values for the fields selected AFAIK. SELECT DISTINCT kbq_ent.qid AS kbq_ent_qid, ...

15 30 50 per page