 |
|
Creating a 10g
Database on OCFS
Oracle Database Tips by Donald Burleson |
The following walks through the steps for creating
a 10g RAC database.
1.
Use oraenvor racenvto set the environmental variables and launch the
dbca. Use the ampersand to launch the configuration assistant as a
background process, freeing up the prompt for use.
2.
Choose to create or configure a Real Application Cluster
database.
3.
Choose to Create a Database.
4.
Ensure that all nodes are selected.
5.
Select Custom Database.
6.
Use any name you wish except that of a pre-existing database.
7.
If you choose to configure a database with Enterprise Manager,
be aware that doing so will launch the emwd.ps daemon. This will allow
you to manage the database from a browser on a remote computer. Take
note of the URL displayed on the ?Database creation complete? screen
at the end of the install.
8.
It is easier to use the same password for all accounts.
9.
This new feature is a big improvement over the 9i version of
dbca. Choose Cluster File System and continue.
10.
Indicate a directory on shared storage as shown.
11.
This book does not cover Flash Recovery or Archiving so
deselect these. Visit this book's support website for details on these
features. (http://www.database-expert.com/rac).
12.
To save time on database creation, eliminate all unnecessary
options as shown. If you chose to configure the database with
Enterprise Manager, then leave the checkbox for the EM repository
checked.
13.
Configure the database service and TAF policy as shown. A
database service adds entries to the
tnsnames.ora file and
resources to the CRS. This allows connections to failover to a backup
instance in the event of instance failure. See Appendix H for more
information about database services for high availability.
14.
This is simply a warning; do not configure memory usage below
44%.
15.
Depending on the available RAM, 60% memory allocation is a good
start.
16.
Verify the file locations for the datafiles.
17.
Choose to Create Database.
18.
Review the parameters before the last OK button is clicked.
19.
If the options were not included, database creation will take
about an hour. If an error occurs, it will almost certainly happen in
the first minute or two.
20.
If the Enterprise Manager was chosen, write down the URL shown
on this screen. Once the OK button is clicked on this screen, allow
several minutes for the database to be started on each node. The
following message will pop up and eventually disappear.
The Oracle 10g RAC database configuration is far
different from the 9i database configuration. By default, CRS will
attempt to keep everything, including databases, running at all times.
If nodes are rebooted at this time, the instances will be restarted
automatically.
Check the status of services with the
crs_status command as shown
in Figure 9.2. 10g databases will be listed in the output of this
command. However 9i databases, even when registered in the CRS, will
not.
What are these additional resources in the CRS
that end with ?.cs? and ?.srv?? These are the resources for the
database high availability service that were created. The following
commands can be used to read each service's complete configuration,
including Oracle's description.
$ORA_CRS_HOME/bin/crs_stat
?p ora.fast.fast_conn.cs
$ORA_CRS_HOME/bin/crs_stat ?p ora.fast.fast_conn.fast1.srv
$ORA_CRS_HOME/bin/crs_stat ?p ora.fast.fast_conn.fast2.srv
Turn to Appendix H for more information about
configuring database services for high availability.
10g srvctl
With the new Cluster Ready Services
added to Oracle 10g software, a number of new commands are available.
For example, the srvctl utility is now used to start, stop and check
the status of vip, gsd, listener,
and ons as a group. This group of programs is referred to as ?nodeapps.?
Figure 9.3 demonstrates checking the status of nodeapps.
A few new verbs have been added to srvctl's
vocabulary. The following table provides some examples:
### Disable a
database so that it does not start on boot:
srvctl stop database ?d mydb
srvctl disable database ?d mydb
### Enable a
database:
srvctl enable database ?d mydb
### Make an
instance dependent on another service
### (mydb will not be started until +ASM service is running)
srvctl modify instance ?d mydb ?i mydb1 's +ASM1
srvctl modify instance ?d mydb ?i mydb2 's +ASM2
For a more complete list of new srvctl
functionalities, visit the website http://tahiti.oracle.com to find
the Oracle Real Application Clusters Administrator's Guide (Part
Number B10765-02), and look for the subheading ?B Server Control (SRVCTL)
Reference.?
CRS Utilities
A number of CRS utilities, as listed in Figure
9.4, are included with 10g Cluster Ready Services. Looking at the help
available for each of these programs through the command and the tag
?help, demonstrates that most of these programs can do many things.
Unfortunately, these programs are poorly
documented by Oracle. What you should know about them is that they can
be used to add 3rd party applications to a cluster for
fault tolerance.
Figure 9.5 demonstrates using the
crs_startscript to start a database service after it has
been shutdown by srvctl. Even though the response from the program
only mentions member ?oracle1?, the database is started on both nodes.
This is only shown as a demonstration; I suggest using srvctl to start
and stop databases.
Before building the next database, it is a good
idea to shutdown the existing database and to prevent it from
restarting. Use srvctl to disable the database with the following
commands:
srvctl stop
database ?d fast
srvctl disable database ?d fast
Figure 9.6 demonstrates shutting down the existing
database with srvctl and removing its services from the CRS
repository. Note that when attempting to remove the last instance, the
error PRKP-1075 is returned. All instances are removed when the
database is removed, which means that removing the instances prior to
removing the database is unnecessary.
From experience, I have found it is better to use
srvctl to remove a database configuration than it is to use the $ORA_CRS_HOME/bin/crs_unregistercommand. The latter command leaves too much of the
configuration orphaned in the CRS file, making it impossible to add a
database with the same name back in later. However, crs_unregister can
be used to clean up any orphan configuration that srvctl missed. An
example can be found in Appendix C.
 |
If you want to learn RAC at home, get the bestselling book "Personal
Oracle Real Application Clusters" by Edward Stoever.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot of Oracle tuning scripts. |
|