Installing oracle from scratch makes kids no longer confused

Source: Internet
Author: User

Description:
This article only provides a brief introduction to installation, without detailed instructions on installation. It solves problems encountered during oracle installation,
It is no longer depressing for kids who are in touch with oracle in linux ~~~
1. Configure the Basic Environment
1. Groups and users required to create an oracle database
# Groupadd oinstall
# Groupadd dba
# Useradd-g oinstall-G dba-d/home/oracle-m-r oracle
2. Give the oracle Password
# Passwd oracle
New unix password: oracle
3. Edit the oracle user's environment variable. bash_profile
# Vi. bash_profile # Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi # User specific environment and startup programs
######### Add the following a few lines ##########
ORACLE_BASE =/u01/oracle
ORACLE_HOME =/u01/oracle/product/10.2.0/db_1
ORACLE_SID = shzq
LD_LIBRARY_PATH = $ ORACLE_HOME/lib:. PATH = $ PATH: $ ORACLE_HOME/bin:. export NLS_LANG = American_america.ZHS16GBK
Export PATH
Export ORACLE_BASE ORACLE_SID ORACLE_HOME LD_LIBRARY_PATH
4. Create a data file storage directory and grant corresponding Permissions
# Mkdir/u0 {1, 2, 3}
# Chmod-R 775/u0 {, 3}
# Chown-R oracle: oinstall/u0 {1, 2, 3}
5. Add the corresponding system parameter configuration
// Edit the/etc/sysctl. conf file as the root user and add
// If the system file authentication file does not exist during installation,
// Modify the size of the following numbers.
======================================
Kernel. shmall = 2097152
Sharemem limits to 8G
Kernel. shmmax = 4294967296
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 262144
Net. core. wmem_default = 262144
Net. core. rmem_max = 262144
Net. core. wmem_max = 262144
======================================
// Execute to make the settings take effect immediately
#/Sbin/sysctl-p
6. Number of files and Security Settings
# Vi/etc/security/limits. conf
// Add the following content
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536 # vi/etc/pam. d/login
// Add the following content
Session required/lib/security/pam_limits.so
7. Create a File Installation source directory
// Use the oracle account to log on and execute
# Cd/u03
# Mkdir software
// Upload the oracle Installation Package to software
// Check if the software permission of the installation package is 755,
// And belongs to oracle: oinstall
8. Modify the hosts file and Host Name
# Vi/etc/hosts
192.168.1.11 oracle10g
# Hostname oracle10g9. installation Package and compilation environment # yum-yt groupinstall "Developement Tools" "Development Libraries" # yum localinstall *. the following N packages of rpm, of course, need to distinguish 64bit and 32bit (not explained) compat-libstdc ++-33-3.2.3-61.x86_64.rpm
Gcc-4.1.2-46.el5.x86_64.rpm
Gcc-c ++-4.1.2-46. el5.x86 _ 64.rpm
Glibc-devel-2.5-42.i386.rpm
Glibc-devel-2.5-42.x86_64.rpm
Glibc-headers-2.5-42.x86_64.rpm
Kernel-headers-2.6.18-164.el5.x86_64.rpm
Libgomp-4.4.0-6.el5.x86_64.rpm
Libstdc +-devel-4.1.2-46.el5.x86_64.rpm
LibXau-devel-1.0.1-3.1.i386.rpm
LibXau-devel-1.0.1-3.1.x86_64.rpm
LibXp-1.0.0-8.1.el5.i386.rpm
LibXp-1.0.0-8.1.el5.x86_64.rpm
LibXp-devel-1.0.0-8.1.el5.i386.rpm
LibXp-devel-1.0.0-8.1.el5.x86_64.rpm ----------------------------------------------------
// The next step is to install the oracle database. After troubleshooting N errors
// Congratulations! OK!
10. Create a listener for oracle
$ Netca
11. Create a database
$ Dbca
If you cannot start oracle normally, look down! Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Ii. oracle Installation troubleshooting
1. error message
Sga size can not be greater than maxmum shared memory segment size, refer to oracle installation guide to configure your operating system kernel parameters
Memory segment size cannot be shared. Refer to the Oracle Installation Guide to set parameters for your operating system kernel.
After sysctl. conf is adjusted, the parameter settings are inconsistent with the physical memory! (Refer to the new sysctl. conf parameter)
2. What is the SID of oracle?
It is a unique identifier of a database! Is an initial ID automatically assigned by the system when a database is created,
SID is mainly used for DBA operations and interaction with the operating system. To access the Instance name from the operating system perspective, you must use ORACLE_SID
3. ORA-27102: out of memory
OS: CentOS5.4 GB memory
Note: inaccurate setting of a parameter will make oracle Installation useless !!!
Therefore, do not copy the documents obtained from www; otherwise, the documents will no doubt die.
Shmall of/etc/sysctl. conf
// The value set by the shmall parameter is too small will report the ORA-27102: out of memory
// For 32-bit systems, one page is 4 kb, that is, 4096 bytes.
Kernel. shmall = 2097152 is 2097152*4 k/1024/1024 = 8G, that is, a total of 8 GB shared memory is available.
// Settings reference
Kernel. shmall = 2097152 --- memory 8 GB
Kernel. shmall = 4194304 --- memory 16 GB
Kernel. shmall = 8388608 --- 32 GB memory
// Give a brief explanation and description of each parameter value.
(1) shmmax: this parameter defines the maximum size (in bytes) of the shared memory segment ). The default value is 32 MB, which is usually set to 2 GB in oracle.
(2) shmmni: This Kernel Parameter is used to set the maximum number of shared memory segments within the system. The default value of this parameter is 4096, which does not need to be changed.
(3) shmall: this parameter indicates the total amount of shared memory that can be used by the system at one time (in pages ). The default value is 2097152, which does not need to be modified.
(4) sem: this parameter indicates the set semaphore.
(5) file-max: Maximum number of file handles. The file handle setting indicates the number of files that can be opened in linux.
#/Sbin/sysctl-p
4.1.4. oracle database network configuration reference (see attachment)
A: listener. ora
# Listener. ora Network Configuration File:/u01/oracle/product/10.2.0/db_1/network/admin/listener. ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
) LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle) (PORT = 1521 ))
)
) B: sqlnet. ora
# Sqlnet. ora Network Configuration File:/u01/oracle/product/10.2.0/db_1/network/admin/sqlnet. ora
# Generated by Oracle configuration tools. NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT) C: tnsnames. ora
# Tnsnames. ora Network Configuration File:/u01/oracle/product/10.2.0/db_1/network/admin/tnsnames. ora
# Generated by Oracle configuration tools. SHZQ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shzq)
)
) EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1 ))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
5. If the swap partition is too small when Oracle is installed, You can manually expand the swap partition size.
// Use the root user
# Dd if =/dev/zero of =/home/swap bs = 1024 count = 1024000
// Create a/home/swap partition file. The size is 1024000 blocks. Generally, 1 block is 1 K, so the space here is 1024 M (1G );
// Specify the partition type as swap
// Use the mkswap command to convert the partition into a swap partition:
#/Sbin/mkswap/home/swap
// Make the configured swap take effect
#/Sbin/swapon/home/swap
// Free-m view swap and memory size
# Free-m
// Modify the/etc/fstab file for automatic mounting
#/Home/swap defaults 0 0
6. Connect another client or application server to the oracle database of the current server.
// Prerequisites: the client or application server must install at least the oracle client or the oracle database.
Error message:
> Sqlplus/nolog
SQL> conn'/as sysdba'
Enter the password :******
ERROR:
ORA-12560: TNS: protocol adapter error.

SQL> connect system/manager
ERROR:
ORA-12560: TNS: protocol adapter error // Description: from client or Application Server (linux or WIN)
# Tnsnping 192.168.1.11
# Tnsping oracle10g // resolution required
// Take windows as an example:
C: \ Documents ents and Settings \ Administrator> tnsping 192.168.1.11
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0-Production on 15-2-
14:16:18 2012
Copyright (c) 1997,200 5, Oracle. All rights reserved.
Used parameter files:
D: \ oracle \ product \ 10.2.0 \ db_1 \ network \ admin \ sqlnet. ora
Alias resolved using EZCONNECT Adapter
Attempting to contact (DESCRIPTION = (CONNECT_DATA = (SERVICE_NAME = 192.168.1.11) (AD
DRESS = (PROTOCOL = TCP) (HOST = 192.168.1.11) (PORT = 1521 )))
OK (20 ms)
Bytes -----------------------------------------------------------------------------------------
7. Connect the client to an oracle configuration file instance: (see attachment)
A: listener. ora
# Listener. ora Network Configuration File: D: \ oracle \ product \ 10.2.0 \ db_1 \ network \ admin \ listener. ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D: \ oracle \ product \ 10.2.0 \ db_1)
(PROGRAM = extproc)
)
) LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1 ))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.11) (PORT = 1521 ))
)
) B: sqlnet. ora
# Sqlnet. ora Network Configuration File: D: \ oracle \ product \ 10.2.0 \ db_1 \ network \ admin \ sqlnet. ora
# Generated by Oracle configuration tools. # This file is actually generated by netca. But if MERs choose
# Install "Software Only", this file wont exist and without the native
# Authentication, they will not be able to connect to the database on NT. SQLNET. AUTHENTICATION_SERVICES = (ETS) NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT) C: tnsnames. ora
# Tnsnames. ora Network Configuration File: D: \ oracle \ product \ 10.2.0 \ db_1 \ network \ admin \ tnsnames. ora
# Generated by Oracle configuration tools. SHZQ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.11) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shzq)
)
) EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1 ))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
8. oracle installation is complete. The system comes with the user and password // internal/oracle
// Sys/change_on_install
// System/manager
// Scott/tiger
// Sysman/oem_temp 3. Use PLSQL Developer to manage linux Oracle servers
1. Log On 2. Use 3. Function Description:
// 1. This article does not focus on oracle installation, but on Troubleshooting during oracle installation.
// 2. debug after installation (this article only provides technical support for MAIL: linuxhzg # qq.com # Replace @)
// 3. Use of clients and software
// 4. Next time update the tomcat application to connect to the oracle database
// 5. I recommend Oracle Database 11g Database Management art only to readers without any advertisement!


This article is from the "Han Feng" blog

Listen instance configuration 1 http://up.2cto.com/2012/0217/20120217042815985.zip
Listen instance configuration 2 http://up.2cto.com/2012/0217/20120217042816102.zip
Listen to instance configuration 3 http://up.2cto.com/2012/0217/20120217042816597.zip
 

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.