Although the complete details of an Oracle Database 11g installation are beyond the scope of this book, you will see the basics of an Oracle install using the Oracle Universal Installer
Trang 110 Part I: Critical Database Concepts
new features include “invisible” indexes, simplified table maintenance, and editioned objects You should evaluate your previous architecture decisions in light of the new features available
In the next several chapters, you will see how to install Oracle Database 11g and how to upgrade to Oracle Database 11g from prior releases Following those chapters, you will see an
overview of application planning, followed by many chapters on the use of SQL, PL/SQL, Java, object-oriented features, and XML to get the most out of your Oracle database Your application architecture may change over time as the business process changes During those changes you should be sure to review the latest features to determine how your application can best exploit them for functionality and performance
Trang 2Installing Oracle
Database 11g and
Creating a Database
11
Trang 312 Part I: Critical Database Concepts
s Oracle’s installation software becomes easier to use with each release, it is very tempting to open the box of CDs and start the installation right away Although this
is fine if you’re going to experiment with some new database features, a lot more planning is required to perform a successful installation without rework or even reinstallation a month from now Although the complete details of an Oracle
Database 11g installation are beyond the scope of this book, you will see the basics of an
Oracle install using the Oracle Universal Installer (OUI) In any case, a thorough review of the installation guide for your specific platform is key to a successful Oracle database deployment
NOTE
Although this chapter is intended for beginning database
administrators, the planning process should include end users,
application developers, and system administrators, so the workload
and space requirements will be as accurate as possible.
The following issues should be addressed or resolved before you start the installation:
Decide on the local database name, and which domain will contain this database For the first project to use the database, estimate the number of tables and indexes as well as their size, to plan for disk space estimates beyond what is required for the Oracle SYSTEM tablespace and the associated Oracle software and tools
Plan the locations of the physical datafiles on the server’s disk to maximize performance and recoverability In general, the more physical disks, the better If a RAID or a shared storage area will be used for the datafiles, consider Oracle Managed Files to manage the placement of the datafiles You can use automatic storage management (ASM) to simplify your storage management See Chapter 51 for details on ASM
Review and understand the basic initialization parameters
Select the database character set, along with an alternate character set Although it’s easy
to let the character sets default on install, you may need to consider where the users of the database are located and their language requirements Character sets can be changed after installation only if the new character set is a superset of the existing character set Decide on the best default database block size The default block size defined by DB_ BLOCK_SIZE cannot be changed later without reinstalling the database Note that Oracle can support multiple block sizes within a single database
Plan to store non-SYSTEM user objects in non-SYSTEM tablespaces Make sure that all non-administrative users are assigned a non-SYSTEM tablespace as their default tablespace
Plan to implement Automatic Undo Management to ease administration of transaction undo information
Plan a backup and recovery strategy Decide how the database needs to be backed up, and how often Plan to use more than one method to back up the database
■
■
■
■
■
■
■
■
■
A
Trang 4Familiarity with a couple of key Web sites is a must Oracle Technology Network (OTN), at http://otn.oracle.com, has a wealth of information, including white papers, free tools, sample code,
and the online version of Oracle Magazine There is no charge for using OTN, other than registering
on the site You can download the latest version of the Oracle software from the OTN site
Purchasing a license for Oracle database software is a good start, but an Oracle support contract with Web support may be the key to a successful installation and deployment Using Oracle’s Metalink (http://metalink.oracle.com) means you might never have to leave the friendly confines of your Web browser to keep your database up and running Through Metalink, you can submit a support request, search through other support requests, download patches, download white papers, and search the bug database
Overview of Licensing and Installation Options
A successful initial software installation is the first step Regardless of the software and hardware platform on which you’re installing Oracle, the types of installations you can perform are the same Although these may change with product releases, they generally include the following:
Enterprise Edition This is the most feature rich and extensible version of the Oracle
database It includes features such as Flashback Database and allows you to add
additional pieces of licensed functionality, such as Oracle Spatial, Oracle OLAP,
Oracle Label Security, and Oracle Data Mining
Standard Edition This edition provides a good subset of the features of the Enterprise
Edition, generally including the features that a small business will need
Personal Edition This edition allows for development of applications that will run on
either the Standard or Enterprise Edition This edition cannot be used in a production environment
Licensing for the Oracle database is only by named user or CPU, and there is no longer a concurrent user licensing option Therefore, the DBA should use the initialization parameter LICENSE_MAX_USERS to specify the maximum number of users that can be created in the database
In addition, the Oracle Management Server (the back end for an Oracle Enterprise Manager, or OEM, client) can be installed during a server- or client-side installation However, it is recommended that this installation be performed after a basic database installation has been completed
Using OUI to Install the Oracle Software
Use the Oracle Universal Installer (OUI) to install and manage all Oracle components for both the
server-side and client-side components You can also deinstall any Oracle products from the initial OUI screens
During the server installation, you will choose the version of Oracle Database 11g from
the list in the previous section: Enterprise Edition, Standard Edition, or one of the other options available for your platform
It is strongly recommended that you create a starter database when prompted during the install Creating the starter database is a good way to make sure the server environment is set up correctly,
as well as to review any new features of Oracle Database 11g The starter database may also be a
good candidate as a repository for either OEM or Recovery Manager
■
■
■
Trang 514 Part I: Critical Database Concepts
The exact flow of the installation process may change depending on your operating environment and Oracle version At the conclusion of the Oracle software installation, the Database Configuration Assistant (DBCA) will launch and will begin the process of creating a new database for use on your server
NOTE
For UNIX environments, you will need to set a proper value for the
DISPLAY environment variable and enable xhost prior to starting OUI
via the runInstaller script.
When you launch the OUI, you will be asked to provide information about your configuration choices As shown in Figure 2-1, the first screen will ask for the base location for the Oracle software, the home location for the database, and the type of installation You can also choose to have a starter database created following the successful Oracle software installation For the database, you will need to specify its name and a password
FIGURE 2-1 OUI initial screen
Trang 6OUI will then
perform a series of
prerequisite checks
to make sure your
environment is
configured to support
the Oracle installation
These checks include
basic network
configuration and
environment variable
settings, as shown in the
illustration at right
Your database can
be configured to associate
with your Metalink
(Oracle Support)
account In the next
section of the OUI,
shown here, you can
specify the Metalink
username and password
you use You can use the
Test Registration option
to verify connectivity to
the Metalink site from
your computer
Trang 716 Part I: Critical Database Concepts
At this point, the
installation is ready to
proceed, and OUI will
display a list of the
selected products to
install As shown here,
that list will include the
core software as well
as related utilities and
scripts
The Oracle
installation can now
begin As shown below,
Oracle provides a
status bar to show the
installation progress
The time to complete
the installation depends
on the processing speed
of your computer Do
not run other processes
on your computer
during this time because they may interfere with the successful completion of the Oracle software installation
Trang 8After the Oracle software has been successfully installed, the Database Configuration Assistant will be automatically launched if you selected that option As shown in the following illustration, the creation steps include copying the datafiles for the starter database into the targeted area on your computer and then creating an instance The result of this step will be a fully functional database that you can use for the practice exercises in this book
As shown here, multiple configuration assistants will run The Database Configuration
Assistant (DBCA) creates the database, whereas the Oracle Net Configuration Assistant verifies your networking configuration Connections to your database will use Oracle Net You can choose not to run the configuration assistants or to retry those that fail
Trang 918 Part I: Critical Database Concepts
With the networking configuration verified, the DBCA can now complete the database creation, as shown next
When the database creation completes, you will see a summary screen similar to the one shown
in the following illustration The summary screen will list the name of the database that was created, the location of the database parameter file, and the accounts that are unlocked As a security measure, most of the accounts inside a new Oracle database are locked The password for the unlocked accounts is the password set during the initial creation (refer to Figure 2-1)
If you chose to change the security settings, you will see the security management page, shown next You may choose to unlock any of the standard accounts provided with your Oracle database For each of the unlocked accounts, you can specify a password By default, the only unlocked accounts are those used to manage the database, such as SYS and SYSTEM
Trang 10Following the password management screen, you will see a final set of summary screens showing the success of the individual configuration assistants and the overall success of the installation The database you created will be fully available, with an instance running on your local computer to access that database You can now use tools such as SQL*Plus to access the sample database
As part of the Windows installation, Oracle installs an Oracle Administration Assistant (in the Start menu structure, it is available under the Oracle configuration and migration tools menu) Use the Administration Assistant to simplify your management of your local database For example, you can navigate through the Administration Assistant interface to select your database When you right-click the database, a series of options will become available, including Startup/Shutdown Configuration Options You can use this screen to specify that the database instance will be started and shut down whenever the Windows service is started and shut down, thereby simplifying your