In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Due to business migration, oracle DB needs to be redeployed. This article is for the deployment record only. The deployment document mainly refers to the official document http://docs.oracle.com/cd/E11882_01/install.112/e47689/toc.htm.
Summary:
Host: OpenStack CVM
System: Completing a Minimal Linux centos 6.8 x8664
DB:Oracle Database 11g Release 2
Memory: 2Gb
Hard disk: / dev/vda 20Gb
/ dev/vdb 30Gb
Swap:0
A system requires:
Oracle DB is installed using a graphical interface, which requires that the system must support a graphical interface.
Note: as explained here, graphical interface installation is not required. ORACLE also supports command line installation, but does not seem to be able to customize the installation
For Linux installed with Minimal, there is no graphical interface by default. Install X Window System using the following command
# yum groupinstall-y "Desktop"X Window System"
Second, to be able to connect remotely to the system, openssh-server is required. The following command confirms that there is no installation.
# rpm-qa | grep ssh#yum install openssh-server
Confirm that the system firewall allows ssh ports to pass through
The graphical interface can be called remotely using the following command
# ssh-X name@example.com
2 hardware requirements:
The system must meet the following minimum hardware requirements
1. Memory:
Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more
Confirm the memory size with the following command
# grep MemTotal / proc/meminfo
Note: the following table describes the relationship between RAM and swap space
RAMSwap Space1 GB
< RAM < 2 GB1.5 倍RAM大小2 GB < RAM < 16 GB等于 RAM 实际大小 RAM >16 GB16 GB
Confirm the Swap space with the following command
# grep SwapTotal / proc/meminfo
View available memory and Swap
# free
Automatic memory management:
Starting with Oracle 11G, the automatic memory management feature requires more shared memory (/ dev/shm) and file descriptors. The size of shared memory is larger than the parameters of memory_max_target and memory_target for each instance. If the parameter is set to non-zero or an incorrect size, it will cause oracle to launch Times wrong ora-00845.
The following command confirms the shared available capacity:
# df-h / dev/shm/
In case of ora-00845 error, increase the size of / dev/shm mount point.
For example:
# mount-t tmpfs shmfs-o size=7g / dev/shm
Add an entry in / etc/fstab:
Shmfs / dev/shm tmpfs size=7g 0
two。 System architecture:
Confirm that the system can run oracle
Uname-m
3. Disk space:
/ tmp:1Gb free space
View available space
Df-h / tmp
Note: if the free space does not meet the requirements, the TMP and TMPDIR environment variables of the oracle user can be configured.
The following tables describe the disk space requirements for software files and data files for each installation type on Linux x86-64:
Installation TypeRequirement for Software Files (GB) Enterprise Edition4.7Standard Edition4.6
Installation TypeDisk Space for Data Files (GB) Enterprise Edition1.7Standard Edition1.5
The following command confirms the available disk space
# df-h
Display:
Oracle 11G R2 requires a resolution of not less than 10240768
Confirm the system version:
# cat / proc/version or # lsb_release
Confirm the kernel:
# uame-r2.6.32-573.el6.x86_64
Dependency package:
Oracle Linux 6, Red Hat Enterprise Linux 6 And Asianux Server 4The following packages (or later versions) must be installed:binutils-2.20.51.0.2-5.11.el6 (x86'64) compat-libcap1-1.10-1 (x86'64) compat-libstdc++-33-3.2.3-69.el6 (x86'64) compat-libstdc++-33-3.2.3-69.el6.i686gcc-4.4.4-13.el6 (x86'64) gcc-c++-4.4.4-13.el6 (x86'64) ) glibc-2.12-1.7.el6 (i686) glibc-2.12-1.7.el6 (x86'64) glibc-devel-2.12-1.7.el6 (x86'64) glibc-devel-2.12-1.7.el6.i686kshlibgcc-4.4.4-13.el6 (i686) libgcc-4.4.4-13.el6 (x86'64) libstdc++-4.4.4-13.el6 (x86'64) libstdc++-4.4.4-13.el6 .i686libstdc + +-devel-4.4.4-13.el6 (x86 / 64) libstdc++-devel-4.4.4-13.el6.i686libaio-0.3.107-10.el6 (x86 / 64) libaio-0.3.107-10.el6.i686libaio-devel-0.3.107-10.el6 (x86 / 64) libaio-devel-0.3.107-10.el6.i686make-3.81-19.el6sysstat-9.0.4-11.el6 (x86 / 64)
The following command confirms whether to install the dependency package:
# rpm-Q package_name
Three preparations:
Create a swap partition:
Since the swap is not assigned by default in the private CVM system, the swap needs to be established manually.
1. Create a 2G swap partition
# dd if=/dev/zero of=/mnt/swap bs=1M count=2048
two。 Set up swap partition files
# mkswap / mnt/swap
3. Enable swap Partition
# swapon / mnt/swap
4. Set up boot mount swap partition
# echo "/ mnt/swap swap swap defaults 0" > > / etc/fstab
Install the dependency package:
Sudo yum install binutils\ compat-libcap1\ compat-libstdc++-33\ compat-libstdc++-33.i686\ gcc\ gcc-c++\ glibc\ glibc-devel\ glibc-devel.i686\ ksh\ libgcc\ libstdc++\ libstdc++.i686\ libstdc++-devel\ libstdc++-devel.i686\ libaio\ libaio.i686\ libaio-devel\ libaio-devel.i686\ make\ sysstat\ unixODBC.i686\ unixODBC-devel
Adjust kernel parameters:
The following kernel values are the minimum values that satisfy the operation of oracle. For example, in a production system, it is recommended that you adjust these values to optimize the system. For kernel parameter information, check the operating system file
1. Edit the / etc/sysctl.conf file to modify the following parameter values
Fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 4294967295kernel.shmmni = 4096kernel.sem = 25032000100 128net.ipv4.ip_local_port_range = 900065500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576
two。 Update kernel current value
# / sbin/sysctl-p
3. Confirm kernel value update
# / sbin/sysctl-a
4. After updating the kernel parameter values, restart the system or run the command so that the changes to / etc/sysctl.conf take effect immediately
Cluster shared disk verifies the cvuqdisk package. Here, the local directory is used as the data directory, and there is no explanation for cvuqdisk.
Hostname resolution:
1. View hostname
# cat / etc/sysconfig/networkNETWORKING=yesHOSTNAME=dev-oracle.novalocalNOZEROCONF=yes
two。 Edit the / etc/hosts file and add the following line
127.0.0.1 dev-oracle.novalocal
3. Confirm that the hostname resolution is successful
# ping-c 3 dev-oracle.novalocalPING dev-oracle.novalocal (127.0.0.1) 56 (84) bytes of data.64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.109 ms64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.109 ms64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.054 ms
Close transparent_hugepage
Linux 6 transparent_hugepage is enabled by default. A problem with dynamic memory allocation may cause delays in memory allocation. Therefore, oracle recommends that you disable transparent_hugepage to avoid performance problems.
Red Hat Linux kernels:
# cat / sys/kernel/mm/redhat_transparent_hugepage/enabled
Other kernels
# cat / sys/kernel/mm/transparent_hugepage/enabled
The following output indicates that the
[always] madvise never
Disable transparent_hugepage
Add the following entry to the kernel boot file / etc/grub.conf
Transparent_hugepage=never
Such as:
Title CentOS (2.6.32-642.4.2.el6.x86_64) root (hd0,0) kernel / boot/vmlinuz-2.6.32-642.4.2.el6.x86_64 ro\ root=UUID=4b816de7-ec12-431c-a571-5f3d828bf0e1 rd_NO_LUKS rd_NO_LVM\ LANG=en_US.UTF-8 rd_NO_MD console=ttyS0,115200 SYSFONT=latarcyrheb-sun16\ crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet\ transparent_hugepage=never initrd / boot/initramfs- 2.6.32-642.4.2.el6.x86_64.img
Restart the system takes effect
Create system users and groups:
Separation of role permissions:
Oracle recommends that you create an owner with software installation permissions.
Create separate users and groups with the same permissions for independent operations
Dba
This group must be created when the Oracle database is installed on the system for the first time. This group identifies that the operating system user has permission to manage the database (sysdba privilege)
Oper
This is an optional group. If you want to create a limited database administration permission, create this group.
Create groups and users with separate roles:
Create an oinstall group
# groupadd oinstall
Create a dba group
# groupadd-g 502 dba
Create a per group
Groupadd-g 503 oper
Create a software owner user
1. Create an Oracle user
# useradd-u 502-g oinstall-G dba,oper oracle
two。 Set user password
# passwd oracle
Check the resource limits of the installation user:
Refer to the following recommended range values
Resource Shell LimitResourceSoft LimitHard Limit
Open file descriptors
Nofile
At least 1024
At least 65536
Number of processes available to a single user
Nproc
At least 2047
At least 16384
Size of the stack segment of the process
Stack
At least 10240 KB
At least 10240 KB, and at most 32768 KB
1. Log in using the installation user
two。 Check file descriptors, soft and hard limits. Make sure the results are within the recommended range
$ulimit-Sn1024 $ulimit-Hn65536
3. Check the user process limit. Make sure the results are within the recommended range
$ulimit-Su2047 $ulimit-Hu16384
4. Check the stack settings. Make sure it is within the recommended range
$ulimit-Ss10240 $ulimit-Hs32768
Edit / etc/security/limits.conf adds the following parameters to the end of the file, and the adjustable limit
* soft nofile 65535 * hard nofile 65535oracle soft nproc 2047oracle hard nproc 16384oracle soft stack 10240
Create a directory
Log in using the root user
Create the Oracle root directory
Here is the user directory, which is set according to the user name. If your user name is ora, replace oracle with ora
# mkdir-p / data/app/oracle#chown-R oracle:oinstall / data/app/oracle#chmod-R 775 / data/app/oracle
Create a database file directory (for automatic storage)
# mkdir / data/oradata#chown oracle:oinstall / data/oradata#chmod 775 / data/oradata
Create a recovery file directory (quick recovery for automatic storage)
# mkdir / data/fast_recovery_area#chown oracle:oinstall / data/fast_recovery_area#chmod 775 / data/fast_recovery_area
Set language
$export LANG=en_US.UTF-8
Install in English to prevent garbled
Or download the Chinese font zysong.ttf and put it in the / usr/share/fonts/zh_CN/TrueType directory, then you can install it in Chinese language.
$export LANG=zh_CN.UTF-8
Set up the user environment
This environment variable can be set after the database installation is complete and the database instance is established
ORACLE_BASE: root directory for database user
ORACLE_HOME: installation directory for the actual database software
ORACLE_SID: the name of the actual database instance
$vim ~ / .bash_profilePATH=$PATH:$HOME/binexport PATHumask 022export ORACLE_BASE=/data/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export PATH=$PATH:$ORACLE_HOME/binexport ORACLE_SID=orcl
Fourth, install oracle:
Open a remote window by using ssh-X to call support to connect to the server as an oracle user
Execute the database installation script
/ runInstallerStarting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 10608 MB PassedChecking swap space: must be greater than 150 MB. Actual 2047 MB PassedChecking monitor: must be configured to display at least 256 colors. Actual 16777216 PassedPreparing to launch Oracle Universal Installer from / tmp/OraInstall2016-09-12 08-22-04PM. Please wait...
The client will pop up the graphical installation interface and follow the graphical interface prompts to install step by step.
Note that there are two options for installation
One is to install and configure the database, and the other is to install only the database. This case chooses to install and configure the database by default
There is not much difference between the two installation methods, and there are instructions in the graphical interface.
Choose to install only the database. After installation, execute the `dbca` command to call the graphical interface to create the database, and the `netca` command to call the graphical interface to create monitoring. For more information, please see http://dengqsintyt.iteye.com/blog/1991930/ in the second half of this link.
Uncheck the box. If you do not purchase oracle support in the next step, it will all be empty.
Yes, continue.
Create and configure the database by default
Select a server class
Single instance mode
Advanced installation mode
Default language
Enterprise Edition is selected by default
Oracle Base: select the oracle root directory
Software Location: select the software installation directory
Default is generic / transaction handling
Database name and service name. The ORACLE_SID should be the same when configuring the user environment
Turn on automatic memory management
Set the encoding to UTF8
Enable Oracle Enterprise Management console OEM
Select the database file directory, and select the previously established database file directory / data/oradata
Automatic backup setting, production environment is recommended to enable, select the previously established quick recovery directory / data/fast_recovery_area
Set the database user and password, you can set a separate password for each user, or you can choose the following Use the same password for all accounts to use a unified password
Select an authorized group, which is generally fine by default. If an oper group has been created previously, OSOPER should select the oper group.
Check the installation requirements and confirm that the relevant packages have been installed. You can choose "Ignore All" to ignore them directly, otherwise you can't continue. It is shown here that the missing package is due to a problem with the version
After the installation, the following window will pop up. Click the red circle to reset the user's password.
Finally, the following window pops up, using the root user to execute two scripts
# / bin/sh / data/app/oraInventory/orainstRoot.shChanging permissions of / data/app/oraInventory.Adding read,write permissions for group.Removing read,write Execute permissions for world.Changing groupname of / data/app/oraInventory to oinstall.The execution of the script is complete.# / bin/sh / data/app/oracle/product/11.2.0/dbhome_2/root.shRunning Oracle 11g root.sh script...The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= / data/app/oracle/product/11.2.0/dbhome_2Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.Finished product-specific root actions.
The installation is all over
How to add oracle to the system service, please refer to the previous document http://morrowind.blog.51cto.com/1181631/1696145
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.