Install Oracle9i in Linux in VMware

Source: Internet
Author: User

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, www.britepic.org can perform the following steps.
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
If this step is omitted, the last step of installation will report the ORA-27123: unable to attach to shared memory segment error.

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. www.britepic.org is a Simplified Chinese version of my Red Hat linux 9, and the installation program is in English. In this case, 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.
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.
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 execute the following command under the common command line:
Lsnrctl start monitoring
Lsnrctl stop monitoring
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.
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.

Notes:

Installation documents written a long time ago
1. Make sure that the RPM development kit has been installed by running the following command:
Rpm-q gcc cpp compat-libstdc ++ glibc-devel glibc-kernheaders binutils
2. Download the Oracle9i installation file from the Oracle Official Website: Linux9i_Disk1.cpio.gz,Linux9i_Disk2.cpio.gz,Linux9i_Disk3.cpio.gz
Decompress the three files,
Zcat Linux9i_Disk1.cpio.gz | cpio-idmv
Zcat Linux9i_Disk2.cpio.gz | cpio-idmv
Zcat Linux9i_Disk3.cpio.gz | cpio-idmv
There are three directories: Disk1 Disk2 Disk3.
3. Set Kernel Parameters
Vi/etc/sysctl. conf, add the following parameters
Kernel. shmmax = 4294967295 memory 512 M
Calculation method: kernel: shmmax = 1024*1024 * RAM (M)/2
Or
Edit/etc/sysctl. conf
Kernel. shmmax = 4294967295
The above is MB memory, so this value is set. You can set it according to the actual situation.
The shmmax parameter defines the maximum size of the shared memory segment. The recommended value of shmmax is half of the physical memory.
Run sysctl-p.
4. Modify the total number of files that oracle users can open
Vi/etc/security/limits. conf
Oracle soft nofile 65536
Oracle hard nofile 65536
Oracle soft nproc 16384
Hard nproc 16384

4. Create a data directory and user
Use the groupadd command as root to add the dba group;
# Groupadd dba
For Oracle9i, you also need to add an oinstall group to assign permissions to install software in the data warehouse.
# Groupadd oinstall
For oracle9i, use the oinstall and dba groups as the default groups to create oracle accounts
# Useradd-g oinstall-G dba oracle
Set the password for the Oracle account
# Passwd oracle
Corresponding directory created for Oracle
# Mkdir/opt/oracle
# Mkdir/opt/oracle/product
# Mkdir/opt/oracle/product/9.2.0
To allow the Oracle account to use these installation locations during installation, you must have the appropriate permissions. Change all permissions of the installation location to an Oracle account.
# Chown-R oracle. oinstall/opt/oracle
# Mkdir/var/opt/oracle
# Chown oracle. dba/var/opt/oracle
# Chmod 755/var/opt/oracle
5. Use. bash_profile of the oracle account to insert the following environment variables
Vi. bash_profile setting Variables
Export LD_ASSUME_KERNEL = 2.4.1
Export ORACLE_BASE =/opt/oracle
Export ORACLE_HOME =/opt/oracle/product/9.2.0
Export ORACLE_SID = ora9
Export ORACLE_TERM = xterm
Export TNS_ADMIN = $ ORACLE_HOME/network/admin
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
Export ORA_NLS33 = $ ORACLE_HOME/ocommon/nls/admin/data
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 = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
CLASSPATH = $ CLASSPATH: $ ORACLE_HOME/network/jlib
Export CLASSPATH
(1) export TNS_ADMIN = $ ORACLE_HOME/network/admin
In this way, no listener errors are frequently reported.
Log on to oracle again, and the Environment will take effect.

  • 1
  • 2
  • 3
  • Next Page

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.