Menu

25 Temmuz 2011 Pazartesi

ORA-01000: maximum open cursors exceeded hatasi

Error : ORA-01000: maximum open cursors exceeded

Cozum 
Open cursor sayisini artirmak
ALTER SYSTEM SET open_cursors = 5000 SCOPE=BOTH;

Default degeri 300 olmali
SQL> show parameter open_cursor;

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------
open_cursors                         integer     300
SQL>

14 Temmuz 2011 Perşembe

Glassfish windows service gibi baslatmak

1. C:\glassfish3.1\glassfish\bin>asadmin create-service
2. C:\glassfish3.1\glassfish\domains\domain1\bin>domain1Service.exe start
3 .C:\glassfish3.1\glassfish\domains\domain1\bin>domain1Service.exe stop
4. C:\glassfish3.1\glassfish\domains\domain1\bin>domain1Service.exe uninstall
5. C:\glassfish3.1\glassfish\domains\domain1\bin>domain1Service.exe install

12 Temmuz 2011 Salı

Mysql create user

mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost'
    ->     WITH GRANT OPTION;

5 Temmuz 2011 Salı

Oracle Enterprise Linux uzerine, Oracle 11gr2 Kurulumu

Bu makalemizde, Oracle Enterprise Linux 5 uzerine Oracle 11gr2 kurulumunu ve linux icin gerekli kernel ayarlarinin yapilmasini inceleyecez..
Linux uzerine kurulum icin asagidaki adimlari takip edecez.
  • Download Software
  • Unpack files
  • Hosts File
  • Set kernel parameters
  • Setup
  • Installation
  • Post installation
Indirmek icin

Unpack Files 
indirdigimiz file`lari zipden cikariyoruz.
# unzip linux.x64_11gR2_database_1of2.zip 
# unzip linux.x64_11gR2_database_2of2.zip

Hosts Files

# vi /etc/hosts 
127.0.0.1            localhost.localdomain  localhost
192.168.10.12    ora11g.localdomain  ora11g
Set Kernel Parameters
Oracle`in tavsiye ettigi minimum degerleri asagidaki gibi olmalidir.
# vi /etc/sysctl.conf
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
Yaptigimiz islemlerin, restart yapmadan uygulanmasi icin..
 # vi /sbin/sysctl -p
Asagidaki satirlarida ekleyelim.
# vi /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240
SELINUX`u kapatmamiz gerekmektedir.
# vi /etc/selinux/config
   SELINUX=disabled // bu satir disabled olmalidir. 
Simdi kurulum icin, bize gerekli olan, paketleri yuklemeliyiz.
gerekli olan paketler, OEL 5 DVD`nin icinde bulabilir.

# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-2*
cd /
eject 
Simdi grouplar ve user ekleyecez.
# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd asmadmin
# useradd -g oinstall -G dba,oper,asmadmin oracle
# passwd oracle 
// Eger ASM kullanmayacaksaniz, asmadmin`e gerek yoktur. 
Simdi Oracle software kurulumu icin, directory yaratacaz, ve oracle kullanicisina
yetki verecez.


# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01
Buradan sonra "oracle" kullanicisi ile login oldukdan sonra, ".bash_profile" icine
asagidaki satirlari ekliyoruz.
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ora11g.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ORCL; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ORCL; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH 
Gerekli islemleri yaptikdan sonra, zipden cikardigimiz "database" klasoru icindeki runInstaller`i calisitiriyoruz.
# cd database
# ./runInstaller
Buradan sonra, karsiniza, grafik ekran gelecektir.
Ama eger runInstaller`i calistirken asagidaki hata ile karsilasirsaniz

[oracle@ertugrula database]$ ./runInstaller
bash: ./runInstaller: Permission denied
Eger sizde benim gibi yukaridaki hata ile karsilastiysaniz yapmamiz gereken, permissionlar vermekte asagida oldugu gibi
[oracle@ertugrula grid]$ chmod u+x runInstaller
[oracle@ertugrula grid]$ chmod u+x ./install/.oui
[oracle@ertugrula grid]$ chmod u+x ./install/unzip
Simdi tekrar deneyiniz,
# ./runInstaller

4 Temmuz 2011 Pazartesi

chmod: changing permissions of `VBoxLinuxAdditions.run': Read-only file system

Virtual boxda tam ekran yaparken asagidaki hatayi aliyorsak;


# sudo ./VBoxLinuxAdditions.run
chmod: changing permissions of `VBoxLinuxAdditions.run': Read-only file system

Cozum:

# sudo sh VBoxLunuxAdditions.run


En iyi Backup alma yonteminden biri

Asagidaki kodumuz, en iyi backup alma yontemlerinden biridir, (Tabiki cok daha iyileri vardir.)

RMAN > BACKUP as COMPRESSED BACKUPSET DATABASE FORMAT
               '/home/oracle/backup/datafile/dbf_%d_%t_%s.rman' 
               TAG='DBF_DB11G_20110321_1453' PLUS
               ARCHIVELOG format '/home/oracle/backup/arcfile/arc_%d_%t_%s.rman'
               TAG='ARC_DB11G_20110321_1453'