Oracle

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску

Заметки по установке и работе с Oracle

Установка ORACLE 10 на Solaris

Подготовка к установке

  • добавить пользователя oracle, задать ему пароль
useradd -d /export/home/oracle -m -s /usr/bin/bash oracle
passwd oracle
  • создать 2 группы, dba и oinstall (назначение второй - мне не ясно), добавить пользователя в группы
grouppadd dba
grouppadd oinstall
usermod -g dba -G oinstall oracle
  • проверить наличие свободного места. (в моем случае - в разделе /export)
  • установить значения переменных окружения (я вписал их как в .profile так ив .bashrc):
# su - oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ env
HZ=
SHELL=/usr/bin/bash
TERM=xterm
TMPDIR=/tmp
ORACLE_SID=orcl
ORACLE_BASE=/export/home/oracle
MAIL=/usr/mail/oracle
PATH=/export/home/oracle/10g/bin:/usr/bin:
PWD=/export/home/oracle
TZ=EET
SHLVL=1
HOME=/export/home/oracle
TMP=/tmp
LOGNAME=oracle
DISPLAY=localhost:0.0
ORACLE_HOME=/export/home/oracle/10g
  • Заливаю инсталляционные файлы по ftp (сразу в каталог oracle, вся инсталляция будет проходить под аккаунтом oracle)
  • Запускаю инсталлятор.

Post-install

В файле /oracle/10g/bin/dbstart (строка 77)

#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
ORACLE_HOME_LISTNER=$ORACLE_HOME


Все сказанное касается версии 10 если не сказано обратное.

Полезные комманды

Все комманды вводить после su - oracle

lsnrctl status
bash-3.00$ lsnrctl status

LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 27-MAY-2010 10:55:05

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
Start Date                27-MAY-2010 09:25:39
Uptime                    0 days 1 hr. 29 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/10g/network/admin/listener.ora
Listener Log File         /oracle/10g/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=solaris-test)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
bash-3.00$ tnsping test-solaris
TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 27-MAY-2010 11:00:22

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/oracle/10g/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name
bash-3.00$ tnsping solaris-test

TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 27-MAY-2010 11:00:29

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/oracle/10g/network/admin/sqlnet.ora

Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=solaris-test.))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.2)(PORT=1521)))
OK (10 msec)

Файлы и их назначение

/var/opt/oracle/oratab
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/export/home/oracle/10g:Y

Термины

  • Схема (Schema) - коллекция объектов БД. (аналог database в mysql ? )

Ссылки