Graficzne środowisko zarządzania bazą danych - Enterprise Manager

1. Przygotowanie środowiska sieciowego (powinno być zrobione po poprzednich ćwiczeniach) a. Edycja pliku: $TNS_ADMIN/admin/listener.ora

b. Edycja pliku: $TNS_ADMIN/admin/tnsnames.ora

c. Uruchomienie procesu nasłuchu: lsnrctl start LISTENERXX

2. Przygotowanie bazy danych

a. Przygotowanie pliku parametrowego

SQL> create spfile from pfile='$HOME/admin/pfile/initDBXX.ora';

File created.

b. Uruchomienie instancji bazy danych

SQL> startup

ORACLE instance started.

Total System Global Area 159383552 bytes

Fixed Size 1218244 bytes

Variable Size 58722620 bytes

Database Buffers 92274688 bytes

Redo Buffers 7168000 bytes

Database mounted.

Database opened.

c. Zezwolenie na automatyczne powiększanie pliku tworzącego tymczasową przestrzeń tabel:

SQL> select name from v$tempfile;

NAME

------------------------------

/home1/admXX/oradata/TEMP1.dbf

SQL> alter database tempfile '/home1/admXX/oradata/TEMP1.dbf'

autoextend on;

Database altered.

d. Wskazanie procesu nasłuchu, który powinien obsługiwać instancję bazy danych SQL> alter system set LOCAL_LISTENER=LISTENER1 scope=both;

SQL> alter system set LOCAL_LISTENER=LISTENERXX scope=both;

System altered.

SQL> alter system register;

System altered.

e. Stworzenie pliku hasłowego ( polecenie wpisać w jednej linii)

[admXX@admlab2 ~]$ sudo -u oracle_adm orapwd

file=$ORACLE_HOME/dbs/orapwDBXX

password=oracle entries=5

FORCE=y

f. Sprawdzenie poprawności działania pliku hasłowego

[admXX@admlab2 ~]$ sqlplus sys/oracle@DBXX as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 3 00:20:46

2010

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -

Production

With the Partitioning, OLAP and Data Mining options

3. Tworzenie konfiguracji dla narzędzia Enterprise Manager ( polecenie wpisać w jednej linii)

[admXX@admlab2 ~]$ sudo -u oracle_adm emca -config dbcontrol db

-repos recreate -SID DBXX -PORT 100XX -DBSNMP_PWD oracle -

SYSMAN_PWD oracle -SYS_PWD oracle -DBCONTROL_HTTP_PORT 110XX -

AGENT_PORT 120XX -RMI_PORT 130XX -JMS_PORT 140XX

STARTED EMCA at Mar 2, 2010 11:42:47 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

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

Enter the following information:

Email address for notifications (optional):

Outgoing Mail (SMTP) server for notifications (optional):

---------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ... /home/oracle_adm/oracle/product/10.2.0/db_1

Database hostname ................ admlab2.cs.put.poznan.pl

Listener port number ................ 100XX

Database SID ................ DBXX

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............

---------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: Y

Mar 2, 2010 11:43:06 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at

[…]

INFO: >>>>>>>>>>> The Database Control URL is http://admlab2.cs.put.poznan.pl:110XX/em <<<<<<<<<<< Enterprise Manager configuration completed successfully

FINISHED EMCA at Mar 2, 2010 11:48:34 PM

4. Zarządzanie narzędziem Enterprise Manager

a. Uruchamianie

[admXX@admlab2 ~]$ sudo -u oracle_adm emctl start dbconsole

TZ set to Poland

Oracle Enterprise Manager 10g Database Control Release

10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights

reserved.

http://admlab2.cs.put.poznan.pl:110XX/em/ console/aboutApplication Starting Oracle Enterprise Manager 10g Database Control

.................................. started.

-------------------------------------------------------------

Logs are generated in directory

/home/oracle_adm/oracle/product/10.2.0/db_1/admlab2.cs.put.pozn

an.pl_DBXX/sysman/log

b. Zatrzymywanie

[admXX@admlab2 ~]$ sudo -u oracle_adm emctl stop dbconsole

TZ set to Poland

Oracle Enterprise Manager 10g Database Control Release

10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights

reserved.

http://admlab2.cs.put.poznan.pl:110XX/em/ console/aboutApplication Stopping Oracle Enterprise Manager 10g Database Control ...

... Stopped.

c. Sprawdzanie statusu

[admXX@admlab2 ~]$ sudo -u oracle_adm emctl status dbconsole

TZ set to Poland

Oracle Enterprise Manager 10g Database Control Release

10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights

reserved.

http://admlab2.cs.put.poznan.pl:110XX/em/ console/aboutApplication Oracle Enterprise Manager 10g is running.

--------------------------------------------------------------

Logs are generated in directory

/home/oracle_adm/oracle/product/10.2.0/db_1/admlab2.cs.put.pozn

an.pl_DBXX/sysman/log

5. Logowanie do konsoli administracyjnej

a. W przeglądarce internetowej wprowadź adres, który wyświetlały wyniki poleceń z poprzedniego ćwiczenia (wystarczy jego wyróżniona część)

b. Zaloguj się jako użytkownik sys z hasłem oracle i uprawnieniami sysdba

c. Zapoznaj się z interfejsem konsoli administracyjnej. Postaraj się znaleźć informacje o:

• Statusie bazy danych (czy instancja i proces nasłuchowy są uruchomione)

• Przestrzeniach tabel i tworzących je plikach

• Tymczasowej przestrzeni tabel

• Plikach dziennika powtórzeń

• Parametrach inicjalizacyjnych instancji