首页 > Linux操作系统 > Linux操作系统 > 转贴:上周ORACLE RAC培训时的安装RAC的详细步骤(四)

转贴:上周ORACLE RAC培训时的安装RAC的详细步骤(四)

原创 Linux操作系统 作者:orchidllh 时间:2005-03-07 00:00:00 0 删除 编辑

  ****  ORACLE     INTERNAL   ****   ****  ORACLE     INTERNAL   ****
         Copyright (c) 2003-2004 Oracle. All rights reserved.

Fresh install of Oracle                      Last Update: 29NOV04
    on Red Hat Enterprise Linux 3 U2:       Comments:

VMWARE NOTES: o If you install in VMWARE you might have issues
                with slow CDROM.  Disable Real-Time Protection in Norton
                AntiVirus (by default it gets re-enabled automatically
                after 30 minutes, watch out)
              o To speed things up you can also pre-copy all the needed
                ISOs from CDs to your local hard drive, good for reinstalls
              o Disable screen saver inside VM for better results.

              o We are configuring RAC on a single node, i.e. TWO instances
                on ONE server, which is not what customers would do, however
                it's very useful for debugging/learning how CRS/RAC works. 
                In developing the scripts we made them as general as possible
                so they would work almost unchanged on real servers.

1. If you haven't already, log in to Linux GUI desktop as the oracle user.
   DO NOT LOG IN TO DESKTOP AS ROOT and su to oracle.

2. To prepare the GUI environment:
   a. Locate the terminal program (Main Menu --> System Tools --> Terminal).
   b. Right-click on the "Terminal" menu item.
      i. Select "Add this launcher to panel".

   Note: This adds the Terminal program icon to the launcher panel at the
         bottom of the screen, since we will be using this program often.

3. Open two terminal windows, if you haven't already:

   a. Click the Terminal icon we just added to the taskbar.
   b. In one of the windows change user to root by typing:

      $ su -
      Password: oracle

   Note: The prompt changed from "$" to "#" to indicate that the shell is
         running with root privileges.  From now on in these scripts, each
         command will begin with either a "$" or "#" character to indicate
         whether the command should be run in the "oracle" window or the
         "root" window.  Pay attention, it does make a difference.

4. Oracle 10g can use ssh instead of rsh to install software to remote nodes.
   If ssh is not defined the installer will fallback to rsh.
   In both cases (ssh/rsh) login must be password-less during installation.
   To set up secure, password-less login via SSH for the oracle user:

   a. Generate the user's public and private SSH keys (~/.ssh/
      and id_dsa), as the oracle user:
    $ ssh-keygen -t dsa

      i. "Enter file in which to save the key ...:" --> Press ENTER.
     ii. "Enter passphrase ...:"
            For LESS Secure connection just Press ENTER.
            For Secure connection enter a passphrase only you will know.
    iii. "Enter same passphrase again:" Either ENTER or passphrase.

   Note: In a real multi-server environment, you would repeat step 'a.'
         above on each server in the cluster before proceeding to step 'b.'

   b. Create the authorized_keys file by combining the contents of the files from each server.  You can do this all on one node
      by running the command below multiple times, replacing "raclinux1"
      with a different node name each time.  As the oracle user:

    $ ssh raclinux1 "cat ~/.ssh/" >> ~/.ssh/authorized_keys

      i. Each time you connect from any node to a new hostname for the first
         time, you will see a message similar to:

            "The authenticity of host 'raclinux1 (' can't be
            established.  RSA key fingerprint is ...
            Are you sure you want to continue connecting (yes/no)?"

         Type "yes" and press ENTER.  You will then see the message:

            "Warning: Permanently added 'raclinux1,' (RSA) to
            the list of known hosts."

     ii. "oracle@raclinux1's password:"  --> Type "oracle" and press ENTER.

   Note: In a real multi-server environment, copy the authorized_keys file
         you just created to the ~/.ssh directory of the oracle user on each
         server in the cluster.  For example, you could use the following
         command to copy it to node "raclinux2":
         $ scp ~/.ssh/authorized_keys raclinux2:/home/oracle/.ssh/
oracle@raclinux2's password:  --> Type "oracle" and press ENTER.

   c. (Optional) If you entered passphrase above, and desire password-less
       login (needed for 10g RAC install), you need to inform the ssh-agent
       (already running for desktop) of the passphrase so that ssh clients
       would not be prompted for a passphrase.  Once you notify ssh-agent the
       passphrase is cached for duration of the GUI desktop login, and further
       client requests are satisfied by the ssh-agent.
         $ ssh-add
         Enter passphrase for /home/oracle/.ssh/id_dsa: *TYPE YOUR PASSPHRASE*
         Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa)

   d. (not optional) To finalize and test the passwordless SSH connection,
      answer YES to any prompt (run twice, second time will not prompt for

      i. Run "ssh raclinux1 date".
     ii. Run "ssh raclocal1 date".
    iii. Run "ssh date".
     iv. Run "ssh date".

   Note: In a real multi-server environment, repeat above steps on all nodes.

   Troubleshoot:  If password is being asked check ownership of user's home
                  directory should be restricted for writes to group and others.
                  Tail /var/log/messages during a connect attempt
                  run ssh in verbose mode as: "ssh -vvv raclinux1 date"

5. Obtain support zip file which contains much needed files for rest of
   course.  It allows you to complete course without editing any files
   as all needed files are fully supplied.
   The file is called: and is in the same
   place on Oracle Files Online you got these files from.
   Place it in the oracle home directory and unzip as follows:
   $ cd
   $ unzip
   NOTE: Easily transfer the file inside the VM using VMware's Shared
         Folder feature, access at: /mnt/hgfs/vmware_shared as setup
         in Stage 2.

6. Change permission to ORACLE_BASE directory, as root:

   # chown oracle:oinstall /opt/oracle

7. If you choose to put the CRS files (Voting disk & OCR file) on raw devices
   you must do this step, otherwise skip this step.
   Remember, if you decide to use OCFS (skip this step):
             see bug 3467544 for details.

   Setup raw devices for voting disk and OCR file:

   a. vi or nedit as root  /etc/sysconfig/rawdevices   and add:
      (you may also use pre-edited supplied file at

/dev/raw/raw1   /dev/sdd1
/dev/raw/raw2   /dev/sdd2

   b. Change permission on the raw devices to oracle:

      # chown oracle:dba  /dev/raw/raw1
      # chown oracle:dba  /dev/raw/raw2
      OR in shorthand Linux-style:

      # chown oracle:dba  /dev/raw/raw[12]

   c. Restart the raw devices as root:

      # /etc/init.d/rawdevices  restart

   d. Create symbolic links for the voting disk & OCR file as oracle:

      $ cd /ocfs
      $ ln -sf /dev/raw/raw1  ocr_file
      $ ln -sf /dev/raw/raw2  voting_disk

8. Install Cluster Ready Services (CRS):
   a. Put the Oracle10g CRS CD in CD tray, Linux will
      automount it and add a "CDROM" icon to the desktop.
      If not, as root issue:  # mount /mnt/cdrom

   b. (Optional, VMWare specific) If you selected to put CRS files
      (Voting Disk & OCR File) on OCFS you may choose to perform this
      optional command as the oracle user:

      $ dd if=/dev/zero of=/ocfs/voting_disk bs=1M count=9

      Note: The dd command above is not required, but it will speed up
            the that runs at the end of the CRS installation if
            we do it here.

   c. Run the installer, as the oracle user:

      $ cd                                 (Do NOT cd into /mnt/cdrom)
      $ /mnt/cdrom/runInstaller                          (First time)

      i. Screen: "Welcome"
         Click "Next"

     ii. Screen: "Specify Inventory directory and credentials"
         1. Change Inventory directory to:  /opt/oracle/oraInventory
         2. Change Operating System group name to:  oinstall
         3. Click "Next"
    iii. PopUP... As root run /opt/oracle/oraInventory/
         # /opt/oracle/oraInventory/
         Click "Continue" in installer.
     iv. Screen: "Specify File Locations"
         Change Name to: CRS10g
         Change Path to: /opt/oracle/CRS10g
         Click "Next"

      v. Screen: "Language Selection"
         Click "Next"

     vi. Screen: "Cluster Configuration"
         Leave Cluster Name as "crs"
         For public node name, use "".
         For private node name, use "".
         Click "Next"
         Note: If you get warning: node unreachable, double check that
               "ssh date"  returns nothing except the date

    vii. Screen: "Private Interconnect Enforcement"
         For eth0, select "Public" in the "Interface Type" column.
         For eth1, select "Private" in the "Interface Type" column.
         Click "Next"
   viii. Screen: "Oracle Cluster Registry"
         Enter: /ocfs/ocr_file
         Click "Next"
     ix. Screen: "Voting Disk"
         Enter: /ocfs/voting_disk
         Click "Next"
      x. Screen: "Summary"
         Click "Install" to finish installation
     xi. PopUP Setup Privileges: As root run /opt/oracle/CRS10g/
         on each node:

         # /opt/oracle/CRS10g/

         "WARNING: directory '/opt/oracle' is not owned by root"
         See bug 3463657 for details.

         CRS Success message as follows:
         "Oracle CRS stack installed and running under init(1M)"

         Click "OK" in installer PopUP.
    xii. Screen: "End of Installation", exit the installer
         Click "Exit" and confirm exit.

   d. Remove Oracle10g CRS CD, as root user:

      # umount /mnt/cdrom

      Eject CD if not done automatically.

9. Create Oracle user environment:

   a. Edit .bash_profile login file of the oracle user:
      (you may also use pre-edited supplied file at

   $ vi $HOME/.bash_profile    -OR-   nedit  $HOME/.bash_profile

   Insert following 5 lines after "if" statement ends (Line 7):

export ORACLE_SID=O10G1
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/DB10g
export ORA_CRS_HOME=/opt/oracle/CRS10g

# export LD_ASSUME_KERNEL=2.4.19     (Needed for RHEL3 vanilla or Update 1)

   b. Execute the .bash_profile script to pickup changes, as the oracle user
      You will have to do this for any new xterm you open until you relogin
      to GUI desktop:

   $ source $HOME/.bash_profile

   c. As the root user:

   # source ~oracle/.bash_profile

10. Install Oracle Enterprise (RDBMS) edition software from CD:

   a. Put the Oracle10g Database CD in CD tray or point VMware's CD to
      10g-DB.iso.  Linux will automount it and add a "CDROM" icon
      to the desktop.  If not, as root issue:  # mount /mnt/cdrom
   b. Run the installer, as the oracle user:
      $ cd                                 (Do NOT cd into /mnt/cdrom)
      $ /mnt/cdrom/runInstaller                          (Second time)
      i. Screen: "Welcome"
         Click "Next"
     ii. Screen: "Specify File Locations"
         Change Name to: DB10g
         Verify Path is: /opt/oracle/DB10g
         Click "Next"

    iii. Screen: "Specify Hardware Cluster Installation Mode"
         Select: "Cluster Installation"                  (TOP option)
         Select all nodes  (real world RAC will have 2 or more nodes)
         Click "Next"
     iv. Screen: "Select Installation Type"
         Select: "Enterprise Edition"                    (TOP option)
         Click "Next"

      v. Screen: "Product-specific Prerequisite Checks"
         All checks should be successful.
         Click "Next"
         NOTE: If OS kernel parameters not right, fix on OS level as per
               stage 2 then press Back and Next, check will pass;
               see bug 3475723.

     vi. Screen: "Select Database Configuration"
         Select: "Do not create a starter database"      (BOTTOM option)
         Click "Next"

    vii. Screen: Summary
         Click "Install"   (About 30 minutes)
     If you get lbuilder file missing during copy, see bug 3688474.
     If oracle fails to link with a small pop-up screen it's most probably
     due to bug 3442108.  Verify by issuing:

     $ cd /opt/oracle/DB10g/lib
     $ nm libctx10.a

     if following command fails with Segmentation Fault, then it's the problem.
     Get the two corrupt files as follows:

     $ ftp  (user "ftp" password "mailid")
     ftp> cd bug3442108
     ftp> bin
     ftp> passive
     ftp> mget *GOOD*

     unpack them into the lib directory (overwrite or save old library files)
     rename to drop the "-GOOD" from name, and press retry.

     $ gunzip *GOOD*
     $ mv libctx10-GOOD.a  libctx10.a
     $ mv libctxc10-GOOD.a libctxc10.a

   viii. PopUP Setup Privileges: As root run $ORACLE_HOME/
         on each node:

         # $ORACLE_HOME/

         1. "Enter the full pathname of the local.."    Accept default.

         2. VIP Configuration Assistant (vipca) starts automatically:
            a. Screen: "Welcome"
               Click "Next"
            b. Screen: "1 of 2, Network Interfaces"
               Select only the public interface(s), in our case "eth0"
               Click "Next"
            c. Screen: "2 of 2, Virtial IPs for cluster nodes"
               Enter "" under "IP Alias Name".
               Press TAB to autofill the "IP address" column.
               Click "Next"
            d. Screen: "Summary"
               Click "Finish"
            e. Dialog: "Configuration Assistant Progress Dialog"
               After all steps complete, click "OK".
            f. Dialog: "Configuration Results"
               Click "Exit"

         Click "OK" in installer PopUP.
     ix. Screen: "End of Installation", exit the installer
         Click "Exit" and confirm exit.
   c. Remove Oracle10g Database CD, as root user:

      # umount /mnt/cdrom

      Eject CD if not done automatically.

11. Load kernel module hangcheck-timer needed by 10g CRS.

    Edit /etc/rc.local add following line:
    (you may also use pre-edited supplied file at

    insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

    Load module, as root enter:

    # /etc/rc.local
    VMWARE NOTE: For VMWARE use HIGH values, otherwise machine will reboot
                 if brought back from suspend mode, these are good values:
                 hangcheck_tick=9000000 hangcheck_margin=36000000

    To enable autostart at boot on SuSE:
      change in /etc/sysconfig/oracle (included with orarun package)

12. Verify that all services are running properly:
    a. As oracle user:
       $ srvctl status nodeapps -n raclinux1
       VIP is running on node: raclinux1
       GSD is running on node: raclinux1
       PRKO-2016 : Error in checking condition of listener on node: raclinux1
       ONS daemon is running on node: raclinux1
       Listener error will go away once we run netca.
13. (Optionally) Disable reboot on CRS failures
    Comment out the FAST_REBOOT (Line:80 linux section): 
    ###  FAST_REBOOT="/sbin/reboot -n -f"
    Or copy the pre-edited file:
    # cp ~oracle/T3_LinuxDemoFiles-10g/RHat-OS/etc/rc.d/init.d/init.cssd
14. (Optionally) Increase script timeout and check interval on VIP resource.
    Because we are running under VMWare we may hit bug 3505415 which causes
    CRS to shutdown ALL databases when machine is under heavy load. As root:
    i. Extract the resource to be modified details from OCR to text:
       # cd /opt/oracle/CRS10g/bin
       # ./crs_stat -p > /tmp/

   ii. Update/modify the .cap file from above.  Change CHECK_INTERVAL to 900
       seconds and SCRIPT_TIMEOUT to 600 seconds:
       # ./crs_profile -update -dir /tmp -o ci=900,st=600

  iii. Now register the updated resource with OCR (notice the -u, meaning
       update an already registered resource):
       # ./crs_register -dir /tmp -u

     These steps are further documented in above bug as well as note: 276782.1
   iv. Replace racgvip script with a faster one (bug 3419563)
       # cd /opt/oracle/CRS10g/bin
       # mv racgvip racgvip.orig
       # cp ~oracle/T3_LinuxDemoFiles-10g/ORA_CRS_HOME/bin/racgvip .
       # chown oracle:dba racgvip

15. (Optionally) Start iSQL*Plus middle tier (Setting dbconsole enables this):

    a. Apply a workaround for bug #3422358:
       i. As oracle, edit $ORACLE_HOME/bin/isqlplusctl with "vi" or "nedit":
          Locate the line "IS_RAC=true" and change it to "IS_RAC=false".
    b. Start iSQL*Plus, as oracle:
       $ isqlplusctl start
    c. Verify that the iSQL*Plus is running:
       i. From a browser, connect to URL "
* Done RAC Software install, go to dbca Stage to create a RAC database *

        Copyright (c) 2003-2004 Oracle. All rights reserved.
 ****  ORACLE     INTERNAL   ****   ****  ORACLE     INTERNAL   ****

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量