Oracle® Database Oracle Clusterware and Oracle Real Application Clusters Installation Guide 10g Release 2 (10.2) for AIX Part Number B14201-04 |
|
|
View PDF |
This chapter describes the procedures for converting from Oracle Database 10g single-instance databases to Oracle Real Application Clusters (RAC) databases. This appendix contains the following topics:
If you are upgrading from Oracle Parallel Server to RAC, or from an earlier version of RAC, then use Oracle Database Upgrade Assistant (DBUA). In other words, the procedures in this chapter assume that your original single-instance database and the target RAC database are the same release of Oracle 10g, and running on the same platform.
Note:
You must use clustered ASM instances for RAC databases.See Also:
You must comply with the restrictions of the license you have purchased. To understand the restrictions of your license, please refer to the Database Licensing Information manualNote the following administrative considerations before conversion:
Backup procedures should be available before converting from a single-instance Oracle Database to RAC.
Additional archiving considerations apply in RAC environments. In particular, the archive file format requires a thread number. In addition, the archived logs from all instances of a RAC database are required for media recovery. If you archive to a file and you do not use a cluster file system, then a method of accessing the archive logs from all nodes on which the cluster database has instances is required where file systems are not shared.
You can use Database Configuration Assistant to convert from single-instance Oracle databases to RAC. DBCA automates the configuration of the control file attributes, creates the undo tablespaces and the redo logs, and makes the initialization parameter file entries for cluster-enabled environments. It also configures Oracle Net Services, Oracle Clusterware resources, and the configuration for RAC database management for use by Oracle Enterprise Manager or the SRVCTL utility.
Before you use DBCA to convert a single-instance database to a RAC database, ensure that your system meets the following conditions:
It is a supported hardware and operating system software configuration.
It has shared storage: either Oracle Cluster File System or ASM is available and accessible from all nodes.
Your applications have no design characteristics that preclude their use with cluster database processing.
If your platform supports a cluster file system, then you can use it for RAC. You can also convert to RAC and use a non-shared file system. In either case, Oracle strongly recommends that you use Oracle Universal Installer (OUI) to perform an Oracle Database 10g installation that sets up the Oracle home and inventory in an identical location on each of the selected nodes in your cluster.
This section describes the following scenarios:
To convert from a single-instance Oracle Database that is on a non-cluster computer to RAC, perform the procedures described in the following sections, and in the order shown:
Use DBCA to create a preconfigured image of your single-instance database by using the following procedure:
Navigate to the bin directory in $ORACLE_HOME, and start DBCA.
At the Welcome page, click Next.
On the Operations page, select Manage Templates, and click Next.
On the Template Management page, select Create a database template and From an existing database (structure as well as data), and click Next.
On the Source Database page, enter the database name in the Database instance field, and click Next.
On the Template Properties page, enter a name for your template in the Name field. Oracle recommends that you use the database name.
By default, the template files are generated in the directory ORACLE_HOME/assistants/dbca/templates
If you choose to do so, you can enter a description of the file in the Description field, and change the template file location in the Template data file field.
When you have completed entries, click Next.
On the Location of Database Related Files page, select Maintain the file locations, so that you can restore the database to the current directory structure, and click Finish.
DBCA generates two files: a database structure file (template_name
.dbc
), and a database preconfigured image file (template_name
.dfb
).
Perform the pre-installation steps as documented in Part II of this book. Then set up shared storage by referring to the "Configure Disk Storage for Oracle Database and Recovery Files" sections in the pre-installation chapter in Part II.
See Also:
Storage vendor-specific documentation for setting up the shared disk subsystem and for information about how to mirror and stripe disksTo use vendor clusterware, form a cluster with the required number of nodes according to your hardware vendor's documentation. When you have configured all of the nodes in your cluster, either with or without vendor clusterware, then install Oracle Clusterware and validate cluster components by referring to the procedures in Chapter 4, "Installing Oracle Clusterware".
Validate the cluster configuration using the Cluster Verification Utility, as described in Chapter 5, "Installing Oracle Database 10g with Oracle Real Application Clusters".
Copy the preconfigured database image. This includes copying the database structure *.dbc
file and the database preconfigured image *.dfb
file that DBCA created in the previous procedure "Back Up the Original Single-Instance Database" to a temporary location on the node in the cluster from which you plan to run DBCA.
Run the Oracle Universal Installer (OUI) to perform an Oracle Database installation with RAC.
Select Cluster Installation Mode on the Specify Hardware Cluster Installation page of the Oracle Universal Installer (OUI), and select the nodes to include in your RAC database.
On the OUI Database Configuration Types page, select the Advanced install type.
After installing the Oracle Database software, OUI runs post-installation configuration tools, such as Network Configuration Assistant (NETCA), DBCA, and so on.
On the DBCA Template Selection page, use the template that you copied to a temporary location in the "Copy the Preconfigured Database Image" procedure. Use the browse option to select the template location.
If you selected raw storage on the OUI Storage Options page, then on the DBCA File Locations Tab on the Initialization Parameters page, replace the data files, control files, and log files, and so on, with the corresponding raw device files if you have not set up the DBCA_RAW_CONFIG
environment variable. You must also replace default database files with raw devices on the Storage page.
See Also:
for more details about DBCAAfter creating the RAC database, DBCA displays the Password Management page on which you must change the passwords for database privileged users who have SYSDBA
and SYSOPER
roles. When DBCA exits, the conversion process is complete.
There are three scenarios in which a single-instance database can exist on a cluster computer:
Scenario 1: The Oracle home from which the single-instance database is running is cluster-installed. The steps to perform a conversion to RAC in this scenario are described in "Single Instance on a Cluster Running from a Cluster-Enabled Oracle Home".
Scenario 2: The Oracle home from which the single-instance database is running is cluster-installed, but the RAC feature is disabled. Refer to "Single Instance on a Cluster Running from a RAC-Disabled Oracle Home" for instructions on how to convert the database to RAC in this environment.
Scenario 3: The Oracle home from which the single-instance database is running is not cluster-installed. The procedure to convert the single-instance database to RAC in this scenario is described in "Single Instance on a Cluster Running from a Single-Instance Installed Oracle Home".
Use the following procedures to convert your single-instance database on a cluster computer to RAC for all of these scenarios.
Perform the following procedures to convert a single-instance database on a cluster running from a cluster-installed (Oracle Database 10g with RAC) Oracle home.
Use DBCA to create a preconfigured image of your single-instance database as described in the section "Back Up the Original Single-Instance Database". To perform the conversion manually, shut down the single-instance database.
To add nodes to your cluster, add and connect these nodes to the cluster as described in the section "Perform the Pre-Installation Steps". Ensure that all of these nodes can access the shared storage. Also, extend the Oracle Clusterware home to the new nodes using the procedures for "Extending Clusterware and Oracle Software to New Nodes" as described in Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.
From the existing Oracle home, extend this home to the new nodes using the procedure "Adding Nodes at the Oracle RAC Database Layer" as described in Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.
From one of the newly added nodes, configure the listeners on the additional nodes using NetCA. Choose the same port number and protocol that you used on the existing node. If NetCA displays the existing node in the node list page, then do not select this node, because the listener is already configured on it.
Convert the database using one of the following procedures:
If you created the preconfigured image of the single instance database as described in the section "Back Up the Original Single-Instance Database", then use DBCA to complete the conversion to a RAC database.
Start DBCA from the initial node. Select the names of the nodes that you want to include as part of your cluster database. On the Template Selection page, select the preconfigured template that you created in Step 1. Enter the database name and respond to the remaining DBCA prompts.
To use raw devices for the cluster database files: When the Initialization Parameters page appears, enter the raw device name for the SPFILE on the File Locations tab. On the Storage page, replace the default database file names with the raw devices for the control files, redo logs, and data files to create the cluster database. Click Finish, and create the database.
After creating the RAC database, DBCA displays the Password Management page on which you must change the passwords for the database privileged users who have SYSDBA
and SYSOPER
roles. When DBCA exits, the conversion process is complete.
Because you did not use DBCA to create a preconfigured image of your single-instance database in step 1, perform the following steps to complete the conversion:
Create the Optimal Flexible Architecture (OFA) directory structure on each of the nodes that you have added.
See Also:
"Directory Structures for Real Application Clusters" for more information about OFAIf you are converting single-instance database files on a file system to raw devices, then copy the database data files, control files, redo logs, and server parameter file to their corresponding raw devices using the dd
command. Otherwise, continue to the next step.
Re-create the control files by running the CREATE CONTROLFILE
SQL statement with the REUSE
keyword and specify MAXINSTANCES
and MAXLOGFILES
, and so on, as needed for your RAC configuration. The MAXINSTANCES
recommended default is 32.
Shut down the database instance.
If your single-instance database was using an SPFILE parameter file, then create a temporary PFILE from the SPFILE using the following SQL statement:
CREATE PFILE='pfile_name' from spfile='spfile_name'
Set the CLUSTER_DATABASE
parameter to TRUE
, set the INSTANCE_NUMBER
parameter to a unique value for each instance, using a sid
.
parameter
=
value
syntax.
If you optimized memory usage on your single-instance database, then adjust the size of the system global area (SGA) to avoid swapping and paging when you convert to RAC. you should make this adjustment because RAC requires about 350 bytes for each buffer to accommodate the Global Cache Service (GCS). For example, if you have 10,000 buffers, then RAC requires about 350 multiplied by 10,000 bytes more memory. Therefore, adjust the size of the SGA by changing the DB_CACHE_SIZE
and DB_nK_CACHE_SIZE
parameters accordingly.
Start up the database instance using the PFILE created in step 5.
If your single-instance database was using automatic undo management, then create an undo tablespace for each additional instance using the CREATE UNDO TABLESPACE
SQL statement. If you are using raw devices, then ensure that the data file for the undo tablespace is on the raw device.
Create redo threads that have at least two redo logs for each additional instance. If you are using raw devices, then ensure that the redo log files are on raw devices. Enable the new redo threads by using an ALTER DATABASE
SQL statement. Then, shut down the database instance.
Copy the Oracle password file from the initial node, or from the node from which you are working, to the corresponding location on the additional nodes on which the cluster database will have an instance. Replace the ORACLE_SID
name in each password file appropriately for each additional instance.
Add REMOTE_LISTENER=LISTENER_
DB_NAME
and sid
.LOCAL_LISTENER=LISTENER_
SID
parameters to the PFILE.
Configure the net service entries for the database and instances, and address entries for the LOCAL_LISTENER
for each instance and for the REMOTE_LISTENER
in the tnsnames.ora
file. When you have done this, copy these to all nodes.
Create the SPFILE from the PFILE using the procedures in the section "Procedures for Migrating to the Server Parameter File". If you are not using a cluster file system, then ensure that the SPFILE is on a raw device.
Create the $ORACLE_HOME/dbs/init
sid
.ora
file that contains the following entry:
spfile='spfile_path_name'
The variable spfile_path_name
is the complete path name of the SPFILE.
Add the configuration for the RAC database and its instance-to-node mapping using SRVCTL.
Start the RAC database using SRVCTL.
After starting the database with SRVCTL, your conversion process is complete and, for example, you can run the following SQL statement to see the status of all the instances in your RAC database:
select * from v$active_instances
You can install a single instance on a cluster running from a RAC-disabled Oracle home if you performed a one-node cluster (with RAC) installation, but later disabled the RAC feature by unlinking it from the oracle
binary before creating the single instance database. (However, you can also select the local and non-cluster selection on the Node Selection Page to create a non-RAC-enabled single-instance home on a cluster.) Perform the following procedures to convert this type of single-instance database to a RAC database:
Use DBCA to create a preconfigured image of your single-instance database as described in the section "Back Up the Original Single-Instance Database". To perform the conversion manually, shut down the single-instance database.
Change the directory to the lib
subdirectory in the rdbms
directory under the Oracle home.
Relink the oracle
binary by running the following commands:
make -f ins_rdbms.mk rac_on make -f ins_rdbms.mk ioracle
Continue with step 2.
You can only install a single instance on a cluster running from a single-instance installed Oracle home if you selected the local installation option on the OUI Specify Hardware Cluster Installation page during the single-instance Oracle Database 10g installation.
To convert this type of database to a RAC database, perform the procedures described in the following sections:
"Install Oracle Database 10g Software with Real Application Clusters". In this step, make sure that you select a new Oracle home other than the one from which the single-instance database was running.
You can use rconfig
, or Oracle Enterprise Manager to assist you with the task of converting a single-instance database installation to a RAC database. The first of these, rconfig
, is a command line utility. Oracle Enterprise Manager Grid Control database administration option, Convert to Cluster Database, provides a GUI conversion tool. The following sections describe how to use these conversion tools:
Note:
Before you start the conversion, as is always true before you start any major change to your database, always back up your existing database.Before you convert a single-instance database to a RAC database, ensure that the following conditions are met for each cluster node that you intend to make a RAC database node:
Oracle Clusterware 10g Release 2 (10.2) is installed, configured, and running.
Oracle Real Application Clusters 10g Release 2 (10.2) software is installed.
The Oracle binary is enabled for RAC.
Shared storage, either Oracle Cluster File System or ASM, is available and accessible from all nodes.
User equivalence exists for the oracle user.
If you intend to use Oracle Enterprise Manager, then all Enterprise Manager agents are configured and running, and are configured with cluster and host information.
Note:
You must use clustered ASM instances for RAC databases. If your single-instance database uses ASM Storage, then before you userconfig
to convert the Oracle Database with RAC, convert your ASM installation to a cluster-enabled ASM as described in "Converting Single-Instance ASM to Cluster ASM".The following is a list of scenarios for converting a single-instance Oracle database to an Oracle Real Application Clusters (RAC) database:
Converting a single-instance Oracle Database 10g Release 2 (10.2) to an Oracle 10g Release 2 (10.2) RAC database, running out of the same Oracle home and using the same data files as the single-instance database
In this scenario, either use the rconfig
utility, or use the Convert to RAC option on the single-instance database target of Oracle Enterprise Manager Grid Control.
Converting a single-instance Oracle Database version previous to Oracle Database 10g Release 2 (10.2), running out of the same Oracle home and using the same data files as the single-instance database
In this scenario, use OUI and Database Upgrade Assistant (DBUA) to update the single-instance database to Oracle Database 10g Release 2 (10.2). Then use rconfig
or the Enterprise Manager Convert to RAC option, as described in the preceding scenario.
Converting a single-instance Oracle Database 10g Release 2 (10.2) to an Oracle 10g Release 2 (10.2) RAC database, running out of a different Oracle home and using the same data files as the single-instance database.
In this scenario, either use the rconfig
utility in the source database home (the database that you are converting), or use the Convert to RAC option in the single-instance database target of Oracle Enterprise Manager Grid Control. Provide the file storage location when prompted.
Converting a single-instance Oracle Database 10g Release 2 (10.2) to an 10g Release 2 (10.2) RAC database, running out of a different Oracle home, and where the host where the single-instance database is running is not one of the nodes of the RAC database
In this scenario, create a clone image of the single-instance database, and move the clone image to a host that is one of the nodes of the cluster. Then use rconfig
or the Enterprise Manager Convert to RAC option, as described in the preceding scenario.
You can use the command line utility rconfig
to convert a single-instance database to RAC. To use this feature, complete the following steps:
See Also:
Oracle Database Upgrade Guide for information about upgrading existing Oracle Database installationsAs the oracle
user, navigate to the directory $ORACLE_HOME/assistants/rconfig/sampleXMLs
, and open the file ConvertToRAC.xml
using a text editor, such as vi.
Review the ConvertToRAC.xml
file, and modify the parameters as required for your system. The XML sample file contains comment lines that provide instructions for how to configure the file.
When you have completed making changes, save the file with the syntax filename.xml. Make a note of the name you select.
Navigate to the directory $ORACLE_HOME/bin
, and use the following syntax to run the command rconfig
:
rconfig input.xml
where input.xml is the name of the XML input file you configured in step 2.
For example if you create an input XML file called convert.xml
, then enter the following command
$ ./rconfig convert.xml
Note:
TheConvert verify
option in the ConvertToRAC.xml
file has three options:
Convert verify="YES"
: rconfig performs checks to ensure that the prerequisites for single-instance to RAC conversion have been met before it starts conversion
Convert verify="NO"
: rconfig does not perform prerequisite checks, and starts conversion
Convert verify="ONLY"
rconfig only performs prerequisite checks; it does not start conversion after completing prerequisite checks
The following is an example of an XML input file for the rconfig utility. In the example, the XML input file is for converting a single-instance database with ASM to a RAC database with ASM in the same Oracle home.
<n:RConfig xsi:schemaLocation="http://www.oracle.com/rconfig"> - <n:ConvertToRAC> - <!-- Verify does a precheck to ensure all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY --> - <n:Convert verify="YES"> - <!-- Specify current OracleHome of non-rac database for SourceDBHome --> <n:SourceDBHome>/oracle/product/10.2.0/db_1</n:SourceDBHome> - <!-- Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome --> <n:TargetDBHome>/oracle/product/10.2.0/db_1</n:TargetDBHome> - <!-- Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion --> - <n:SourceDBInfo SID="sales"> - <n:Credentials> <n:User>sys</n:User> <n:Password>oracle</n:Password> <n:Role>sysdba</n:Role> </n:Credentials> </n:SourceDBInfo> - <!-- ASMInfo element is required only if the current non-rac database uses ASM Storage --> - <n:ASMInfo SID="+ASM1"> - <n:Credentials> <n:User>sys</n:User> <n:Password>welcome</n:Password> <n:Role>sysdba</n:Role> </n:Credentials> </n:ASMInfo> - <!-- Specify the list of nodes that should have rac instances running. LocalNode should be the first node in this nodelist. --> - <n:NodeList> <n:Node name="node1"/> <n:Node name="node2"/> </n:NodeList> - <!-- Specify prefix for rac instances. It can be same as the instance name for non-rac database or different. The instance number will be attached to this prefix. --> <n:InstancePrefix>sales</n:InstancePrefix> - <!-- Specify port for the listener to be configured for rac database.If port="", alistener existing on localhost will be used for rac database.The listener will be extended to all nodes in the nodelist --> <n:Listener port="1551"/> - <!-- Specify the type of storage to be used by rac database. Allowable values are CFS|ASM. The non-rac database should have same storage type. --> - <n:SharedStorage type="ASM"> - <!-- Specify Database Area Location to be configured for rac database.If this field is left empty, current storage will be used for rac database. For CFS, this field will have directory path. --> <n:TargetDatabaseArea>+ASMDG</n:TargetDatabaseArea> - <!-- Specify Flash Recovery Area to be configured for rac database. If this field is left empty, current recovery area of non-rac database will be configured for rac database. If current database is not using recovery Area, the resulting rac database will not have a recovery area. --> <n:TargetFlashRecoveryArea>+ASMDG</n:TargetFlashRecoveryArea> </n:SharedStorage> </n:Convert> </n:ConvertToRAC> </n:RConfig>
You can use Oracle Enterprise Manager Grid Control to convert a single-instance database to RAC. To use this feature, complete the following steps:
See Also:
Oracle Database Upgrade Guide for information about upgrading existing Oracle Database installationsLog in to Grid Control. From the Grid Control Home page, click the Targets tab.
On the Targets page, click the Databases secondary tab, and click the link in the Names column of the database that you want to convert to RAC.
On the Database Instance Home page, click the Administration secondary tab.
On the Administration page, in the Database Administration Change Database section, click Convert to Cluster Database.
Log in as the database user SYS with SYSDBA privileges to the database you want to convert, and click Next.
On the Convert to Cluster Database: Cluster Credentials page, provide a user name and password for the oracle
user and password of the target database that you want to convert. If the target database is using ASM, then also provide the ASM SYS user and password, and click Next.
On the Hosts screen, select the host nodes in the cluster that you want to be cluster members in the RAC database installed. When you have completed your selection, click Next.
On the Convert to Database: Options page, select whether you want to use the existing listener and port number, or specify a new listener and port number for the cluster. Also provide a prefix for cluster database instances on the cluster.
When you have finished entering information, click Next, or click Help if you need assistance in deciding how to enter information.
On the Convert to Cluster Database: Shared Storage page, either select the option to use your existing shared storage area, or select the option to have your database files copied to a new shared storage location. Also, decide if you want to use your existing Flash Recovery area, or if you want to copy your Flash Recovery files to a new Flash Recovery area using files managed by Oracle Database.
When you have finished entering information, click Next, or click Help if you need assistance in deciding how to enter information.
On the Convert to Cluster Database: Review page, review the options you have selected. Click Submit Job if you want to proceed to conversion. If you want to change options you have selected, click Back. To cancel the conversion, click Cancel.
On the Confirmation page, click View Job to check the status of the conversion.
To convert a single-instance node using ASM to a RAC node using ASM:
Shut down the database instance, the ASM instance, and the listener.
Follow the instructions in Chapter 2 and Chapter 3 to configure each node that you want to have as a cluster member.
If any cluster member node has had previous versions of Oracle clusterware (Cluster Ready Services or Oracle Clusterware) installed, then ensure that you remove the file ocr.loc
on any node that has been labeled previously as a cluster node. The file ocr.loc
is in/etc/oracle
.
log in as the oracle
user, and run DBCA in silent mode to deconfigure ASM. To run DBCA in silent mode, navigate to the directory $ORACLE_HOME/bin and use the following command syntax on the local node:
dbca -silent -deleteASM
You can de-install the single-instance ASM without losing data.
Install Oracle Clusterware on all nodes you intend to have as cluster members, following the directions in Chapter 4.
Install Cluster ASM using DBCA. At the Node Selection page, select all the cluster member nodes for which you intend to use ASM to manage storage. When the ASM Disk Groups page prompts you to select disk groups, select the existing disk groups you used with the single-instance ASM instance that you deleted in step 4.
Start up the single-instance Oracle Database.
After completing the conversion, note the following recommendations for RAC environments, as described in the RAC documentation:
Follow the recommendations for using load balancing and transparent application failover, as described in Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.
Use locally managed tablespaces instead of dictionary managed tablespaces to reduce contention and manage sequences in RAC as described in Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.
Follow the guidelines for configuring an interconnect, for using automatic segment space management and for using SRVCTL to administer multiple instances, as described in Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.
The buffer cache and shared pool capacity requirements in RAC are slightly greater than the requirements for single-instance Oracle databases. Therefore, you should increase the size of the buffer cache by about 10%, and the size of the shared pool by about 15%.