Use Oracle Universal Installer OUI to begin your software installation of the Enterprise Edition of Oracle Database 10g Release 2.. Select Basic Installation, and confirm the following s
Trang 2Harald van Breederode
Mary Jane Bryksa
Trang 33
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
Trang 66
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:
Database Home Location /u01/app/oracle/product/10.2.0/db_1
Create Starter Database Selected
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: _
Trang 77
EM URL: _
Note: Completing this practice is critical for all following practice sessions
Trang 82 Select your installation method for OUI
a Select Basic Installation, and confirm the following settings:
Database Home Location /u01/app/oracle/product/10.2.0/db_1 Installation Type Enterprise Edition
Create Starter Database Selected
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
Trang 99
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
Trang 1010
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
Trang 11c 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
Trang 12g 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!
Trang 1313
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
Trang 1414
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
Trang 1515
e When the test completes successfully, store the credentials by clicking Apply
f f Close the browser
Trang 1616
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
Trang 1717
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
Trang 1818
- 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
Trang 1919
d Click OK
Trang 2020
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: <the password you gave SYS when you
created the database>
d Click OK, and then click Yes
Question: What are the advanced options used for?
Trang 2121
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
Trang 2222
d Enter database credentials: username: sys, password: <the password you gave SYS when you
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
Trang 2323
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
Trang 2424
Trang 2525
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
Trang 2626
b Enter redo01_02.log in the File Name field
c Accept the default file directory, and click Continue
d Click Apply to save your changes
5 Click Redo Log Groups Verify that group 1 now has two members
Trang 2727
6 Repeat step 4 for the remaining two log groups For group 2, use a file name
7 Your flower shop database requires two tablespaces One tablespace will be used to store tables
and the other tablespace will be used for indexes Create a locally managed tablespace named
FSDATA he data file for this tablespace should be named flowers_data.dbf and should be
stored in the /u01/app/oracle/oradata directory
a From the Administration property page, click Tablespaces
b Click Create
c Enter FSDATA in the Name field
d Select Locally Managed, Permanent, and Read Write
e Click Add to enter the following information about the tablespace’s data file:
- Enter flowers_data.dbf in the File Name field
- Select the default file directory
- Enter 100 MB as the file size
- Select “Automatically extend datafile when full (AUTOEXTEND).”
- Enter 100 MB in the Increment field
- Select Value and enter 1 GB as the maximum file size
- Click Continue and then OK to create the tablespace
Trang 2828
8 Repeat step 7 to create a locally managed tablespace named FSINDX The data file for this tablespace should be named flowers_indx.dbf All other settings should be the same as the FSDATA tablespace
Question: Why did you select “Automatically extend datafile when full”?
Trang 2929
Practice 7: Administering Users and Security
In this practice, you use Enterprise Manager to create a role and two users
1 Log in to Database Control as the SYS user with a SYSDBA connection
2 Create the flower shop owner user with the following characteristics:
Temporary tablespace: TEMP
Default tablespace: FSDATA
a Click Users in the Users and Privileges region on the Administration property page
b Click Create
c Enter FSOWNER in the Name field
d Select the default profile and password authentication
e Enter FSOWNER in the Enter Password and Confirm Password fields
f Enter FSDATA in the Default Tablespace field
Hint: Click the flashlight icon for a list of available tablespaces
g Enter TEMP in the Temporary Tablespace field
3 Grant the CREATE SESSION and CREATE TABLE system privileges to the flower shop
owner:
a Select the user from the list of users displayed after the previous practice Click Edit, System
Privileges, and then click Edit List
Trang 3030
b Scroll down the list of available system privileges until you find CREATE SESSION and
CREATE TABLE Use the arrow button to move them to the Selected System Privileges
c Click OK
4 Grant quota on the FSDATA and FSINDX tablespaces to the flower shop owner
a Click Quotas
Trang 31d Click Apply to assign the quotas to FSOWNER
5 Grant Enterprise Manager administrative privileges to the FSOWNER user
Hint: For more information about this task, refer to the lesson titled “Using Oracle Enterprise
Manager Database Control.”
a Click Setup from the links at the top of the Database Control page
b Under Administrators, click Create to create a new administrator
c Enter FSOWNER in the Name, Password, and Confirm Password fields
d Leave Email Address blank
e Click
Trang 3232
6 Create a role for the flower shop retail clerk named FSCLERK with the CREATE
SESSION privilege:
Note: After you create tables and other objects in the next lesson, you grant object
privileges to this role
a Click Roles in the Users and Privileges region of the Administration property page
b Click Create and enter FSCLERK in the Name field, and then select None from the
Authentication drop-down list
c Click System Privileges, and then click Edit List
d Scroll down the list of available system privileges until you find CREATE SESSION
Use the arrow button to move it to the Selected System Privileges
e Click OK, and then click OK again to create the role
Trang 3333
7 Create the first flower shop retail clerk with the following characteristics:
Temporary tablespace: TEMP
a On the Administration property page, click Users
b Click Create
c Enter FSCLERK1 in the Name field
d Select the DEFAULT profile and password authentication
e Enter FSCLERK1 in the password and confirm password fields
f Enter FSDATA in the Default Tablespace field
g Enter TEMP in the Temporary Tablespace field
8 Grant the FSCLERK role to the FSCLERK1 user
a Click Roles and then click Edit List