Oracle 11gr2 Software Installation on Linux Using Shell Script

Hi,
I have requirement to install Oracle Software on Linux Using shell script, with out any manual entries.
Thanks,
loganathan

Srini_Chavali wrote:
Pl identify exact version of database and OS.
Ed - not sure where you looked :-) but response files can certainly be used for an automated installation (which is what I think OP is referring to)
http://docs.oracle.com/cd/E11882_01/install.112/e24321/app_nonint.htm#BABFEECI
HTH
Srini
You are right.  I must be losing it.  My failure rate lately has been abnormally high.  I don't remember exactly how I searched before .. I thought I opened the Installation Guide an searched for 'silent' in "this document only" -- but all I came up with was references to dbca and emca ... nothing for OUI itself.  Now that I go back and do the same search, there it is.

Similar Messages

  • Oracle 11gR2 Express Edition on Linux Ubuntu 11.10 howto

    h1. Oracle 11gR2 Express Edition on Linux Ubuntu 11.10 howto
    Author: Dude
    Version: D
    Last modified: 14-Jan-2012
    You are welcome to add comments, but please do not discuss your installation issues in this thread.  If you have a question about the instructions, please add a simple note to the link of your own thread. The instructions are the result of my own research and development. If you would like to use any of the information for your own blog or website, please include a link to this reference to include future changes.
    Oracle 11gR2 Express Edition on Linux Ubuntu 11.10 howto
    h2. Purpose
    This document outlines instructions how to install Oracle XE under Ubuntu 11.10.
    Ubuntu or Debian based Linux is not on the list of supported operation systems according to the Oracle documentation at http://download.oracle.com/docs/cd/E17781_01/install.112/e18802/toc.htm. You may want to consider virtualization software like Oracle Virtualbox and install Oracle Enterprise Linux as a free and professional alternative to installing XE under Ubuntu. You can also download pre-build virtual machines that include Oracle XE. You can browse http://otn.oracle.com/community/developer-vm for more information.
    h2. Topics
    h4. 1) Install Linux Ubuntu
    h4. 2) Remote Terminal
    h4. 3) Install Additional Software
    h4. 4) Managing Swap Space
    h4. 5) Modify Kernel Parameters
    h4. 6) Oracle Home Directory
    ...a) Resize the Root Partition
    ...b) Setup External Storage
    h4. 7) ORA-00845: MEMORY_TARGET
    h4. 8) Installing Oracle 11gR2 Express Edition
    h4. 9) Post-Installation
    h4. 10) Tips and Troubleshooting
    ...a) Port 1521 appears to be in use by another application
    ...b) cannot touch `/var/lock/subsys/listener': No such file or directory
    ...c) ORA-00845: MEMORY_TARGET
    ...d) Apex ADMIN password
    ...e) SYS and SYSTEM password
    ...f) Uninstall Oracle 11g XE
    ...g) Reconfigure Oracle 11g XE
    ...h) Gnome Classic desktop
    ...i) Unix vi cursor keys
    ...j) Backup Database
    h4. 11) History
    h4. 12) References
    h2. 1) Install Linux Ubuntu
    The following assumes you have installed Ubuntu 11.10 Desktop Edition for AMD 64-bit, or upgraded from a previous version. Keep in mind that Oracle 11gR2 Express Edition is only available for 64-bit architecture. It is not necessarily a requirement, but I would not bother to install Oracle 11gR2 XE on a system with less than 2 GB of RAM installed. You can download Ubuntu for free at: http://www.ubuntu.com/download/ubuntu and install it using the default settings provided.
    You can apply the latest OS patch-sets by clicking the power button icon in the upper right hand corner of the screen and selecting "Updates available..."
    h2. 2) Remote Terminal
    You will need command line access to perform the installation tasks. Select the top "Dash Home" button of the Unity toolbar and enter the word "terminal", or use CTRL-ALT-t. If you prefer to open a remote terminal session use SSH. Ubuntu does not come with a secure shell login by default. To install it, use the following command:
    sudo apt-get install openssh-serverYou cannot login as root unless you set a root password using the "sudo passwd root" command. However, you can get root user access using the "sudo" command, which requires only to re-enter the password of your personal account. Access to "sudo" is controlled by the /etc/sudoers file.
    The best way to establish a remote command line session as root is to login with your personal account, e.g.: ssh [email protected], and then type "sudo su -" to become root, or use "sudo <command>" to execute individual commands. If your account does not have "sudo" access you can login as root using "su - root", but will need to know the root password.
    h2. 3) Install Additional Software
    Oracle 11g Express Edition requires additional software that is not installed by default:
    sudo apt-get install alien libaio1 unixodbch2. 4) Managing Swap Space
    Oracle demands that the minimum swap space for Oracle Database XE is 2 GB (2095100 KB) or twice the size of RAM, whichever is lesser. Enter the following shell command to verify your swap space:
    cat /proc/meminfo | grep -i swap
    SwapCached:            0 kB
    SwapTotal:       2095100 kB
    SwapFree:        2095100 kBYou can increase available swap space by using a swap file as long as disk space permits. The advantage of a swap file versus a swap partition is flexible space management because you can add or delete swap space on demand as necessary. The following will create and enable an additional 1 GB swap file at system startup, located in the /home directory:
    Login as root:
    sudo su -Enter the following commands:
    dd if=/dev/zero of=/home/swapfile bs=1024 count=1048576
    mkswap /home/swapfile
    swapon /home/swapfile
    swapon -aCreate a backup of the original "fstab" file and add the new swap file:
    cp /etc/fstab /etc/fstab.backup_`date +%N`
    echo '/home/swapfile swap swap defaults 0 0' >> /etc/fstabExit from root and verify the new swap space:
    exit
    swapon -s
    Filename                    Type          Size     Used     Priority
    /dev/sda5                               partition     2095100     0     -1
    /home/swapfile                          file          1048572     0     -2Swap space is not a substitute for installed RAM. Swap space is a safeguard that allows the system to move idle processes to disk before the OOM killer will begin to terminate processes in order to free up enough real memory to keep the system operational. The general rule for sizing the swap space depends on the size of installed RAM. If your system has less then 4 GB of RAM the swap space should usually be at least twice this size. If you have more than 8 GB of RAM installed you may consider to use an equal size as swap space. The more RAM you have installed, the less likely you are going to run into memory starvation, and the less likely you are going to need swap space, unless you have a bad process.
    h2. 5) Modify Kernel Parameters
    Oracle 11gR2 Express Edition requires the following Kernel parameters. Enter the commands exactly as shown:
    Login as root:
    sudo su -Cut & paste the following directly into a command shell (not a text editor):
    cat > /etc/sysctl.d/60-oracle.conf <<-EOF
    # Oracle 11g XE kernel parameters
    fs.file-max=6815744
    net.ipv4.ip_local_port_range=9000 65500
    kernel.sem=250 32000 100 128
    # kernel.shmmax=429496729
    kernel.shmmax=107374183
    EOFLoad and verify the new kernel parameters:
    service procps start
    sudo sysctl -q fs.file-max
    sudo sysctl -q kernel.shmmax
    sudo sysctl -q net.ipv4.ip_local_port_range
    sudo sysctl -q kernel.sem The SHMMAX kernel parameter defines the upper memory limit of a process. It is a safeguard to stop a bad process from using all memory and causing RAM starvation. The Linux default is 32 MB. The official Oracle XE installation documentation suggests a value of 4 GB -1 bytes (429496729). Since Oracle 11g XE has a 1 GB memory limit, a smaller footprint will be a better safeguard for the complete system. Setting the SHMMAX parameter to 107374183 will be sufficient.
    h2. 6) Oracle Home Directory
    At the time of this writing, Enterprise Linux 6 is not supported for Oracle database yet. It is therefore not possible to confirm Oracle ext4 filesystem compatibility, which is default in Ubuntu 11. According to various information, ext4 may cause a performance problem for Oracle 11g database. The following will show you how to add a ext3 partition to your existing setup.
    h3. 6.a) Resize the Root Partition
    Provided you have sufficient free disk space, you should be able to resize the root partition to create an extra ext3 filesystem. Considering the 11 GB user datafile limit of the Express Edition, 18 GB should be more than enough.
    You can use the free Gparted Live CD to shrink your startup volume. Gparted downloads are available at http://sourceforge.net/projects/gparted/files/gparted-live-stable. When burning the CD, pay attention to burn the raw .iso image and not the possibly "mounted" image. If you are using a virtual machine like Oracle Virtualbox, you can mount the .iso image directly. There are going to be a few prompts when the system starts from the CD, but you can press Return to accept the defaults.
    When the Gparted window appears:
    - Select your ext4 root partition, usually /dev/sda1
    - Select the "Resize/Move" button from the toolbar.
    - Enter 18000 into the "Free space following" field and press the Return key.
      Be careful not not change the start of the partition!
    - Click the "Resize/Move" of the dialog and then then the "Apply" toolbar button.
      The process may take several minutes - do not abandon it!
    - Select the new unallocated free space of ~ 18 GB and push the "New" button.
    - Set the file system to "ext3" and label it "oraclexe" and click the "Add" button.
      Be sure to label it oraclexe, otherwise the follow-up instructions will fail.
    - Finally select "Apply from the toolbar to apply the changes.
    - Quit "Gparted", select "Exit" from the desktop and choose "Reboot" to restart the system.
    {code}
    After the system has restarted, open a terminal command shell.
    Login as root:
    {code}
    sudo su -
    {code}
    Backup "fstab" and add the UUID of the partition. The "tr" command remove the quotes:
    {code}
    cp /etc/fstab /etc/fstab_`date +%N`
    uuid=`blkid | grep oraclexe | awk '{print $3}'`
    uuid=`echo $uuid | tr -d '\042'`
    echo $uuid
    echo "$uuid  /u01  ext3  errors=remount-ro 0 1" >> /etc/fstab
    {code}
    The UUID is a unique number and should look similar to:
    {code}
    UUID=d1db753e-b5dd-4a4c-a61e-259c69867b58
    {code}
    Restart the system:
    {code}
    reboot
    {code}
    Verify the success:
    {code}
    df -h /u01
    {code}
    h3. 6.b) Setup External Storage
    If you prefer to setup an external drive to install Oracle XE, beware that it can be a fatal mistake to make an entry in /etc/fstab to automount your external storage device.  An unavailable device in /etc/fstab will prevent a system startup and prompt for appropriate actions at the console.
    The following is an example of how to prepare an external storage device to be used for Oracle 11g, including a script to automatically mount an external drive at system startup without the disadvantages of /etc/fstab. The script will also take into consideration that a device name might shift if you attach additional devices.
    To find out which USB devices are connected:
    {code}
    sudo parted -l
    {code}
    Look for the device that matches your USB storage. For example: /dev/sdb1
    {code}
    Model: USB 2.0 Flash Disk (scsi)
    Disk /dev/sdb: 2064MB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Number  Start   End     Size    File system  Name     Flags
    1      20.5kB  1929MB  1929MB  hfs+         mystick
    {code}
    Initialize the device using ext3 filesystem - this will erase all data. The "-c" option will check for bad blocks (read-only), "-L" is the volume label:
    {code}
    sudo umount /dev/sdb1
    sudo mkfs.ext3 -c -L oraclexe /dev/sdb1
    {code}
    Install the pmount distribution package:
    {code}
    sudo apt-get install pmount
    {code}
    Login as root:
    {code}
    sudo su -
    {code}
    Cut & paste the following into the command prompt (not a text editor):
    {code}
    cat > /etc/init.d/oracle-mount <<-EOF
    #! /bin/sh
    # /etc/init.d/oracle-mount
    VOL_UUID=alphanumeric
    VOL_LABEL=oraclexe
    VOL_SYMLINK=/u01
    mount=/usr/bin/pmount
    uuid2dev() {
       VOL_DEVICE="\`blkid | grep \$VOL_UUID | awk '{print \$1}'\`"
       VOL_DEVICE="\`echo \$VOL_DEVICE | tr -d ':'\`"
       echo \$VOL_DEVICE
    case "\$1" in
      start)
        echo "Starting script /etc/init.d/oracle-mount"
        uuid2dev
        \$mount \$VOL_DEVICE \$VOL_LABEL
        if [ -d /media/\$VOL_LABEL ]; then
           echo "Mount \$VOL_DEVICE success"
           ln -sf /media/\$VOL_LABEL \$VOL_SYMLINK
        else
           echo "Error mouting \$VOL_DEVICE"
        fi
      stop)
        echo "Stopping script /etc/init.d/oracle-mount"
        uuid2dev
        /bin/umount \$VOL_DEVICE 2>/dev/null
        if [ "\`/usr/bin/pmount | /bin/grep \$VOL_DEVICE\`" ]; then
           echo "Error unmounting \$VOL_DEVICE"
        else
           rm -f \$VOL_SYMLINK
        fi
        echo "Usage: /etc/init.d/oracle-u01 {start|stop}"
        exit 1
    esac
    ### BEGIN INIT INFO
    # Provides:          oracle-mount
    # Required-Start:    \$remote_fs \$syslog
    # Required-Stop:     \$remote_fs \$syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Start daemon at boot time
    # Description:       Mount hotplug-usb drive and create symlink
    ### END INIT INFO
    EOF
    {code}
    Install the oracle-mount init script:
    {code}
    chmod 755 /etc/init.d/oracle-mount
    update-rc.d oracle-mount defaults 01 99
    {code}
    Get the UUID of the volume "oraclexe" and update the VOL_UUID in the init script accordingly:
    {code}
    uuid=`blkid | grep oraclexe | awk '{print $3}'`
    echo $uuid
    sed -i "s/^VOL_UUID=.*/VOL_$uuid/g" /etc/init.d/oracle-mount
    {code}
    The UUID of your device will be a unique number, but should be similar to:
    {code}
    UUID="3f5e9963-b328-49f3-b3e8-a3561ae34106"
    {code}
    Logout of root and test the init script:
    {code}
    exit
    sudo /etc/init.d/oracle-mount stop
    ls /u01
    sudo /etc/init.d/oracle-mount start
    ls /u01
    {code}
    Your output should look like:
    {code}
    Stopping script /etc/init.d/oracle-mount
    /dev/sdb1
    ls: cannot access /u01: No such file or directory
    Starting script /etc/init.d/oracle-mount
    /dev/sdb1
    Mount /dev/sdb1 success
    lost+found
    {code}
    h2. 7) ORA-00845: MEMORY_TARGET
    Oracle 11gR2 XE under Ubuntu 11.10 will result in "ORA-00845: MEMORY_TARGET not support on this system" either at Oracle database startup or during the initial installation. Ubuntu 11.10 uses a new version of the "systemd" system and session manager and has migrated away from /dev/shm and other common directories in favor of /run.
    There are several ways how to address the problem. You can either enable /dev/shm shared memory, or change the default memory management of Oracle 11g from AMM (Automatic Memory Management) to ASMM (Automatic Shared Memory Management) as it was in used the previous 10g version. Since AMM is one of the new features of 11g, the following will show you how to make to make AMM work.
    Login as root:
    {code}
    sudo su -
    {code}
    Cut & paste the following into the command prompt (not a text editor):
    {code}
    cat > /etc/init.d/oracle-shm <<-EOF
    #! /bin/sh
    # /etc/init.d/oracle-shm
    case "\$1" in
      start)
        echo "Starting script /etc/init.d/oracle-shm"
        # Run only once at system startup
        if [ -e /dev/shm/.oracle-shm ]; then
          echo "/dev/shm is already mounted, nothing to do"
        else
          rm -f /dev/shm
          mkdir /dev/shm
          mount -B /run/shm /dev/shm
          touch /dev/shm/.oracle-shm
        fi
      stop)
        echo "Stopping script /etc/init.d/oracle-shm"
        echo "Nothing to do"
        echo "Usage: /etc/init.d/oracle-shm {start|stop}"
        exit 1
    esac
    ### BEGIN INIT INFO
    # Provides:          oracle-shm
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Bind /run/shm to /dev/shm at system startup.
    # Description:       Fix to allow Oracle 11g use AMM.
    ### END INIT INFO
    EOF
    {code}
    Install the oracle-shm init script:
    {code}
    chmod 755 /etc/init.d/oracle-shm
    update-rc.d oracle-shm defaults 01 99
    {code}
    Restart the system:
    {code}
    reboot
    {code}
    Verify the success:
    {code}
    sudo cat /etc/mtab | grep shm
    {code}
    {code}
    none /run/shm tmpfs rw,nosuid,nodev 0 0
    /run/shm /dev/shm none rw,bind 0 0
    {code}
    The upper limit of shared memory under Linux is set to 50 % of the installed RAM by default. If your system has less than 2 GB of RAM installed, there is still a chance to run into ORA-00845 error if your shared memory is used by other software.
    The verify available shared memory, type the following commands:
    {code}
    sudo df -h /run/shm
    {code}
    h2. 8) Installing Oracle 11gR2 Express Edition
    The final release version of Oracle 11gR2 Express Edition can be downloaded for free at http://otn.oracle.com/database/express-edition/downloads. The software should automatically downloaded into the "Downloads" folder of your home directory.
    Enter the following commands to unpack the installer:
    {code}
    cd ~/Downloads
    unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
    rm oracle-xe-11.2.0-1.0.x86_64.rpm.zip
    {code}
    The Debian Linux based package management of Ubuntu is not compatible with the Red Hat package manager. The Oracle installer needs to be converted using the following commands:
    {code}
    cd ~/Downloads/Disk1
    sudo alien --to-deb --scripts oracle-xe-11.2.0-1.0.x86_64.rpm
    (This may take a few minutes)
    rm oracle-xe-11.2.0-1.0.x86_64.rpm
    {code}
    The following needs to be set for compatibility:
    {code}
    sudo ln -s /usr/bin/awk /bin/awk
    sudo mkdir /var/lock/subsys
    {code}
    Ubuntu uses different tools to manage services and system startup scripts. The "chkconfig" tool required by the Oracle installer is not available in Ubuntu. The following will create a file to simulate the "chkconfig" tool.
    Login as root:
    {code}
    sudo su -
    {code}
    Copy & paste the following *directly* into the command prompt to create a file:
    {code}
    cat > /sbin/chkconfig <<-EOF
    #!/bin/bash
    # Oracle 11gR2 XE installer chkconfig hack for Debian based Linux (by dude)
    # Only run once.
    echo "Simulating /sbin/chkconfig..."
    if [[ ! \`tail -n1 /etc/init.d/oracle-xe | grep INIT\` ]]; then
    cat >> /etc/init.d/oracle-xe <<-EOM
    ### BEGIN INIT INFO
    # Provides:                  OracleXE
    # Required-Start:        \\\$remote_fs \\\$syslog
    # Required-Stop:        \\\$remote_fs \\\$syslog
    # Default-Start:            2 3 4 5
    # Default-Stop:            0 1 6
    # Short-Description:   Oracle 11g Express Edition
    ### END INIT INFO
    EOM
    fi
    update-rc.d oracle-xe defaults 80 01
    EOF
    {code}
    Exit root:
    {code}
    exit
    {code}
    Set execute privileges:
    {code}
    sudo chmod 755 /sbin/chkconfig
    {code}
    Install Oracle 11gR2 Express Edition entering the following commands:
    {code}
    cd ~/Downloads/Disk1
    sudo dpkg --install ./oracle-xe_11.2.0-2_amd64.deb
    (This may take a couple of minutes)
    {code}
    Run the configuration script to create (clone) the database and follow the screen. Accept the default answers, including "y" to startup the database automatically, or modify as required.
    {code}
    sudo /etc/init.d/oracle-xe configure
    (This can take a few minutes - the installation completed successfully.)
    {code}
    To verify success, the procedure should end showing:
    {code}
    Starting Oracle Net Listener...Done
    Configuring database...Done
    Starting Oracle Database 11g Express Edition instance...Done
    Installation completed successfully.
    {code}
    Set a password for the Oracle account:
    {code}
    sudo passwd oracle
    {code}
    h2. 9) Post-Installation
    In order to use sqlplus and other tools, the Oracle account requires specific environment variables. The following will set these variables automatically at every Oracle login:
    Login as the Oracle user:
    {code}
    su - oracle
    {code}
    Copy the default account skeleton files and add the Oracle env script to .profile:
    {code}
    cp /etc/skel/.bash_logout ./
    cp /etc/skel/.bashrc ./
    cp /etc/skel/.profile ./
    echo "" >>./.profile
    echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >>./.profile
    {code}
    By default, the Oracle Database XE graphical user interface is only available at the local server, but not remotely. The following will enable remote logins:
    Login as the Oracle user:
    {code}
    su - oracle
    {code}
    Login as SYSDBA and execute the following:
    {code}
    sqlplus / as sysdba
    SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
    exit
    {code}
    See http://download.oracle.com/docs/cd/E17781_01/admin.112/e18585/toc.htm for more information.
    h3. a) Unity desktop configurations
    The Oracle XE menu under the previous Gnome Classic desktop shows several useful scripts to backup the database, start and stop the database, etc. Under the Unity based desktop this menu is not available. You can either switch to the Gnome Classic desktop as outlined in chapter 2, or perform the following steps to modify and copy the scripts as outlined below. The start and stop database scripts will also be modified to perform a progress feedback.
    Login as user root:
    {code}
    sudo su -
    {code}
    Convert desktop files:
    {code}
    cd /usr/share/applications
    sed -i 's/Categories.*/Categories=Database;Office;Development;/g' oraclexe*
    sed -i 's/MultipleArgs/X-MultipleArgs/g' oraclexe*
    sed -i 's/MimeType.*/MimeType=application\/x-database/g' oraclexe*
    sed -i 's/.png//g' oraclexe*
    sed -i 's/Terminal=false/Terminal=true/g' oraclexe-startdb.desktop
    sed -i 's/Terminal=false/Terminal=true/g' oraclexe-stopdb.desktop
    {code}
    Exit root:
    {code}
    exit
    {code}
    Login as user Oracle:
    {code}
    su - oracle
    {code}
    Modify database start and stop scripts:
    {code}
    cd /u01/app/oracle/product/11.2.0/xe/config/scripts
    cp startdb.sh start.sh_orig
    cp stopdb.sh stopdb.sh_orig
    sed -i 's/>.*//g' startdb.sh
    sed -i 's/>.*//g' stopdb.sh
    {code}
    You will need SYSDBA privileges and set Oracle environment variables in order to use your regular user account.
    Login to your regular user account:
    {code}
    su - dude
    {code}
    Enter the folowing command:
    {code}
    sudo usermod -a -G dba dude
    {code}
    Then update your profile to automatically set the necessary Oracle environment variables:
    {code}
    echo "" >>./.profile
    echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >>./.profile
    {code}
    Update your Desktop folder to contain useful Oracle XE scripts:
    {code}
    cp /usr/share/applications/oraclexe* ~/Desktop
    chmod 750 ~/Desktop/oraclexe*
    {code}
    To verify success re-login and try "sqlplus":
    {code}
    su - oracle
    sqlplus / as sysdba
    {code}
    h2. 10) Tips and Troubleshooting
    h3. 10. a) Port 1521 appears to be in use by another application
    Error: Port 1521 appears to be in use by another application. Specify a different port.This error happens after a previously unsuccessful configuration attempt using /etc/init.d/oracle-xe configure script. The script was able to start the Listener process, but most likely failed to continue  to clone the database, e.g. ORA-00845. The following should correct the problem:
    Determine the oracle listener process that is already running:
    {code}
    $ ps -ef | grep oracle
    {code}
    Your output should be similar to:
    {code}
    oracle   19789     1  0 19:46 ?        00:00:00 /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr
    {code}
    Then kill the process, using the appropriate process id, for instance:
    {code}
    $ sudo kill -9 19789
    {code}
    h3. 10.b) cannot touch `/var/lock/subsys/listener': No such file or directory
    Starting Oracle Net Listener...touch: cannot touch `/var/lock/subsys/listener': No such file or directoryThis error occurs when you run /etc/init.d/oracle-xe configure, but failed the preinstallation step to create the /var//lock/subsys directory as outlined in chapter 8.
    h3. 10.c) ORA-00845: MEMORY_TARGET
    ORA-00845: MEMORY_TARGET not supported on this system See chapter 7 to enable /dev/shm and verify free space available in /run/shm
    h3. 10.d) Apex ADMIN password
    According to the Oracle documentation, the password for the INTERNAL and ADMIN Oracle Application Express user accounts is initially the same as the SYS and SYSTEM administrative user accounts. Well, I tried several times without success. To reset the Apex Admin password:
    Login as user oracle:
    {code}
    su - oracle
    {code}
    Login as SYSDBA and type the following:
    {code}
    sqlplus / as sysdba
    {code}
    At the SQL prompt, type the following to be prompted to change the password:
    {code}
    SQL> @?/apex/apxxepwd.sql
    exit
    {code}
    When done, open your browser and go to http://127.0.0.1:8080/apex
    Workspace: Internal
    Username: ADMIN
    Password: password you set with apxxepwd.sql
    I will prompt you to reset the password:
    old password: password you set with apxxepwd.sql
    new password: final_password
    You can also login as the Apex Admin using http://127.0.0.1:8080/apex/apex_admin
    h3. 10.e) SYS and SYSTEM password
    Use the following commands to reset the SYS and SYSTEM passwords if necessary:
    Login as the Oracle user:
    {code}
    su - oracle
    {code}
    Login as SYSDBA and type the following at the SQL prompt:
    {code}
    sqlplus / as sysdba
    SQL> alter user sys identified by "password" account unlock;
    SQL> alter user system identified by "password" account unlock;
    SQL> exit
    {code}
    h3. 10.f) Uninstall Oracle 11g XE
    The following will completely uninstall and remove Oracle 11g XE:
    Open a terminal seesion and login as user root:
    {code}
    sudo su -
    {code}
    Enter the following:
    {code}
    /etc/init.d/oracle-xe stop
    dpkg --purge oracle-xe
    rm -r /u01/app
    rm /etc/default/oracle-xe
    update-rc.d -f oracle-xe remove
    update-rc.d -f oracle-mount remove
    update-rc.d -f oracle-shm remove
    {code}
    h3. 10.g) Reconfigure Oracle 11g XE
    Type the following commands in a terminal window:
    {code}
    sudo /etc/init.d/oracle-xe stop
    sudo rm /etc/default/oracle-xe
    sudo /etc/init.d/oracle-xe configure
    {code}
    h3. 10.h) Gnome Classic desktop
    Ubuntu 11 moved from the Gnome Classic desktop to Unity and removed the "Ubuntu Classic" login option. Unity was designed to make more efficient use of space given a limited screen size and touch screens. If you prefer to use the Gnome Classic desktop, enter the following into a terminal window:
    {code}
    sudo apt-get install gnome-panel
    {code}
    To log into the Gnome Classic desktop, select the "Gearwheel" at the login screen and select "Gnome Classic".
    h3. 10.i) Unix vi cursor keys
    The instructions in this tutorial do not require the use of any text editor. However, if you would like use the backspace and cursor keys in the "vi-editor", the following needs to be installed:
    {code}
    sudo apt-get install vim
    {code}
    h3. 10.j) Backup Database
    In order to perform an online database backup using the supplied "Backup Database" script, the database needs to run in Archive-Log mode. This can be setup using the following commands:
    Login as the Oracle user:
    {code}
    su - oracle
    {code}
    Login as SYSDBA and type the following:
    {code}
    sqlplus / as sysdba
    SQL> shutdown immediate
    SQL> startup mount
    SQL> alter database archivelog;
    SQL> alter database open;
    SQL> exit
    {code}
    h2. 11) History
    Version: A, 24-Oct-2011
    - first release
    Version: B, 25-Oct-2011
    - reduced instructions.
    - corrected errors in 6a and 8.
    - new strategy addressing ORA-00845 error.
    - rework of chapter 10.
    Version: C, 30-Nov-2011
    - corrected typo in 6a
    - new procedures in 9a.
    - added progress feedback to database scripts.
    Version D, 14-Jan-2012
    - corrected presentation errors.
    - reorganized instructions.
    h3. 12) References
    http://download.oracle.com/docs/cd/E17781_01/install.112/e18802/toc.htm
    http://askubuntu.com/questions/57297/why-has-var-run-been-migrated-to-run
    http://lwn.net/Articles/436012/
    https://forums.oracle.com/forums/thread.jspa?threadID=2300750&tstart=0
    Kind regards and best of luck!
    Dude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Excellent Blog. Thank You
    Small clarification on Step **6) Oracle Home Directory, ...a) Resize the Root Partition**
    Ubuntu 11.10 has Gparted available as a Ubuntu software download, DONT use that while trying the above step, instead download the ISO file from http://sourceforge.net/projects/gparted/files/gparted-live-stable/ gparted-live-0.12.0-5.iso (124.6 MB)
    Burn that ISO file on a Blank DVD, reboot the Ubuntu , during startup select Boot from DVD Option if not already selected. this will take to Boot Menu Options of Gparted Live then select the first menu option, and this allows to do further action such as Re-sizing .
    and once you have chosen and executed step a) . do NOT run step b) also that is "Setup External Storage"
    I hope this minor clarification can avoid some confusion
    Regards
    Madhusudhan Rao
    Edited by: MadhusudhanRao on Mar 24, 2012 11:30 PM

  • Can we do oracle 11g software installation in parallel to SAP upgrade

    Hi Basis Expert,
    I need your inputs for one of this query
    The query is. Can we do oracle 11g software installation in parallel to SAP upgrade when the system is in Downtime phase.
    The idea is running SAP upgrade and in parallel running oracle 11g software installation. So that we can reduced the time.
    Please share your valuable inputs.
    Regards,
    Anil Shenoy.

    yes, of course.
    using different environment during the installation of the new engine, you could install the new oracle home 11 also tomorrow (including the SBP).
    infact, before the ./RUNINSTALLER you have to set the environment
    setenv ORACLE_HOME /oracle/SID/112_64
    setenv ORACLE_HOME_SRC /oracle/SID/102_64
    setenv ORACLE_HOME_TGT /oracle/SID/11202
    setenv  LIBPATH $ORACLE_HOME/lib:$LIBPATH
    setenv PATH /oracle/SID/112_64/bin: $PATH

  • Following error occurs while oracle client 10g installation on Linux 5

    Following error occurs while oracle client 10g installation on Linux 5
    [oraclient@SVHJ0678 client]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-04-14_02-30-53AM. Please wait ...[oraclient@SVHJ0678 client]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2010-04-14_02-30-53AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
    at sun.awt.DebugHelper.<clinit>(Unknown Source)
    at java.awt.Component.<clinit>(Unknown Source)

    user8862191 wrote:
    Following error occurs while oracle client 10g installation on Linux 5
    What is Linux 5? Do you mean Oracle Enterprise Linux (OEL) 5 ???
    [oraclient@SVHJ0678 client]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-04-14_02-30-53AM. Please wait ...[oraclient@SVHJ0678 client]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2010-04-14_02-30-53AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
    at sun.awt.DebugHelper.<clinit>(Unknown Source)
    at java.awt.Component.<clinit>(Unknown Source)

  • Step by Step Oracle i-Learning Installation on Linux

    Hi all;
    I prepare one documentation about Step by Step Oracle i-Learning Installation on Linux.
    Its avaliable at:
    http://heliosguneserol.wordpress.com/2010/05/25/step-by-step-oracle-i-learning-installation-on-linux/
    Hope it helps to forum users
    Regard
    Helios

    Helios,
    Thanks for sharing this with us!
    Thanks,
    Hussein

  • Linux command/shell script to find Memory consumed by JVM in EBS,SOA

    Hi All,
    Could anyone please let me know the following:
    a)Linux command/shell script to find Memory consumed by JVM for every 1 minute frequency interval in EBS R12, SOA suite
    b)Percentage of the Heap memory usage by the JVM for every 1 minute frequency interval in EBS R12, SOA suite
    Thanks for your time!
    Regards,

    user10088255 wrote:
    Hi All,
    Could anyone please let me know the following:
    a)Linux command/shell script to find Memory consumed by JVM for every 1 minute frequency interval in EBS R12, SOA suite
    b)Percentage of the Heap memory usage by the JVM for every 1 minute frequency interval in EBS R12, SOA suite
    Thanks for your time!
    Regards,Please see these docs.
    JVM: Guidelines to setup the Java Virtual Machine in Apps Ebusiness Suite 11i and R12 [ID 362851.1]
    Generate JVM heap dump in E-Business suite 11i and R12 [ID 462550.1]
    11i: How To Use Jconsole to Monitor JVM with Oracle E-Business Suite 11i [ID 415455.1]
    Configuring various JVM tuning parameters for Oracle E-Business suite 11i and R12 [ID 567551.1]
    Script to find Apache, Java, Jinitiator, Forms version and JVM details for Oracle E-Business Suite 11i [ID 466890.1]
    JVM Memory Monitoring, Tuning, Garbage Collection, Out of Memory, and Heap Dump Analysis For SOA Suite Integration 11g [ID 1358719.1]
    How to Perform Memory and Thread Analysis on SOA [ID 1450293.1]
    Thanks,
    Hussein

  • Make .dmp file using shell script

    i am new in linux.
    i want to make .dmp file(export form a table) in a particular directory using shell script .
    then form .dmp file i want to convert it in .zip file
    Edited by: 855516 on Jul 18, 2011 5:26 PM

    The following should give you a head start:
    Create the following file i.e. scott_export.sh
    #!/bin/bash
    MAILADR="[email protected]"
    EXPDIR="/home/oracle/datapump"
    EXPDIR4SQL="'$EXPDIR'"
    DUMPFILE="export_`date +%N`.dmp"
    LOGFILE="export_`date +%N`.log"
    ORACLE_SID=test; export ORACLE_SID
    PATH=$PATH:/usr/local/bin; export PATH
    ORAENV_ASK=NO
    . /usr/local/bin/oraenv
    mkdir -p $EXPIDR 2>/dev/null
    sqlplus -s /nolog <<EOF
    connect / as sysdba
    set pages 0 feed off
    create or replace directory datapump as $EXPDIR4SQL;
    grant read, write on directory datapump to scott;
    exit
    EOF
    expdp scott/tiger tables=EMP,DEPT \
          transport_full_check=y \
          directory=datapump dumpfile=$DUMPFILE logfile=$LOGFILE
    gzip $EXPDIR/$DUMPFILE >> $EXPDIR/$LOGFILE
    cat $EXPDIR/$LOGFILE | mailx -s "$LOGFILE" $MAILADR
    # ENDGive execute privileges:
    $ chmod 750 scott_export.sh
    The above script should also work as a cron job.

  • How to get ORA errors in alertlog file using shell script.

    Hi,
    Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
    Thanks

    Hi,
    You can define the alert log as an external table, and extract messages with SQL, very cool:
    http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
    If you want to write a shell script to scan the alert log, see here:
    http://www.rampant-books.com/book_2007_1_shell_scripting.htm
    #!/bin/ksh
    # log monitoring script
    # report all errors (and specific warnings) in the alert log
    # which have occurred since the date
    # and time in last_alerttime_$ORACLE_SID.txt
    # parameters:
    # 1) ORACLE_SID
    # 2) optional alert exclusion file [default = alert_logmon.excl]
    # exclude file format:
    # error_number error_number
    # error_number ...
    # i.e. a string of numbers with the ORA- and any leading zeroes that appear
    # e.g. (NB the examples are NOT normally excluded)
    # ORA-07552 ORA-08006 ORA-12819
    # ORA-01555 ORA-07553
    BASEDIR=$(dirname $0)
    if [ $# -lt 1 ]; then
    echo "usage: $(basename) ORACLE_SID [exclude file]"
    exit -1
    fi
    export ORACLE_SID=$1
    if [ ! -z "$2" ]; then
    EXCLFILE=$2
    else
    EXCLFILE=$BASEDIR/alert_logmon.excl
    fi
    LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
    if [ ! -f $EXCLFILE ]; then
    echo "alert exclusion ($EXCLFILE) file not found!"
    exit -1
    fi
    # establish alert file location
    export ORAENV_ASK=NO
    export PATH=$PATH:/usr/local/bin
    . oraenv
    DPATH=`sqlplus -s "/ as sysdba" <<!EOF
    set pages 0
    set lines 160
    set verify off
    set feedback off
    select replace(value,'?','$ORACLE_HOME')
    from v\\\$parameter
    where name = 'background_dump_dest';
    !EOF
    `
    if [ ! -d "$DPATH" ]; then
    echo "Script Error - bdump path found as $DPATH"
    exit -1
    fi
    ALOG=${DPATH}/alert_${ORACLE_SID}.log
    # now create awk file
    cat > $BASEDIR/awkfile.awk<<!EOF
    BEGIN {
    # first get excluded error list
    excldata="";
    while (getline < "$EXCLFILE" > 0)
    { excldata=excldata " " \$0; }
    print excldata
    # get time of last error
    if (getline < "$LASTALERT" < 1)
    { olddate = "00000000 00:00:00" }
    else
    { olddate=\$0; }
    errct = 0; errfound = 0;
    { if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
    { # get next record from file
    next; # get next record from file
    # here we are now processing errors
    OLDLINE=\$0; # store date, possibly of error, or else to be discarded
    while (getline > 0)
    { if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    OLDLINE = \$0; # no error, clear and start again
    errfound = 0;
    # save the date for next run
    olddate = dtconv(\$3, \$2, \$5, \$4);
    continue;
    OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
    if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
    { # extract the error
    errloc=index(\$0,"ORA-")
    if (errloc > 0)
    { oraerr=substr(\$0,errloc);
    if (index(oraerr,":") < 1)
    { oraloc2=index(oraerr," ") }
    else
    { oraloc2=index(oraerr,":") }
    oraloc2=oraloc2-1;
    oraerr=substr(oraerr,1,oraloc2);
    if (index(excldata,oraerr) < 1)
    { errfound = errfound +1; }
    else # treat fuzzy as errors
    { errfound = errfound +1; }
    END {
    if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    print olddate > "$LASTALERT";
    function dtconv (dd, mon, yyyy, tim, sortdate) {
    mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
    if (mth < 1)
    { return "00000000 00:00:00" };
    # now get month number - make to complete multiple of three and divide
    mth=(mth+2)/3;
    sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
    return sortdate;
    !EOF
    ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
    ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
    rm $LASTALERT
    if [ $ERRCT -gt 1 ]; then
    echo "$ERRCT Errors Found \n"
    echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
    exit 2
    fi

  • How to write CLOB parameter in a file or XML using shell script?

    I executed a oracle stored procedure using shell script. How can i get the OUT parameter of the procedure(CLOB) and write it in a file or XML in UNIX environment using shell script?
    Edit/Delete Message

    SQL> var c clob
    SQL>
    SQL> begin
      2          select
      3                  DBMS_XMLGEN.getXML(
      4                          'select rownum, object_type, object_name from user_objects where rownum <= 5'
      5                  ) into :c
      6          from    dual;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set long 999999
    SQL> set heading off
    SQL> set pages 0
    SQL> set feedback off
    SQL> set termout off
    SQL> set trimspool on
    // following in the script is not echo'ed to screen
    set echo off
    spool /tmp/x.xml
    select :c from dual;
    spool off
    SQL>
    SQL> --// file size
    SQL> !ls -l /tmp/x.xml
    -rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml
    SQL> --// file content
    SQL> !cat /tmp/x.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <ROWNUM>1</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>BONUS</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>2</ROWNUM>
      <OBJECT_TYPE>PROCEDURE</OBJECT_TYPE>
      <OBJECT_NAME>CLOSEREFCURSOR</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>3</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>DEPT</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>4</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMP</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>5</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMPTAB</OBJECT_NAME>
    </ROW>
    </ROWSET>
    SQL>

  • Sql Loader by using shell script, not able to insert data

    Hi,
    I am trying to dump the data by using shell script.(in shell script i am having sqlldr command)(its a host excutable method cocurrent program)
    When i am loading the data, by placing my files(.ctl,.prog,.csv,symbolink file for .prog) in $Custom_top/bin, it is loading exactly. 17000 records inserted.
    But if i am loading the data by placing my files in $custom_top/custom_folders. unable to insert total data. only 43 records inserting.
    Please any one can help me.
    Thanks in advance.
    Rama.

    Srini, Thanks a lot for ur reply,
    Oracle Apps version R12,
    Microsoft windows XP profissional
    Version 2002 service Pack 3
    My Control file Script is:
    load data
    infile '$XADP_TOP/data/CPIU/in/XXOKS_Price_Increase.csv'
    append
    into table XXOKS_CONTRACT_PRICE_INCR_DTLS
    fields terminated BY ',' optionally enclosed by '"'
    TRAILING NULLCOLS
    (EXCLUSION_FLAG,
    LEGACY_NUMBER,
    CUSTOMER_NUMBER,
    CUSTOMER_NAME,
    REQUEST_ID,
    CONTRACT_NUMBER,
    CONTRACT_START_DATE,
    CONTRACT_END,
    REQUEST_LINE_ID,
    LINE_START_DATE,
    LINE_END_DATE,
    ITEM_NUMBER,
    ITEM_DESCRIPTION,
    UNIT_PRICE,
    QTY,
    NEW_UNIT_PRICE,
    LINE_AMOUNT,
    NEW_LINE_AMOUNT,
    PRICE_INCREASED_DATE,
    PERCENTAGE_INCREASED,
    ORIGINAL_CONTRACT_AMOUNT,
    NEW_CONTRACT_AMOUNT,
    PRICE_INCREASE_AMOUNT)
    My .prog File is: Please fidn that i created symbolink file also for my .prog.
    if [ -z $XADP_TOP ];then
    echo "XADP_TOP environment variable is not set!"
    exit 1
    fi
    cd $XADP_TOP/data/CPIU/in
    DATE=`date +%y%m%d:%H%M`
    i_program_name="$0"
    i_ora_pwd="$1"
    i_user_id="$2"
    i_user_name="$3"
    i_request_id="$4"
    i_ftp_host_name="$5"
    i_ftp_user_name="$6"
    i_ftp_user_password="$7"
    ftp_prog() {
    # FTP Function to reuse the FTP Commands
    if [ $# -ne 6 ];then
    echo "Usage : ftp_prog <Hostname> <User name> <Password> <Remote Directory> <command> <filename>"
    exit 2
    fi
    l_ftp_host_name="$1"
    l_ftp_user_name="$2"
    l_ftp_user_password="$3"
    l_ftpdir="$4"
    l_ftp_command="$5"
    l_ftp_filename="$6"
    ftp -v -n ${l_ftp_host_name} <<EOF
    user ${l_ftp_user_name} ${l_ftp_user_password}
    ascii
    cd ${l_ftpdir}
    ${l_ftp_command} ${l_ftp_filename}
    quit
    EOF
    #exit $?
    # setting the ftp directory
    #ftpdir="/`echo ${TWO_TASK:-$ORACLE_SID}|tr "[A-Z]" "[a-z]"`/CPIU"
    ##ftpdir="/FinTEST/quoting/PS/ar"
    ftpdir="$XADP_TOP/data/CPIU/in"
    # setting the in directory and out directory
    indir="$XADP_TOP/data/CPIU/in"
    outdir="$XADP_TOP/data/CPIU/out"
    ftp_prog ${i_ftp_host_name} ${i_ftp_user_name} ${i_ftp_user_password} ${ftpdir} get XXOKS_Price_Increase.csv
    echo $ftpdir
    echo "Converting the data file into unix mode"
    dos2unix XXOKS_Price_Increase.csv XXOKS_Price_Increase.csv
    chmod 777 XXOKS_Price_Increase.csv
    cd $XADP_TOP/bin
    echo "Trying to excute sqlldr and entering into the into control file"
    $ORACLE_HOME/bin/sqlldr userid=$i_ora_pwd control=XXOKS_PRICE_INCR_LOAD log=$XADP_TOP/log/XXOKS_PRICE_INCR_LOAD_${DATE}.log;
    exit_status=$?
    echo "Checking the status and giving permissions to the data file which in in dir"
    if [ $exit_status -eq 0 ]; then
    cd $XADP_TOP/data/CPIU/in
         chmod 777 XXOKS_Price_Increase.csv
    echo "try to move data file into out dir"
    # Moving the file to out directory
    mv XXOKS_Price_Increase.csv ${outdir}/XXOKS_Price_Increase.csv_${DATE}
    #echo "ready to zip file in out dir step6"
    # Zipping the file
    #gzip -f ${outdir}/XXOKS_Price_Increase.csv_${DATE}
    echo "deleting the file which is in dir"
    # Deleting the file from in directory
    /bin/rm -f ${indir}/XXOKS_Price_Increase.csv
    # Deleting from the remote directory
    ftp_prog ${i_ftp_host_name} ${i_ftp_user_name} ${i_ftp_user_password} ${ftpdir} delete XXOKS_Price_Increase.csv
    echo "sqlloader finished successfully."
    else
    echo "Error in loader"
    ##echo "Loader error in Price Increase Detials File ${i_file}"
    fi
    exit $exit_status
    And My Log file Comments are
    SQL*Loader: Release 10.1.0.5.0 - Production on Thu Dec 3 01:32:08 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: XXOKS_PRICE_INCR_LOAD.ctl
    Data File: /oesapp/applmgr/GIS11/apps/apps_st/appl/xadp/12.0.0/data/CPIU/in/XXOKS_Price_Increase.csv
    Bad File: XXOKS_Price_Increase.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table XXOKS_CONTRACT_PRICE_INCR_DTLS, loaded from every logical record.
    Insert option in effect for this table: APPEND
    TRAILING NULLCOLS option in effect
    Column Name Position Len Term Encl Datatype
    EXCLUSION_FLAG FIRST * , O(") CHARACTER
    LEGACY_NUMBER NEXT * , O(") CHARACTER
    CUSTOMER_NUMBER NEXT * , O(") CHARACTER
    CUSTOMER_NAME NEXT * , O(") CHARACTER
    REQUEST_ID NEXT * , O(") CHARACTER
    CONTRACT_NUMBER NEXT * , O(") CHARACTER
    CONTRACT_START_DATE NEXT * , O(") CHARACTER
    CONTRACT_END NEXT * , O(") CHARACTER
    REQUEST_LINE_ID NEXT * , O(") CHARACTER
    LINE_START_DATE NEXT * , O(") CHARACTER
    LINE_END_DATE NEXT * , O(") CHARACTER
    ITEM_NUMBER NEXT * , O(") CHARACTER
    ITEM_DESCRIPTION NEXT * , O(") CHARACTER
    UNIT_PRICE NEXT * , O(") CHARACTER
    QTY NEXT * , O(") CHARACTER
    NEW_UNIT_PRICE NEXT * , O(") CHARACTER
    LINE_AMOUNT NEXT * , O(") CHARACTER
    NEW_LINE_AMOUNT NEXT * , O(") CHARACTER
    PRICE_INCREASED_DATE NEXT * , O(") CHARACTER
    PERCENTAGE_INCREASED NEXT * , O(") CHARACTER
    ORIGINAL_CONTRACT_AMOUNT NEXT * , O(") CHARACTER
    NEW_CONTRACT_AMOUNT NEXT * , O(") CHARACTER
    PRICE_INCREASE_AMOUNT NEXT * , O(") CHARACTER
    value used for ROWS parameter changed from 64 to 43
    Table XXOKS_CONTRACT_PRICE_INCR_DTLS:
    43 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 255162 bytes(43 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 43
    Total logical records rejected: 0
    Total logical records discarded: 0
    Run began on Thu Dec 03 01:32:08 2009
    Run ended on Thu Dec 03 01:32:08 2009
    Elapsed time was: 00:00:00.19
    CPU time was: 00:00:00.04
    Plz srini help me.
    Thanks in advance
    Rama..

  • PL/SQL using Shell Script

    Hi,
    I want to study in details about how to use shell script in pl/sql codes. Can any one suggest some useful link on the same.
    Nordik

    smon wrote:
    BluShadow wrote:
    miriam_omaha wrote:
    If you mean execute a shell script from a procedure, there are ways, not easy ways, to execute a shell script - try this thread on that topic:Not easy?
    What's not easy about setting up a job using DBMS_SCHEDULER which can directly call any executable at the operating system level?that doesn't meet the requirement, it's about executing host commands from within plsql.Which you can do with DBMS_SCHEDULER by creating a job to execute straight away. DBMS_SCHEDULER can execute operating system commands...
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1010013
    >
    'EXECUTABLE'
    This specifies that the program is external to the database. External programs implies anything that can be executed from the operating system's command line. AnyData arguments are not supported with job or program type EXECUTABLE.

  • How to Email Concurrent Program Output to Email using Shell Script

    Hi All,
    Have a Nice Day,
    I have a tricky requirement and i was not able to achieve, let me explain my requirement
    I have created a PLSQL Concurrent Program named "Approval Update". This will do update and it display the number of rows updated.
    Now i need to take this concurrent program output and it needs to be send it to the person who submits this program as an email using shell scripts.
    I have referred meta link note as well as some OTN posts but I was not able to achieve this.
    Please help me to complete this As soon as possible, Thanks in advance for your help.
    Let me know if you need more clarifications.
    Regards,
    CSK

    I don't have much idea in shell scripts all i want is, in my shell script i need to get the parent concurrent program output and that needs to be emailed to the intended person.
    Please help to to get the shell script commands for this.I do not have any shell script to share, sorry! If you want the query to get the parent request_id so you can get the log/out file name/location from then please refer to:
    REQUESTS.sql Script for Parent/Child Request IDs and Trace File IDs [ID 280295.1]
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONC_REQ_SUMMARY_V&c_owner=APPS&c_type=VIEW
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE -- LOGFILE_NAME & OUTFILE_NAME
    Thanks,
    Hussein

  • How to pick a message from a mail box using shell script

    Hi
    Can any one tell me how to pick a message from a mail box using shell script.
    Thanks,
    Suman.

    Hi Suman,
    Can any one tell me how to pick a message from a mail box using shell script.Grep for the message and then either cut or awk for the text. . . Something like this:
    ls -al /mail/directory | grep "$1"* | awk '{print $9}'
    Jon emmons has working samples in his book on Oracle shell scripting . . .
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

  • Passing flexfield from report wrapper to seeded report using shell script

    I am unable to pass flexfield values from report wrapper to seeded report using shell script
    below is the shell script that i am using to transfer GL Account High and GL Account Low to the seeded program Receipt Journal Report (ARXRJR). the flex fields get passed through the parameter v_param_12 and v_param_13. but all i am getting in the seeded report log file is the reporting level,reporting context,set_of_books,period, gl_date_low/high .
    #TEST Program for Passing GL Account High and GL Account Low
    v_user_name=`echo $3`
    v_login_pwd=`echo $FCP_LOGIN`
    v_prog_name=`echo TESTARXRJR`
    echo 'v_prog_name: '$v_prog_name
    # testing for passing the arguments from CM ...
    if [ -z "$1" ]
    then
    echo "Please pass the first argument...."
    exit 1
    fi
    v_request_id=`echo $4`
    echo 'v_request_id: '$v_request_id
    v_param_1=`echo $5`
    echo 'v_param_1: '$v_param_1
    v_param_2=`echo $6`
    echo 'v_param_2: '$v_param_2
    v_param_3=`echo $7`
    echo 'v_param_3: '$v_param_3
    v_param_4=`echo $8`
    echo 'v_param_4: '$v_param_4
    v_param_5="$9"
    echo 'v_param_5: '$v_param_5
    shift
    v_param_6=`echo $9`
    echo 'v_param_6: '$v_param_6
    shift
    v_param_7=`echo $9'`
    echo 'v_param_7: '$v_param_7
    shift
    v_param_8=`echo "$9"`
    echo 'v_param_8: '$v_param_8
    shift
    v_param_9=`echo $9`
    echo 'v_param_9: '$v_param_9
    shift
    v_param_10=`echo $9`
    echo 'v_param_10: '$v_param_10
    shift
    v_param_11=`echo $9`
    echo 'v_param_11: '$v_param_11
    shift
    v_param_12=`echo $9`
    echo 'v_param_12: '$v_param_12
    shift
    v_param_13=`echo $9`
    echo 'v_param_13: '$v_param_13
    shift
    v_param_14=`echo $9`
    echo 'v_param_14: '$v_param_14
    shift
    v_param_15=`echo $9`
    echo 'v_param_15: '$v_param_15
    shift
    v_param_16=`echo $9`
    echo 'v_param_16: '$v_param_16
    shift
    v_param_17=`echo $9`
    echo 'v_param_17: '$v_param_17
    shift
    v_param_18=`echo $9`
    echo 'v_param_18: '$v_param_18
    shift
    v_param_19=`echo $9`
    echo 'v_param_19: '$v_param_19
    shift
    v_param_20=`echo $9`
    echo 'v_param_20: '$v_param_20
    shift
    v_param_21=`echo $9`
    echo 'v_param_21: '$v_param_21
    shift
    v_param_22=`echo $9`
    echo 'v_param_22: '$v_param_22
    shift
    v_param_23=`echo $9`
    echo 'v_param_23: '$v_param_23
    echo "Executiong SQL to obtain org id and responsibility name"
    (sqlplus -s /nolog <<end_of_sql
    conn $v_login_pwd
    set heading off
    set echo off
    set feedback off
    SELECT 'ORGID:'||b.profile_option_value || ':' ||e.responsibility_name
    FROM fnd_profile_options a,
    fnd_profile_option_values b,
    fnd_concurrent_requests c,
    fnd_responsibility d,
    fnd_responsibility_tl e
    WHERE c.request_id = $v_request_id
    AND c.responsibility_id = b.level_value
    AND b.profile_option_id = a.profile_option_id
    AND a.application_id = b.application_id
    AND c.responsibility_application_id = d.application_id
    AND d.application_id = e.application_id
    AND a.profile_option_name = 'ORG_ID'
    AND c.responsibility_id = d.responsibility_id
    AND d.responsibility_id = e.responsibility_id;
    exit
    end_of_sql
    ) > a.log
    v_var=`grep -iv "ORG_ID" a.log|sed 's/Connected.//'`
    echo 'v_var: ' $v_var
    v_org=`echo $v_var| awk 'FS=":" {print $2 }'`
    v_resp_name=`echo $v_var | awk 'FS=":" {print $3}'`
    echo 'v_org :'$v_org
    echo 'v_resp_name :'$v_resp_name
    echo 'Sumitting Receipt Journal Report...'
    user_request=`CONCSUB $v_login_pwd GL "$v_resp_name" $v_user_name WAIT=Y CONCURRENT AR ARXRJR \
              \"$v_param_3\"\
              \"$v_param_4\"\
              \"$v_param_5\"\
              \"$v_param_6\"\
              \"$v_param_7\"\
              \"$v_param_8\"\
              \"$v_param_9\"\
              \"$v_param_10\"\
              \"$v_param_11\"\
              \"$v_param_12\"\
              \"$v_param_13\"\
              \"$v_param_14\"\
              \"$v_param_15\"\
              \"$v_param_16\"\
              \"$v_param_17\"\
              \"$v_param_18\"\
              \"$v_param_19\"\
              \"$v_param_20\"\
              \"$v_param_21\"\
              \"$v_param_22\"\
              \"$v_param_23\"`
    user_request=`echo $user_request|awk '{print $3}'`
    echo Request is $user_request
    trx_rep_file="$user_request"
    echo 'trx_rep_file: '$trx_rep_file
    sleep 10
    for i in 1 2 3 4 5
    do
    if test -f $APPLCSF/$APPLLOG/l$user_request.req
    then
    if test [`grep -i '"Concurrent process completed successfully"' $APPLCSF/$APPLLOG/l$user_request.req`]
    then
    if test -f $APPLCSF/$APPLOUT/o$trx_rep_file.out
    then
    echo +++++++++++++++++++++++++++++++++
                   echo 'output file found'
                   echo ++++++++++++++++++++++++++++++++++++++
    else
    echo +++++++++++++++++++++++++++++++++++++++++
              echo failure in Report listing production
              echo +++++++++++++++++++++++++++++++++++++++
    fi
    break
    else
    echo +++++++++++++++++++++++++++++++++++++++
    echo Job not Over Yet
         echo +++++++++++++++++++++++++++++++++++++++++++++
    fi
    echo +++++++++++++++++++++++++++++++++++++++
    echo File not found yet
    echo ++++++++++++++++++++++++++++++++++++++
    fi
    sleep 10
    done
    echo ----------------------------------------------------------
    echo Transaction Listing process over
    echo ---------------------------------------------------------
    echo ----------------------------------------------------------
    echo Executing SQL to derive Search Pattern
    echo ----------------------------------------------------------
    v_pattern=`sqlplus -s /nolog <<EOF1
    conn $v_login_pwd
         set heading off
         set echo off
         set feedback off
         SELECT 'SEARCH^'||meaning||'^'||attribute1||'^'||attribute2||'^'||attribute3
         FROM fnd_lookup_values
         WHERE lookup_type = '$v_param_2'
         AND lookup_code = '$v_prog_name';
    exit
         EOF1`
    echo 'v_pattern: '$v_pattern
    v_pattern_n1=`echo $v_pattern|sed 's/Connected.//'|awk 'FS="^" {print $2}'`
    echo 'v_pattern_n1: '$v_pattern_n1
    v_pattern_n2=`echo $v_pattern|sed 's/Connected.//'|awk 'FS="^" {print $3}'`
    echo 'v_pattern_n2: '$v_pattern_n2
    v_pattern_n3=`echo $v_pattern|sed 's/Connected.//'|awk 'FS="^" {print $4}'`
    echo 'v_pattern_n3: '$v_pattern_n3
    v_pattern_n4=`echo $v_pattern|sed 's/Connected.//'|awk 'FS="^" {print $4}'|sed 's/ //'`
    echo 'v_pattern_n4: '$v_pattern_n4
    echo 'v_param_12: '$v_param_12
    echo 'v_param_13: '$v_param_13
    echo -----------------------------------
    echo Deriving final output
    echo ----------------------------------
    v_var=`cat $APPLCSF/$APPLOUT/o$trx_rep_file.out | grep -i "$v_pattern_n1"|\
                   sed "s/(/-/g"|sed "s/)/ /g"|\
                   sed "s/$v_pattern_n1/$v_pattern_n2/g"|\
              sed 's/ /~/g'|\
    sed 's/~~*/~/g'|\
                   sed 's/ *//g'|\
                   sed 's/,//g'`
    echo 'v_var: '$v_var
    v_var_2=`cat $APPLCSF/$APPLOUT/o$trx_rep_file.out|grep -i "$v_pattern_n3"|\
                   uniq`
    v_out_1=`echo "$v_var"|grep -i "$v_pattern_n2"|awk 'FS="~" {print $3}'`
    echo 'v_out_1: '$v_out_1
    echo 'v_var_2: '$v_var_2
    echo ------------------------------------------------------------
    v_out_2=`echo "$v_var_2"|grep -i "$v_pattern_n3"|awk 'FS=":" {print $2}'`
    echo 'v_out_2: '$v_out_2
    echo ----------------------------------------------
    echo Process comleted
    echo ----------------------------------------------------
    echo ================================================================================
    #---------------------------------------------------------------------------------------------------

    The name of this OTN group is "Database - General"
    Your question relates to an unnamed application that might be E-Business Suite, or PeopleSoft, or Siebel, who can say.
    Please re-ask your question in the appropriate applications forum and be sure to clearly name the full product name and version. We are not mind readers and we can not look over your shoulder.

  • Posting a useful shell script

    Is there a Sun form to post useful shell scripts?

    Look at Bigadmin's main page. There is an option there to let you share your scripts and other resources with the community.

Maybe you are looking for