Pythontr

husonet | Tarih: 14.03.2013

Debian Oracle 10g Enterprise kurulumu

10g lisansı Oracle Enterprise kurulumu.

indirmemiz gereken dosya 10201_database_linux32.zip


mkdir -p /home/boran/oracle10g
cd /home/boran/oracle10g
unzip -x 10201_database_linux32.zip


oracle kullanıcısı açma ve yapilandirma
groupadd oinstall
groupadd dba
useradd oracle -m -d /home/oracle -g oinstall -G dba -s /bin/bash
passwd oracle


xauth ekleme
xauth list
xauth add orclserver/unix:10 MIT-MAGIC-COOKIE-1 abcdef0123456789abcdef0123456789


Kurulacak paketler
aptitude install libXt6 libXp6 libXtst6


SSH ile kurulum yapalım
ssh -X oracle@boran
DISPLAY=192.168.2.161:0.0; export DISPLAY


Debian da kurulum için aşağıdaki parametreleriyle birlikte runInstallerı çalıştıralım...
# Bu desen 10 g için hazırlandı
./runInstaller -IgnoreSysPreReqs -silent -responseFile  /home/oracle/database/response/enterprise.rsp ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1  ORACLE_HOME_NAME=ORADB102_Home10 n_configurationOption=3


Kurulumdan sonra root olarak /u01/app/oracle/product/10.2.0/db_1/root.sh çalıştıralım.

oratab dosyası ayarları
vim /etc/oratab
orcl:/u01/app/oracle/product/10.2.0/db_1:N


Servis dosyasını oluşturalım
su -
vim /etc/init.d/dbora
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME_LISTNER=$ORACLE_HOME
export ORACLE_OWNR=oracle
export ORACLE_OWNER=oracle
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
#export ORACLE_UNQNAME=DEFAULT
#export ORACLE_HOSTNAME=localhost.localdomain
export ORACLE_HOSTNAME=127.0.0.1
export PATH=$PATH:$ORACLE_HOME/bin
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
#su $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
#su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_OWNER -c "/home/oracle/scripts/startup.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1"
touch /var/lock/subsys/dbora
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORACLE_OWNER -c "/home/oracle/scripts/shutdown.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
#su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
#su $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f /var/lock/subsys/dbora
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0


Çalıştırma izini
chmod u+x /etc/init.d/dbora



Profile Ayarlarını Yapalım
su - oracle
mkdir -p /home/oracle/scripts
chown oracle:oinstall /home/oracle/scripts


Startup file

vim /home/oracle/scripts/startup.sh
# Start Database
sqlplus / as sysdba << EOF
STARTUP;
EXIT;
EOF


Shutdown file

vim /home/oracle/scripts/shutdown.sh
# Stop Database
sqlplus / as sysdba << EOF
SHUTDOWN IMMEDIATE;
EXIT;
EOF


chmod u+x /home/oracle/scripts/startup.sh /home/oracle/scripts/shutdown.sh


vim .profile
. /home/oracle/scripts/oracle_env.sh


Genel Ayarlar
vim  /home/oracle/scripts/oracle_env.sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH






vim /u01/app/oracle/product/10.2.0/db_1/bin/dbstart
#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
ORACLE_HOME_LISTNER=$ORACLE_HOME


vim /u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora
*.compatible=10.2.0.1.0
*.control_files='ora_control1','ora_control2'
*.db_block_buffers=100# SMALL
*.db_file_multiblock_read_count=8# SMALL
*.db_files=80# SMALL
*.db_name='orcl'
*.global_names=TRUE
*.log_buffer=32768# SMALL
*.log_checkpoint_interval=10000
*.max_dump_file_size='10240'# limit trace file size to 5 Meg each
*.parallel_max_servers=5# SMALL
*.processes=50# SMALL
*.shared_pool_size=62198988# SMALL


mkdir /u01/app/oracle/product/10.2.0/db_1/dbs/orcl


TNS Name dosyasını ayarlayalım
vim /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
orcl=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=127.0.0.1)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=orcl)
)
)


Listener Ora dosyasını ayarlayalım
vim /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)


netstat ile 1521 nolu portumuz dinleme yapıyormu bakalım
netstat -taunp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1041/portmap
tcp 0 0 0.0.0.0:38640 0.0.0.0:* LISTEN 1053/rpc.statd
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN 2462/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1551/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1545/exim4
tcp 0 0 127.0.0.1:1521 127.0.0.1:46614 TIME_WAIT -
tcp 0 0 127.0.0.1:1521 127.0.0.1:46610 TIME_WAIT -
tcp 0 0 127.0.0.1:1521 127.0.0.1:46616 TIME_WAIT -
tcp 0 0 127.0.0.1:1521 127.0.0.1:46615 TIME_WAIT -
tcp 0 48 192.168.2.162:22 176.33.145.115:57474 ESTABLISHED 1668/sshd: boran [p
tcp6 0 0 :::22 :::* LISTEN 1551/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1545/exim4
udp 0 0 0.0.0.0:45013 0.0.0.0:* 1053/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1524/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 1041/portmap
udp 0 0 0.0.0.0:46618 0.0.0.0:* 1524/avahi-daemon:
udp 0 0 0.0.0.0:805 0.0.0.0:* 1053/rpc.statd
udp6 0 0 :::5353 :::* 1524/avahi-daemon:
udp6 0 0 :::38269 :::* 1524/avahi-daemon:



sqlplus sys as sysdba
SQL>show parameter db_name
SQL> alter system set db_name=ORCL scope=spfile;