Tag Archives: SQL

NoSQL joins SQL in FoundationDB purchase of Akiban

Database software vendor FoundationDB has acquired Akiban, another purveyor of database software, in a move to develop a hybrid data-store application capable of storing both SQL and non-SQL data.

“Being all things to all people is a tough place to be, but I think there is a way to thread that needle and offer a real interesting service,” said David Rosenthal, a co-founder of FoundationDB. Terms of the acquisition were not disclosed.

Vienna, Virginia-based FoundationDB developed a data storage engine that can store information in both non-SQL and SQL data structures.

FoundationDB offers all the capabilities of a standard relational database management system (RDMS)—including fault tolerance and full ACID (Atomicity, Consistency, Isolation, Durability) compliance—while still offering the easy multi-server scalability of a NoSQL data store.

To read this article in full or to leave a comment, please click here

…read more

Source: FULL ARTICLE at PCWorld

Cisco releases security patches to mitigate attack against Unified Communications Manager

Cisco Systems released a security patch for its Unified Communications Manager (Unified CM) enterprise telephony product in order to mitigate an attack that could allow hackers to take full control of the systems. The company also patched denial-of-service vulnerabilities in its Intrusion Prevention System software.

The Cisco Unified CM is a call processing component that extends enterprise telephony features and functions to IP phones, media processing devices, VoIP gateways, and multimedia applications, according to Cisco.

At the beginning of June, researchers from a French security consultancy firm called Lexfo publicly demonstrated an attack that chained together multiple “blind” SQL injection, command injection and privilege escalation vulnerabilities in order to compromise a Cisco Unified CM server.

To read this article in full or to leave a comment, please click here

…read more

Source: FULL ARTICLE at PCWorld

Common security flaws leave applications open to amateur hackers, security report says

The software industry’s inability to reduce the number of security flaws in its code is fueling an age of the “everyday hacker,” criminals who can exploit vulnerabilities with a minimum of technical skills, Security testing firm Vercode’s latest State of Software Security (SoSS) report suggests.

Of the 22,430 applications submitted to the firm’s code analysis service in an 18-month period ending June 2012, only 13 percent of web applications were able to pass the generic OWASP Top 10 list of security problems.

When it came to standalone applications, only 31 percent complied with the separate CWE/SANS Top 25, a significant decrease on the compliance rate in the previous SoSS report caused, Veracode suggested, by a broader sample of companies using the service.

Nevertheless, the percentage of applications containing common but serious flaws such as SQL injection remained static at 32 percent, with cross-site scripting also stubbornly entrenched at 67 percent.

To read this article in full or to leave a comment, please click here

From: http://news.techworld.com/security/3440950/sql-injection-flaws-easy-find-exploit-veracode-report-finds/#tk.rss_all

Help related to clearing of shell scripting doubt

By hitesh1907

Hello Gurus,

Can anybody please help me to understand as what does this lines(Marked in bold) does:

_TABLESPACE_OFFLINE=`cat ${_tmp_res} | grep -iv “online” | grep -v “^[ ]*$” | grep -iv “SQL>”` ——->1

if [ “X${_TABLESPACE_OFFLINE}” != “X” ];then
_tmp_tablespace_status=1
if_need_raise_alarm

Output of _TABLESPACE_OFFLINE from line 1 is:

TABLESPACE_NAME STATUS
—————————— ———
EMA_PROCLOG_20120918 READ ONLY
EMA_PROCLOG_20120919 READ ONLY
EMA_PROCLOG_20120920 READ ONLY
TABLESPACE_NAME STATUS
—————————— ———
EMA_PROCLOG_20120921 READ ONLY
EMA_PROCLOG_20120922 READ ONLY
EMA_PROCLOG_20120923 READ ONLY
EMA_PROCLOG_20120924 READ ONLY
EMA_PROCLOG_20120925 READ ONLY
EMA_PROCLOG_20120926 READ ONLY
EMA_PROCLOG_20120927 READ ONLY
20 rows selected.

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

SQL date for last seven days

By zozoo

Hi team,

i have a condition in sql where we have as below

Code:

select sum(column_A)
from temp_t
where date >= tdb_datestr_to_epoch('21/11/1995 10:00:00','dd/mm/yyyy hh24:mi:ss')
and date < tdb_datestr_to_epoch('22/11/1995 10:00:00','dd/mm/yyyy hh24:mi:ss')


the problems is i have to do the above for 7 days repeatedly so im trying to automated this

the ones in orange are DD from day filed and they should be consecutive

i tried this

Code:

DECLARE
i number(1);
BEGIN
i:=7;
while (i > 0 )
LOOP
DBMS_OUTPUT.put_line (TO_CHAR (SYSDATE-i,'DD/MM/YYYY'));
i:= i -1;
END LOOP;
END;


so now how to input these in to the the above sql query i.e in > condition it should if its 12/01/2013 then in < condition the date should be 13/01/2013[/CODE][/COLOR]

i have knowledge in shell,awk as well

Thanks all

happy to learn new things

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Regarding executing sql query in shell script

By abhii

Hi,

I have one SQL file prepared in UNIX and one script that is executing that.

In SQL i have Update and create queries.

I want to introduce conditions in SQL file (in UNIX) that if either of the create or update query failes whole transaction should be rollback.

I just have 1 create and 2 update and i dont want to work on SQL as i want this to be sorted out using shell scripting,

Thanks
Abhii

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Query – date command

By nag_sathi

Hi,

I am trying to capture the total run time of a script which contains SQL‘s by providing date command in top & bottom, it displaying both the times same in top & bottom.However the time in the sql connection is different.Please help.

OS – LINUX
Shell – ksh

Code:

printf "Script Started at $date" >> $LOGFILE
sqlplus userid/pwd test1.sql
.
.
.
sqlplus userid/pwd testn.sql
printf "Script Ended at $date" >> $LOGFILE


…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Dynamic Variable in Linux

By gemi

Hi All,

I am trying declare variables at runtime to use them for some calculation. What im doing is to try and run a bunch of sql queries in round-robbin fashion for few times. So im trying to create a different variable for each SQL file using the file name to keep track of the total time of individual queries.

for ((i=1;i<=$no_of_runs;i++))
do
ls *.sql | while read SQL_FILE
do
start=`date +%s`;
db2 -vtf $SQL_FILE > $SQL_FILE.out;
end=`date +%s`;
${SQL_FILE}_temptime=`expr $end – $start`;
${SQL_FILE}_totaltime=`expr ${SQL_FILE}_totaltime + ${SQL_FILE}_temptime`;
done
done

Now i believe this is not allowed. ${SQL_FILE}_temptime is not the way to generate/use the variable. I think the way around this problem is to use “eval”. I haven’t used “eval” before and im having trouble putting it to use.
Can i request someone to guide me through this problem. If i have to use eval then how can it be used in my case.

Appreciate your help.

Thanks
A

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Overland Storage Wins 'Hardware Product of the Year' at Network Computing Awards

By Business Wirevia The Motley Fool

Filed under:

Overland Storage Wins ‘Hardware Product of the Year’ at Network Computing Awards

SnapServer DX Series Tops Competition as Best Hardware of 2013

LONDON–(BUSINESS WIRE)– Overland Storage (NAS: OVRL) , the trusted global provider of effortless data management and data protection solutions across the data lifecycle, today announced that its SnapServer DX Series NAS storage arrays has won ‘Hardware Product of the Year’ for the second consecutive year at the 2013 Network Computing Awards. In addition, the SnapScale X2 clustered scale-out NAS solution was a finalist in the ‘New Product of the Year’ category.

The Network Computing Awards are based on votes from readers of Network Computing Magazine and are intended to give industry-wide recognition to the technology, tools, solutions and products at the forefront of the evolving technology market. The awards were presented at a ceremony on 14 March at Hotel Russell, London.

“We are excited that the SnapServer DX Series was awarded this recognition for the second year running,” said Joe Disher, Director of Product Marketing for Disk Based Products, Overland Storage. “Now scalable up to 384TB, and with support for 10GbE networking and SSD drives, the SnapServer DX Series with DynamicRAID is the most flexible and highly scalable network attached storage in it’s class.”

The SnapServer DX Series is a unified NAS and iSCSI SAN device that leverages the company’s DynamicRAID technology to completely eliminate the need to provision storage capacity. Expandable to 384TB and featuring an array of integrated enterprise-class features including snapshots, replication and remote management, the SnapServer DX Series enables storage environments to effortlessly scale without downtime while ensuring maximum data protection. Offering unprecedented flexibility, the SnapServer DX Series is the ideal solution for applications from virtualized server, Microsoft Exchange, SharePoint and SQL environments to digital imaging, web services, storage consolidation and backup.

About Overland Storage

Overland Storage is a trusted global provider of effortless data management and data protection solutions across the data lifecycle. By providing an integrated range of technologies and services for primary, nearline, offline, archival, and cloud data storage. For more information, visit www.overlandstorage.com.

Connect with Overland Storage:

Follow Overland on Twitter: www.twitter.com/OverlandStorage

…read more
Source: FULL ARTICLE at DailyFinance

Please help: Oracle gqsql or sqlplus output format like mysql

By Linusolaradm1

On psql

Code:

select titolo,lingua from titolo where titolo ~* 'brivid';


Code:

titolo | lingua
------- + ------
Brivido | 1


On Sqlplus/gqsql

Code:

SQL> select titolo,genere,anno,lingua from titolo where titolo like '%rivid%';


Code:

TITOLO -------------------------------------------------------------------------------- GENERE ANNO LINGUA ---------- ---- ----------
Brivido 1 1986 1


How can format the sql output on sqlplus to do something similar like mysql or psql?
Thanks

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Problems with fetching data from Oracle database

By kumarjt

Here’s a database query which looks up the NAME column of PRODUCT table


SELECT NAME FROM PRODUCT ;


And this query retrieves me the following output
SUGAR
COCOA
HONEY
WHEAT
CABBAGE
CAULI FLOWER
[6 rows selected]
Please note the last record CAULI FLOWER contains TWO blank spaces between the two words.

Now I want to do the same using Unix script and I wrote the following :
set -A prod_list `sqlplus -s USER/PWD@DB <<!
SET HEADING OFF ;
SET NEWPAGE NONE ;
SET FEEDBACK OFF ;
SET LINESIZE 4000 ;
SET WRAP OFF ;
SELECT NAME FROM PRODUCT ;
!
`
and then queried the prod_list array to find 7 instead of 6 entries
for product in ${prod_list[@]} ; do
echo $product
done
The output is like
SUGAR
COCOA
HONEY
WHEAT
CABBAGE
CAULI
FLOWER
7 items in the array. 😮
My guess is the TWO interim spaces within the last record value is splitting the record in two seperate records
at that point of time when I am trying to fetch the records via sqlplus (ie., via Unix).
Can this behavior be overridden ? If yes how ?
Also we tried to use a SQL cursor to fetch the values into unix , but we do not know exactly how to do it. 🙁
Can anybody help us on that too ?

Please note :
Unix version : Korn Shell
OS : Linux
Database : Oracle 11g

Thanks
Kumarjit.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Use sqlplus statment inside case sentence

By Vares

Hello,

I have a problem. I want to launch a different sql queries for different shell parameter values, something like this.


#/bin/bash
case $1 in

"A")
sqlplus -s user/pass << SQL

query A;
SQL

"B") sqlplus -s user/pass << SQL2

query B;
SQL2

*) echo "something"

esac


The problem is that the first sqlplus connection does not finish (with SQL string) and the rest of the code is considered “A” case, esac included. So case statment is bad defined.

Anyone can help me? I was looking inside this forum and I didn´t find something similar

Thanks a lot!! and sorry about me english

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Use sqlplus statement inside case sentence

By Vares

Hello,

I have a problem. I want to launch a different sql queries for different shell parameter values, something like this.


#/bin/bash
case $1 in

"A")
sqlplus -s user/pass << SQL

query A;
SQL

"B") sqlplus -s user/pass << SQL2

query B;
SQL2

*) echo "something"

esac


The problem is that the first sqlplus connection does not finish (with SQL string) and the rest of the code is considered “A” case, esac included. So case statment is bad defined.

Anyone can help me? I was looking inside this forum and I didn´t find something similar

Thanks a lot!! and sorry about me english

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Adam Stokes: Mental Note: Django 1.4.x and Storm .19

Some notes on getting Storm used as a database backend for Django. Props to James Henstridge for doing the heavy lifting.

Setup virtualenv and install dependencies:

console
$ virtualenv --prompt=stormy venv
$ source venv/bin/activate
$ pip install django storm psycopg2 pytz python-dateutil
$ pip freeze > requirements.txt

Setup django skeleton

console
$ django-admin.py startproject myproject
$ cd myproject
$ python manage.py startapp common

Edit settings.py to include the proper middleware and STORM_STORES

“` python settings.py
MIDDLEWARE_CLASSES = (

'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'storm.django.middleware.ZopeTransactionMiddleware',       # Added this line
# Uncomment the next line for simple clickjacking pro

)

STORM_STORES = { ‘default’ : “postgres://adam@localhost/testdb” }
“`

Next in my app add some models

“` python common/models.py
from django.db import models
from storm.sqlobject import StringCol, UtcDateTimeCol, BoolCol, IntCol
from storm.locals import Int
from storm.expr import SQL
from datetime import datetime
from pytz import UTC
import dateutil.parser

class Bug(models.Model):

__storm_table__ = "bug"
id = Int(primary=True,)
date_created = UtcDateTimeCol(notNull=True,)
date_last_message = UtcDateTimeCol()
date_last_updated = UtcDateTimeCol()
date_made_private = UtcDateTimeCol()
description = StringCol(notNull=True,)
duplicate_of = IntCol()
heat = IntCol()
gravity = IntCol()
information_type = StringCol()
latest_patch_uploaded = UtcDateTimeCol()
message_count = IntCol(notNull=True,)
number_of_duplicates = IntCol()
other_users_affected_count_with_dupes = IntCol()
owner = IntCol(notNull=True,)
private = BoolCol(notNull=True, default=False,)
security_related = BoolCol(notNull=True, default=True,)
tags = StringCol()
title = StringCol(notNull=True,)
users_affected_count = IntCol()
users_affected_count_with_dupes = IntCol()
web_link = StringCol()
who_made_private = IntCol()

“`

Pull the data into the view

“` python common/views.py
from django.core.context_processors import csrf
from django.shortcuts import render_to_response, HttpResponseRedirect
from storm.django.stores import *
from myproject.common.models import *

def index(request):

store = get_store('default')
bug = store.find(Bug)
return render_to_response("common/index.html", { 'bug' : bug })

“`

Finally, edit the template to display the data

“` html templates/common/index.html

{% extends ‘layout.html’ %}

{% block page_name %}Home{% endblock %}

{% block content %}

    {% for b in bug %}

  • {{ b.id }} : {{ b.title }}
  • {% endfor %}

{% endblock content %}

“`

Things to do:

  • Have get_store persisted when the application starts
  • Integrate migrations with South
  • Integrate with something like celery for running some background jobs

I haven’t done anything major other than a few queries so time will tell how well this does when this project really gets into making use of Storm.

…read more
Source: FULL ARTICLE at Planet Ubuntu

Password encrypting technique

By Gangadhar Reddy

Hi,
We have a unix shell script which tries login to database. The user name and password to connect to database is stored in a file connection.sql.

Now connection.sql has contents

Code:

def ora_user =&1

CONNECT A_PROXY[&ora_user]/abc123@DEV01


When on UNIX server we connect to database and set spool on and invoke connection.sql .. in the output spooled file we see the password. We want the password to be in encrypted form .. how can we achieve that?

Code:

SQL> set echo on
SQL> set feed on
SQL> set termout on
SQL> set sqlblanklines on
SQL> @GTBIR_DW/dbscripts/connection.sql BIR
SQL> def ora_user =&1
SQL>
SQL> CONNECT A_PROXY[&ora_user]/abc123@DEV01
Connected.

SQL> spool off


In the spooled file we want something like this instead of displaying the password.

Code:

SQL> CONNECT A_PROXY[&ora_user]/******@DEV01


Thanks,
GR

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums