Tải bản đầy đủ (.pdf) (63 trang)

Oracle 2 days DBA student guide

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (11.36 MB, 63 trang )

Oracle Database 10g:
2 Days DBA
Volume I • Student Guide

D22057GC10
Production 1.0
June 2006
D46524

1


Authors
Donna Keesling
Maria Billings
Technical Contributors
and Reviewers
Christopher Andrews
Tammy Bednar
Tom Best
Harald van Breederode
Mary Jane Bryksa
Marielle Canning
Tim Chien
Donna Cooksey
Judy Ferstenberg
Gerlinde Frenzen
Joel Goodman
Pete Jones
Isabelle Marchand
Sabiha Miri


Manish Pawar
Jim Spiller
George Stabler
Anthony Woodell

Editor
Daniel Milne

Graphic Designer
Satish Bettegowda

Publisher
Jobi Varghese

2


Copyright © 2006, Oracle. All rights reserved.
Disclaimer
This docum ent contains proprietary information and is protected by copyright and
other intellectual property laws. You may copy and print this docum ent solely for your
own use in an Oracle training course. The document may not be modified or altered in
any way. Except where your use constitutes "fair use" under copyright law, you may
not use, share, download, upload, copy, print, display, perform, reproduce, publish,
license, post, transmit, or distribute this document in whole or in part without the
express authorization of Oracle.
The information contained in this docum ent is subject to change without notice. If you
find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

Restricted Rights Notice
If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
disclose these training materials are restricted by the terms of the applicable Oracle
license agreement and/or the applicable U.S. Government contract.
Trademark Notice
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle
Corporation and/or its affiliates. Other names may be trademarks of their respective
owners.

3


Flower Shop Database Table Descriptions
CUSTOMERS
CUSTOMER_ID
CUST_FIRST_NAME
CUST_LAST_NAME
STREET_ADDRESS
CITY
STATE
POSTAL_CODE
PHONE_NUMBER

NUMBER(6)
VARCHAR2(20)
VARCHAR2(20)

VARCHAR2(40)
VARCHAR2(30)
VARCHAR2(10)
VARCHAR2(10)
VARCHAR2(20)

EMPLOYEES
EMPLOYEE_ID
FIRST_NAME
LAST_NAME
EMAIL_ADDRESS
PHONE_NUMBER
HIRE_DATE
JOB_ID
SALARY
MANAGER_ID

NUMBER(6)
VARCHAR2(20)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(20)
DATE
VARCHAR2(10)
NUMBER(8)
NUMBER(6)

JOBS
JOB_ID
JOB_TITLE

MIN_SALARY
MAX_SALARY

VARCHAR2(10)
VARCHAR2(35)
NUMBER(6)
NUMBER(6)

JOB_HISTORY
EMPLOYEE_ID
START_DATE
END_DATE
JOB_ID

NUMBER(6)
DATE
DATE
VARCHAR2(10)

ORDERS
ORDER_ID
ORDER_DATE
ORDER_MODE
CUSTOMER_ID
DELIVERY_MODE
ORDER_STATUS
SALES_CLERK_ID
ORDER_TOTAL

NUMBER(12)

DATE
VARCHAR2(8)
NUMBER(6)
VARCHAR2(8)
NUMBER(2)
NUMBER(6)
NUMBER(8,2)

4


ORD_ITEMS
ORDER_ID
PRODUCT_ID
UNIT_PRICE
QUANTITY

NUMBER(12)
NUMBER(6)
NUMBER(8)
NUMBER(8)

PRODUCTS
PRODUCT_ID
PRODUCT_NAME
PRODUCT_DESC
CATEGORY
SUPPLIER_ID
LIST_PRICE
MIN_PRICE

QTY_ON_HAND

NUMBER(6)
VARCHAR2(50)
VARCHAR2(200)
NUMBER(2)
NUMBER(6)
NUMBER(8,2)
NUMBER(8,2)
NUMBER(8)

5


Practice 2: Installing the Oracle Database Software
Background: In the practices of this course, you assume the role of a DBA. The OS accounts on
your computer are:
 The oracle user with a password of oracle
 The root user with a password of oracle
The system administrator has set up the OS so that it is ready for the installation, and the installation
media is staged at /stage/Disk1. Perform the following tasks as the default oracle OS user,
unless otherwise indicated.
Your Tasks
1. Use Oracle Universal Installer (OUI) to begin your software installation of the Enterprise Edition
of Oracle Database 10g Release 2. This is a “Basic Installation” of the Oracle software with a
“starter” database. In the database, you unlock the HR schema that is used throughout the
following practice sessions.
2. Select your installation method by entering and accepting the following settings:
Object
Setting

Database Home Location

/u01/app/oracle/product/10.2.0/db_1

Installation Type

Basic

UNIX DBA Group

oinstall

Create Starter Database

Selected

Global Database Name

orcl

Database Password

oracle

Confirm Password

oracle

3. When the prerequisite checks are finished, install the Oracle software and enable the
configuration assistants to create and configure your first database.

4. Unlock the HR schema.
5. When prompted, execute configuration scripts as the root user. Accept the default for the local
bin directory. When finished, exit the root OS user, close the XTerm window, and finish your
installation with OUI.
Please make a note of your End of Installation URLs. You will use them in later practice
sessions.

iSQL*PlusURL:____________________________________________________________
iSQL*Plus DBA URL:_______________________________________________________
6


EM URL:_________________________________________________________________
Note: Completing this practice is critical for all following practice sessions.

7


1. Install the Oracle database software as the oracle user. Navigate to the /stage/Disk1
directory, and start the Oracle Universal Installer.
a. Double-click the XTerm icon on your desktop, and then enter:
$ cd /stage/Disk1
$ ./runInstaller
2. Select your installation method for OUI.
a. Select Basic Installation, and confirm the following settings:
Object

Setting

Database Home Location


/u01/app/oracle/product/10.2.0/db_1

Installation Type

Enterprise Edition

UNIX DBA Group

oinstall

Create Starter Database

Selected

Global Database Name

Orcl

b. Enter oracle as Database Password and Confirm Password. Then click Next. OUI is
checking product-specific prerequisites.

c. Click Next, when OUI has finished its prerequisite checks. Click Next again.
3. When the prerequisite checks are finished, the Summary page is displayed.
8


a. Click Install to begin your installation.
After the installation, the Database Configuration Assistant (DBCA) begins to configure your
database.

4. Unlock the HR schema.

a. Click the Password Management button, when prompted.
The Password Management page appears.
b. Scroll until you find the HR username, deselect Lock Account?, and enter hr in the New
Password and Confirm Password fields.

9


c. Click OK on the Password Management page, and then again on the Database Configuration
Assistant page. (The OK button is below the Password Management button.)
The next Configuration Assistant begins its work.
5. When the Execute Configuration scripts page appears, follow the instructions on that page, and
then finish your installation with OUI.

a. Double-click the XTerm icon on your desktop.
b. Run the orainstRoot.sh and root.sh scripts as root, and then click Continue.
10


$ su
# password: oracle screen>
# cd /u01/app/oracle/oraInventory
# ./orainstRoot.sh
# cd /u01/app/oracle/product/10.2.0/db_1
# ./root.sh
c. Accept the default for the local bin directory.


d. Enter exit to exit the root OS user.
e. Close the XTerm window, and click OK on the Execute Configuration scripts page.

The End of Installation page appears.

11


f.

Please make a note of your URLs. You will use them in later practice sessions.

iSQL*Plus URL:_______________________________________________________
iSQL*Plus DBA URL:__________________________________________________
EM URL:____________________________________________________________
g. Click Exit, and then click Yes to leave OUI.
h. Close the terminal window in which you started OUI.
You have installed the Oracle software and created your first database. Congratulations!

12


Practice 3: Using Oracle Enterprise Manager Database Control
In the flower shop, Enterprise Manager will be used to manage the database. In this practice, you
verify that the dbconsole process is started, and log in to Enterprise Manager Database Control.
1. Open a terminal window and log on to your PC as the oracle user.
2. Verify that the Enterprise Manager dbconsole process is started by using the emctl
utility to check the status.
/home/oracle> emctl status dbconsole
TZ set to US/Mountain

Oracle Enterprise Manager 10g Database Control Release
10.1.0.2.0
Copyright (c) 1996, 2003 Oracle Corporation. All rights
reserved.
http://localhost:5500/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
-------------------------------------------------Logs are generated in directory
/u01/app/oracle/product/10.1.0/orcl/sysman/log
3. If the dbconsole process is not started, use the emctl utility to start the process.
/home/oracle> emctl start dbconsole
4. Invoke Enterprise Manager Database Control by opening your browser and entering the
following URL: http://hostname:portnumber/em
Log in to the database as the SYS user and specify SYSDBA. Click I Agree on licensing
information page

13


5. When Database Control needs to call a host operating system command, it must authenticate to
the operating system. It is possible to save the host username and password by setting referred
credentials, so that they do not have to be entered for each command. Close the browser after
completing this practice.
Set preferred credentials for your host as follows:
a. Click Preferences in the links at the top right of the Database Control page.

b. Click Preferred Credentials in the menu to the left of the Preferences property page.

c. Click the Set Credentials icon for the Host target.

d. Enter the operating system username oracle and password oracle for normal and

privileged operations. Validate the entries by clicking Test.

14


e. When the test completes successfully, store the credentials by clicking Apply.

f.

f. Close the browser.

15


Practice 4: Configuring the Oracle Network Environment
In this practice, you verify that the listener is started. You also configure local naming to access
another database.
1. Invoke Enterprise Manager Database Control by opening your browser and entering the
following URL: http://hostname:portnumber/em
Log in to the database as the SYS user.
2. Click the Listener from the Database home page to verify that the listener is started.

3. In the flower shop, there will be multiple computers that use the application and access
the database. Work with another group in your classroom to simulate this requirement.
Configure local naming so that you can access the other group’s database.
a. Click Net Services Administration from the related links at the bottom of the Listener
status page.
16



b. Select Local Naming from the Administer drop-down list and click Go.

c. Enter host login information and select the Save as Preferred Credential check box.
Click Login.

d. Click Create to enter a new network service name.

17


- Enter testorcl for the Net Service Name.
- Select Use Service Name and enter orcl for the service name.
- Select Database Default.

e. Click Add in the Addresses region.
- Select the TCP/IP protocol.
- Enter 1521 for the listener port.
- Enter the host name or IP address for your partner’s computer.
- Click OK to return to the Create Net Service Name property page. Click OK.

4. Test the new network service name.
a. Select the testorcl service.
b. Click Test Connection.
c. Enter the password of oracle for dbsnmp and click Test.
18


d. Click OK.

19



Practice 5: Managing the Oracle Instance
In this practice, you use Enterprise Manager to shut down and restart your instance. In addition,
you explore the initialization parameters in your database and become familiar with the alert log
and trace files.
1. Log in to Database Control as the SYS user with a SYSDBA connection.

2. Shut down your instance.
a. Click Shutdown.
b. Enter host operating system credentials: username: oracle, password: oracle.
c. Enter database credentials: username: sys, password: created the database>.
d. Click OK, and then click Yes.
Question: What are the advanced options used for?

20


3. Restart your instance.
a. Exit Database Control. Wait for about two minutes, and then reopen Database
Control.
b. Click Startup.

c. Enter host operating system credentials: username: oracle, password: oracle.

21


d. Enter database credentials: username: sys, password:

created the database>.
e. Click OK, and then click Yes.

4. View the alert log to see what information was recorded when you restarted your instance.
a. Log in to Database Control.
b. Click Alert Log Content in the Related Links region at the bottom of the home page.

c. Move to the end of the log. Find:
- The time when the database was opened
- The location where background trace files will be written (BACKGROUND_DUMP_DEST)
- The version of the database

22


5. Access the Memory Parameters page to view the values for the memory parameters.
a. Navigate to the Administration property page.

b. Click Memory Parameters.

c. The Memory Parameters chart is displayed.

23


24


Practice 6: Managing Database Storage Structures
In this practice, you use Enterprise Manager to manage the storage structures of your database.

You verify whether the control file has been multiplexed and multiplex the redo log groups.
Finally, you create new tablespaces for tables and other objects in your flower shop database.
1. Log in to Database Control as the SYS user with a SYSDBA connection.
2. Access the Administration page, and click the Control Files link in the Storage region. Verify
whether the control files in your database have been multiplexed.

Question: Control files are multiplexed to decrease the chance of losing all control files from a
single failure. What would you do in a production system to improve the control file multiplexing
shown above?
3. Return to the Administration property page. Click Redo Log Groups.
Question: How could you improve the current configuration to make your system more reliable?
4. Multiplex the redo log files in your database to protect against loss.
a. Select group 1. Click Edit and then click Add.

25


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×