Create 12c RAC Database
Overview
What follows are the steps to create a standard Oracle RAC database for an enterprise environment.
You can view the progress of the dbca via:
tail -f /u01/app/oracle/diag/rdbms/<DBName>/<InstName>/trace/alert_<InstName>.log
TOC
Create RAC Database
Prerequisites
- You have created the BASH profile? for the oracle user account.
- Your SA has provided disks and volumes for ASM.
- You have installed and configured the Grid Infrastructure (GI)?.
- As grid user, ensure core cluster components up:
- olsnodes
- srvctl status asm
- crsctl check cluster -all
- crs_stat -t
- Using asmca you have created the required Disk Groups
Commonly created groups below:- MGMT: Grid Infrastructure Management Repository (AKA GIMR).
- GRID: OCR (Oracle Cluster Registry) and Voting Files.
- DATA: Control, data, redo, parameter, password and temp files.
- FRA (Fast Recovery Area): Archived logs, control and redo files.
Procedure
Perform the below as the oracle user account.
Run dbca.
cd $ORACLE_HOME/bin ./dbca &
Welcome
Next
Database Operation
Create Database
Creation Mode
Advanced configuration
Deployment Type
Database Type: Oracle Real Application Clusters (RAC) Database Configuration Type: Admin Managed Custom Database
Nodes Selection
Ensure all nodes to selected. Example: lnx01 lnx02
Database Identification
Global Database Name: oradb SID Prefix: oradb Note: Whatever name you choose will be used as the base name for instances. Ex: oradb1, oradb2 ... Create As Container Database
Storage Option
Use following for the database storage attributes Database files Storage Type: Automatic Storage Management (ASM) +DATA/{DB_UNIQUE_NAME} Use Oracle-Managed Files
This will be the: DB_CREATE_FILE_DEST
Fast Recovery Area
Specify Fast Recovery Area Recovery Files Storage Type: Automatic Storage Management (ASM) Fast Recovery Area: +FRA Fast Recovery Area Size: <use default or greater> Ex: 25 GB Determine FRA Size Enable Archiving Automatic Archiving Archive Log File Format: %t_%s_%r.arc Note: No need to specify "Archive log destinations". The FRA will be used.
This will be the: DB_RECOVERY_FILE_DEST
Database Options
Only select what you are actually going to use. Ex: Oracle JVM (if prompted) Data Vault Option [ ] Configure Oracle Database Vault [ ] Configure Oracle Label Security
Configuration Options
Memory Use Automatic Shared Memory Management SGA size: 2394 mb (Use 50-75% of your systems RAM.) PGA size: 798 mb Sizing Block Size: 8192 Bytes Processes: 1500 Character Sets Use Default Connection Mode Dedicated Server Mode
Management Options
Run Cluster Verification Utility (CVU) Check Periodically Configure Enterprise Manager (EM) Database Express EM Database Express Port: 5500 Register with Enterprise Manager (EM) Cloud Control
User Credentials
Use the same administrative password for all accounts Password: ******** Confirm Password: ********
Creation Options
Create database Select: ===> Make sure to press after each change! <=== • Control Files: Options Maximum Datafiles: 1024 Maximum Instances: 8 Maximum Log History: 1 Maximum Redo Log Files: 16 Maximum Log Members: 3 • Tablespaces For each where possible: Use Locally Managed Tablespace Allocation: (x) Automatic Use Bigfile Tablespace Caveats • A SYSTEM tablespace cannot use Automatic Segment Space Management. • A Temp tablespace cannot be automatically allocated, i.e. you have to use (x) Uniform and specify Bytes. • Datafiles (AUTOEXTEND) Increment: 25 MBytes Maximum Size: Unlimited File Size (small | medium) -------------------------------- --------------------------- OMF_SYSAUX_1 1 gb | 2 gb OMF_SYSTEM_1 1 gb | 2 gb OMF_TEMP_1 5 gb | 25 gb OMF_UNDOTBS<n_1> 2 gb | 25 gb OMF_USERS_1 25 mb • Redo Log Groups (minimum 4 groups with two members each) File Name Size ----------------------------------- ------ <OMF_1_REDOLOG_MEMBER_0> 200 mb <OMF_2_REDOLOG_MEMBER_0> ... <OMF_3_REDOLOG_MEMBER_0> ... <OMF_4_REDOLOG_MEMBER_0> ... Create Database Save as a Database Template Name: Standard
Summary
Press • Window blanks out for about a minute. • Then Progress Page displayed... You can tail the log shown /u01/app/oracle/diag/rdbms/oradb/oradb1/trace/alert_oradb1.log
APPENDIX
Delete Database
As the oracle user run the Database Configuration Assistant (DBCA).
0. cd $ORACLE_HOME/bin
./dbca &
1. Select: (x) Delete Database.
User name: SYS
Password: ********
2. Management Options:
[ ] De-register from EM cloud control
3. Summary: Confirm this is the database you want deleted.
Then press Finish
4. Process will run...
5. When completed you will see the message:
"Database deletion completed"
You might need to delete FRA data to regain ASM space.
grid> asmcmd asmcmd> cd FRA asmcmd> rm -rf mydb
FRA data is not purged when you delete a database.
Add RAC Database Instance
- Assumes Oracle database product already installed.
- Run using the oracle user from first RAC node. You will add a node from there.
- Database Operation
(x) Instance Management - Instance Operation
(x) Add an instance - Database List
You should see Database listed\selected. Select Next. - List Instance
Existing instances will be displayed.
Click Next to add the new instance. - Add Instance
Instance Name: db3 (increments existing base name)
Node name: <Hostname Displayed> - Summary
- If need be change the Custom Storage Locations.
- Review then press Finish.
- Progress Page (process displayed)
- Adding instance...
- Completing instance management...
- Finish
Success = Instance "<InstanceName>" added successfully on node "<NodeName>".
Select Close. - Confirm
srvctl status database -d <DBName>
Added instance should be displayed.
Delete RAC Database Instance
This process deletes the Oracle instance and its associated OFA directory structure. All information about this instance will be deleted. Run using the oracle user from first RAC node. You will delete the node from there.
- Run DBCA
cd $ORACLE_HOME/bin
./dbca & - Database Operation
(x) Oracle RAC database Instance management - Instance Operation
(x) Delete an instance - Select Database
You should see the Database listed\selected.
Select instance from list to delete.
User name: sys
Password: ******** - Delete Instance Selection
(x) oradb3 (Node name: rac03) - Summary
- Instance to be deleted will be displayed.
- If correct press Finish.
- Progress Page (process displayed)
- Deleting instance...
- Completing instance management...
- Finish
Success = Instance "<InstanceName>" deleted successfully on node "<NodeName>".
Select Close. - Confirm
srvctl status database -d <DBName>
Deleted instance should not be displayed.
Fast Recovery Area (FRA) Size
The minimum recommended size is:
FRA = database size + RMAN files + archived logs + flashback logs (if used)
Multiplex Redo Logs and Control Files
Prerequisite (init file system):
mkdir -p /u03/oradata chown -R oracle:oinstall /u03/oradata chmod -R 775 /u03/oradata mkdir -p /u04/oradata chown -R oracle:oinstall /u04/oradata chmod -R 775 /u04/oradata
During dbca:
Location: 1. /u03/oradata Location: 2. /u04/oradata
OMF creates the following directories correspondingly:
/u03/oradata/ORADB /u03/oradata/ORADB/controlfile /u03/oradata/ORADB/onlinelog /u04/oradata/ORADB /u04/oradata/ORADB/controlfile /u04/oradata/ORADB/onlinelog
New Database Initial Oracle Schema
ANONYMOUS APPQOSSYS AUDSYS DBSNMP DIP GGSYS GSMADMIN_INTERNAL GSMCATUSER GSMUSER OJVMSYS ORACLE_OCM OUTLN REMOTE_SCHEDULER_AGENT SYS SYS$UMF SYSBACKUP SYSDG SYSKM SYSRAC SYSTEM WMSYS XDB XS$NULL