Installation and configuration of oracle9.2i in Red Hat Linux

Source: Internet
Author: User
  1. Download and preparation
    Http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk1.cpio.gz
    Http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk2.cpio.gz
    Http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk3.cpio.gz
    I suggest placing the installation file under the drive letter of windows, sharing the folder, and using Mount-T smbfs to allow Linux to access the shared folder under Windows for installation. for virtual Linux, it does not need to occupy that large space.
    Ensure that the network between on-premises Linux and Windows is smooth. Use the root user to set an IP address for Linux, "Start Menu"-> "system settings"-> "network"
    More than 8 GB of virtual Linux disk space, 2.8 GB of Linux, 2.85 GB of Oracle, and 2 GB of database;
    Virtual Machine memory. I allocated 512 m for my own installation, and the speed is still relatively low. I think other users use 256 m, which is very slow.
    If the above information is available, perform the following steps.
  2. Environment configuration and installation
    1) Add a user group and log on as the root user.
    Groupadd orainstall
    Groupadd oradba
    Groupadd oraworkflow
    Useradd ora-G orainstall, oradba
    You can use different usernames and groups as needed.

    2) switch to the root user
    VI/etc/sysctl. conf
    Then add the last row
    Kernel. shmmax = 261986254
    The value of this parameter must be smaller than or equal to the value of physical memory, otherwise the setting will not take effect. It indicates the maximum size of a single shared memory segment, which is generally set to half of the physical memory.
    If this step is omitted, the last step of installation, or the ORA-27123: Unable to attach to shared memory segment error is reported when dbca creates the database.

    3) add environment variables to. bash_profile
    Log On with the ora user and add the following content to the file:
    # Oracle
    Export ld_assume_kernel = 2.4.1
    Export oracle_base =/home/ora/ora9
    Export ORACLE_HOME =/home/ora/ora9/Oracle
    Export ora_nls33 = $ ORACLE_HOME/ocommon/NLS/admin/Data
    # Nouse
    Export oracle_sid = linuxdb
    Export oracle_term = xterm
    Export tns_admin = $ ORACLE_HOME/Network/admin
    Export nls_lang = american_america.us7ascii
    # Lib, Class
    LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
    LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/lib
    Export LD_LIBRARY_PATH
    Export Path = $ path: $ ORACLE_HOME/bin
    Classpath = $ classpath: $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
    Classpath = $ classpath: $ ORACLE_HOME/Network/jlib
    Export classpath
    After modifying. bash_profile, log on again, or source. bash_profile, the environment variable configured above takes effect.

    4) decompress the file
    In Windows, share the Oracle folder that stores the installation files, set the sharing permission to readable and writable, and then execute the following command:
    Mount-T smbfs-O username = Cl, password = Chenli, IP = 192.168.1.100-l // Chenli/Oracle/home/ora/setup
    Command explanation:
    In the preceding command, username = Cl, password = Chenli indicates that Cl is a Windows user, and Chenli indicates the password of Cl.
    In IP = 192.168.1.100, 192.168.1.100 is the IP address of the Windows host.
    // In Chenli/Oracle, Chenli is the host name of the Windows host, and Oracle is a shared folder.
    /Home/ora/setup is the directory path in Linux. It must exist. You can set different paths as needed.

    Decompress the file and execute the following commands in sequence:
    CD/home/ora/setup
    Gunzip ship_9204_linux_disk1.cpio.gz
    Gunzip ship_9204_linux_disk2.cpio.gz
    Gunzip ship_9204_linux_disk3.cpio.gz
    Cpio-idmv <ship_9204_linux_disk1.cpio
    Cpio-idmv <ship_9204_linux_disk2.cpio
    Cpio-idmv <ship_9204_linux_disk3.cpio
    After execution, three directories, disk1, disk2, and disk3, are displayed.

    5) Installation
    Log on to the Linux GUI using the ora user
    Go to the/home/ora/Setup/disk1 directory.
    Run./runinstaller
    Note: Sometimes the installation interface is garbled. The Simplified Chinese version of my Red Hat Linux 9 installation program is in English. You can run the following command to solve the problem:
    Export lc_all = C
    Export lang = C
    Then execute./runinstaller, and there will be no garbled characters.

    I encountered the following error when executing./runinstaller:
    ./Runinstaller: Line 58:./runinstaller: cannot execute binary file
    Soon I thought about whether or not the software was installed incorrectly. When I checked that the file name was A64-bit, I downloaded it again and then installed it.
    Therefore, when downloading the software, be sure to check whether the installed software matches your operating system.

    Next, we will continue to choose "Next.
    When the following window appears, enter the group oradba created earlier.

    When the following window appears.

    Follow the prompts to run the script orainstroot. Sh in the/tmp directory as the root user. The result is as follows:
    [Root @ localhost TMP] #. /orainstroot. sh <br/> creating Oracle inventory pointer file (/etc/orainst. loc) <br/> changing groupname of/home/Oracle/ora9/orainventory to oradba. <br/> [root @ localhost TMP] #

    The following window appears:

    As prompted, use the root user to go to the corresponding directory and execute the script root. Sh. The result is as follows:
    [Root @ localhost Oracle] #. /root. sh <br/> running oracle9 root. sh script... <br/>/nthe following environment variables are set: <br/> oracle_owner = Oracle <br/> ORACLE_HOME =/home/Oracle/ora9/Oracle </P> <p> enter the full pathname of the local bin directory: [/usr/local/bin]: <br/> copying dbhome to/usr/local/bin... <br/> copying oraenv to/usr/local/bin... <br/> copying coraenv to/usr/local/bin... </P> <p>/ncreating/etc/oratab file... <br/> adding Entry to/etc/oratab file... <br/> entries will be added to the/etc/oratab file as needed by <br/> Database Configuration assistant when a database is created <br/> finished running generic part of Root. sh script. <br/> now product-specific root actions will be saved med. <br/> [root @ localhost Oracle] #

    Finally, set the password for sys, system, and so on.

  3. Error summary:
    I have encountered some problems during the installation process. I will share with you here.
    1) the dialog box displays the error message: thrown when the IP address of a host cannot be determined.
    In this case, you need to use the root user to open/etc/hosts and edit the file. The correspondence between the IP address and host name should be as simple as possible. In the second column, that is, the host name should not appear in the IP address format X. x. x. host Name of X

    2) at the end of the installation, the following error message is displayed when the agent tool is installed:
    Parameter "orahome" =/Oracle/product/9.2.0
    Parameter "nodeinfo" = no_value
    Agent service failed
    This problem is caused by no patching, but it does not affect the use of the database, but the agent tool is not available.
    Download p2617419_220_generic.zip p3006854_9204_linux.zip p3238244_9204_linux.zip
    Then install it. You need to re-Execute Oracle Installation./runinstaller, so it is best to install this patch before installation.

  4. Start Database
    Log on to Linux as a ora user
    Run the following command: sqlplus "/As sysdba"
    Display SQL> execute the command startup to start the database; execute shutdown to close the database.

    Start the monitoring program and run the following command in normal command line mode:
    LSNRCTL start monitoring
    LSNRCTL Stop monitoring

  5. Use Database
    Log on to the host using the ora user
    Run sqlplus "/As sysdba" to log on to the database as the system DBA.
    Create a tablespace, create a user, and grant permissions to the user.

    1) create a tablespace.
    Create tablespace devbase
    Datafile '/home/ora/tbspace/devbase_20080121.dbf' size 500 m
    Autoextend on
    Next 100 m
    Maxsize 1000 m;
    Make sure that the/home/ora/tbspace directory exists and has the permission to store the tablespace files.

    2) create a user
    Create user Dev
    Identified by dev123
    Default tablespace devbase
    Temporary tablespace temp;
    Create a user Dev and check whether the password is dev123. The default tablespace is devbase.
    Note: you cannot use Dev to log on to the database at this time, because the dev user does not have the create session, connect, and resource permissions, and cannot log on;

    3) grant permissions to users
    Grant resource, connect to Dev;
    Grant create session to Dev;
    Grant create table to Dev;
    Grant create tablespace to Dev;
    Grant create view to Dev;
    Now you can log on with the dev user.

    4) change the User Password
    Log On with the Sys or system user and run the following SQL statement to modify the user password:
    Alter user Dev identified by Chenli;

    Finally, because of a small problem, modify ORACLE_HOME/Network/admin/tnsnames. ora: replace all the host values in the file with IP addresses. This reduces the host name => ip address resolution process during database logon. Sometimes, it will increase the login speed.

  6. Create a development environment for normal Linux Users
    Configure the environment variables and find the Oracle program in the search path.
    Vi. bash_profile Add the following configuration
    # Oracle
    Export oracle_base =/home/ora/ora9
    Export ORACLE_HOME =/home/ora/ora9/Oracle
    Export oracle_sid = linuxdb
    Export oracle_term = xterm

    # LD_LIBRARY_PATH
    LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/lib:/usr/local/lib: $ ORACLE_HOME/rdbms/demo

    Path = $ path:/usr/bin:/usr/sbin:/usr/local/bin :.
    Path = $ path: $ ORACLE_HOME/bin
    Export path

    Create the XR read and execute permissions for common users in all directories in the path $ ORACLE_HOME/bin, $ ORACLE_HOME/include, $ ORACLE_HOME/lib, in this way, the login user can use some el programs in the $ ORACLE_HOME/bin directory. it is also necessary to ensure that the header file and library file under ORACLE can be used during the development process.

    1) create a seq object
    Create sequence seq_staff_id
    Minvalue 1
    Max value 9999999
    Start with 1
    Increment by 1
    Cache 20;

    2) create a table
    Create Table staff_info
    (
    Staff_id number (10 ),
    Staff_name varchar2 (20 ),
    ADDR varchar2 (200)
    );

    OK. A basic Oracle database can be used.

  7. Establish Oracle Development Environment on Windows
    Install oracle on your computer (the minimum requirement is the Oracle client), and select the installation mode on the Oracle Installation interface.
    Then, find the Network/admin path under the Oracle Installation Directory, which contains tnsnames. ora, and add the following content:
    Local_dev =
    (Description =
    (Address = (Protocol = TCP) (host = 192.168.1.100) (Port = 1521 ))
    (CONNECT_DATA =
    (Server = dedicated)
    (SERVICE_NAME = linuxdb)
    )
    )

    After saving, open the console and enter the command sqlplus DEV/Chenli @ local_dev to log on to the linuxdb database in Linux.
    In this way, you can use plsqldeveloper and other software for development on Windows. You can also use C/C ++, Java, and other programs to connect to the Oracle database through TNS.

  8. How to Get oracle help
    If an error occurs during Oracle development, you can quickly obtain the error information using the following methods:
    Use Oracle to install the user to log on to the host, and then run the command: oerr ora errno. errno is the error code.
    If you encounter an Error Code 1102, run the following command under the Oracle installer:
    [Ora @ localhost ora] $ oerr ora 1102 <br/> 01102,000 00, "Cannot mount database in exclusive mode" <br/> // * cause: some other instance has the database mounted exclusive or shared. <br/> // * Action: shutdown other instance or mount in a compatible mode.
    The Error Code 1102 is displayed.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.