Friday, December 11, 2009

Removing Oracle Software

This chapter describes how to completely remove all Oracle databases, instances, and software from an Oracle home directory. It includes information about the following topics:


Note:

If you want to remove an Oracle Real Application Clusters (RAC) installation, see the Oracle Real Application Clusters Installation and Configuration Guide for more information.

If you want to remove an individual product, check the product-specific documentation for requirements and restrictions.


Overview

To completely remove all Oracle databases, instances, and software from an Oracle home directory, you must:

  • Identify all instances associated with the Oracle home.

  • Remove database and ASM instances.

  • Shut down processes.

  • Reconfigure the Oracle Cluster Synchronization Services Daemon, if necessary.

  • Remove the Oracle software.

The following sections describe how to perform these tasks.

Identifying All Instances

To identify all instances associated with the Oracle home that you want to remove, enter one of the following commands:

  • Solaris:

    $ more /var/opt/oracle/oratab

  • Other operating systems:

    $ more /etc/oratab

The output for this command contains entries similar to the following:

+ASM:/u01/app/oracle/product/10.1.0/db_1:N
CUST:/u01/app/oracle/product/10.1.0/db_1:N

These entries show that the +ASM Automatic Storage Manager instance and the CUST Oracle database instance are associated with the /u01/app/oracle/product/10.1.0/db_1 Oracle home directory.

Removing an Oracle Database

To completely remove Oracle Database software, you must remove any installed databases. To remove an Oracle database:


Note:

Removing an Oracle database deletes all of the data in the database. If you want to keep this data, make sure that you back up the database before deleting it.

  1. Log in as the oracle user:

    $ su - oracle

  2. Run the oraenv or coraenv script to set the environment for the database that you want to remove, for example:

    • Bourne, Bash, or Korn shell:

      $ . /usr/local/bin/oraenv

    • C shell:

      % source /usr/local/bin/coraenv

  3. At the prompt, specify the SID for the database that you want to remove.

  4. Start the Database Configuration Assistant (DBCA):

    $ dbca

    The Welcome window appears.

  5. Click Next.

    The Operations window appears.

  6. Select Delete a Database, then click Next.

  7. Select the database that you want to delete, then click Finish.

  8. In the window that appears, confirm that you want to delete the database.

  9. When the DBCA removes the database, you are prompted to choose whether you want to perform another operation. Click Yes to return to the Operations screen or click No to exit from DBCA. If you want to remove another database, click Yes and repeat steps 6 to 8.

Removing an ASM Instance

To completely remove Oracle database software, you must also remove any ASM instances running in the Oracle home. To remove an ASM instance:

  1. If necessary, log in as the oracle user:

    $ su - oracle

  2. Run the oraenv or coraenv script to set the environment for the ASM instance that you want to remove, for example:

    • Bourne, Bash, or Korn shell:

      $ . /usr/local/bin/oraenv

    • C shell:

      $ source /usr/local/bin/coraenv

  3. At the prompt, specify the SID for the ASM instance that you want to remove.

  4. Connect to the ASM instance as the SYS user:

    $ sqlplus "SYS/SYS_PASSWORD AS SYSDBA"

  5. Enter the following command to determine whether any Oracle database instance is using the ASM instance:

    SQL> SELECT INSTANCE_NAME FROM V$ASM_CLIENT;

    This command lists all of the database instances that are using this ASM instance.


    Note:

    This command only lists database instances that are running. It is possible that other instances are associated with the ASM instance, but they are not currently running.

    If you removed a database from this Oracle home but the output from the command shows that this ASM instance is supporting a database instance in another Oracle home, do not remove the ASM instance or the Oracle home.


  6. If there are no database instances associated with this ASM instance, drop the disk groups associated with this instance as follows:


    Note:

    Dropping an ASM disk group makes the disk devices that it used available for use with another ASM instance if required. However, all data in the disk group is lost. Make sure that no other database instance requires any data from this disk group before you drop it.

    1. Identify the disk groups associated with the ASM instance:

      SQL> SELECT NAME FROM V$ASM_DISKGROUP;

    2. For each disk group that you want to delete, enter a command similar to the following:

      SQL> DROP DISKGROUP name INCLUDING CONTENTS;

  7. Enter the following command to shut down the ASM instance:

    SQL> SHUTDOWN

  8. Remove the entry for the ASM instance from the /etc/oratab file (or from the /var/opt/oracle/oratab file on Solaris).

Reconfiguring Oracle Cluster Synchronization Services

Oracle Cluster Synchronization Services (CSS) is a daemon process that is configured by the root.sh script when you install Oracle Database 10g for the first time. It is configured to start every time the system boots. This daemon process is required to enable synchronization between Oracle ASM and database instances. It must be running if an Oracle database is using ASM for database file storage.


Note:

On cluster systems with Oracle Real Application Clusters (RAC) installations, the CSS daemon is configured during the Oracle Cluster Ready Services (CRS) installation. If the system is running Oracle CRS, see the Oracle Real Application Clusters Installation and Configuration Guide for information about removing RAC or CRS.

Before you remove an Oracle Database 10g Oracle home, you must determine whether the CSS daemon is running from that Oracle home and whether any other Oracle Database 10g Oracle homes exist on the system:

  • If the Oracle Database 10g Oracle home that you want to remove is the only Oracle Database 10g installation on the system, you can delete the CSS daemon configuration.

  • If the CSS daemon is running from the Oracle Database 10g Oracle home that you want to remove and other Oracle Database 10g installations exist on the system, you must reconfigure the CSS daemon to run from another Oracle Database 10g Oracle home.

The following subsections describe how to complete these tasks.

Identifying Oracle Database 10g Oracle Homes

To identify all of the Oracle Database 10g Oracle home directories, enter one of the following commands:

  • Solaris:

    $ more /var/opt/oracle/oratab

  • Other operating systems:

    $ more /etc/oratab

From the output, identify any Oracle home directories where Oracle Database 10g is installed. Oracle homes that contain Oracle Database 10g typically have paths similar to the following. However, they might use different paths.

/mount_point/app/oracle/product/10.1.0/db_n

If there is only one Oracle home directory that contains Oracle Database 10g, see the "Deleting the Oracle CSS Daemon Configuration" section for information about deleting the Oracle CSS daemon configuration.

If you identify more than one Oracle Database 10g Oracle home directory, see the following section for information about reconfiguring the Oracle CSS daemon.

Reconfiguring the Oracle CSS Daemon

To reconfigure the Oracle CSS daemon so that it runs from an Oracle home that you are not removing, follow these steps:

  1. In all Oracle home directories on the system, stop all Oracle ASM instances and any Oracle Database instances that use ASM for database file storage.

  2. Switch user to root.

  3. Depending on your operating system, enter one of the following commands to identify the Oracle home directory being used to run the CSS daemon:

    • AIX or Linux:

      # more /etc/oracle/ocr.loc

    • Other operating systems:

      # more /var/opt/oracle/ocr.loc

    The output from this command is similar to the following:

    ocrconfig_loc=/u01/app/oracle/product/10.1.0/db_1/cdata/localhost/local.ocr
    local_only=TRUE

    The ocrconfig_loc parameter specifies the location of the Oracle Cluster Registry (OCR) used by the CSS daemon. The path up to the cdata directory is the Oracle home directory where the CSS daemon is running (/u01/app/oracle/product/10.1.0/db_1 in this example).


    Note:

    If the value for the local_only parameter is FALSE, Oracle CRS is installed on this system. See the Oracle Real Application Clusters Installation and Configuration Guide for information about removing RAC or CRS.

    If this Oracle home directory is not the Oracle home that you want to remove, you can continue to the "Removing Oracle Software" section.

  4. Change directory to the Oracle home directory for an Oracle Database 10g installation that you are not removing.

  5. Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:

    • Bourne, Bash, or Korn shell:

      # ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_2
      # export ORACLE_HOME

    • C shell:

      # setenv ORACLE_HOME /u01/app/oracle/product/10.1.0/db_2

  6. Enter the following command to reconfigure the CSS daemon to run from this Oracle home:

    # $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME

    The script stops the Oracle CSS daemon, reconfigures it in the new Oracle home, and then restarts it. When the system boots, the CSS daemon starts automatically from the new Oracle home.

  7. To remove the original Oracle home directory, see the "Removing Oracle Software" section.

Deleting the Oracle CSS Daemon Configuration

To delete the Oracle CSS daemon configuration, follow these steps:


Note:

Delete the CSS daemon configuration only if you are certain that no other Oracle Database 10g installation requires it.

  1. Remove any databases or ASM instances associated with this Oracle home. See the preceding sections for information about how to complete these tasks.

  2. Switch user to root.

  3. Change directory to the Oracle home directory that you are removing.

  4. Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:

    • Bourne, Bash, or Korn shell:

      # ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1
      # export ORACLE_HOME

    • C shell:

      # setenv ORACLE_HOME /u01/app/oracle/product/10.1.0/db_1

  5. Enter the following command to delete the CSS daemon configuration from this Oracle home:

    # $ORACLE_HOME/bin/localconfig delete

    The script stops the Oracle CSS daemon, then deletes its configuration. When the system boots, the CSS daemon no longer starts.

Removing Oracle Software

The following steps describe how to use the Installer to remove Oracle software from an Oracle home:


Note:

Always use the Oracle Universal Installer to remove Oracle software. Do not delete any Oracle home directories without first using the Installer to remove the software.

  1. If necessary, log in as the oracle user:

    $ su - oracle

  2. Set the ORACLE_HOME environment variable to specify the path of the Oracle home directory that you want to remove:

    • Bourne, Bash, or Korn shell:

      $ ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1
      $ export ORACLE_HOME

    • C shell:

      $ setenv ORACLE_HOME /u01/app/oracle/product/10.1.0/db_1

  3. Remove any databases or ASM instances associated with this Oracle home and delete or reconfigure the Oracle CSS daemon.

    See the preceding sections for information about how to complete these tasks.

  4. Stop any processes running in this Oracle home:

    Process Name Command
    Database Control $ORACLE_HOME/bin/emctl stop dbconsole
    Oracle Net listener $ORACLE_HOME/bin/lsnrctl stop
    iSQL*Plus $ORACLE_HOME/bin/isqlplusctl stop
    Ultra Search $ORACLE_HOME/bin/searchctl stop

  5. Start the Installer as follows:

    $ $ORACLE_HOME/oui/bin/runInstaller

  6. In the Welcome window, click Deinstall Products.

    The Inventory window appears, listing all of the Oracle homes on the system.

  7. In the Inventory window, select the Oracle home and the products that you want to remove, then click Remove.


    Note:

    If you choose to remove Oracle JVM, the Oracle Universal Installer removes all installed products that depend on Oracle JVM, including Oracle Database.

  8. When the Installer displays a confirmation window asking you to confirm that you want to deinstall the products and their dependant components, click Yes.

    The Installer displays a progress indicator as it removes the software.

  9. When the products have been deleted, click Cancel to exit from the Installer, then click Yes.

10g Release 2 (10.2) for Solaris Operating System (x86-64)

Oracle® Database

Quick Installation Guide

10g Release 2 (10.2) for Solaris Operating System (x86-64)

B15705-01

February 2006


Oracle Database Quick Installation Guide, 10g Release 2 (10.2) for Solaris Operating System (x86-64)

B15705-01

Copyright © 2006, Oracle. All rights reserved.

The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited.

The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose.

If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software—Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs.

Oracle, JD Edwards, and PeopleSoft are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party.

This guide describes how to quickly install Oracle Database 10g on Solaris x86-64 systems. It includes information about the following:

  1. Reviewing Information About This Guide

  2. Logging In to the System as root

  3. Checking the Hardware Requirements

  4. Checking the Software Requirements

  5. Configuring Kernel Parameters

  6. Creating Required Operating System Groups and User

  7. Creating Required Directories

  8. Configuring the oracle User's Environment

  9. Mounting the Product Disc

  10. Installing Oracle Database

  11. Installing Products from the Oracle Database 10g Companion CD

  12. What to Do Next?

  13. Additional Information

  14. Documentation Accessibility

1 Reviewing Information About This Guide

This guide describes how to install Oracle Database by using the default installation options.

Tasks Described in This Guide

The procedures in this guide describe how to:

  • Configure your system to support Oracle Database

  • Install Oracle Database on a local file system by using the Basic Installation option

  • Configure a general-purpose Oracle Database installation that uses the local file system for database file storage

Results of a Successful Installation

After you successfully install Oracle Database:

  • The database that you created and the default Oracle Net listener process run on the system.

  • Oracle Enterprise Manager Database Control and iSQL*Plus are running and can be accessed by using a Web browser.

Tasks Not Described in This Guide

This guide covers the Basic Installation scenario and does not describe how to complete the following tasks:

  • Using the Advanced Installation option to install the software

  • Installing the software on a system that has an existing Oracle software installation

  • Installing Oracle Clusterware and Oracle Real Application Clusters (RAC) on a cluster

  • Enabling Enterprise Manager e-mail notifications or automated backups

  • Using alternative storage options such as Automatic Storage Management or raw devices for database storage

Where to Get Additional Installation Information

For more information about installing Oracle Database, including information about the tasks not described in this guide, refer to one of the following guides:

  • If you want to install the software on a single system, then refer to Oracle Database Installation Guide for Solaris Operating System (x86-64).

  • If you want to perform a RAC installation, then refer to Oracle Database Oracle Clusterware and Oracle Real Application Clusters Installation Guide for Solaris Operating System. This guide also describes how to install Oracle Clusterware, which is a prerequisite for RAC installations.

Both these guides are available on the product disc. To access them, use a Web browser to open the welcome.htm file located in the top-level directory of the installation media, and then select the Documentation tab.

2 Logging In to the System as root

Before you install Oracle Database, you must complete several tasks as the root user. To log in as the root user, complete one of the following procedures:

Note:

You must install the software from an X Window System workstation, an X terminal, or a PC or other system with X server software installed.
  • If you are installing the software from an X Window System workstation or X terminal, then:

    1. Start a local terminal session, for example, an X terminal (xterm).

    2. If you are not installing the software on the local system, then enter the following command to enable the remote host to display X applications on the local X server:

      $ xhost fully_qualified_remote_host_name

      For example:

      $ xhost somehost.us.acme.com

    3. If you are not installing the software on the local system, then use the ssh, rlogin, or telnet command to connect to the system where you want to install the software:

      $ telnet fully_qualified_remote_host_name

    4. If you are not logged in as the root user, then enter the following command to switch user to root:

      $ su - root
      password:
      #

  • If you are installing the software from a PC or other system with X server software installed, then:

    Note:

    If necessary, refer to your X server documentation for more information about completing this procedure. Depending on the X server software that you are using, you may need to complete the tasks in a different order.
    1. Start the X server software.

    2. Configure the security settings of the X server software to permit remote hosts to display X applications on the local system.

    3. Connect to the remote system where you want to install the software, and start a terminal session on that system, for example, an X terminal (xterm).

    4. If you are not logged in as the root user on the remote system, then enter the following command to switch user to root:

      $ su - root
      password:
      #

3 Checking the Hardware Requirements

The system must meet the following minimum hardware requirements:

  • At least 512 MB of physical RAM

  • The following table describes the relationship between installed RAM and the configured swap space requirement.

    RAM Swap Space
    Between 512MB and 2048 MB 1.5 times the size of RAM
    Between 2049 MB and 8192 MB Equal to the size of RAM
    More than 8192 MB 0.75 times the size of RAM

  • 400 MB of disk space in the /tmp directory

  • Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on the installation type

  • 1.2 GB of disk space for a preconfigured database that uses file system storage (optional)

    Note:

    The disk space requirement for databases that use Automatic Storage Management or raw device storage is described later in this chapter.

    Additional disk space, either on a file system or in an Automatic Storage Management disk group, is required for the flash recovery area if you choose to configure automated backups.

To ensure that the system meets these requirements:

  1. To determine the physical RAM size, enter the following command:

    # /usr/sbin/prtconf | grep "Memory size"

    If the size of the physical RAM is less than the required size, then you must install more memory before continuing.

  2. To determine the size of the configured swap space, enter the following command:

    # /usr/sbin/swap -s

    If necessary, refer to the operating system documentation for information about how to configure additional swap space.

  3. To determine the amount of disk space available in the /tmp directory, enter the following command:

    # df -h /tmp

    If there is less than 400 MB of free disk space available in the /tmp directory, then complete one of the following steps:

    • Delete unnecessary files from the /tmp directory to meet the disk space requirement.

    • Set the TMP and TMPDIR environment variables when setting the oracle user's environment (described later).

    • Extend the file system that contains the /tmp directory. If necessary, contact your system administrator for information about extending file systems.

  4. To determine the amount of free disk space on the system, enter the following command:

    # df -h

    The following table shows the approximate disk space requirements for software files for each installation type:

    Installation Type Requirement for Software Files (GB)
    Enterprise Edition 2.0
    Standard Edition 1.5
    Custom (maximum) 2.5

  5. To determine whether the system architecture can run the software, enter the following command:

    # /bin/isainfo -kv

    Note:

    The following is the expected output of this command:

    64-bit amd64 kernel modules

    If you do not see the expected output, then you cannot install the software on this system.

4 Checking the Software Requirements

The system must meet the following minimum software requirements, depending on the distribution and version of your operating system:

Note:

Oracle Universal Installer performs checks on your system to verify that it meets the listed requirements. To ensure that these checks pass, verify the requirements before you start Oracle Universal Installer.
  • The operating system version must be Solaris 10.

  • The following packages (or later versions) must be installed:

    SUNWarc
    SUNWbtool
    SUNWhea
    SUNWlibm
    SUNWlibms
    SUNWsprot
    SUNWtoo
    SUNWi1of
    SUNWi1cs
    SUNWi15cs
    SUNWxwfnt

    Note: You may also require additional font packages for Java, depending on your locale. Refer to the following Web site for more information:

    http://java.sun.com/j2se/1.4.2/font-requirements.html

For the Oracle products that you want to install, the system must meet the following product-specific requirements:

  • Oracle Messaging Gateway

    Oracle Messaging Gateway supports the integration of Oracle Streams Advanced Queuing (AQ) with the following software:

    • IBM MQSeries V6.0, client and server

    • Tibco Rendezvous 7.2

  • PL/SQL native compilation, Pro*C/C++, Oracle Call Interface, Oracle C++ Call Interface, and Oracle XML Developer's Kit (XDK)

    • Sun ONE Studio 10 (C and C++ 5.5)

    • gcc 3.4.2

  • Oracle JDBC/OCI Drivers

    You can use the following optional JDK versions with the Oracle JDBC/OCI drivers, however they are not required for the installation:

    • Sun Java 2 SDK Standard Edition 1.2.2_17 and the JNDI extension

    • Sun Java 2 SDK Standard Edition 1.3.1_11 and the JNDI extension

    Note: JDK 1.4.2_08 is installed with this release.

  • Pro*FORTRAN

    Fortran 95

To ensure that the system meets these requirements:

  1. To determine which version of Solaris is installed, enter the following command:

    # uname -r

    If necessary, refer to your operating system documentation for information about upgrading the operating system.

  2. To determine whether the required packages are installed, enter a command similar to the following:

    # pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm \
    SUNWlibms SUNWsprot SUNWsprox SUNWtoo SUNWi1of \
    SUNWi1cs SUNWi15cs SUNWxwfnt

    If a package is not installed, then install it. Refer to your operating system or software documentation for information about installing packages.

In addition, you need to verify that the following patches are installed on the system. The procedure following the table describes how to check these requirements.

Note:

There may be more recent versions of the patches listed installed on the system. If a listed patch is not installed, then determine whether a more recent version is installed before installing the version listed.
  • For all installations on Solaris 10, the following patches are required:

    • 118345-03: SunOS 5.10_x86: ld Patch

    • 119961-01: SunOS 5.10_x86, x64, Patch for assembler

  • For PL/SQL native compilation and installation of Pro*C/C++, Oracle Call Interface, Oracle C++ Call Interface, or Oracle XML Developer's Kit (XDK) on Solaris 10, the following C and C++ compiler patches are required:

    • 117837-05: C++ compiler optimization patch

    • 117846-08: C++ compiler optimization patch

    • 118682-01: Patch for SS10_x86 debuginfo handling

  • For Oracle Messaging Gateway installation, the following corrective service diskettes (CSDs) for WebSphere MQ are required:

    • CSD09 or later for MQSeries V6.0

    • MQSeries Client for Sun Solaris, Intel Platform Edition- V5.1 SupportPac MACE

To ensure that the system meets these requirements:

  1. To determine whether an operating system patch is installed, enter a command similar to the following:

    # /usr/sbin/patchadd -p | grep patch_number(without version number)

    For example, to determine if any version of the 111713 patch is installed, use the following command:

    # /usr/sbin/patchadd -p | grep 111713

    If an operating system patch is not installed, then download it from the following Web site and install it:

    http://sunsolve.sun.com

  2. If you require a CSD or a SupportPac for WebSphere MQ, then refer to the following Web site for download and installation information:

    http://www.ibm.com/software/integration/mqfamily/support/summary/sun.html

5 Configuring Kernel Parameters

Verify that the kernel parameters shown in the following table are set to values greater than or equal to the recommended value shown. The procedure following the table describes how to verify and set the values.

Parameter Replaced by Resource Control Recommended Value
noexec_user_stack NA 1
semsys:seminfo_semmni project.max-sem-ids 100
semsys:seminfo_semmns NA 1024
semsys:seminfo_semmsl project.max-sem-nsems 256
semsys:seminfo_semvmx NA 32767
shmsys:shminfo_shmmax project.max-shm-memory 4294967295
shmsys:shminfo_shmmin NA 1
shmsys:shminfo_shmmni project.max-shm-ids 100
shmsys:shminfo_shmseg NA 10

Note:

If the current value of any parameter is higher than the value listed in this table, then do not change the value of that parameter.

To view the current value specified for these kernel parameters, and to change them if necessary, follow these steps:

  1. To view the current values of the resource control, enter the following commands:

    # id -p // to verify the project id
    uid=0(root) gid=0(root) projid=1 (user.root)
    # prctl -n project.max-shm-memory -i project user.root
    # prctl -n project.max-sem-ids -i project user.root

  2. If you must change any of the current values, then:

    1. To modify the value of max-shm-memory to 6 GB:

      # prctl -n project.max-shm-memory -v 6gb -r -i project user.root

    2. To modify the value of max-sem-ids to 256:

      # prctl -n project.max-sem-ids -v 256 -r -i project user.root

6 Creating Required Operating System Groups and User

The following local operating system groups and users are required if you are installing Oracle Database:

  • The Oracle Inventory group (oinstall)

  • The OSDBA group (dba)

  • The Oracle software owner (oracle)

  • An unprivileged user (nobody)

To determine whether these groups and users already exist, and if necessary, to create them, follow these steps:

  1. To determine whether the oinstall group exists, enter the following command:

    # more /var/opt/oracle/oraInst.loc

    If the oraInst.loc file exists, then the output from this command is similar to the following:

    inventory_loc=/u01/app/oracle/oraInventory
    inst_group=oinstall

    The inst_group parameter shows the name of the Oracle Inventory group, oinstall.

  2. To determine whether the dba group exists, enter the following command:

    # grep dba /etc/group

    If the output from this commands shows the dba group name, then the group already exists.

  3. If necessary, enter the following commands to create the oinstall and dba groups:

    # /usr/sbin/groupadd oinstall
    # /usr/sbin/groupadd dba

  4. To determine whether the oracle user exists and belongs to the correct groups, enter the following command:

    # id -a oracle

    If the oracle user exists, this command displays information about the groups to which the user belongs. The output should be similar to the following, indicating that oinstall is the primary group and dba is a secondary group:

    uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)

  5. If necessary, complete one of the following actions:

    • If the oracle user exists, but its primary group is not oinstall or it is not a member of the dba group, then enter the following command:

      # /usr/sbin/usermod -g oinstall -G dba oracle

    • If the oracle user does not exist, enter the following command to create it:

      # /usr/sbin/useradd -g oinstall -G dba oracle

      This command creates the oracle user and specifies oinstall as the primary group and dba as the secondary group.

  6. Enter the following command to set the password of the oracle user:

    # passwd -r files oracle

  7. To determine whether the nobody user exists, enter the following command:

    # id nobody

    If this command displays information about the nobody user, then you do not have to create the user.

    If the nobody user does not exist, then enter the following command to create it:

    # /usr/sbin/useradd nobody

7 Creating Required Directories

Create directories with names similar to the following, and specify the correct owner, group, and permissions for them:

  • The Oracle base directory

  • An optional Oracle data file directory (optional)

The Oracle base directory must have 3 GB of free disk space, or 4 GB of free disk space if you choose not to create a separate Oracle data file directory.

Note:

If you do not want to create a separate Oracle data file directory, you can install the data files in a subdirectory of the Oracle base directory. However, this is not recommended for production databases.

To determine where to create these directories:

  1. Enter the following command to display information about all mounted file systems:

    # df -k

    This command displays information about all the file systems mounted on the system, including:

    • The physical device name

    • The total amount, used amount, and available amount of disk space, in kilobytes

    • The mount point directory for that file system

  2. From the display, identify a file system that has appropriate free space.

    The file system that you identify can be a local file system, a cluster file system, or an NFS file system on a certified NAS device.

  3. Note the name of the mount point directory for each file system that you identified.

To create the required directories and specify the correct owner, group, and permissions for them:

Note:

In the following procedure, replace /u01 and /u02 with the appropriate mount point directories that you identified in Step 3 previously.
  1. Enter the following command to create subdirectories in the mount point directory that you identified for the Oracle base directory:

    # mkdir -p /u01/app/oracle

  2. If you intend to use a second file system for the Oracle Database files, then create an oradata subdirectory in the mount point directory that you identified for the Oracle data file directory (shown as /u02 in the examples):

    # mkdir /u02/oradata

  3. Change the owner and group of the directories that you created to the oracle user and the oinstall group:

    # chown -R oracle:oinstall /u01/app/oracle
    # chown -R oracle:oinstall /u02/oradata

  4. Change the permissions on the directories that you created to 775:

    # chmod -R 775 /u01/app/oracle
    # chmod -R 775 /u02/oradata

  5. When you configure the oracle user's environment later in this chapter, set the ORACLE_BASE environment variable to specify the Oracle base directory that you have created.

8 Configuring the oracle User's Environment

You run Oracle Universal Installer from the oracle account. However, before you start Oracle Universal Installer, you must configure the environment of the oracle user. To configure the environment, you must:

  • Set the default file mode creation mask (umask) to 022 in the shell startup file.

  • Set the DISPLAY environment variable.

To set the oracle user's environment:

  1. Start a new terminal session, for example, an X terminal (xterm).

  2. Enter the following command to ensure that X Window applications can display on this system:

    $ xhost fully_qualified_remote_host_name

  3. Complete one of the following steps:

    • If the terminal session is not connected to the system where you want to install the software, then log in to that system as the oracle user.

    • If the terminal session is connected to the system where you want to install the software, then switch user to oracle:

      $ su - oracle

  4. To determine the default shell for the oracle user, enter the following command:

    $ echo $SHELL

  5. Open the oracle user's shell startup file in any text editor:

    • C shell (csh or tcsh):

      % vi .login

  6. Enter or edit the following line in the shell startup file, specifying a value of 022 for the default file mode creation mask:

    umask 022

  7. If the ORACLE_SID, ORACLE_HOME, or ORACLE_BASE environment variable is set in the file, then remove the appropriate lines from the file.

  8. Save the file, and exit from the editor.

  9. To run the shell startup script, enter the following command:

    • Bash shell:

      $ . ./.bash_profile

    • Bourne shell or Korn shell:

      $ . ./.profile

    • C shell:

      % source ./.login

  10. If you are not installing the software on the local system, then enter a command similar to the following to direct X applications to display on the local system:

    • Bourne, Bash, or Korn shell:

      $ DISPLAY=local_host:0.0 ; export DISPLAY

    • C shell:

      % setenv DISPLAY local_host:0.0

    In this example, local_host is the host name or IP address of the system that you want to use to display Oracle Universal Installer (your workstation or PC).

  11. If you determined that the /tmp directory had insufficient free disk space when checking the hardware requirements, then enter the following commands to set the TMP and TMPDIR environment variables. Specify a directory on a file system with sufficient free disk space.

    • Use the df -k command to identify a suitable file system with sufficient free space.

    • If necessary, enter commands similar to the following to create a temporary directory on the file system that you identified, and set the appropriate permissions on the directory:

      $ su - root
      # mkdir /mount_point/tmp
      # chmod a+wr /mount_point/tmp
      # exit

    • Enter commands similar to the following to set the TMP and TMPDIR environment variables:

      Bourne, Bash, or Korn shell:

      $ TMP=/mount_point/tmp
      $ TMPDIR=/mount_point/tmp
      $ export TMP TMPDIR

      C shell:

      % setenv TMP /mount_point/tmp
      % setenv TMPDIR /mount_point/tmp

  12. Enter commands similar to the following to set the ORACLE_BASE and ORACLE_SID environment variables:

    • Bourne, Bash, or Korn shell:

      $ ORACLE_BASE=/u01/app/oracle
      $ ORACLE_SID=sales
      $ export ORACLE_BASE ORACLE_SID

    • C shell:

      % setenv ORACLE_BASE /u01/app/oracle
      % setenv ORACLE_SID sales

    In these examples, /u01/app/oracle is the Oracle base directory that you created earlier, and sales is the name that you want to call the database (typically no more than five characters).

  13. If you are using raw devices for database storage, then set the DBCA_RAW_CONFIG environment variable to specify the full path to the raw device mapping file:

    • Bourne, Bash, or Korn shell:

      $ DBCA_RAW_CONFIG=$ORACLE_BASE/oradata/dbname/dbname_raw.conf
      $ export DBCA_RAW_CONFIG

    • C shell:

      % setenv DBCA_RAW_CONFIG=$ORACLE_BASE/oradata/dbname/dbname_raw.conf

  14. Enter the following commands to ensure that the ORACLE_HOME and TNS_ADMIN environment variables are not set:

    • Bourne, Bash, or Korn shell:

      $ unset ORACLE_HOME
      $ unset TNS_ADMIN

    • C shell:

      % unsetenv ORACLE_HOME
      % unsetenv TNS_ADMIN

  15. To verify that the environment has been set correctly, enter the following commands:

    $ umask
    $ env | more

    Verify that the umask command displays a value of 22, 022, or 0022 and the environment variables that you set in this section have the correct values.

9 Mounting the Product Disc

On most Solaris systems, the product disc mounts automatically when you insert it into the drive. If the disc does not mount automatically, then follow these steps to mount it:

  1. Switch user to root:

    $ su - root

  2. If necessary, enter a command similar to the following to eject the currently mounted disc, then remove it from the drive:

    # eject

  3. Insert the disc into the disc drive.

  4. To verify that the disc mounted automatically, enter a command similar to the following:

    # ls /dvd/dvd0

  5. If this command fails to display the contents of the disc, then eEnter a command similar to the following:

    # /usr/sbin/mount -r -F hsfs /dev/dsk/cxtydzs2 /dvd

    In this example, /dvd is the disc mount point directory and /dev/dsk/cxtydzs2 is the device name for the disc device, for example /dev/dsk/c0t6d0s2.

  6. If Oracle Universal Installer displays the Disk Location dialog box, then enter the disc mount point directory path. For example:

    • Disc mounted automatically:

      /dvd/dvd0

    • Disc mounted manually:

      /dvd

10 Installing Oracle Database

After configuring the oracle user's environment, start Oracle Universal Installer and install Oracle Database, as follows:

  1. To start Oracle Universal Installer, enter the following commands:

    • If the installation files are on disc, enter commands similar to the following, where directory_path is the path of the db directory on the DVD:

      $ cd /tmp
      $ /directory_path/runInstaller

    • If the installation files are on the hard disk, change directory to the db directory and enter the following command:

      $ ./runInstaller

  2. The following table describes the recommended action for each Oracle Universal Installer screen. Use the following guidelines to complete the installation:

    • If you need more assistance, or if you want to choose an option that is not a default, then click Help for additional information.

    • If you encounter errors while installing or linking the software, then refer to Oracle Database Installation Guide for Solaris Operating System (x86-64) for information about troubleshooting.

    Note:

    If you have completed the tasks listed previously, then you can complete the installation by choosing the default values on most screens.
    Screen Recommended Action
    Select Installation Method The Basic Installation option is selected by default.

    Specify the directory path of the Oracle home. Ensure that the UNIX DBA group oinstall is selected. If you want to create a starter database, then specify a name and password for it. Then, click Next.

    Specify Inventory Directory and Credentials This screen is displayed only during the first installation of Oracle products on a system.

    Specify the full path of the Oracle Inventory directory. Ensure that the operating system group selected is oinstall. Then, click Next.

    Product-Specific Prerequisite Checks Verify that all of the prerequisite checks succeed, then click Next.

    Oracle Universal Installer checks the system to verify that it is configured correctly to run Oracle software. If you have completed all of the preinstallation steps in this guide, all of the checks should pass.

    If a check fails, then review the cause of the failure listed for that check on the screen. If possible, rectify the problem and rerun the check. Alternatively, if you are satisfied that your system meets the requirements, then you can select the check box for the failed check to manually verify the requirement.

    Summary Review the information displayed on this screen, and then click Install.
    Install This screen displays status information while the product is being installed.
    Configuration Assistants This screen displays status information for the configuration assistants that configure the software and create a database. When the message is displayed at the end of this process, click OK to continue.
    Execute Configuration Scripts When prompted, read the instructions and then run the scripts mentioned on this screen. Click OK to continue.
    End of Installation The configuration assistants configure several Web-based applications, including Oracle Enterprise Manager Database Control. This screen displays the URLs configured for these applications. Make a note of the URLs used. The port numbers used in these URLs are also recorded in the following file:
    oracle_home/install/portlist.ini

    To exit from Oracle Universal Installer, click Exit and then click Yes.


11 Installing Products from the Oracle Database 10g Companion CD

The Oracle Database 10g Companion CD contains additional products that you can install. Whether you need to install these products depends on which Oracle Database products or features you plan to use. If you plan to use the following products or features, then you must complete the Oracle Database 10g Products installation from the Companion CD:

  • JPublisher

  • Oracle JVM

  • Oracle interMedia

  • Oracle JDBC development drivers

  • Oracle SQLJ

  • Oracle Database Examples

  • Oracle Text supplied knowledge bases

  • Oracle Ultra Search

  • Oracle HTML DB

  • Oracle Workflow server and middle-tier components

For more information about installing software from the Companion CD, refer to Oracle Database Companion CD Installation Guide for Solaris Operating System (x86-64).

12 What to Do Next?

To become familiar with this release of Oracle Database, it is recommended that you complete the following tasks:

  • Log in to Oracle Enterprise Manager Database Control using a Web browser.

    Oracle Enterprise Manager Database Control is a Web-based application that you can use to manage a single Oracle Database installation. The default URL for Database Control is similar to the following:

    http://host.domain:1158/em/

    To log in, use the user name SYS and connect as SYSDBA. Use the password that you specified for this user during the Oracle Database 10g installation.

  • Refer to Oracle Database Installation Guide for Solaris Operating System (x86-64) for information about required and optional postinstallation tasks, depending on the products that you want to use.

  • Refer to Oracle Database Installation Guide for Solaris Operating System (x86-64) for information about how to use Database Control to learn about the configuration of your installed database.

  • To learn more about using Oracle Enterprise Manager Database Control to administer a database, refer to Oracle Database 2 Day DBA.

    This guide, designed for new Oracle DBAs, describes how to use Database Control to manage all aspects of an Oracle Database installation. It also provides information about how to enable e-mail notifications and automated backups, which you might not have configured during the installation.

13 Additional Information

This section contains information about the following:

Product Licenses

You are welcome to install and evaluate the products included in this media pack for 30 days under the terms of the Trial License Agreement. However, you must purchase a program license if you want to continue using any product after the 30 day evaluation period. See the following section for information about purchasing program licenses.

Purchasing Licenses, Version Updates, and Documentation

You can purchase program licenses, updated versions of Oracle products, and printed versions of Oracle documentation from the Oracle Store Web site:

http://oraclestore.oracle.com

Contacting Oracle Support Services

If you have purchased Oracle Product Support, you can call Oracle Support Services for assistance 24 hours a day, seven days a week. For information about purchasing Oracle Product Support or contacting Oracle Support Services, go to the Oracle Support Services Web site:

http://www.oracle.com/support

Locating Product Documentation

Documentation for Oracle products is available in both HTML and Adobe portable document format (PDF) formats from several locations:

  • On discs in the media pack:

    • Platform-specific documentation is available on the product discs. To access this documentation, see the welcome.htm file located in the top-level directory of the installation media.

    • Generic product documentation is available in the Oracle Documentation Library.

  • From the Oracle Technology Network Web site:

    http://www.oracle.com/technology/documentation/index.html

To view PDF documents, download the free Adobe Acrobat Reader from the Adobe Web site, if necessary:

http://www.adobe.com

14 Documentation Accessibility

Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For more information, visit the Oracle Accessibility Program Web site at

http://www.oracle.com/accessibility/

Accessibility of Code Examples in Documentation

Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.

Accessibility of Links to External Web Sites in Documentation

This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.

TTY Access to Oracle Support Services

Oracle provides dedicated Text Telephone (TTY) access to Oracle Support Services within the United States of America 24 hours a day, seven days a week. For TTY support, call 800.446.2398.

Oracle Database 10g Release 2 (10.2.0.2) Installation On Solaris 10 (x86)

In this article I'll describe the installation of Oracle Database 10g Release 2 (10.2.0.2) on Solaris 10 (x86). The article is based on a default server installation as shown here. Alternative installations may require a different setup procedure.

Download Software

Download the following software:

Unpack Files

Unzip the files:
unzip 10202_database_solx86.zip
You should now have a single directory called "database" containing installation files.

Hosts File

The /etc/hosts file must contain a fully qualified name for the server:
    

Set Kernel Parameters

In previous versions of Solaris, kernel parameters were amended by adding entries to the "/etc/system" file, followed by a system reboot.
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=256
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=100
The Oracle installer recognizes kernel parameters set using this method, but it is now deprecated in favour of resource control projects, explained below.

As the root user, issue the following command.
projadd oracle
Append the following line to the "/etc/user_attr" file.
oracle::::project=oracle
If you've performed a default installation, it is likely that the only kernel parameter you need to alter is "max-shm-memory". To check the current value issue the following command.
# prctl -n project.max-shm-memory -i project oracle
project: 100: oracle
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-shm-memory
privileged 254MB - deny -
system 16.0EB max deny -
#
To reset this value, make sure at least one session is logged in as the oracle user, then from the root user issue the following commands.
# prctl -n project.max-shm-memory -v 4gb -r -i project oracle
# projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle
The first dynamically resets the value, while the second makes changes to the "/etc/project" file so the value is persistent between reboots.
# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
oracle:100::::project.max-shm-memory=(priv,4294967296,deny)
#
The Oracle installer seems incapable of recognising kernel parameter set using resource control projects, but if you ignore the warnings the installation completes successfully.

Setup

Add the "SUNWi1cs" and "SUNWi15cs" packages using the "pkgadd" command.
# pkgadd -d /cdrom/sol_10_106_x86/Solaris_10/Product SUNWi1cs SUNWi15cs

Processing package instance from

X11 ISO8859-1 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.

This appears to be an attempt to install the same architecture and
version of a package which is already installed. This installation
will attempt to overwrite this package.

Using as the package base directory.
## Processing package information.
## Processing system information.
16 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of [y,n,?] y

Installing X11 ISO8859-1 Codeset Support as

## Installing part 1 of 1.

Installation of was successful.

Processing package instance from

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.

This appears to be an attempt to install the same architecture and
version of a package which is already installed. This installation
will attempt to overwrite this package.

Using
as the package base directory.
## Processing package information.
## Processing system information.
21 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of [y,n,?] y

Installing X11 ISO8859-15 Codeset Support as

## Installing part 1 of 1.

Installation of was successful.
#
Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba -d /export/home/oracle oracle
mkdir /export/home/oracle
chown oracle:oinstall /export/home/oracle
passwd -r files oracle
Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01
If you have not partitioned your disks to allow a "/u01" mount point, you may want to install the software in the "/export/home/oracle" directory as follows:
mkdir -p /export/home/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /export/home/oracle
Login as the oracle user and add the following lines at the end of the .profile file, making sure you have set the correct ORACLE_BASE value:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

# Select the appropriate ORACLE_BASE
#ORACLE_BASE=/export/home/oracle; export ORACLE_BASE
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=:0.0; export DISPLAY
Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller
During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.
  1. Select Installation Method
  2. Specify Inventory Directory and Credentials
  3. Select Installation Type
  4. Specify Home Details
  5. Product-Specific Prerequisite Checks
  6. Select Configuration Option
  7. Select Database Configuration
  8. Specify Database Configuration Options
  9. Select Database Management Option
  10. Specify Database Storage Option
  11. Specify Backup and Recovery Options
  12. Specify Database Schema Passwords
  13. Summary
  14. Install
  15. Configuration Assistants
  16. Database Configuration Assistant
  17. Database Configuration Assistant Password Management
  18. Execute Configuration Scripts
  19. End Of Installation

Post Installation

Edit the "/var/opt/oracle/oratab" file setting the restart flag for each instance to 'Y':
TSH1:/u01/app/oracle/product/10.2.0/db_1:Y
For more information see:
Hope this helps. Regards Tim...

vi solaris 10

vi(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | COMMAND SUMMARY | USAGE | ENVIRONMENT VARIABLES | FILES | ATTRIBUTES | SEE ALSO | AUTHOR | NOTES

NAME

    vi, view, vedit- screen-oriented (visual) display editor based on ex

SYNOPSIS


    /usr/bin/vi [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-t tag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...
    /usr/bin/view [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-t tag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...
    /usr/bin/vedit [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-ttag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...
    /usr/xpg4/bin/vi [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-ttag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...
    /usr/xpg4/bin/view [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-ttag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...
    /usr/xpg4/bin/vedit [-|-s] [-l] [-L] [-R] [-r[filename]] [-S] [-ttag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command] filename...

DESCRIPTION

    vi (visual) is a display-oriented text editor based on an underlying line editor ex. It is possible to use the command mode of ex from within vi and to use the command mode of vi from within ex. The visual commands are described on this manual page; how to set options (like automatically numbering lines and automatically starting a new output line when you type carriage return) and all ex line editor commands are described on the ex(1) manual page.

    When using vi, changes you make to the file are reflected in what you see on your terminal screen. The position of the cursor on the screen indicates the position within the file.

    The view invocation is the same as vi except that the readonly flag is set.

    The vedit invocation is intended for beginners. It is the same as vi except that the report flag is set to 1, the showmode and novice flags are set, and magic is turned off. These defaults make it easier to learn how to use vi.

OPTIONS

    Invocation Options

      The following invocation options are interpreted by vi (previously documented options are discussed in the NOTES section of this manual page):

      - | -s

      Suppress all interactive user feedback. This is useful when processing editor scripts.

      -C

      Encryption option; same as the -x option, except that vi simulates the C command of ex. The C command is like the X command of ex, except that all text read in is assumed to have been encrypted.

      -l

      Set up for editing LISP programs.

      -L

      List the name of all files saved as the result of an editor or system crash.

      -r filename

      Edit filename after an editor or system crash. (Recovers the version of filename that was in the buffer when the crash occurred.)

      -R

      Readonly mode; the readonly flag is set, preventing accidental overwriting of the file.

      -S

      This option is used in conjunction with the -t tag option to tell vi that the tags file may not be sorted and that, if the binary search (which relies on a sorted tags file) for tag fails to find it, the much slower linear search should also be done. Since the linear search is slow, users of large tags files should ensure that the tags files are sorted rather than use this flag. Creation of tags files normally produces sorted tags files. See ctags(1) for more information on tags files.

      -t tag

      Edit the file containing the tag, tag, and position the editor at its definition.

      -v

      Start up in display editing state using vi. You can achieve the same effect by simply typing the vi command itself.

      -V

      Verbose. When ex commands are read by means of standard input, the input will be echoed to standard error. This may be useful when processing ex commands within shell scripts.

      -wn

      Set the default window size to n. This is useful when using the editor over a slow speed line.

      -x

      Encryption option; when used, vi simulates the X command of ex and prompts the user for a key. This key is used to encrypt and decrypt text using the algorithm of the crypt command. The X command makes an educated guess to determine whether text read in is encrypted or not. The temporary buffer file is encrypted also, using a transformed version of the key typed in for the -x option. If an empty encryption key is entered (that is, if the return key is pressed right after the prompt), the file will not be encrypted. This is a good way to decrypt a file erroneously encrypted with a mistyped encryption key, such as a backspace or undo key.

      +command | -c command

      Begin editing by executing the specified editor command (usually a search or positioning command).

    /usr/xpg4/bin/vi

      If both the -t tag and the -c command options are given, the -t tag option will be processed first. That is, the file containing tag is selected by -t and then the command is executed.

OPERANDS

    The following operands are supported:

    filename

    A file to be edited.

COMMAND SUMMARY

    vi Modes

      Command

      Normal and initial mode. Other modes return to command mode upon completion. ESC (escape) is used to cancel a partial command.

      Input

      Entered by setting any of the following options:


      a A i I o O c C s S R


      Arbitrary text may then be entered. Input mode is normally terminated with the ESC character, or, abnormally, with an interrupt.
      Last line

      Reading input for : / ? or !. Terminate by typing a carriage return. An interrupt cancels termination.

    Sample commands

      In the descriptions, CR stands for carriage return and ESC stands for the escape key.

      <-
      ->
      down-arrow
      up-arrow

      arrow keys move the cursor

      h j k l

      same as arrow keys

      itextESC

      insert text

      cwnewESC

      change word to new

      easESC

      pluralize word (end of word; append s; escape from input state)

      x

      delete a character

      dw

      delete a word

      dd

      delete a line

      3dd

      delete 3 lines

      u

      undo previous change

      ZZ

      exit vi, saving changes

      :q!CR

      quit, discarding changes

      /textCR

      search for text

      ^U ^D

      scroll up or down

      :cmdCR

      any ex or ed command

    Counts before vi commands

      Numbers may be typed as a prefix to some commands. They are interpreted in one of these ways:

      line/column number

      z G |

      scroll amount

      ^D ^U

      repeat effect

      most of the rest

    Interrupting, canceling

      ESC

      end insert or incomplete command

      DEL

      (delete or rubout) interrupts

    File manipulation

      ZZ

      if file modified, write and exit; otherwise, exit

      :wCR

      write back changes

      :w!CR

      forced write, if permission originally not valid

      :qCR

      quit

      :q!CR

      quit, discard changes

      :e nameCR

      edit file name

      :e!CR

      reedit, discard changes

      :e + nameCR

      edit, starting at end

      :e +nCR

      edit, starting at line n

      :e #CR

      edit alternate file

      :e! #CR

      edit alternate file, discard changes

      :w nameCR

      write file name

      :w! nameCR

      overwrite file name

      :shCR

      run shell, then return

      :!cmdCR

      run cmd, then return

      :nCR

      edit next file in arglist

      :n argsCR

      specify new arglist

      ^G

      show current file and line

      :ta tagCR

      position cursor to tag

      In general, any ex or ed command (such as substitute or global) may be typed, preceded by a colon and followed by a carriage return.

    Positioning within file

      F

      forward screen

      ^B

      backward screen

      ^D

      scroll down half screen

      ^U

      scroll up half screen

      nG

      go to the beginning of the specified line (end default), where n is a line number

      /pat

      next line matching pat

      ?pat

      previous line matching pat

      n

      repeat last / or ? command

      N

      reverse last / or ? command

      /pat/+n

      nth line after pat

      ?pat?-n

      nth line before pat

      ]]

      next section/function

      [[

      previous section/function

      (

      beginning of sentence

      )

      end of sentence

      {

      beginning of paragraph

      }

      end of paragraph

      %

      find matching ( ) or { }

    Adjusting the screen

      ^L

      clear and redraw window

      ^R

      clear and redraw window if ^L is -> key

      zCR

      redraw screen with current line at top of window

      z-CR

      redraw screen with current line at bottom of window

      z.CR

      redraw screen with current line at center of window

      /pat/z-CR

      move pat line to bottom of window

      zn.CR

      use n-line window

      ^E

      scroll window down one line

      ^Y

      scroll window up one line

    Marking and returning

      ``

      move cursor to previous context

      ´´

      move cursor to first non-white space in line

      mx

      mark current position with the ASCII lower-case letter x

      `x

      move cursor to mark x

      ´x

      move cursor to first non-white space in line marked by x

    Line positioning

      H

      top line on screen

      L

      last line on screen

      M

      middle line on screen

      +

      next line, at first non-white space character

      -

      previous line, at first non-white space character

      CR

      return, same as +

      down-arrow
      or j

      next line, same column

      up-arrow
      or k

      previous line, same column

    Character positioning

      ^

      first non-white space character

      0

      beginning of line

      $

      end of line

      l or ->

      forward

      h or <-

      backward

      ^H

      same as <- (backspace)

      space

      same as -> (space bar)

      fx

      find next x

      Fx

      find previous x

      tx

      move to character following the next x

      Tx

      move to character following the previous x

      ;

      repeat last f, F, t, or T

      ,

      repeat inverse of last f, F, t, or T

      n|

      move to column n

      %

      find matching ( ) or { }

    Words, sentences, paragraphs

      w

      forward a word

      b

      back a word

      e

      end of word

      )

      to next sentence

      }

      to next paragraph

      (

      back a sentence

      {

      back a paragraph

      W

      forward a blank-delimited word

      B

      back a blank-delimited word

      E

      end of a blank-delimited word

    Corrections during insert

      ^H

      erase last character (backspace)

      ^W

      erase last word

      erase

      your erase character, same as ^H (backspace)

      kill

      your kill character, erase this line of input

      \

      quotes your erase and kill characters

      ESC

      ends insertion, back to command mode

      CTRL-C

      interrupt, suspends insert mode

      ^D

      backtab one character; reset left margin of autoindent

      ^^D

      caret (^) followed by control-d (^D); backtab to beginning of line; do not reset left margin of autoindent

      0^D

      backtab to beginning of line; reset left margin of autoindent

      ^V

      quote non-printable character

    Insert and replace

      a

      append after cursor

      A

      append at end of line

      i

      insert before cursor

      I

      insert before first non-blank

      o

      open line below

      O

      open line above

      rx

      replace single character with x

      RtextESC

      replace characters

    Operators

      Operators are followed by a cursor motion and affect all text that would have been moved over. For example, since w moves over a word, dw deletes the word that would be moved over. Double the operator, for example dd, to affect whole lines.

      d

      delete

      c

      change

      y

      yank lines to buffer

      <

      left shift

      >

      right shift

      !

      filter through command

    Miscellaneous Operations

      C

      change rest of line (c$)

      D

      delete rest of line (d$)

      s

      substitute characters (cl)

      S

      substitute lines (cc)

      J

      join lines

      x

      delete characters (dl)

      X

      delete characters before cursor dh)

      Y

      yank lines (yy)

    Yank and Put

      Put inserts the text most recently deleted or yanked; however, if a buffer is named (using the ASCII lower-case letters a - z), the text in that buffer is put instead.

      3yy

      yank 3 lines

      3yl

      yank 3 characters

      p

      put back text after cursor

      P

      put back text before cursor

      "xp

      put from buffer x

      "xy

      yank to buffer x

      "xd

      delete into buffer x

    Undo, Redo, Retrieve

      u

      undo last change

      U

      restore current line

      .

      repeat last change

      "dp

      retrieve d'th last delete

USAGE

    See largefile(5) for the description of the behavior of vi and view when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

ENVIRONMENT VARIABLES

    See environ(5) for descriptions of the following environment variables that affect the execution of vi: LC_CTYPE, LC_TIME, LC_MESSAGES, and NLSPATH.

FILES

    /var/tmp

    default directory where temporary work files are placed; it can be changed using the directory option (see the ex(1) command)

    /usr/share/lib/terminfo/?/*

    compiled terminal description database

    /usr/lib/.COREterm/?/*

    subset of compiled terminal description database

ATTRIBUTES

    See attributes(5) for descriptions of the following attributes:

    /usr/bin/vi

    /usr/bin/view

    /usr/bin/vedit

      ATTRIBUTE TYPE ATTRIBUTE VALUE
      Availability SUNWcsu
      CSI Not enabled

    /usr/xpg4/bin/vi

    /usr/xpg4/bin/view

    /usr/xpg4/bin/vedit

      ATTRIBUTE TYPE ATTRIBUTE VALUE
      Availability SUNWxcu4
      CSI Enabled

SEE ALSO