CentOS6.5 under ORACLE11G-R2 installation, uninstall

Source: Internet
Author: User
Tags locale uuid iptables

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

First, hardware requirements
The content commands in this section are executed by the root user.
1. Memory
Recommended memory should be greater than 2G, 1G can run, but more difficult.
Memory View command:
[Email protected]/]# Cat/proc/meminfo
Or
[Email protected]/]# 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 partition
Swap partition size, usually set to more than 1.5 times times the memory, can also be adjusted according to the actual situation.
Swap partition View command:
[[email protected]/]# grep swaptotal/proc/meminfo
swaptotal:67682296 KB
3. Hard disk space
It is recommended that the data use a separate mount partition, with/data as the data partition in this article. Require/tmp directory space is not less than 400M.
Disk Space View command:
[Email protected]/]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/vg_tsprlsdbserver-lv_root 50G 4.3G 43G 10%/
Tmpfs 16G 348K 16G 1%/DEV/SHM
/DEV/SDA1 485M 39M 421M 9%/boot
/dev/mapper/vg_tsprlsdbserver-lv_home 210G 190M 199G 1%/Home
/DEV/SDB1 1.1T 4.5G 1.1T 1%/data

Directory Space size view command:
[Email protected] tmp]# du-ch/tmp

Second, the software requirements
1. Install dependent packages
When installing the system, it is recommended to select the development library. CentOS6.5 (x64) After installing 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 to uninstall libgcc-4.4.7-4.el6.x86_64.rpm, so file is unloaded from the/lib64 before the backup, in case of accidental deletion of use)
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: The above installation package, I searched for a long time before finishing the collection completely. Uploaded to Csdn, no resources required. When installing the above Resource pack on a 64-bit CentOS6.5, you need to uninstall the original 64-bit installation package, and then install the uninstalled 64-bit installation package (the 64-bit installation package, which can also be found on the installation CD) after the installation is successful. 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, it is important to note that when uninstalling libgcc-4.4.7-4.el6.x86_64, the libgcc_s.so.1 in the/lib64 directory is uninstalled, and the file is restored after successful uninstallation. The above-mentioned dependency package libgcc-3.4.6-3.i386.zip contains my system backup package.
  If a dependent package is missing, you can use the RPM command to view, install offline, and install the appropriate installation package online. Take the GCC package as an example:
View the installation package, install the command:
[[[email protected] tmp]# rpm-qa|grep gcc
  offline install command:
[[email  Protected] tmp]# RPM–IVH gcc-***.rpm
  Online installation command:
[[email protected] tmp]# yum install gcc
  Note: Depending on the system check results, determine what installation package your system needs to install.

Third, the environment configuration
1. Create an Oracle installation user
A. Create A Oinstall Group
[Email protected] tmp]# Groupadd Oinstall
B. Create a DBA Group
[[email protected] tmp]# Groupadd DBA
C, create a new user Oracle, set its primary group to Oinstall, and the sub-group as DBA
[Email protected] tmp]# useradd-g oinstall-g dba Oracle
D. View Create User ID information
[[email protected] tmp]# ID Oracle
E. Set the Oracle user password
[Email protected] tmp]# passwd Oracle

2. Setting User Environment variables
Oracle software will be installed using Oracle users, the home directory is/home/oracle, and if installed in a custom path, you need to create a path and set its run permissions.
To modify the user environment variable file/home/oracle/.bash_profile, execute the command:
[Email protected] 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
Execute the source command to make the environment variable parameters effective
[Email protected] oracle]# Source/home/oracle/.bash_profile
To view the environment variable parameters command:
[Email protected] oracle]# env | More

3, modify the system core and environmental parameters
A. Modify Kernel parameters
Execute the following command to modify the configuration file/etc/sysctl.conf
[Email protected] 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: Kernel.shmmax and Kernel.shmmax parameters, should keep the system unchanged, if necessary, can be suitably adjusted to large.
Execute the command sysctl to make the kernel parameters effective:
[Email protected] oracle]# sysctl–p

B, modify the number of processes and the maximum number of sessions
Execute the following command to modify the configuration file/etc/security/limits.conf
[Email protected] oracle]# vi/etc/security/limits.conf
Add the following information at the end of the file:
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 1024
Oracle Hard Nofile 65536

C. Setting Up Association Information
Execute the following command to modify the associated file/etc/pam.d/login
[Email protected] oracle]# Vi/etc/pam.d/login
Add the following information at the end of the file:
Session Required Pam_limits.so

D, modify the system startup environment parameters
Execute the following command to modify the system boot environment parameter file/etc/profile
[Email protected] 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 parsing information
Execute command, modify/etc/hosts file
[Email protected] ~]# vi/etc/hosts
Add the following information at the end of the file:
192.168.30.203 Tsp-rls-dbserver

F, data partition mount
In this article, the database installation is described, and the data file system uses a separate data partition. Therefore, you need to execute the Mount command to add the partition mount information.
Manually mounted, you need to execute the following command:
To view the disk partition information command:
[Email protected] oracle]# fdisk–l
Executes the mount command, hangs on the SDB1 partition, to/data (the directory needs to be pre-created):
[Email protected] oracle]# Mount/dev/sdb1/data
Execute the umount command to cancel the Mount partition:
[Email protected] oracle]# Umount/data
To view the Mount partition results command:
[Email protected] oracle]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/vg_tsprlsdbserver-lv_root 50G 4.3G 43G 10%/
Tmpfs 16G 348K 16G 1%/DEV/SHM
/DEV/SDA1 485M 39M 421M 9%/boot
/dev/mapper/vg_tsprlsdbserver-lv_home 210G 190M 199G 1%/Home
/DEV/SDB1 1.1T 4.5G 1.1T 1%/data

To view the system partition UUID method:
[Email protected] oracle]# Blkid
Or
[Email protected] oracle]# ls-l/dev/disk/by-uuid
Total dosage 0
lrwxrwxrwx. 1 root root 10 July 12:18 0a99941d-8caa-4e3a-9645-a0239dd385f1. /.. /dm-0
lrwxrwxrwx. 1 root root 10 July 12:20 3d9b7f12-0690-48d2-ae9a-004956dc5072. /.. /sdb1
lrwxrwxrwx. 1 root root 10 July 12:18 A292586a-9cfb-45c5-88f3-5c9530e65dae. /.. /dm-1
lrwxrwxrwx. 1 root root 10 July 12:18 a486566b-272d-4de7-a852-72fcfc6e7a1a. /.. /dm-2
lrwxrwxrwx. 1 root root 10 July 12:18 f4ab21a5-f068-428c-85ae-b9f2ec1ac640. /.. /sda1

Execute the following command to modify the system partition file/etc/fstab to automatically mount the partition when the system starts:
[Email protected] oracle]# Vi/etc/fstab
Add the following information to the file (using the SDB1 uuid):
Uuid=3d9b7f12-0690-48d2-ae9a-004956dc5072/data EXT4 Defaults 1 2

Iv. Oracle Installation process
Before performing a database installation, it is a good idea to restart the system to ensure that the parameters are set to take effect.
With Oracle users logging in to the system, GUI support is required, and Remote desktop tools such as Xhost, Nomanchine and so on can be used in this article using the Nomachine tool. (if necessary, please download the installation yourself)
1, download ORACLE11GR2 installation files, upload to the server
Execute commands, unzip files, set executable permissions:
[Email protected] soft]$ Unzip Linux.x64_11gR2.zip
[Email protected] soft]$ chmod 755-r./linux.x64_11gr2
2. Log in as Oracle user

3. Set the locale information and run the Oracle Installation Wizard
Because the Oracle Setup Wizard does not recognize the Chinese font, the terminal temporarily sets the locale variable and runs Runinstaller.
[Email protected] linux.x64_11gr2]$ export Lang=en_us
[Email protected] linux.x64_11gr2]$ export Lc_all=en_us
[Email protected] linux.x64_11gr2]$./runinstaller

The following 4-26 steps are omitted, and if necessary, download the Word version in the resources:

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


4. Select the installation type (create DB instance)

5. Installation program type (server Class)

6. Installation Instance selection (Single DB instance)

7. Installation type (custom installation)

8. Select the supported languages (Chinese language support)

9. Database type (Enterprise database)

10. Database installation path (environment variable setting information)

11. Installation detail Path (default)

12. DB instance type (Data Warehouse)

13. Database Instance Service Name

14. Memory configuration (default 40%)

15. Character Set settings (Al32utf8)

16. Security settings (default)

17. Sample data structure (default)

18. Database control Management (default)

19. Database file system (separate data partition:/data/oracle)

20. Automatic database backup (default)

21, database management user password (unified password Settings)

22. Manage and operate account grouping settings (default)

23, installation of pre-inspection information collection (need to pass all, ignore the option, may result in a running exception)

24. Installation and assembly process

25. Database Configuration Summary Information
Management Url:https://tsp-rls-dbserver:1158/em

26. Log in as root user, run configuration script

27. Execute script orainstroot process (/home/oracle/orainventory/orainstroot.sh)
[Email protected] deps]#/home/oracle/orainventory/orainstroot.sh
changing permissions of/home/oracle/orainventory.
Adding read,write permissions for group.
Removing Read,write,execute permissions for the 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)
[Email protected] deps]#/home/oracle/app/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script ...

The following environment variables is set as:
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'll be added to The/etc/oratab file as needed by
Database Configuration Assistant When a database is created
Finished running generic part of root.sh script.
Now product-specific root actions would be performed.
Finished product-specific root actions.

29. Complete Installation
Management Url:https://tsp-rls-dbserver:1158/em

30. Open firewall port (1521, 1158)
Execute command:
[[email protected] deps]#/sbin/iptables-i input-p TCP--dport 1521-j ACCEPT
[[email protected] deps]#/sbin/iptables-i input-p TCP--dport 1158-j ACCEPT
Save Settings command:
[Email protected] deps]#/etc/rc.d/init.d/iptables Save
To view the Port Open command:
[Email protected] deps]#/etc/init.d/iptables status
Restart Firewall service
[Email protected] deps]#/etc/rc.d/init.d/iptables restart

31. Automatic start of Oracle service configuration on Boot
A. Modify Dbstart and Dbshut scripts
[Email protected] ~]$ VI $ORACLE _home/bin/dbstart
[Email protected] ~]$ VI $ORACLE _home/bin/dbshut
Locate the oracle_home_listner=$1 in the file and modify it to: oracle_home_listner= $ORACLE _home
B. Modify the Oratab file
[Email protected] ~]$ Vi/etc/oratab

Will Oratsp:/home/oracle/app/product/11.2.0/dbhome_1:n
Modified to: Oratsp:/home/oracle/app/product/11.2.0/dbhome_1:y

C, modify the rc.local file (root user)
[Email protected] 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. Oracle Offload
1. Stop Monitoring Service (Oracle User login)
[[email protected] ~]$ Lsnrctl stop
2. Stop the database

3. Remove the Oracle installation path (root user login)
[Email protected] deps]# Rm-rf/home/oracle/app
[Email protected] deps]# rm-rf/home/oracle/orainventory

4. Delete the system path file (root user login)
[Email protected] deps]# Rm-rf/usr/local/bin/dbhome
[Email protected] deps]# rm-rf/usr/local/bin/oraenv
[Email protected] deps]# rm-rf/usr/local/bin/coraenv

5. Delete the DB instance table (root user login)
[Email protected] deps]# Rm-rf/etc/oratab

6. Delete the DB instance lock file (root user login)
[Email protected] deps]# Rm-rf/etc/orainst.loc

7. Delete the Oracle user and user group (root user login)
[Email protected] deps]# Userdel-r Oracle
[Email protected] deps]# Groupdel Oinstall
[[email protected] deps]# Groupdel DBA

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.