Share the content if you found it is useful (You can share using 300 community websites) click "share" at the end of the post.

You are encouraged to leave a comment.

Friday, December 26, 2008

Dataguard: Physical Standby Database

In this post I described in detail the way in which we can configure a Dataguard for Oracle Databases. Here the instance is of 11g.

Oracle Database 11g RMAN introduces the FROM ACTIVE DATABASE capability to the DUPLICATE FOR STANDBY command. This alleviates the previous need for interim storage on both the Primary and Standby systems, and the limitation of single stream network traffic.

Now when taking the backup of the Primary database you can simultaneously create and restore the standby database over the network in parallel streams. Apart from some simple Oracle Net setup, and creating a couple of directories and an interim password file, the whole standby creation can be done in one RMAN script.

RMAN will automatically copy the server parameter file to the standby host, start the auxiliary instance with the server parameter file, restore a backup control file, and copy all necessary database files and archived redo logs over the network to the standby host.



Perform an Oracle Database 11g installation (software and db installed) for a single server environment OR Oracle Database 11g installation (software and db installed) on 1 server and Oracle Database 11g software only on 2nd server for a dual server environment.

Please Save the following script as we need to run during this process.

1. Script for RMAN:

run {
allocate channel prmy1 type disk;

allocate channel prmy2 type disk;

allocate channel prmy3 type disk;

allocate channel prmy4 type disk;

allocate auxiliary channel stby type disk;

duplicate target database for standby from active database


parameter_value_convert 'orcl','orclsby1'

set db_unique_name='orclsby1'

set db_file_name_convert='/orcl/','/orclsby1/'

set log_file_name_convert='/orcl/','/orclsby1/'

set control_files='/u01/app/oracle/oradata/orclsby1.ctl'

set log_archive_max_processes='5'

set fal_client='orclsby1'

set fal_server='orcl'

set standby_file_management='AUTO'

set log_archive_config='dg_config=(orcl,orclsby1)'

set log_archive_dest_1='service=orcl ASYNC
valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orcl'


2. Create Standby logfile (cr_sby_redologs.sql)

alter database add standby logfile
size 52428800


3. Query for Archived Logs (query_archived_log.sql)

SELECT sequence#, first_time, next_time

FROM v$archived_log
ORDER BY sequence#

Preparing the Primary Database for Standby Database Creation

You verify that the primary database is configured correctly to support a physical standby database.

You only need to perform these preparatory tasks once. After you complete these steps, the database is prepared to serve as the primary database for one or more standby databases. You should perform the following steps:


Determine if FORCE LOGGING is enabled. If it is not enabled, enable FORCE LOGGING mode. This statement may take some time to complete, because it waits for all unlogged direct write I/O to finish. You use the following commands:




Configure redo transport authentication.

Data Guard uses Oracle Net sessions to transport redo data and control messages between the members of a Data Guard configuration. These redo transport sessions are authenticated using either the Secure Sockets Layer (SSL) protocol or a remote login password file.

In this blog, we will be using a remote login password file which will be created in a subsequent step.


Configure the primary database to receive redo data, by adding the standby logfiles to the primary. You can use the cr_sby_redologs.sql script, after validating the directory paths reflect your environment.

It is highly recommended that you have one more standby redo log group than you have online redo log groups as the primary database. The files must be the same size or larger than the primary database’s online redo logs.

SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl01.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl02.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl03.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl04.log' size 52428800
3 /
Database altered.


Set primary database initialization parameters

On the primary database, you define initialization parameters that control redo transport services while the database is in the primary role. You use SQL commands similar to the following to verify these settings:

Ensure the following parameters are set to reflect the Data Guard configuration.

DB_NAME Specifies the database name. Must be orcl.
DB_UNIQUE_NAME Specify a unique name for each database. Does not change even if DG roles change. Must be orcl.
CONTROL_FILES Specifies the local path name for the control files on the primary database.
LOG_ARCHIVE_CONFIG Uses the DG_CONFIG attribute to list the DB_UNIQUE_NAME of the primary and standby databases.
LOG_ARCHIVE_DEST_1 Defaults to archive destination for the local archived redo log files.
LOG_ARCHIVE_DEST_2 Valid only for the primary role, this destination transmits redo data to the remote physical standby destination orclsby1.
REMOTE_LOGIN_PASSWORDFILE Must be EXCLUSIVE or SHARED if a remote login password file is used (default = EXCLUSIVE)

Use the following commands to set the LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_2 indicating the primary and standby databases.


Issue the following statements to determine your database's archival state, and then put the primary database in ARCHIVELOG mode to enable automatic archiving.

In this practice, you configure the network environment and create a physical standby database.

NOTE: In this blog, you configure the network for a single server environment. If you are configuring an environment on two different servers, you would need to configure Net Manager on both servers accordingly.

A. Use Oracle Net Manager to create an Oracle Net service name for your physical standby database.


Launch Net Manager.


Expand Local. Select Service Naming and click the green plus sign


Enter your (i.e. orclsby1) in the Net Service Name field and click Next


Select TCP/IP (Internet Protocol) and click Next


Enter your fully qualified and click Next.


Enter your in the Service Name field and click Next


Click Finish.


Click File -> Save Network Configuration to save the information to the tnsnames.ora file.

B. Use Oracle Net Manager to configure an entry for your standby database in the listener.ora file.


Expand Listeners




Select Database Services in the drop-down list.


Click Add Database.


Enter your in the Global Database Name field. Enter your and your in the SID field.


Select File -> Save Network Configuration.


Select File -> Exit.

C. Creating the standby database over the network


Reload the listener.

$lsnrctl reload


Navigate to ORACLE_HOME/dbs folder to perform this steps.

Copy the remote login password file (orapworcl) from the primary database system to the standby database system, renaming it to orapworclsby1.

The password file must be re-copied each time the SYSDBA or SYSOPER privilege is granted or revoked and whenever the login password of a user with these privileges is changed. You may need FTP, or some other remote file transfer mechanism, if you are using differenet servers.


In the ORACLE_HOME/dbs folder, for the standby system, create an initialization parameter file named initorclsby1.ora containing a single parameter: DB_NAME=


For the standby system, change to the /u01/app/oracle/admin directory. Create your (i.e. orclsby1) directory. Change to your (i.e. orclsby1) directory and create the adump directory.


For the standby system, create your (i.e. orclsby1) directory in $ORACLE_BASE/oradata for the data files.

NOTE: Depending on how you installed Oracle Database 11g, you may need to also add the following directory paths: $ORACLE_BASE/flash_recovery_area and $ORACLE_BASE/oradata


On the standby system, set the ORACLE_SID environment variable to your (i.e. orclsby1) and start the instance in NOMOUNT mode with the text initialization parameter file.


On the primary system, ensure the ORACLE_SID environment variable is set to your primary DB (i.e. orcl).


On the primary system, invoke RMAN and connect as SYSDBA to the target database. Connect to the auxiliary database.


Execute the script no.1 from prerequisite of this blog for RMAN on the primary system. When this script finishes you will have a new standby database that was created over the network without any interim storage.


Perform a log switch on the primary database and redo will start being sent to the standby.


On the standby system, ensure the ORACLE_SID environment variable is set to your (i.e. orclsby1) and start the MRP process.

Verify that the Physical Standby Database is Performing Correctly

Once you create the physical standby database and set up redo transport services, you may want to verify database modifications are being successfully transmitted from the primary database to the standby database. To see that redo data is being received on the standby database, you should first identify the existing archived redo log files on the standby database, force a log switch and archive a few online redo log files on the primary database, and then check the standby database again. The following steps show how to perform these tasks.


On the standby database, identify the existing archived redo log files by querying the V$ARCHIVED_LOG view.

You can use the query_archived_log.sql file.

On the primary database, issue the ALTER SYSTEM SWITCH LOGFILE statement to force a log switch and archive the current
online redo log file group.


On the standby database, re-query the V$ARCHIVED_LOG view to verify the redo data was received and archived on the standby database:


On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were actually applied. Please requery until you see a YES in the APPLIED column.

At the completion of this step, the physical standby database is running and provides the maximum performance level of data protection.

Installing Oracle Database 10g Release 2 on Linux x86

In this Post I describe the installation of Oracle Database 10g Release 2 on Linux x86 (Versions covered RHEL AS 4 and RHEL AS 4update 5)

Part I: Installing Linux

This guide assumes a server with the following hardware:

  • 800MHz Pentium III CPU
  • 1024MB of RAM
  • SCSI host adapter (Ultra SCSI 160)
  • Four SCSI disk drives (1 x 9GB + 3 x 36GB)
  • One 100Base-T Ethernet adapter

Your hardware does not have to match this in order to use this guide. All that is necessary for a basic database install is a single CPU, 1024MB of RAM, and one disk drive (IDE, SCSI, or FireWire) with at least 7GB of free space.

Now, let's walk through the process of installing the Linux operating system on a server. The instructions assume a fresh install of Linux (as opposed to an upgrade), that the server will be dedicated to Oracle, and that no other operating systems or data are on the server.

RHEL4 or RHEL 4 update 5

Oracle Database 10g Release 2 is certified to run the base release of RHEL4 (Advanced Server and Enterprise Server) without updates. If you have update CDs, you can use the boot CD from the update instead of the boot CD from the base release to automatically apply all updates during the installation. All updates from Red Hat are supported by Oracle.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.

  1. Boot the server using the first CD.
    • You may need to change your BIOS settings to allow booting from the CD.
  2. The boot screen appears with the boot: prompt at the bottom of the screen.
    • Select Enter to continue with a graphical install on the console.
    • The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
  3. Language Selection
    • Accept the default.
  4. Keyboard Configuration
    • Accept the default.
  5. Welcome Screen
    • Click on Next.
  6. Disk Partitioning Setup
    • A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

      (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

      This guide uses the following partitioning scheme, with ext3 for each filesystem:

      The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
      - 100MB /boot partition
      -1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
      -7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

  7. Boot Loader Configuration
    • Accept the default.
  8. Network Configuration
    • It is usually best to configure database servers with a static IP address. To do so, click on Edit .
    • A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK .
    • In the Hostname box, select manually and enter the hostname.
    • In the Miscellaneous Settings box, enter the remaining network settings.
  9. Firewall Configuration
    • For the purposes of this walk-through, no firewall is configured. Select No firewall
    • Select Disabled on the "Enable SELinux" drop down list.
    • Click on Proceed when the "Warning - No Firewall" window appears.
  10. Additional Language Support
    • Accept the default.
  11. Time Zone Selection
    • Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
  12. Set Root Password
    • Enter a password for root, and enter it again to confirm.
  13. Package Installation Defaults
    • Select Customize software packages to be installed.
  14. Package Group Selection
    • Select only the package sets shown here and leave all others unselected.
    • Desktop
      • X Window System
      • Gnome
    • Applications
      • Graphical Internet (optional)
    • Servers
      • Do not select anything in this group.
    • Development
      • Development Tools
    • System
      • Administration Tools
      • System Tools
        • Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.
    • Miscellaneous
      • Do not select anything in this group.
    • Click on Next to proceed.
  15. Installing Packages
    • Software will be copied to the hard disk and installed. Change disks as prompted.
  16. Congratulations
    • Remove the installation media from the system, and click on Reboot .
  17. The system automatically reboots and presents a new welcome screen.
    • Click on Next.
  18. License Agreement
    • Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
  19. Date and Time
    • Set the Date and Time.
    • If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
  20. Display
    • Accept the defaults or change as required.
  21. Red Hat Login
    • Enter your Red Hat Network login and password or create a new one.
  22. System User
    • Create an account for yourself.
    • Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
  23. Additional CDs
    • Click on Next.
  24. Finish Setup
    • Click on Next.
  25. A graphical login screen appears.
  26. Congratulations! Your RHEL4 software is now installed.

Verifying Your Installation

Required kernel version: 2.6.9-5.0.5.EL This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g Release 2 .

Check your kernel version by running the following command:

# uname -r

# uname -r

Once you've completed the steps above, all of the packages required for Oracle Database 10g Release 2 will have been installed. Verify this using the example below.

Required package versions (or later):
  • binutils-
  • compat-db-4.1.25-9
  • control-center-2.8.0-12
  • gcc-3.4.3-9.EL4
  • gcc-c++-3.4.3-9.EL4
  • glibc-2.3.4-2
  • glibc-common-2.3.4-2
  • gnome-libs-
  • libstdc++-3.4.3-9.EL4
  • libstdc++-devel-3.4.3-9.EL4
  • make-3.80-5
  • pdksh-5.2.14-30
  • sysstat-5.0.5-1
  • xscreensaver-4.18-5.rhel4.2
  • libaio-0.3.96
  • openmotif21-2.1.30-11.RHEL4.2 (Required only to install Oracle demos. Installation of Oracle demos is not covered by this guide.)
To see which versions of these packages are installed on your system, run the following command:
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
# rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
> gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21

Part II: Configuring Linux for Oracle

Now that the Linux software is installed, you need to configure it for Oracle. This section walks through the steps required to configure Linux for Oracle Database 10g Release 2.

Verifying System Requirements

To verify that your system meets the minimum requirements for an Oracle Database 10g Release 2 database, log in as root and run the commands below.

To check the amount of RAM and swap space available, run this:
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo

# grep MemTotal /proc/meminfo
MemTotal: 1034680 kB
# grep SwapTotal /proc/meminfo
SwapTotal: 1534196 kB

The minimum RAM required is 1024MB, and the minimum required swap space is 1GB. Swap space should be twice the amount of RAM for systems with 2GB of RAM or less and between one and two times the amount of RAM for systems with more than 2GB.

You also need 2.5GB of available disk space for the Oracle Database 10g Release 2 software and another 1.2GB for the database. The /tmp directory needs at least 400MB of free space. To check the available disk space on your system, run the following command:

df -h

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 6.8G 1.3G 5.2G 20% /
/dev/sda1 99M 17M 77M 18% /boot

The example shows that the /tmp directory does not have its own filesystem. (It's part of the root filesystem for this guide.) With 5.2 GB available, the root filesystem has just enough space for the installation (2.5 + 1.2 + 0.4 = 4.1GB) with a little room left over.

Create the Oracle Groups and User Account

Next, create the Linux groups and user account that will be used to install and maintain the Oracle Database 10g Release 2 software. The user account will be called oracle, and the groups will be oinstall and dba. Execute the following commands as root:

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -m -g oinstall -G dba oracle
# id oracle
uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

Set the password on the oracle account:

passwd oracle

# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Create Directories

Now create directories to store the Oracle Database 10g Release 2 software and the database files. This guide adheres to the Optimal Flexible Architecture (OFA) for the naming conventions used in creating the directory structure.

The following assumes that the directories are being created in the root filesystem. This is done for the sake of simplicity and is not recommended as a general practice. These directories would normally be created as separate filesystems.

Issue the following commands as root:

mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle

# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle

Configuring the Linux Kernel Parameters

The Linux kernel is a wonderful thing. Unlike most other *NIX systems, Linux allows modification of most kernel parameters while the system is up and running. There's no need to reboot the system after making kernel parameter changes. Oracle Database 10g Release 2 requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, don't change it.

kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

If you're following along and have just installed Linux, the kernel parameters will all be at their default values and you can just cut and paste the following commands while logged in as root.

cat >> /etc/sysctl.conf <> /etc/sysctl.conf < kernel.shmall = 2097152
> kernel.shmmax = 536870912
> kernel.shmmni = 4096
> kernel.sem = 250 32000 100 128
> fs.file-max = 65536
> net.ipv4.ip_local_port_range = 1024 65000
# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144

Run the following commands as root to verify your settings:

/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
/sbin/sysctl -a | grep rmem_default
/sbin/sysctl -a | grep rmem_max
/sbin/sysctl -a | grep wmem_default
/sbin/sysctl -a | grep wmem_max

# /sbin/sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shm-use-bigpages = 0
# /sbin/sysctl -a | grep sem
kernel.sem = 250 32000 100 128
# /sbin/sysctl -a | grep file-max
fs.file-max = 65536
# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 1024 65000
# /sbin/sysctl -a | grep rmem_default
net.core.rmem_default = 262144
# /sbin/sysctl -a | grep rmem_max
net.core.rmem_max = 262144
# /sbin/sysctl -a | grep wmem_default
net.core.wmem_default = 262144
# /sbin/sysctl -a | grep wmem_max
net.core.wmem_max = 262144

Setting Shell Limits for the oracle User

Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root:

cat >> /etc/security/limits.conf <> /etc/pam.d/login <
cat >> /etc/profile <> /etc/csh.login <

Part III: Installing Oracle

Oracle Database 10g Release 2 can be downloaded from OTN. Oracle offers a development and testing license free of charge. However, no support is provided and the license does not permit production use. A full description of the license agreement is available on OTN.

The easiest way to make the Oracle Database 10g Release 2 distribution media available on your server is to download them directly to the server.

Use the graphical login to log in as oracle.

Create a directory to contain the Oracle Database 10g Release 2 distribution:

mkdir 10gR2_db

To download Oracle Database 10g Release 2 from OTN, point your browser (Firefox works well) to Fill out the Eligibility Export Restrictions page, and read the OTN License agreement. If you agree with the restrictions and the license agreement, click on I Accept.

Click on the link, and save the file in the directory you created for this purpose (10gR2_db)—if you have not already logged in to OTN, you may be prompted to do so at this point.

Unzip and extract the file:

cd 10gR2_db

Install the Software and Create a Database

Log in using the oracle account.

Change directory to the location where you extracted the Oracle Database 10g Release 2 software.
$ cd $HOME/10gR2_db

Change directory to Disk1.

$ cd database

Start the Oracle Universal Installer.

$ ./runInstaller
  1. Select Installation Method
    • Select Basic Installation
    • Oracle Home Location: /u01/app/oracle/product/10.2.0/db_1
    • Installation Type: Enterprise Edition (1.3GB)
    • UNIX DBA Group: oinstall
    • Make sure Create Starter Database is checked
    • Global Database Name: demo1
    • Enter the Database Password and Confirm Password
    • Click on Next
  2. Specify Inventory Directory and Credentials
    • Inventory Directory: /u01/app/oracle/oraInventory
    • Operating System group name: oinstall
    • Click on Next
  3. Product-specific Prerequisite Checks
    • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding.
    • Click on Next
  4. Summary
    • A summary of the products being installed is presented.
    • Click on Install.
  5. Configuration Assistants
    • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
  6. Execute Configuration Scripts
    • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.
    • Click on OK when finished.
  7. End of Installation
    • Make note of the URLs presented in the summary, and click on Exit when ready.
  8. Congratulations! Your new Oracle Database 10g Release 2 database is up and ready for use.

Part IV: Configuring Storage

The database we created in Part III used a single filesystem for disk storage. However, there are several other ways to configure storage for an Oracle database.

Part IV explores other methods of configuring disk storage for a database. In particular, it describes creating additional filesystems and using Automatic Storage Management (ASM). Use of raw devices and Oracle Cluster File System (OCFS) is covered in the next article in this series which walks through installing Oracle RAC Database 10g Release 2 on Linux x86.

Partition the Disks

In order to use either file systems or ASM, you must have unused disk partitions available. This section describes how to create the partitions that will be used for new file systems and for ASM.

WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data.

This example uses /dev/sdb (an empty SCSI disk with no existing partitions) to create a single partition for the entire disk (36 GB).

# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs

Command (m for help): p

Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
Partition number (1-4): 1
First cylinder (1-4427, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):
Using default value 4427

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
Syncing disks.

Now verify the new partition:

# fdisk -l /dev/sdb

Disk /dev/sdb: 36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 4427 35559846 83 Linux

Repeat the above steps for each disk to be partitioned. The following section on Filesystems uses a single disk partition, /dev/sdb1. The ASM example uses three partitions on three disks: /dev/sdb1, /dev/sdc1, and /dev/sdd1


Filesystems are the most widely used means of storing data file, redo logs, and control files for Oracle databases. Filesystems are easy to implement and require no third-party software to administer.

In most cases, filesystems are created during the initial installation of Linux. However, there are times when a new filesystem must be created after the initial installation, such as when a new disk drive is being installed.

This section describes building a new filesystem and using it in an Oracle database. Unless otherwise noted, all commands must be run as root.

Create the Filesystem

Use ext3 to create this new filesystem. Other filesystems work just as well, but ext3 offers the fastest recovery time in the event of a system crash.

# mke2fs -j /dev/sdb1
mke2fs 1.26 (3-Feb-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4447744 inodes, 8889961 blocks
444498 blocks (5.00%) reserved for the super user
First data block=0
272 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208, 4096000, 7962624

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Create the Mount Point

A filesystem must have a mount point, which is simply an empty directory where the new filesystem "attaches" to the system's directory tree. Mount points should be given names consistent with the Oracle Flexible Architecture (OFA) standard.

Because you have already created the /u01 directory in Part I, use /u02 for this example.

# mkdir /u02

Add the New Filesystem to /etc/fstab

So that the new filesystem will be mounted automatically when the system boots, you need to add a line to the /etc/fstab file that describes the new filesystem and where to mount it. Add a line similar to the one below to /etc/fstab, using a text editor.

/dev/sdb1 /u02 ext3 defaults 1 1

Mount the New Filesystem

Mounting the filesystem makes it available for use. Until the filesystem is mounted, files cannot be stored in it. Use the following commands to mount the filesystem and verify that it is available.

mount /u02
df -h /u02

# mount /u02
# df -h /u02
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 33G 33M 31G 1% /u02

Create Oracle Directories and Set Permissions

Now you create a directory to store your Oracle files. The directory name used in the example follows the OFA standard naming convention for a database with ORACLE_SID=demo1.

mkdir -p /u02/oradata/demo1
chown -R oracle:oinstall /u02/oradata
chmod -R 775 /u02/oradata

Create a New Tablespace in the New Filesystem

The new filesystem is ready for use. Next you create a new tablespace in the filesystem to store your database objects. Connect to the database as the SYSTEM user, and execute the CREATE TABLESPACE statement, specifying the data file in the new filesystem.

$ sqlplus

SQL*Plus: Release - Production on Sun Nov 27 15:50:50 2005

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

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options

SQL> create tablespace data1
2 datafile '/u02/oradata/demo1/data1_01.dbf' size 100m
3 extent management local
4 segment space management auto;

Tablespace created.

Now you can use the new tablespace to store database objects such as tables and indexes.

SQL> create table demotab (id number(5) not null primary key,
2 name varchar2(50) not null,
3 amount number(9,2))
4 tablespace data1;

Table created.

Accessing the Database with SQL*Plus

Log into Linux as oracle. Set the environment.

Set the Oracle environment variables:

$ . oraenv
ORACLE_SID = [oracle] ? demo1

Run SQL*Plus:

$ sqlplus

SQL*Plus: Release - Production on Sun Nov 27 15:40:29 2005

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

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options


Using Oracle Enterprise Manager 10g Database Control

In a Web browser, connect to the URL provided during the installation.

Ex: (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYS
Connect As: SYSDBA

Click on

Welcome to the world of Oracle Enterprise Manager 10g Database Control!

Starting and Stopping Oracle Enterprise Manager Database Control:

$ emctl start dbconsole
$ emctl stop dbconsole

Accessing the Database Using iSQL*Plus

iSQL*Plus is a Web-based version of the venerable SQL*Plus interactive tool for accessing databases. To use iSQL*Plus, click on the iSQL*Plus link in the Related Links section of the OEM console or point your browser to the iSQL*Plus URL provided during installation.

Ex: (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYSTEM

Click on .

Enter SQL commands in the Workspace box, and click on Execute.

Starting and Stopping iSQL*Plus:

$ isqlplusctl start
$ isqlplusctl stop

Starting and Stopping the Listener:

The listener accepts connection requests from clients and creates connections to the database once the credentials have been authenticated. Before you can use OEM or iSQL*Plus, the listener must be up.

$ lsnrctl start
$ lsnrctl stop

Starting and Stopping the Database:

The easiest way to start and stop the database is from the OEM Console. To do that from the command line, use SQL*Plus while logged in as oracle, as follows:


$ sqlplus

SQL*Plus: Release - Production on Sun Nov 27 15:39:27 2005

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

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 96470632 bytes
Database Buffers 180355072 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.

SQL> exit


$ sqlplus

SQL*Plus: Release - Production on Sun Nov 27 15:40:29 2005

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

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> exit

Monday, December 22, 2008

Transport Tablespace (Scripts) - 8 steps!!!


1. select owner|| '.' ||, segment_type,tablespace_name from dba_segments where tablespace_name in ('tablespace_name')

if you want to add any user then

create user identified by password;

grant connect, resource to

2. alter tablespace read only;

3. execute dbms_tts.transport_set_check('tablespace_name',TRUE);

4. select * from transport_set_violations;

-- This should return 'NO ROWS SELECTED'


exp "'/as sysdba'" file = exp_tts.dmp log=exp_tts.log transport_tablespace=y tablespaces= tablespace_name

5. copy the .dmp file to target $ORACLE_HOME

6. Copy the datafile to target destination


if you want to create user


create user identified by password;

grant connect, resource to

7. Import

imp "'/as sysdba'" file=exp_tts.dmp log=imp_tts.log fromuser = touser=newuser if created transport_tablespace=y datafiles=

source and destination

8. alter tablespace read write;

Friday, December 19, 2008

Printer and Pasta configuration on Oracle Applications

Setting up printer in Linux OS (Remote printer configuration)
- Run printtool as root
Illustration I: Printtool Command in Linux

Click new from the popup

Adding a New Print Queue
Here I gave name as HPLaser2105 and short description as HPLaserJet printer in Abdulla Machine (Just to identify)

Defining a Print Queue
You select queue type from the drop-down combo box (Networked Windows (SMB))

Select Queue Type
You click specify from the window.
Select Windows SMB

Here is the configuration window
Configuration - Printer residing Machine
It is finished with configuring. (It will be like (specified))
Configuration - Note the word (Specified)
Next Select printer model, Here I selected PCL6/PCL XL Printer
Note for PCL from Provider

Next Test Print from the printer (It should be printed!) else review the steps.
Test Page Print
After configuration the printer configuration will be like this.
Finish Printer Configuration
You should share, and make the printer as default by clicking edit.

Now the Applications Configuration:
Login as sysadmin and navigate to system administrator then Install:Printer
Then navigate to Driver. Here I created HPLASER2105 (Printer type)
Selected SRW driver as L
Driver method as command and driver method parameters as Spool File
Arguments as
To test the argument, please run this command in os command
$lp –c –d -n1 –t"Print Test"
Here I used (example)
lp –c –dHPlaser2105 –n1 –t"Print Test" sqlnet.log

Command Line : Printer command for Linux (telnet)

The printer should work. This is the command we are going to pass as argument in Oracle Apps

Define Printer Driver from SYSADMIN -> Install Print. Provide SRW Driver as L for Landscape
You next navigate to
Install printer -> style
You query for Landscape with SRW driver as L

Look for SRW Driver L for Landscape
Then move to Printer Types
Here you have to define a new type called Hplaser2105 and description as PCL

Create a new Printer TYPE
You select as HPPD, HPW, LANDSCAPE, LANDWIDE,PORTRAIT, PORTRAITLASERCHECK, RL1PAPER styles and correspondence driver files with HPLJ4.

Now. You register the printer
Install:Printer-> Register

Registering Printer
Here I have defined the printer as HPLASER2105, Selected type as HPLASER2105 and Description as Windows Remote Printer Configuration.

Set Profile option for Printer at site level – Most important.

That’s all, we completed. Now
1. Bounce the concurrent Service. It is most important. Whenever, you are doing modification with printer, you should do bouncing the concurrent service.

2. Now run a concurrent request to print a report

3. Here Selected Active users

Print Test with any report (Here I used Active Users)
Click Options.
There you select copies as 1.

Then submit with OK
Now, the concurrent manager should complete with status completed normal. Review the log file.
If any thing happened in middle, please review the steps. Thats All.. Finished Printer configuration in Oracle Applications.

Pasta is Oracle Application utility to convert text report files to Post Script so that these can be printed by PostScript Printers. Executable name for Pasta is FNDPSTAX. For various printing options via Pasta, you can use pasta configuration file called as pasta.cfg

The pasta.cfg is there in $FND_TOP/resource.

Copy the Pasta.cfg to Pasta_(Your printername).cfg. (Oracle recommends to copy the name to your printer name) PASTA makes it easy to customize your printing configuration very easy. So use the OS Printer name to define the Pasta.
1. Replace printer_name parameter in pasta.cfg as one with your OS printer name. Here my printer name is HPlaser2105
The command lp –c –d{printername} should print with command line.
Please check before you make changes with your pasta.cfg.
Screen Shot.
Save and exit.
Login to Oracle Apps as System admin
Navigation Path: Install -> Printer ->Driver -> create a driver, PASTA_PORTRAIT. There will be default PASTA-DRIVERS in built with Oracle Apps, We can use them.
For Portrait -> use SRW driver as P
For LANDSCAPE -> use SRW driver as L
For LANDWIDE -> use SRW driver as LW
You please check the Spool File and program name as FNDPSTAX.
Install -> Printer -> Type
Here I have created PASTA_POSTSCRIPT_HPLASER2105 with all the drivers.
Then you register.
Install -> Printer -> Register.
Save and Exit.

Restart your concurrent Manager (Important)

Check with Active Reports
You please note, the language I selected As Arabic and PASTA as the printer. Submit the request, It should completed normal. In case any problem in the middle, then review the steps.

Thursday, December 18, 2008

FNDCPASS Tricks and Methods

In Oracle Application 11i and R12, we have an FND functionality for changing the passwords for either application user, or product schema password or most important the “APPS” password. The FND binary which will help us is doing these things is FNDCPASS.

This is present in $FND_TOP/bin directory.

This post explains the usage of FNDCPASS, best practices that needs to be followed while using FNDCPASS and some tricks when FNDCPASS screws up the instance :))


Below is the usage for FNDCPASS
Usage: FNDCPASS logon 0 Y system/password mode username new_password

where logon is username/password[@connect]

system/password is password of the system account of that database


username is the username where you want to change its password

new_password is the new password in unencrypted format

FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME

FNDCPASS apps/apps 0 Y system/manager ORACLE GL GL1
FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

You can just type FNDCPASS and press enter, it will give you these details.

The first usage

FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME

is for changing the password for apps and applsys. These are the database schema users
(most important for application to work). Password for both these users should be in synch. You can change the password of these users using this command. Note that this is the only way to change the password for apps and applsys. Please do not try any other method for changing apps and applsys password. Oracle recomends using FNDCPASS only to change apps and applsys password. Also note that using this command will change the password for both apps and applsys.

Following activities will take place

(1) applsys validation. (make sure APPLSYS name is correct)
(2) reencrypt all password in FND_USER
(3) reencrypt all password in FND_ORACLE_USERID
(4) update applsys’s password in FND_ORACLE_USERID table.
(5) Update apps password in FND_ORACLE_USERID table. Also changes are made in DBA_USERS table.

The second usage
FNDCPASS apps/apps 0 Y system/manager ORACLE GL GL1

is for changing password for any other product schema like MSC, GL etc.

Following activities will take place
(1) update GL’s password in FND_ORACLE_USERID table. The new password is reencrypted
with the current applsys password. If GL does not exists, step (2) below does not happen. Message for invalid oracle user is written in the log file.

(2) alter user to change GL’s password.

The third usage
FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

is for changing the application level passwords like sysadmin etc used for logging into

Following activities will take place
(1) update VISION’s password in FND_USER table. The new password is reencrypted
with the current applsys password.

If VISION does not exist, message for invalid application user is written in the log file.
No products affected by the patch When you run FNDCPASS command it will check the integrity of all schema password in the application. If any of the password is corrupt then this will through and error and will not change the password.

The tables that it uses is FND_USER and FND_ORACLE_USERID. All the application
passwords and schema passwords are stored in these two tables. Ofcourse DBA_USERS
will have the schema users and password stored as well.

When we run FNDCPASS it will update all the above 3 tables.

Best practices for using FNDCPASS

Before using FNDCPASS and changing the passwords from default to some thing else,
always follow the following best practices.
1) Always, Always, Always keep the back of tables FND_USER and FND_ORACLE_USERID. You can take back of these tables using CREATE TABLE —

You must have backup of these tables before running FNDCPASS. In case if FNDCPASS fails then it might corrupt the passwords of your application and worst can happen that the application wont come up. So always be cautions about this command.

2) If possible also keep an export dump of these two tables.

3) Verify each arguement you are providing to FNDCPASS. Like verify that apps and system passwords you are providing is correct.

4) Never update apps, applsys or any schema password directly from database using the alter command. Always use FNDCPASS. System password can be set directly using ALTER command in database.

Issue with APPLSYS and APPS password

Scenario 1:
As you know that apps and applsys password should be in synch and should be changed
There can be situation where a novice user changes applsys password from the backend
database. In that case when you try to start the services it will show following error

Cannot access application ORACLE password

Cause: Application Object Library was unable access your ORACLE password.

You can even reproduce this issue (ofcourse after taking the backup of FND_USER and
FND_ORACLE_USERID table) using the following steps:

1. Use the ALTER USER command to change the APPLSYS password
2. Try to run the script to start Apps services.
3. You will get an error “Cannot complete applications logon. You may have entered an invalid applications password, or there may have been a database connect error.”
4. Then try FNDCPASS to fix password and you will get the error the APPFND01496

If this situation happens then you cannot access the application. In fact the services even wont start.
Resolution to such problem is to rollback the 2 tables FND_USER and FND_ORACLE_USERID. Once you rollback the tables, apps and applsys passwords will be in synch and password will be older one. You can then run FNDCPASS and change the password.

Scenario 2:

Some times when you run FNDCPASS, you get following error
APPFND01502: Cannot encrypt application ORACLE password

Cause: Application Object Library was unable encrypt your ORACLE password.

Action: Contact your support representative. (ORACLEUSER=APPS_SERV)

The error comes because the table fnd_oracle_userid contain rows for schemas that does
not exist. Those rows must be deleted from the table.

Use the following query to get the details of the schema that doest not exists
select * from fnd_oracle_userid
where oracle_username not in
(select username from all_users);

The rows returned by this query can be deleted from FND_ORACLE_USERID table.
This will resolve this issue.

Scenario 3:
There can be situation where users has update APPLSYS password using ALTER command in database directly and also you dont have backup of those tables. Under such situation, it is very difficult to recover the application and make it working. Still following methodology is proposed which might help you to restore the password back and make your application work fine.

For this to work you should have some other application (may be debug or UAT) which is having the same passwords or default passwords for schemas. If you have such application the following the below steps in the application which is affected by password mismatch.

This method is for resetting apps and applsys passwords. Below are the SQL statements that will help you reset the APPS and APPLSYS passwords to APPS, the APPLSYSPUB password to PUB, and the SYSADMIN password to SYSADMIN.

WARNING: This procedure will cause all user passwords to become invalid. ALL users
passwords will need to be reset through the sysadmin responsibility.

Step 1) Reset the Oracle User IDs

Open a SQL*Plus as SYSTEM and reset the passwords for the APPS, APPLSYS, and the
APPLSYSPUB Oracle user ID:


Step 2) Backup the FND_ORACLE_USERID and FND_USER tables (even though these tables are right now corrupted, do take a backup. You can restore the same when ever you want).

Open a SQL*Plus session as APPLSYS and backup the tables:
create table FND_ORACLE_USERID_BAK as (select * from FND_ORACLE_USERID);
create table FND_USER_BAK as (select * from FND_USER);

Step 3) Reset the APPS and APPLSYS application encrypted passwords
Open a SQL*Plus session as APPLSYS and update the FND_ORACLE_USERID table.

This encrypted string we are updating is the default encrypted string for apps. So if your

application is having apps password the encrypted string will look like this. We are
updating this encrypted string here directly.

Verify the table update:

Step 4) Reset the APPLSYSPUB application encrypted password
Open a SQL*Plus session as APPLSYS and update the FND_ORACLE_USERID table.


The above encrypted string is the encrypted string for password pub. If your applsyspub
password is pub then the encrypted string in FND_ORACLE_USERID will look like
Verify the table update:

Once these updates are done, try your luck by running FNDCPASS and it should work
Related Posts Plugin for WordPress, Blogger...

Let us be Friends...

Share |

Popular Posts


11.5.1. to 11.5.5 Cloning Procedure. 11g 11i 11i and R12 11i Autoconfig 11i Cloning 12.1.1 SSL 2 Node RAC errors out adop Advanced Replication Apache version Apex Apex for Oracle database Apex Installation Apex Installation on Oracle E Business Suite. 11i with Apex Apex on 11i Apex on Oracle 11i Apex402 apexins.sql APPL_TOP Character Application Express Application server Issue APPLSYS password Apps Password Asynchronous Replication Autoconfig Autoconfig Managed Beehive Bit of operating system Block block media corrupt BPEL Central Inventory Character Set Conversion Cloning of 11i Cloning of Oracle Applications Clusterware Concurrent CPU 2011 CPU 2012 April CPU 2012 January. CPU 2012 October CRS custom top Custom Top Creation Database . Database Query Dataguard DBMS_REPAIR Demantra . Domain Name E Business Suite Migration EBS 12.2 EPM exp/imp Oracle Applications Flashback table flows_020200 FND_TOP/resource FNDCPASS FNDCPUCF Forms server upgrade Forms startup FRM-92101 Fusion Middleware Hostname Hot Backup Hot cloning HotBackup Hotbackup Cloning of Oracle Apps hrglobal.drv. NLS Saudi Arabian HRMS hyperion Import and Export Oracle Applications Install Oracle Installation of R12 Installation Steps integration Oracle EBS Issues Database issues Oracle EBS Issues with Upgrade 12.1.1 Java Mission Control Java Upgrade java/sql/SavePoint JInitiator Junk Characters Language Translation Linux Linux Migration listener trace Listner version Local Inventory Login Page Master-Master Replication Memory Tuning Multiple Language NLS Non-Autoconfig Enabled OBIEE 11g Installation OBIEE Issues OIM Opatch version OpenSSL ora-01031 Oracle oracle 11g Oracle Announcement Oracle Application servers Oracle Application services Oracle Applications Oracle Applications 11i oracle applications 12.2 Oracle Applications Cloning Oracle Applications Upgrade Oracle Applications. Oracle Apps cloning Oracle BPEL oracle certifications oracle database Oracle Database RMAN Oracle Database upgradation Oracle DB oracle E Business suite 12.2 Oracle EBS oracle EPM Oracle Forms Logo oracle Fusion Applications Oracle Inventory oracle news Oracle OUI Oracle R12 oracle Sun Solaris Oracle Tuning Oracle Virtual Box Oracle Webgate Oracle WMA configuration orcladmin password for Oracle Applications Pasta Configuration pasta.cfg patch PDF Performance Physical Standby Platform migration Printer Configuration Profile Option R12 RAC Rapid Install Rapidwiz Real Application Clusters 10g Recovery RMAN RMAN Recovery SA Gosi Service Oriented Architecture SOA SQLTXPLAIN SSL Configuration step-by-step upgrade Sun solaris Swap Tablespace Trace Enable Trace file Translation Synchronization Patch transport tablespace tuning Tuning SGA uifont.ali Underscore Universal Content Management Upgradation of 12.0.5 to 12.1.1 Upgrade Upgrade 11g Upgrade Apps Upgrade DB Upgrade to 11g UTF8 version of oracle applications versions Web server upgrade weblogic windows workflow version XML Publisher version