0
votes
1answer
48 views

Is this statement syntactically correct?

$q = "SELECT var1, var2, var3 FROM tablename WHERE var_a = '$var_a' AND var_b = '$var_b' AND ( ( var1 = '$var1' AND var2 = '$var2' ) OR ( var1 = '$var2' AND var2 = '$var1' ) )"; This ...
1
vote
2answers
50 views

ORA-01033 “ORACLE initialization or shutdown in progress” caused by ORA-10567 “REDO is inconsistent with data block”

I faced an error while logging to database with regular user (non SYS/DBA): C:\Users\user>sqlplus tester@orcl ORA-01033 ORACLE initialization or shutdown in progress However I can connect via ...
0
votes
1answer
28 views

How to retrieve stored procedures from raw data

I have all the raw data from a database that I can't access through the mysql program anymore. I was able to get the tables by copying the .frm files over to the new installation of mysql, but I don't ...
-3
votes
0answers
18 views

How do i compare current table and history table so that i get to know which data is upated or deleted from current table [on hold]

I am working on my project on DB2 I have to compare current table with history table.So that we get to know that which record is added or deleted from current table. Please suggest some ...
0
votes
1answer
20 views

Synchronize part of the tables to use offline (no internet use) then sync back to server

I read some synchronization post but seems not suit my case. As I will sometimes go travelling locally and other country which I may have no access to internet then I could not even get the data in my ...
0
votes
1answer
36 views

Apparantly errorneous Exceeds 8K row length message

In attempting to alter an SQL Server table adding DATE and FLOAT columns. I get a message: Warning: The table "CustomerTransactions" has been created, but its maximum row size exceeds the allowed ...
0
votes
0answers
30 views

SQL Server 2008 R2 to 2012 [on hold]

We had developed the ssis packages using BIDS 2008 and deployed on SQL 2008 R2 machine and it was working fine. Now our DB's are migrated to sql server 2012. But we have deployed the old packages and ...
0
votes
1answer
10 views

Update query for Minimum absolute difference in Access [SQL]

I have 3 tables in an Access db. Table_1 and Table_2 are where the source data comes from and I am filling Table_3. Table_1 has the following fields: Acct_Name Amt Table_2 has the following ...
0
votes
1answer
21 views

How to grant permissions for User defined type in Oracle

This is probably easy but i can't seem to figure it out. I created my user-defined type as CO_ADMIN. However, the application using the type runs using GS_USER database account. I have granted ...
2
votes
1answer
71 views

Searching a big table for a few results without scanning the whole table

I need to search a very big PostgreSQL table (500+M rows), I want to limit the returned search results, but using the "limit" keyword cant prevent the search over the whole set of data(is it correct?) ...
0
votes
0answers
15 views

How can create a central database for PHPBB, Drupal and Joomla? [on hold]

I want to create a central database conataining PHPBB databases, Drupal Databases, Joomla databases an so on. Here one of the important task that I want to do, is to create a single Login and Singup ...
0
votes
0answers
28 views

Moving datadir OK start, but socket error for mysql client

I'm trying to move my MySQL datadir from /var/lib/mysql over to /home/mysql (an ssd drive as I'm having iowait issues on /var/lib/mysql when MySQL is running on that drive). The OS is CentOS 5.6 ...
0
votes
1answer
38 views

Logical problem with a database model

Beforehand the table names and columns are in spanish, my native language is spanish. I've got a database to manage the tickets sales of a trip that is made by a bus, the problem is that when i relate ...
1
vote
1answer
30 views

for what My mysql server get mr than 2 gig RAM on my vps?

imnot know english very well so sory for my bad dictation on my vps that has 4 gigabyte RAM and 4 core CPU and 220 gig HDD . i haved installed centos basic server 6.5 x64 and virtualmin last version ...
0
votes
1answer
30 views

MySQL add few column exception for TRIGGER UPDATE FOR EACH ROW

How to effectively add column id, name exception for trigger: CREATE TRIGGER updated BEFORE UPDATE ON table1 FOR EACH ROW SET NEW.date=NOW() so that date=NOW() will be affected on updating any ...
0
votes
0answers
19 views

Is it best practice to include partition keys within foreign keys when referencing partitioned tables?

The large tables in our database are partitioned by an id in order to separate data and speed up IO. The table of the data is partitioned by the partition key, but the primary key is only on an ...
0
votes
0answers
8 views

Logging all user actions

I'm creating a community-driven project and, of course, I want to be protected against spam or evil users. In case of undesirable changes in the DB I would log all users' actions ...
0
votes
2answers
19 views

MySQL get values from the other table by using inner joins

In mysql I have 3 tables called as ps_product_lang ps_order_detail and ps_image here are the tables sample data === ps_product_lang === CREATE TABLE IF NOT EXISTS `ps_product_lang` ( ...
0
votes
0answers
19 views

Postgresql tries to connect to fe80::1, permission denied

I upgraded a couple of days ago to IPv6 on my local test machine and since then I've been experiencing some issue with connecting to my local PostgreSQL server. I set the host to 'localhost', which ...
0
votes
0answers
25 views

Order by Like Value and Count

My Name field values are "Name1 (AB)", "Name2 (AB)", "Name3 (CD)", "Name4 (EF)", etc. Is it possible to count the total "%(AB)" and the total "%(CD)" etc...in one query or will it require a sub query? ...
-6
votes
0answers
23 views

SQL query problem [on hold]

i am facing lot of downtime daily basis. finally the hosting company mention this problem. please guide me how to resolve this. (SELECT id, sef_url, title, details, picture, picture1, picture2, ...
1
vote
0answers
29 views

Does the order of columns in a non-clustered ColumnStore index matter? [duplicate]

I'm reading about creating a non-clustered ColumnStore index. I noticed that when I modify an already created non-clustered ColumnStore in SQL Server Management Studio I have an option to change the ...
2
votes
1answer
178 views

SQL Parameter Sniffing Possible Workaround

Our system has roughly 500 "Customers" that have extreme differences in record counts. Here is a (greatly simplfied) sample query that could return 0 - 100000 rows depending on the parameter passed. ...
0
votes
0answers
28 views

Result of query not showing in phpmyadmin

I have a 500,000 row database that I am running a reasonably complex query on: SELECT yfog, (SELECT AVG(yds) FROM pbp_yards_gained p2 WHERE p2.yfog=p1.yfog AND type = ...
0
votes
1answer
30 views

Difference between character_maximum_length and character_octet_length

Maybe there is an answer for this somewhere but, I couldn't find any efficient answer on Google for this question, therefore, I will ask this here. I wanted to get some information about my Stored ...
0
votes
0answers
14 views

Pasting into PHPMyAdmin

This is probably really simple but I have had a look on the web but can't seem to find an answer. I am experimenting with MySQL + PHPMyAdmin on a WAMPserver stack and was saving queries in Excel When ...
0
votes
1answer
15 views

Easy way to automate database synchronization

I have to get data from a remote database and store it in my local database. And mapping between the two database is something like shown in the below image. So, for this I'm looking for a Python ...
1
vote
1answer
68 views

Reducing execution time for this gnarly SQL

I'm creating an order system of some kind. There is a function that I use to get orders (in PHP) and retrieve the required information about the order. However, it seems that I am pulling a lot of ...
1
vote
1answer
43 views

Update different columns on different clauses

I have a database table in Postgres 9.3 with the following layout: id SERIAL, col1 INT, col2 INT Whenever a new row is inserted, I will have to update ALL rows col1 and/or col2 in different cases ...
0
votes
0answers
47 views

Showing employee on leave [on hold]

How can I show an employee which is absent and leave and absent but not in leave here I can show which employee is on leave when there ApproveStatus is true and I can give date manually from which ...
0
votes
0answers
16 views

What is safe way to restore mysql database?

When database is online. I want to restore dump file to it. Here is my plan: set global read_only=ON use root with super_priv to drop all databases do restore all databases set global read_only=OFF ...
0
votes
0answers
26 views

sysbench configure error

I have MariarDB with Galera installed on Centos 6.5. ./configure checking for sqrt in -lm... yes checking for mysql_config... no configure: error: mysql_config executable not found ...
0
votes
0answers
6 views

where did my mongo databses go?

I have various Mongo databases and when I do ls -l in my CentOS linux I can see the databaseA.0 and databaseA.ns files for each database and the file size is large enough to tell my data is still ...
0
votes
0answers
15 views

How does database connection actually works? [duplicate]

I am wondering, on a practical level : what is a database connection? What does it represent for PHP/Java/Ruby/etc to have an opened connection for instance? What about the MySQL deamon? Does it ...
0
votes
0answers
21 views

SQL SERVER 2012 Express - Can't change Thesaurus Location

I have a requirement for an application to change the location where SQL SERVER looks for the Global Thesaurus file. According to the official documentation: "You can change the location and names ...
0
votes
1answer
31 views

How to compare all rows in a table and extract data using triggers

I have two table one table stores the gps data of various users another table stores the idle time of the users based upon the gps data of latitude and longitude values and timestamp difference. ...
0
votes
0answers
120 views
+50

Find active values of SQLNET.ORA parameters on server

How can I find the active values of SQLNET.ORA parameters on the server? I know how to find the SQLNET.ORA file but there's no guarantee the values in that file are actively used. Parameter changes ...
0
votes
1answer
17 views

How should I use RMAN clone refresh using set until time?

I am using this technique to refresh dev. environments with production data. The business process is to request a tape hold for the full backup I want to use for a clone refresh to dev. Once this is ...
-3
votes
0answers
59 views

How to fix my corrupted SQL Server database? [closed]

My database in SQL Server is corrupted. Tried to return the backup, but when importing, there is an error that the database is corrupted. What should I do, tell me?
-2
votes
0answers
31 views

Is it possible to do simple division or multiplication in Select Statement? and then insert into new table or create permanent view? [migrated]

I want to calculate the buy/sell ratio based on the two items/values obtained in the select statement, is it possible? Thanks. SELECT Ticker, sum(dBuyAmount) as Buy, sum(dSellAmount) as Sell, ...
0
votes
1answer
29 views

How to sum the buy order and sell order in one row per each ticker

I have a table containing some trading information of several tickers and I would like to divide the data into sum(Amount) for buy and sell separately, grouping by each ticker. I have one table ...
1
vote
1answer
58 views

Why is my filtered index being ignored?

--Setup, actual queries after the space --create table fltrind (a integer,b integer) truncate table fltrind DROP INDEX fltrind.nf DROP INDEX fltrind.f DECLARE @i integer SET @i=0 while @i<100 BEGIN ...
-1
votes
0answers
45 views

How to select record with biggest value of column [migrated]

Columns: numberIWant, value I would like to get numberIWant number of records, which have biggest value. select max(value) from myTable only returns the max value. I want to find numberIWant that ...
1
vote
2answers
29 views

Why is MySQL ignoring my indexes?

I have a query select distinct id from patient where company_id in (1) and (name_last like 'peter%' or name_first like 'peter%' or remote_id like 'peter%') running on a table that looks like this ...
1
vote
0answers
26 views

How to add a missing database to an AlwaysOn Availability Group [duplicate]

Setup: Microsoft SQL Server 2012, and we have 3 production servers(prod1, prod2, prod3) with AlwaysOn. We recently added a new database and the new database was added to our Availability Group(named ...
0
votes
0answers
36 views

cascade delete doesn't work even though constraint is added

I created the following table: CREATE TABLE message_link ( id serial NOT NULL, thread_id integer, message_id integer, user_id integer, read boolean NOT NULL, CONSTRAINT message_link_pkey ...
0
votes
1answer
10 views

PHP/MongoDB: Unset all fields in a document

I want to use PHP to remove documents from a MongoDB collection, but it's a capped collection (and it's stuck that way until I can get more memory), which means I can't remove documents. I have to do ...
2
votes
1answer
149 views

Partitioning Query

I have a couple of questions about the phyiscal layout of tables when they are partitioned. I've been researching this but am still a little unsure. Say I have an existing table:- CREATE TABLE ...
1
vote
2answers
29 views

Is there a policy or special server configuration to limit SQL Server query results?

I have been seeing developers using SELECT * FROM table when testing their queries. The issue is that many developers are executing such SELECT statements on huge tables, which slows down SQL Server ...
1
vote
1answer
21 views

Access Value between ranges

I'd like the following population logic built in an Access database: I have two tables. The first, Table1 contains a set of buckets, with a starting and ending value: Start End Bucket ...

15 30 50 per page