Database

gtko for lucid (ubuntu 10.04 LTS (lucid lynx))

make instant client and ORACLE_HOME configuration as prior tora post.
i precompiled gtko, grab it from here.

you are ready :)

Bookmark and Share
Tags: , ,

Related posts

oracle

Comments (0)

Permalink

tora with oracle support on lucid (ubuntu 10.04 LTS (lucid lynx))

first we take rpm packages from
oracle instant client downloads.
you need to download devel, basic, sqlplus packages.
we need alien to convert rpms to deb.
sudo apt-get install alien
convert them to deb packges;
alien oracle-instantclient11.2-basic_11.2.0.1.0-2_i386.rpm
alien oracle-instantclient11.2-devel_11.2.0.1.0-2_i386.rpm
alien oracle-instantclient11.2-sqlplus_11.2.0.1.0-2_i386.rpm

install new deb packages with sudo dpkg -i

download and install the libaio library
libaio, libao-dev
give this commands;

sudo echo "/usr/lib/oracle/11.2/client/lib" > /etc/ld.so.conf.d/oracle.conf
sudo ldconfig
export ORACLE_HOME=/usr/lib/oracle/11.2/client
sudo "export ORACLE_HOME=/usr/lib/oracle/11.2/client" > ~/.bash_profile

take tora debian package from proturk

wget http://www.proturk.com/downloads/tora_2.1.1-1_i386.deb
sudo dpkg -i tora_2.1.1-1_i386.deb

now you can run tora with /usr/local/tora/bin/tora command.

if it not works probably you dont have qtscintilla or qt4 libraries, install them with synaptic.

if you want to compile by yourself, here is the configure command;
./configure --with-instant-client=/usr/lib/oracle/11.2/client --with-oracle-includes=/usr/include/oracle/11.2/client --with-oracle-libraries=/usr/lib/oracle/11.2/client/lib --with-oci-version=11G

Bookmark and Share
Tags: , , , ,

Related posts

oracle

Comments (0)

Permalink

oracle XMLType kullanımı

Öncelikli olarak XMLType tipinde bir tablo oluşturalım. Tablo adı deneme_tablo olsun

create table deneme_tablo of xmltype;

bir kayıt insert edelim

insert into deneme_tablo values(
	xmltype('<kisi adi="muhammed" soyadi="yürürdurmaz" />')
)
insert into deneme_tablo values(
	xmltype('<kisi adi="ismail" soyadi="çakır" />')
)

şimdi tüm kayıtları listeleyelim

select * from deneme_tablo

şimdi ismi muhammed olan kayıtları sorgulayalım

select * from deneme_tablo tb
where existsNode(tb.OBJECT_VALUE, '/kisi[@adi=''muhammed'']') = 1

şimdi kişi adlarını listeleyelim olan kayıtları sorgulayalım

select extractValue(tb.OBJECT_VALUE, '/kisi/@adi') from deneme_tablo tb
Bookmark and Share
Tags: , , , ,

Related posts

Database
oracle

Comments (0)

Permalink

sql between operatörü

select * from tablo where sayi between 1 and 5

sql kullanırken between operatörünbe dikkat edin. bazı veritabanlarında 1 dahil olmazken bazılarında 5 dahil olmuyor. bazırlarında 1 ve 5 dahil olurken bazılarında 1 ve 5 dahil olmuyor

örnek olarak oracle üzerinde 1 ve 5 dahil oluyor

Bookmark and Share
Tags: , , ,

Related posts

Database
oracle

Comments (1)

Permalink

SqlTools Linux üzerine kurma

Öncelikle Sqltools indiriyoruz.

sistemimizde wine kuruluysa direkt olarak tıklayıp kurabiliriz.
wine yoksa
sudo apt-get install wine
ile kuruyoruz.
Oracle instant client a ihtiyaç duyucaz, instantclient-basic-win32-11.1.0.7.0.zip. basic versiyonu indiriyoruz. Tabi benim veritabanım türkçe encoding de eğer ingilizce ise veritabanınız daha ufak olan basic-lite paketini indirebilirsiniz.
ev dizinimizdeki
.wine/drive_c/Program Files/SQLTools 1.42/ dizinine gidip instantclient-basic-win32-11.1.0.7.0.zip dosyasını buraya açıyoruz.
instantclient_11_1 dizinine açıcaktır. içindekileri üst dizine taşıyın.

daha sonra wine Sqltools.exe komutuyla ya da ana menudeki wine grubundan SQLtools u çalıştırabilirsiniz.

Bookmark and Share
Tags: , , , , ,

Related posts

Linux
oracle

Comments (0)

Permalink

oracle dbconsole localtime hatası

emctl start dbconsole

komutu ile dbconsole başlatmaya çalıştığınızda

/usr/bin/diff: /etc/localtime: No such file or directory TZ set to
Etc/GMT+12 Oracle Enterprise Manager 10g Database Control Release

hatası alıyorsanız, sisteminizin timezone ayarını yapmamışınızdır demektir.

ln -sf /usr/share/zoneinfo/Turkey /etc/localtime

komutu ile oluşturacağınız linkle bu sorunu aşabilirsiniz.

eğer

does not match the current environment TZ setting

hatası görüyorsanız, db ile sistem timezone farklıdır.

ORACLE_HOME dizinine geçip

emctl resetTZ agent

komutu vererek bu sorunu da aşabilirsiniz.

Bookmark and Share
Tags: , , , , , ,

Related posts

Linux
oracle

Comments (0)

Permalink

php ile mysql veritabanı karekter seti değişmek için örnek kod

Bu örnekte utf8_swedish_ci karekter setindeki bir veritabanını utf8_turkish_ci setine çeviriyoruz. Kullanmadan önce yedek almayı unutmayın!


<?php

$host = "localhost";
$user = "root";
$pass = "password";
$db =   "database";

mysql_connect($host, $user, $pass);
mysql_select_db($db);

$eski = ’utf8_swedish_ci‘;
$yeni = ’utf8_turkish_ci‘;
$cset = ’utf8‘;

function sorgula($sql) {
    $rs = mysql_query($sql);
    if (!$rs) {
        $message  = ’Hata: ‘ . mysql_error() . "\n<br>";
        $message .= ’Sorgu: ‘ . $sql . "\n<br>";
        die($message);
    }
    return $rs;
}

$tablolar = sorgula("SHOW TABLES");
$html  = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>";
$html .= "<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" /></head>";

print $html. ’<body><pre>‘;

while ($sutunlar = mysql_fetch_row($tablolar)) {
    $table = mysql_real_escape_string($sutunlar[0]);
    sorgula("ALTER TABLE `$table` DEFAULT CHARACTER SET $cset");
    echo "$table $cset e dönüştü! \r\n";
    $rs = sorgula(" SHOW FULL FIELDS FROM `$table` ");
    while ($sutun=mysql_fetch_assoc($rs)) {
        if ($sutun['Collation']!=$eski)
            continue;
        $field = mysql_real_escape_string($sutun['Field']);
        sorgula ("ALTER TABLE `$table` CHANGE `$field` `$field` $sutun[Type] CHARACTER SET $cset COLLATE $yeni");
        echo "$table tablosu $field alani $yeni karekter setine dönüştürüldü\r\n";
    }
}
print "</pre></body></html>";
?>

Bookmark and Share
Tags: , , ,

Related posts

Database
mysql
php

Comments (0)

Permalink

oracle tns listener kilitlendiğinde yeniden başlatmak için basit bir script

Hani böylesine zorla yapmak istemeyizde mecbur kalınca, niye olmasın :)
lsnrctl stop
komutuyla durmuyorsa.
#!/bin/bash

for ind in `ps -aef | grep tnslsnr | grep -v grep | cut -f4 -d ' '`
do
kill -9 $ind
echo "process $ind"
done
if [ $? -eq 0 ]; then
lsnrctl start
fi
exit

Bookmark and Share
Tags: , , , , ,

Related posts

Database
oracle

Comments (0)

Permalink

Switch to our mobile site