Oracle 10g RMAN database Setup

Oracle Recovery Manager is an excellent tool for the backup and recovery of Oracle databases. It allows you to easily backup your information on scheduled bases to ensure against all forms of data loss. Additionally, it makes the process of recovering from data corruption to disk loss in a very expedient manor. The following instruction set covers the setup of an oracle database for storage of your recovery catalog and the cataloging of your first target database. This instruction set was written from a Linux installed Oracle system; however it will work on most any flavor of UNIX.

1. Logon to your linux server as the Oracle software owner.

2. Use the ./dbca command as follows to open up the Oracle Database Creation Assistant or create a database named RMAN manually. Note: This oracle database is only used to store the catalog information of backed-up databases, thus the storage and memory requirements are very low. I would not allocate more than 200MB of space and 100MB of memory to this database.

linux1# cd $ORACLE_HOME/bin
linux1# ./dbca

3. If using dbca, follow the prompted screens to create a general purpose database.

4. If the database is created using manual methods ensure that the following Oracle scripts are executed after build.

connect sys/oracle@RMAN as sysdba
set echo off
connect system/oracle@RMAN
conn sys/oracle@RMAN as sysdba

5. Logon to your newly created database and create a tablespace for the RMAN user with the following command.

create tablespace rman
datafile ‘/u05/oradata/RMAN/rman01.dbf’ size 200m
extent management local autoallocate
segment space management auto;

6. Logon to your newly created database and create the RMAN User with the following command. Then grant the RMAN user the privileges: recovery_catalog_owner, connect, and resource.

create user rman identified by rman
temporary tablespace temp
default tablespace rman quota unlimited on rman;

grant recovery_catalog_owner to rman;

grant connect,resource to rman;

7. Add the following text to the listener.ora file on the server hosting the RMAN database and ensure that an entry is listed on all database servers to be backed-up in their individual tnsnames.ora files for the newly created RMAN database.

(ORACLE_HOME = /u01/opt/app/oracle/product/10.2.0/Db_1)

8. Issue a stop and restart of the oracle listener for changes to take affect.

linux1# lsnrctl stop

linux1# lsnrctl start

9. Register the target database in the catalog.

10. Logon to your server and set the ORACLE_SID parameter to your target database.

linux1# echo $ORACLE_SID

linux1# ORACLE_SID=orcl
linux1# export ORACLE_SID
linux1# echo $ORACLE_SID

11. Execute the command , to logon to the RMAN utility.

linux1# rman target / catalog rman/rman@RMAN

Recovery Manager: Release – Production on Wed Sep 24 15:42:29 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORCL (DBID=3051662701)
connected to recovery catalog database


12. Issue the command in the RMAN utility.

RMAN> create catalog

recovery catalog created


13. Issue the command in the RMAN utility.

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete


14. NOTE: By default RMAN will attempt to register a TAPE drive in the system. If you do not have a tape drive available specify.


old RMAN configuration parameters:
old RMAN configuration parameters are successfully deleted
starting full resync of recovery catalog
full resync complete

This completes the creation of RMAN recovery catalog and registration of your target database.

Larry Catt, OCP 9i, 10g

Configuration of Oracle Flashback

The Flashback database allows you to maintain a backup version of changes in the database that enables you to recovery from user mistakes without the need for a full database recovery. In this section, we will describe the following:

1. Configuration of Flashback for existing database.
2. Configuration of Flashback to a new database.

Steps in implementing the Flashback for existing database

1. Defining the Initialization Parameters for Flashback area.

a. DB_RECOVERY_FILE_DEST_SIZE – defines the maximum size that the Flashback Area can grow to. NOTE: This parameter must be set before defining DB_RECOVERY_FILE_DEST.
b. DB_RECOVERY_FILE_DEST – this the directory storage area on disk that will hold all files related to backup and recovery, note this is for both flashback recovery and traditional RMAN recovery.

2. Specify initialization parameter by defining in PFILE or Altering the system: In this example we will alter the system.

SQL> alter system set db_recovery_file_dest_size=30G scope = both;
System altered.
SQL> alter system set db_recovery_file_dest=’/u03/oradata/orcl/flash_recovery_area’ scope = both;
System altered.

3. Ensure that the parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST are not set in the database. With Flashback you can only specify an LOG_ARCHIVE_DEST_n, by default LOG_ARCHIVE_DEST_10 will be set to your flash_recovery area.

SQL> show parameter log_archive

———————————— ———– ——————————
log_archive_config string
log_archive_dest string
log_archive_dest_1 string LOCATION=use_db_recovery_file_dest
log_archive_dest_10 string
log_archive_dest_2 string LOCATION=/u02/oradata/orcl/arc
log_archive_dest_3 string LOCATION=/u05/oradata/orcl/arc
log_archive_dest_4 string
log_archive_duplex_dest string

4. With the flash recovery area set we can startup our database in flashback mode. NOTE: The database must be mounted in exclusive mode, archiving enabled, and then flashback turned on before opening the database for use.

startup mount exclusive;
alter database archivelog;
alter database flashback on;
alter database open;

5. This completes the configuration of Flashback for existing database.

Configuration of Flashback on a new database

1. The following entries need to be placed in your pfile of new database.

# set location for current datafiles:
DB_CREATE_FILE_DEST = ‘/u02/oradata/orcl’
# set location for control files and online redo logs:
DB_CREATE_ONLINE_LOG_DEST_1 = ‘/u03/oradata/orcl’
DB_CREATE_ONLINE_LOG_DEST_2 = ‘/u04/oradata/orcl’
# set flash recovery area location and size
DB_RECOVERY_FILE_DEST = ‘/u03/oradata/orcl/flash_recovery_area’

2. Create your new database with DBCA or manually with scripts.

Larry Catt, OCP 9i, 10g

Recreating Oracle 10g EM

Oracle 10g Enterprise Manager has been a vast improvement over previous versions. However, I have experienced several situation where its behavior has become very unpredictable due to changes to DBSNMP or SYSMAN schemas and changes made to the your EM configuration files. In these situations, I have found it much easier to remove the EM components and re-install to resolve the problems. NOTE: This may not always be your best option; some objects created in EM may no longer exist after performing this procedure. However, EM will work without error itself.

1. Login to your Oracle server as the oracle software owner, set your ORACLE_SID and shutdown your Oracle EM console.

[root@linux1 ~]# su – oracle
[oracle@linux1 ~]$ ORACLE_SID=orcl
[oracle@linux1 ~]$ export ORACLE_SID
[oracle@linux1 ~]$ emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Stopping Oracle Enterprise Manager 10g Database Control …
… Stopped.
[oracle@linux1 ~]$

2. Startup the Oracle universal installer, located under $ORACLE_HOME/oui/bin directory. The shell script to execute the installer is runInstaller.

3. At the welcome screen select deinstall Products.

4. At the Inventory screen, expand the tabs Oracle Home and Oracle Database to show all installed components. Ensure that only Oracle Enterprise Manager is selected and press the Remove button.

5. At the Confirmation screen, press the Yes button to continue.

6. The Oracle Universal Installer will remove all Oracle Enterprise Manager components.

7. After the uninstall is complete, the Oracle Universal Installer will return you to the Inventory screen, press the Close button to exit the installer.

8. Login to SQL*Plus with as sysdba and drop the user schemas dbsnmp and sysman with the cascade clause.

login as: oracle
oracle@linux1’s password:
Last login: Mon Jan 14 11:31:32 2008 from
[oracle@linux1 ~]$ ORACLE_SID=orcl
[oracle@linux1 ~]$ export ORACLE_SID
[oracle@linux1 ~]$ sqlplus /nolog

SQL*Plus: Release – Production on Mon Jan 14 13:47:52 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect / as sysdba
SQL> drop user sysman cascade;
User dropped.
SQL> drop user dbsnmp cascade;
User dropped.

9. Now execute the script catsnmp.sql located in $ORACLE_HOME/rdbms/admin to recreate the dbsnmp schema.


10. Startup the Oracle universal installer, located under $ORACLE_HOME/oui/bin directory. The shell script to execute the installer is runInstaller.
11. At the welcome screen select Next button.

12. At the Specify Source Location page, enter the directory where you unzipped your oracle database software and select Next.

13. At the Select Installation Type, select the Custom radio button and press Next.

14. At the Specify Home Details, enter the Home name and default path for installation and press Next.

15. You will receive a Warning message stating the directory is not empty. Select Yes to continue.

16. At the Available Products Components page, ensure that only Oracle Enterprise Manger is select and press Next button.

17. At the Product-Specific Prerequisite Checks page, select Next.

18. At the Summary page, select the Install button.

19. The Oracle Enterprise Manger will now install.

20. Once the End of Installation page is display, select the exit button.

21. Logon to your Oracle host machine console as the oracle software owner and set your ORACLE_SID variable.

login as: oracle
oracle@linux1’s password:
Last login: Mon Jan 14 11:31:32 2008 from
[oracle@linux1 ~]$ ORACLE_SID=orcl
[oracle@linux1 ~]$ export ORACLE_SID

22. Startup the em console and test your connection.

[oracle@linux1 ~]$ emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Starting Oracle Enterprise Manager 10g Database Control ……………….. started.
Logs are generated in directory /u01/oracle/oracle/product/10.2.0/db_1/linux1_orcl/sysman/log
[oracle@linux1 ~]$

23. Test your connect to the dbconsole at reference address in the emctl start command: normally this would be http://<machine_name>:1158/em



Larry Catt, OCP 9i, 10g

DBCA will not start with error NJNI10

1. If you see the error below when trying to execute DBCA try the next three steps to resolve.

[oracle@mylinux1 bin]$ ./dbca

UnsaUntitled 1tisfiedLinkError exception loading native library: njni10
Exception in thread “main” java.lang.UnsatisfiedLinkError: get
at Method)
at Source)
at Source)
at Source)
at oracle.sysman.assistants.util.NetworkUtils.(
at oracle.sysman.assistants.util.step.StepContext.(
at oracle.sysman.assistants.dbca.backend.Host.(
at oracle.sysman.assistants.dbca.ui.UIHost.(
at oracle.sysman.assistants.dbca.ui.InteractiveHost.(
at oracle.sysman.assistants.dbca.Dbca.getHost(
at oracle.sysman.assistants.dbca.Dbca.execute(
at oracle.sysman.assistants.dbca.Dbca.main(

[oracle@mylinux1 bin]$

2. Create the following soft links in $ORACLE_HOME/bin directory and retry ./dbca command.

[oracle@mylinux1 bin]$ ln -s $ORACLE_HOME/lib/libnjni10.dylib $ORACLE_HOME/lib/libnjni10
[oracle@mylinux1 bin]$ ln -s $ORACLE_HOME/lib/libclntsh.dylib $ORACLE_HOME/lib/libclntsh.dylib.10.1

3. If the previous step did not resolve the issue ensure that the variable LD_LIBRARY_PATH contains both $ORACLE_HOME/lib and $ORACLE_HOME/lib32. Re-execute your .bash file and retry ./dbca command.

[oracle@mylinux1 ~]$ vi .bash_profile
[oracle@mylinux1 ~]$ . ./.bash_profile

4. If the previous step did not resolve the issue, install or re-install the following 32 bit packages: glibc-devel-2.3.4-2.36.i386.rpm and glibc-2.3.4-2.36.i686.rpm. Then cd to $ORACLE_HOME/bin and execute ./relink all. Finally, retry the ./dbca command.

[root@mylinux1 RPMS]# rpm -Uvh –force glibc-devel-2.3.4-2.36.i386.rpm
Preparing… ########################################### [100%]
1:glibc-devel ########################################### [100%]
[root@mylinux1 RPMS]# rpm -Uvh –force glibc-2.3.4-2.36.i686.rpm
Preparing… ########################################### [100%]
1:glibc ########################################### [100%]
[root@mylinux1 RPMS]#

Larry J Catt, OCP

ASM with RAW Disks will not start after reboot

ASM (Automatic Storage Management) instances for the storage of database files have become a very popular option in the database world since the release of ORACLE 10g. However, there exist several administration concerns over ASM, which the DBA must take into consideration. This article covers the problem of ASM instance not starting after a reboot of a Linux server and applies to most Unix systems while using RAW Disks.

Error: ORA-15042: ASM disk is missing.

Reason: This error is caused by the RAW device being removed from the OS, corrupted, or/and most likely, not owned by the ORACLE user.

1. Verify that the ASM disk exists.

[root@mylinux1 /]# cd /dev/raw
[root@mylinux1 /dev/raw]# ls
[root@mylinux1 u06]#

2. Check the ownership of the disks.

[root@mylinux1 /]# cd /dev/raw
[root@mylinux1 /dev/raw]# ls –la
-rw-r–r– 1 root root 2 Sep 2 08:33 raw1
-rw-r–r– 1 root root 2 Sep 2 08:33 raw2
-rw-r–r– 1 root root 2 Sep 2 08:34 raw3
[root@mylinux1 /dev/raw]#

NOTE: These raw devices are now owned by ROOT after the reboot, thus ORACLE does not have access.

3. On most UNIX systems you will see that the ownership of RAW devices is reset to ROOT after reboot. To correct this behavior, enter the following code into your init process before the Oracle database startup scripts are executed.

chown oracle:dba /dev/raw/raw1
chown oracle:dba /dev/raw/raw2
chown oracle:dba /dev/raw/raw3

Larry J Catt, OCP

CRS setup for ORACLE 10g ASM instance

In order for ASM and RAC to work properly the CRS (Cluster Ready Service) must first be configured. This procedure outlines the configuration of CRS in a Linux environment.

1. Logon to Linux server as the root user.

2. Verify that the correct support packages are installed.

[root@mylinux_1 RPMS]# ls compat-libstdc++*

3. NOTE: depending on your OS you may require a different version or bit setting of this package. I am running x86_64 system so I will install the newest compat-listdc++ package for this system.

[root@mylinux_1 RPMS]# rpm -i compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
[root@mylinux_1 RPMS]#

4. As the ROOT user navigate to the directory $ORACLE_HOME/bin. Execute the command ./localconfig add. The localconfig command cannot be run as the ORACLE user.

[root@mylinux_1 bin]# ./localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process…
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
[root@mylinux_1 bin]#

5. If CRS fails to install you must back out the files created with the command ./localconfig delete. Most likely the failure has occurred due to missing support packages. Verify that all packages suggested by Oracle Corporation for your OS and product version exist. You can find this listing at

Larry Catt, OCP