Troubleshooting of TNS errors after centos oracle10 is installed and restarted

Source: Internet
Author: User

During idle hours in the last two nights, I started to integrate some things on the Linux platform. Today I am going to install the Oracle database below. I have also seen many excellent posts on the Internet, refer to their methods and record their operations so that they can be consulted later. I also hope that they can be consulted on my blog.

I use Linux as the operating system. As for the installation process of the system, I will not mention it. The installation process development kit and development tools of Linux are mandatory. To install Oracle, we also need old software development tools, therefore, you must select this option.

I. Preparations for the System Environment

First, run

Rpm-q gcc make binutils openmotif setarch compat-DB compat-GCC compat-gcc-C ++ compat-libstdc ++-devel, if there is a prompt that the installation is not installed, add the required information to the installation. After the installation, the following prompt may be displayed. Check the online information. It is said that the RPM package is a bug. You can ignore this.

Package compat-gcc-C ++ Is Not Installed

Package compat-libstdc ++ Is Not Installed

The official requirements for Oracle are as follows:

The minimum Ram required is 512 MB, and the minimum swap space required is 1 GB. For systems with Ram less than or equal to 2 GB, the swap space should be twice the number of Ram; for systems with Ram greater than 2 GB, the swap space should be one to two times the number of RAM. We can use the following command to view the memory and virtual memory of the current system:
# Grep memtotal/proc/meminfo
Memtotal: 2067248 KB
# Grep swaptotal/proc/meminfo
Swaptotal: 4096564 KB

Oracle 10 Gb software also requires 2.5 GB of available disk space, while the database requires an additional 1.2 GB of available disk space. The/tmp directory requires at least 400 mb of available space. We can use the following command to view the disk space:
# DF-H

Configure Linux Kernel Parameters
The Linux kernel is excellent. Unlike most other * nix systems, Linux allows you to modify most Kernel Parameters during system startup and runtime. You do not have to restart the system after the Kernel Parameter is changed. The following Kernel Parameter settings are required for Oracle Database 10 GB. The minimum value is given, so if your system uses a large value, do not change it.
# Add VI/etc/sysctl. conf to the end
Kernel. SEM = 250 32000 100 128 # semaphore
FS. File-max = 65536 # maximum number of file handles allocated by Linux
Net. ipv4.ip _ local_port_range = 1024 65000 # port number range (default value: 1024 ~ 4999
Net. Core. rmem_default = 262144
Net. Core. rmem_max = 262144
Net. Core. wmem_default = 262144
Net. Core. wmem_max = 262144
Run the configuration above the/sbin/sysctl-P application.

Create an oracle user account
Next, create a Linux Group and user account for installing and maintaining the Oracle 10g software. User accounts are called Oracle, while groups are called oinstall and DBA. Run the following command as the root user:
#/Usr/sbin/groupadd oinstall
#/Usr/sbin/groupadd DBA
#/Usr/sbin/useradd-m-g oinstall-g dba Oracle

Create an Oracle Installation Directory

# Mkdir-P/u01/APP/Oracle
# Chown-r ORACLE: oinstall/u01/APP/Oracle
# Chmod-r 775/u01/APP/Oracle

Set shell restrictions for oracle users

Add the following content to the/etc/security/limits. conf file to modify the number of processes and files that a single user can use.
# Add VI/etc/security/limits. conf to the end
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

# Vi/etc/PAM. d/login Add the followingCode:
Session required/lib/security/pam_limits.so

# Vi/etc/SELinux/config ensure the following content
SELinux = disabled

Because Oracle 10 Gb does not support centos, modify centos 5
# Vi/etc/RedHat-release
Redhat-4

Modify Oracle user. bash_profile
# Su-Oracle

$ VI./. bash_profile

Add
Export oracle_base =/u01/APP/Oracle
Export ORACLE_HOME = $ oracle_base/product/10.2.0.1
Export oracle_sid = orcl
Export Path = $ path: $ home/bin: $ ORACLE_HOME/bin
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib

If [$ user = "oracle"]; then
If [$ shell = "/bin/KSh"]; then
Ulimit-P 16384
Ulimit-N 65536
Else
Ulimit-u 16384-N 65536
Fi
Fi

2. Start Installation
Log out and Log On As an oracle user (if you do not log on again and directly switch to the Oracle user for installation through "Su-Oracle" on the terminal, the installation may fail due to a display setting error)

Open a terminal and run the following command to start Installation
# Unzip 10201_database_linux32.zip

# CD database

#./Runinstaller

If you still encounter errors during the installation process, some packages should not be installed. In this case, you do not have to terminate the installation process, but open another terminal, check and install the packages mentioned above as the root user. If these packages are installed, go back to Oracle for installation.ProgramClick "retry" in the error prompt box to continue the installation until the installation is successful.

After installation, the orcl database is started. You can configure netmanager on other machines to test whether the connection can be established. If the Oracle client is not installed on other machines, you can also run the Telnet command to test whether port 1521 can be connected.

Telnet 127.0.0.1: 1521

If you enter the black screen, it basically means that port 1521 is accessible, that is, your Orale can be used normally.
If the connection fails, it may be a firewall problem. Open System/management/security level and firewall in the server menu, and then add port 1521.

 

After restarting the ORA-12514: TNS: Listener does not currently know of Service requested in connect descriptor:

VI/usr/local/Oracle/product/10.2.0.1/Network/admin/listener. ora

Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = plsextproc)
(ORACLE_HOME = E: \ oracle \ product \ 10.1.0 \ db_1)
(Program = EXTPROC)
)
)

Changed:
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = plsextproc)
(ORACLE_HOME = E: \ oracle \ product \ 10.1.0 \ db_1)
(Program = EXTPROC)
)
(Sid_desc =
(Global_dbname = orcl)
(ORACLE_HOME = E: \ oracle \ product \ 10.1.0 \ db_1)
(Sid_name = orcl)
)
)

 

1) Start the script (dbstart. SH) LSNRCTL start sqlplus/nolog <EOF connect/As sysdba startup; exit EOF $ sh dbstart. sh. 2) disable the script (dbstop. SH) LSNRCTL stop sqlplus/nolog <EOF connect/As sysdba shutdown immediate; exit EOF $ sh dbstop. sh.

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.