CentOS6.5 Oracle11G-R2 installation, uninstall, linuxoracle11gr2

Source: Internet
Author: User

CentOS6.5 Oracle11G-R2 installation, uninstall, linuxoracle11gr2

CentOS6.5 Oracle11G-R2 installation, uninstall
Resources (including all my installation processes, system backup files): http://download.csdn.net/detail/attagain/7700437

I. Hardware requirements
Commands in this section are executed as root users.
1. Memory
It is recommended that the memory should be larger than 2 GB, and 1 GB can be run, but it is difficult.
Memory view command:
[Root @ tsp-rls-dbserver/] # cat/proc/meminfo
Or
[Root @ tsp-rls-dbserver/] # free-m
Total used free shared buffers cached
Mem: 32062 1301 30760 0 40 552
-/+ Buffers/cache: 708 31354
Swap: 16095 0 16095
2. Swap partitions
Swap partition size, usually set to more than 1.5 times of memory, can also be adjusted according to the actual situation.
Command for viewing swap partitions:
[Root @ tsp-rls-dbserver/] # grep SwapTotal/proc/meminfo
SwapTotal: 67682296 kB
3. Hard Disk Space
We recommend that you use independent Mount partitions for data./data is used as the data Partition in this article. The/tmp directory space must be no less than 400 mb.
Disk Space viewing command:
[Root @ tsp-rls-dbserver/] # df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/vg_tsprlsdbserver-lv_root 50G 4.3G 43G 10%/
Tmpfs 16G 348 K 16G 1%/dev/shm
/Dev/sda1 485 M 39 M 421 M 9%/boot
/Dev/mapper/vg_tsprlsdbserver-lv_home 210G 190 M 199G 1%/home
/Dev/sdb1 1.1 T 4.5G 1.1 T 1%/data

Command for viewing the directory space:
[Root @ tsp-rls-dbserver tmp] # du-ch/tmp

Ii. software requirements
1. Install the dependency package
We recommend that you select the development library when installing the system. After CentOS6.5 (x64) installs the development library, the main dependent packages are:
Compat-libstdc ++-33-3.2.3-61.i386.rpm (url: http://download.csdn.net/detail/attagain/7699569)
Compat-libstdc ++-33-3.2.3-69.el6.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7699573)
Libaio-0.3.105-2.i386.rpm (url: http://download.csdn.net/detail/attagain/7700213)
Libaio-0.3.107-10.el6.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7699585)
Libaio-devel-0.3.105-2.i386.rpm (url: http://download.csdn.net/detail/attagain/7700217)
Libaio-devel-0.3.105-2.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7700247)
Libgcc-3.4.6-3.i386.zip (url: http://download.csdn.net/detail/attagain/7699599 contains: libgcc-3.4.6-3.i386.rpm, libgcc_s-4.4.7-20120601.so.1, libgcc_s.so.1, install this file, first you need to uninstall the libgcc-4.4.7-4.el6.x86_64.rpm, so file is backed up from/lib64 before detaching for accidental deletion)
Libgcc-4.4.7-4.el6.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7700201)
Libstdc ++-3.4.6-11. i386.rpm (url: http://download.csdn.net/detail/attagain/7700169)
Libstdc ++-devel-3.4.6-3.1.i386.rpm (url: http://download.csdn.net/detail/attagain/7699847)
Libstdc ++-4.4.7-4. el6.x86 _ 64.rpm( url: http://download.csdn.net/detail/attagain/7699837)
Pdksh-5.2.14-37.el5_8.1.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7700147)
UnixODBC-2.2.11-7.1.i386.rpm (url: http://download.csdn.net/detail/attagain/7700007)
UnixODBC-2.2.11-7.1.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7700021)
UnixODBC-devel-2.2.11-7.1.i386.rpm (url: http://download.csdn.net/detail/attagain/7699903)
UnixODBC-devel-2.2.11-7.1.x86_64.rpm (url: http://download.csdn.net/detail/attagain/7699907)

Note: I have searched the installation package for a long time to complete the collection. It has been uploaded to csdn and does not require resource splitting. To install the preceding resource package on 64-bit CentOS6.5, you must first uninstall the original 64-bit installation package and then install the uninstalled 64-bit installation package (the preceding 64-bit installation package, you can also find it on the installation disc ). When uninstalling the original 64-bit dependency package, it is recommended to use the parameter -- nodeps, such as: rpm-e libaio-0.3.107-10.el6.x86_64-nodeps. In addition, you need to pay special attention to, when uninstalling the libgcc-4.4.7-4.el6.x86_64, will be in the/lib64 directory libgcc_s.so.1 unmount, after successful uninstallation, but also restore the file. The dependency package libgcc-3.4.6-3.i386.zip contains my system backup package.
If the dependency package is missing, you can use the rpm command to view, install it offline, and install the corresponding installation package online. Take the gcc package as an example:
Check the installation package and whether to install the command:
[Root @ tsp-rls-dbserver tmp] # rpm-qa | grep gcc
Offline installation command:
[Root @ tsp-rls-dbserver tmp] # rpm-ivh gcc-***. rpm
Online installation command:
[Root @ tsp-rls-dbserver tmp] # yum install gcc
Note: Determine the installation package to be installed based on the system check results.

Iii. Environment Configuration
1. Create an oracle Installation user
A. Create an oinstall Group
[Root @ tsp-rls-dbserver tmp] # groupadd oinstall
B. Create a dba group
[Root @ tsp-rls-dbserver tmp] # groupadd dba
C. Create an oracle user, set the master group to oinstall, And the slave group to dba.
[Root @ tsp-rls-dbserver tmp] # useradd-g oinstall-G dba oracle
D. view the information of the created user ID.
[Root @ tsp-rls-dbserver tmp] # id oracle
E. Set the oracle user password
[Root @ tsp-rls-dbserver tmp] # passwd oracle

2. Set User Environment Variables
The oracle software will be installed by the Oracle user. The main directory is/home/oracle. If the software is installed in a custom path, you need to create a path and set its running permissions.
Modify the user environment variable file/home/oracle/. bash_profile and run the following command:
[Root @ tsp-rls-dbserver oracle] # vi/home/oracle/. bash_profile
Add the following information to the end of the file:
Export ORACLE_SID = ORATSP
Export ORACLE_BASE =/home/oracle/app
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH = $ PATH: $ ORACLE_HOME/bin
Run the source command to make the environment variable parameters take effect.
[Root @ tsp-rls-dbserver oracle] # source/home/oracle/. bash_profile
Run the following command to view environment variable parameters:
[Root @ tsp-rls-dbserver oracle] # env | more

3. Modify system kernel and Environment Parameters
A. Modify Kernel Parameters
Run the following command to modify the configuration file/etc/sysctl. conf:
[Root @ tsp-rls-dbserver oracle] # vi/etc/sysctl. conf
Add the following information at the end of the file:
Fs. file-max = 6815744
Fs. aio-max-nr = 1048576
Net. ipv4.ip _ local_port_range = 9000 65500
Net. core. rmem_default = 262144
Net. core. rmem_max = 4194304
Net. core. wmem_default = 262144
Net. core. wmem_max = 1048576
Kernel. sem = 250 32000 100 128

Note: The kernel. shmmax and kernel. shmmax parameters should remain unchanged. If necessary, increase the value as appropriate.
Run the command sysctl to make the kernel parameters take effect:
[Root @ tsp-rls-dbserver oracle] # sysctl-p

B. modify the number of processes and the maximum number of sessions
Run the following command to modify the configuration file/etc/security/limits. conf:
[Root @ tsp-rls-dbserver oracle] # vi/etc/security/limits. conf
Add the following information at the end of the file:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

C. Set association information
Run the following command to modify the associated file/etc/pam. d/login:
[Root @ tsp-rls-dbserver oracle] # vi/etc/pam. d/login
Add the following information at the end of the file:
Session required pam_limits.so

D. Modify system startup Environment Parameters
Run the following command to modify the system startup environment parameter file/etc/profile:
[Root @ tsp-rls-dbserver oracle] # vi/etc/profile
Add the following information at the end of the file:
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
E. Modify host resolution information
Run the command to modify the/etc/hosts file.
[Root @ tsp-rls-dbserver ~] # Vi/etc/hosts
Add the following information at the end of the file:
192.168.30.203 tsp-rls-dbserver

F. Data Partition mounting
This article describes how to install a database. The data file system uses independent data partitions. Therefore, you need to run the mount command to add partition mounting information.
Run the following command to manually mount a file:
Command for viewing disk partition information:
[Root @ tsp-rls-dbserver oracle] # fdisk-l
Execute the mount command and mount it to the sdb1 partition to/data (this directory needs to be created in advance ):
[Root @ tsp-rls-dbserver oracle] # mount/dev/sdb1/data
Run the umount command to unmount the partition:
[Root @ tsp-rls-dbserver oracle] # umount/data
Command to view the Mount partition result:
[Root @ tsp-rls-dbserver oracle] # df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/vg_tsprlsdbserver-lv_root 50G 4.3G 43G 10%/
Tmpfs 16G 348 K 16G 1%/dev/shm
/Dev/sda1 485 M 39 M 421 M 9%/boot
/Dev/mapper/vg_tsprlsdbserver-lv_home 210G 190 M 199G 1%/home
/Dev/sdb1 1.1 T 4.5G 1.1 T 1%/data

How to view the UUID of a system partition:
[Root @ tsp-rls-dbserver oracle] # blkid
Or
[Root @ tsp-rls-dbserver oracle] # ls-l/dev/disk/by-uuid
Total usage 0
Lrwxrwxrwx. 1 root 10 July 30 12:18 0a99941d-8caa-4e3a-9645-a0239dd1_f1->.../dm-0
Lrwxrwxrwx. 1 root 10 July 30 12:20 3d9b7f12-0690-48d2-ae9a-004956dc5072->.../sdb1
Lrwxrwxrwx. 1 root 10 July 30 12:18 a292586a-9cfb-45c5-88f3-5c9530e65dae->.../dm-1
Lrwxrwxrwx. 1 root 10 July 30 12:18 a486566b-272d-4de7-a852-72fcfc6e7a1a->.../dm-2
Lrwxrwxrwx. 1 root 10 July 30 12:18 f4ab21a5-f068-428c-85ae-b9f2ec1ac640->.../sda1

Run the following command to modify the system partition file/etc/fstab so that partitions are automatically mounted when the system starts:
[Root @ tsp-rls-dbserver oracle] # vi/etc/fstab
Add the following information to the file (using the UUID of sdb1 ):
UUID = 3d9b7f12-0690-48d2-ae9a-004956dc5072/data ext4 ults 1 2

Iv. Oracle Installation Process
Before installing the database, you are advised to restart the system to make sure all the set parameters take effect.
Log on to the system as an oracle user and use remote desktop tools such as xhost and NoManchine. This document uses the NoMachine tool. (If necessary, download and install it on your own)
1. Download The Oracle11GR2 installation file from the official website and upload it to the server.
Run the following command to decompress the file and set the executable permissions:
[Oracle @ tsp-rls-dbserver soft] $ unzip linux.x64_11gR2.zip
[Oracle @ tsp-rls-dbserver soft] $ chmod 755-R./linux. x64_11gR2
2. Log On As an oracle user
 

3. Set the language environment information and run the Oracle Installation Wizard.
Because the oracle Installation Wizard cannot recognize Chinese fonts, the terminal temporarily sets language environment variables and runs runInstaller.
[Oracle @ tsp-rls-dbserver linux. x64_11gR2] $ export LANG = en_US
[Oracle @ tsp-rls-dbserver linux. x64_11gR2] $ export LC_ALL = en_US
[Oracle @ tsp-rls-dbserver linux. x64_11gR2] $./runInstaller
 

The steps 4-26 below are omitted. If necessary, please download the word version from the Resource:

Http://download.csdn.net/detail/attagain/7700437


4. Select the installation type (Create a database instance)
 
5. installer type (server type)
 
6. Select an instance for installation (single database instance)
 
7. Installation type (custom installation)
 
8. Select a supported language (Chinese supported)
 
9. Database Type (enterprise-level database)
 
10. database installation path (environment variable settings)
 
11. installation path (default)
 
12. database instance type (data warehouse)
 
13. database instance service name
 
14. Memory configuration (40% by default)
 
15. Character Set setting (AL32UTF8)
 
16. Security Settings (default)
 
17. Sample Data Structure (default)
 
18. Database Control Management (default)
 
19. Database File System (Independent data Partition:/data/oracle)
 
20. Automatic Database Backup (default)
 
21. Database Management User Password (Unified password settings)
 
22. manage and operate account group settings (default)
 
23. Collect the pre-check information (you must pass all the information and ignore the option, which may cause running exceptions)
 
24. Installation and Installation Process
 
25. Database Configuration Summary
Manage URL: https: // tsp-rls-dbserver: 1158/em
 
26. Log On As the root user and run the configuration script.
 
27. Execute the script orainstRoot process (/home/oracle/oraInventory/orainstRoot. sh)
[Root @ tsp-rls-dbserver deps] #/home/oracle/oraInventory/orainstRoot. sh
Changing permissions of/home/oracle/oraInventory.
Adding read, write permissions for group.
Removing read, write, execute permissions for world.

Changing groupname of/home/oracle/oraInventory to oinstall.
The execution of the script is complete.

28. Execute the script root process (/home/oracle/app/product/11.2.0/dbhome_1/root. sh)
[Root @ tsp-rls-dbserver deps] #/home/oracle/app/product/11.2.0/dbhome_1/root. sh
Running Oracle 11g root. sh script...

The following environment variables are set:
ORACLE_OWNER = oracle
ORACLE_HOME =/home/oracle/app/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to/usr/local/bin...
Copying oraenv to/usr/local/bin...
Copying coraenv to/usr/local/bin...

Creating/etc/oratab file...
Entries will be added to the/etc/oratab file as needed
Database Configuration Assistant when a database is created
Finished running generic part of root. sh script.
Now product-specific root actions will be saved med.
Finished product-specific root actions.

29. Installation Complete
Manage URL: https: // tsp-rls-dbserver: 1158/em

 

30. Open firewall ports (ports 1521 and 1158)
Run the following command:
[Root @ tsp-rls-dbserver deps] #/sbin/iptables-I INPUT-p tcp -- dport 1521-j ACCEPT
[Root @ tsp-rls-dbserver deps] #/sbin/iptables-I INPUT-p tcp -- dport 1158-j ACCEPT
Save setting command:
[Root @ tsp-rls-dbserver deps] #/etc/rc. d/init. d/iptables save
Command to view port opening:
[Root @ tsp-rls-dbserver deps] #/etc/init. d/iptables status
Restart the Firewall Service
[Root @ tsp-rls-dbserver deps] #/etc/rc. d/init. d/iptables restart

31. Automatically Start Oracle service configuration at startup
A. Modify the dbstart and dbshut scripts.
[Oracle @ tsp-rls-dbserver ~] $ Vi $ ORACLE_HOME/bin/dbstart
[Oracle @ tsp-rls-dbserver ~] $ Vi $ ORACLE_HOME/bin/dbshut
Locate ORACLE_HOME_LISTNER =1 1 in the file and change it to ORACLE_HOME_LISTNER = $ ORACLE_HOME.
B. Modify the oratab File
[Oracle @ tsp-rls-dbserver ~] $ Vi/etc/oratab

Set ORATSP:/home/oracle/app/product/11.2.0/dbhome_1: N
Changed to ORATSP:/home/oracle/app/product/11.2.0/dbhome_1: Y.

C. Modify the rc. local file (root User)
[Root @ tsp-rls-dbserver deps] # vi/etc/rc. d/rc. local
Add the following information to the end of the file:
Su oracle-lc "/home/oracle/app/product/11.2.0/dbhome_1/bin/emctl start dbconsole"
Su oracle-lc "/home/oracle/app/product/11.2.0/dbhome_1/bin/lsnrctl start"
Su oracle-lc "/home/oracle/app/product/11.2.0/dbhome_1/bin/dbstart"

V. Uninstall Oracle
1. Stop the listening service (oracle user logon)
[Oracle @ tsp-rls-dbserver ~] $ Lsnrctl stop
2. Stop the database.

3. Delete the oracle installation path (root User Logon)
[Root @ tsp-rls-dbserver deps] # rm-rf/home/oracle/app
[Root @ tsp-rls-dbserver deps] # rm-rf/home/oracle/oraInventory

4. Delete the system path file (root User Logon)
[Root @ tsp-rls-dbserver deps] # rm-rf/usr/local/bin/dbhome
[Root @ tsp-rls-dbserver deps] # rm-rf/usr/local/bin/oraenv
[Root @ tsp-rls-dbserver deps] # rm-rf/usr/local/bin/coraenv

5. Delete the database instance table (root User Logon)
[Root @ tsp-rls-dbserver deps] # rm-rf/etc/oratab

6. Delete the lock file of the database instance (root User Logon)
[Root @ tsp-rls-dbserver deps] # rm-rf/etc/oraInst. loc

7. Delete oracle users and user groups (root User Logon)
[Root @ tsp-rls-dbserver deps] # userdel-r oracle
[Root @ tsp-rls-dbserver deps] # groupdel oinstall
[Root @ tsp-rls-dbserver deps] # groupdel dba


Centos62 fails to install oracle10g. If you want to reinstall it, how can you uninstall it?

To install Oracle in LINUX, you must use an Oracle account. First, go to the Oracle user's home directory and view the. bash_profile file. Go to the directory indicated on the Right of export ORACLE_BASE = and delete the flash_recovery_area, oradata, and oraInventory directories.

In the/usr/local/bin directory, delete the three files: coraenv, dbhome, and oraenv.

Finally, delete the/etc/oratab file.
Now you can reinstall Oracle.

Uninstalling oracle from centos 55

First, use oracle oui to enter the installation interface. There is an installed software on the interface. After opening the software, click the directory to be deleted, select Delete, and then delete the oracle installation directory, delete oracle users and groups.

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.