In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, I have been studying hard about the architecture of Oracle and other theoretical knowledge. I summarize some knowledge here, and I do an experiment here to consolidate the recently learned knowledge.
Experimental environment
Redhat Enterprise Linux 6.5 x 86'64 IP address: 192.168.60.100 Oracle 11g release 11.2.0.4
The installation of the system is skipped here, and the IP address has been changed. First, log in to the RHEL system through ssh protocol, configure the YUM local source environment, and install the necessary software dependency packages for Oracle.
[C:\ ~] $ssh root@192.168.60.100 [root@rhel6 ~] # vi / etc/yum.conf [local] / / modify the local YUM source environment; name=localbaseurl= file:///mntgpgcheck=0enabled=1[root@rhel6 ~] # mount / dev/sr0 / mnt/ Mount the local CD as the YUM source Mount: block device / dev/sr0 is write-protected, mounting read-only [root@rhel6 ~] # yum repolist / / check whether the local YUM source configuration is correct; Loaded plugins: product-id, refresh-packagekit, security,: subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.local | 3.9 kB 00:00... Local/primary_db | 3.1 MB 00:00. Repo id repo name statuslocal local 3690repolist: 3690 [root@rhel6 ~] # yum install binutils-y / / install the necessary software packages for Oracle through YUM [root@rhel6 ~] # yum install compat-libcap1-y [root@rhel6 ~] # yum install compat-libstdc++-33-y [root@rhel6 ~] # yum install gcc- y [root@rhel6 ~] # yum install gcc-c++-y [root@rhel6 ~] # yum install glibc- y [root@rhel6 ~] # yum install glibc-devel-y [root@rhel6 ~] # yum install ksh-y [root@rhel6 ~] # yum install libgcc-y [root@rhel6 ~] # yum install libstdc++- y [root @ rhel6 ~] # yum install libstdc++-devel-y [root@rhel6 ~] # yum install libaio- y [root@rhel6 ~] # yum install libaio-devel-y [root@rhel6 ~] # yum install libXext-y [root@rhel6 ~] # yum install libXtst-y [root@rhel6 ~] # yum install libX11-y [root@rhel6 ~] # yum install libXau-y [root@rhel6 ~] # yum install libxcb-y [root@rhel6 ~] # yum install libXi-y [root@rhel6 ~] # yum install make -y [root@rhel6 ~] # yum install sysstat-y [root@rhel6 ~] # yum install unixODBC- y [root@rhel6 ~] # yum install unixODBC-devel-y
Modify the corresponding system hostname and IP address
[root@rhel6 ~] # vi / etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4192.168.60.100 rhel6
Add appropriate grid users and user groups
[root@rhel6 ~] # groupadd-g 501 oinstall [root@rhel6 ~] # groupadd-g 502 dba [root@rhel6 ~] # groupadd-g 503 oper [root@rhel6] # groupadd-g 504 asmadmin [root@rhel6] # groupadd-g 505 asmoper [root@rhel6 ~] # groupadd-g 506 asmdba [root@rhel6 ~] # useradd-g oinstall-G dba,asmdba,oper oracle [root@rhel6 ~] # useradd-g oinstall-G asmadmin,asmdba,asmoper,oper,dba grid [root@rhel6 ~] # passwd oracle [root@rhel6 ~] # passwd grid
Create an installation directory for Grid Infrastructure components
[root@rhel6 ~] # mkdir-p / u01/app/grid [root@rhel6 ~] # mkdir-p / u01/app/11.2.0/grid [root@rhel6 ~] # chown-R grid:oinstall / U01 [root@rhel6 ~] # mkdir-p / u01/app/oraInventory [root@rhel6 ~] # chown-R grid:oinstall / u01/app/oraInventory [root@rhel6 ~] # mkdir-p / u01/app/oracle [root@rhel6 ~] # chown-R oracle:oinstall / u01 / App/oracle [root@rhel6 ~] # chmod-R 775 / U01
Modify operating system parameters
[root@rhel6 ~] # vi / etc/security/limits.confgrid soft nproc 2047 grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536grid soft stack 10240grid hard stack 32768oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle hard stack 32768
Modify Linux server ulmits restrictions
[root@rhel6 ~] # vi / etc/security/limits.d/90-nproc.conf#* soft nproc 1024 *-nproc 16384
Disable SELINUX security restrictions
[root@rhel6 ~] # vi / etc/selinux/configSELINUX=disabled / / modify the configuration file to permanently close selinux; [root@rhel6 ~] # setenforce 0
Turn off IPTABLES Firewall
[root@rhel6 ~] # service iptables stopiptables: Setting chains to policy ACCEPT: filter [OK] iptables: Flushing firewall rules: [OK] iptables: Unloading modules: [OK] [root@rhel6 ~] # chkconfig-- level 35 iptables off / / 3, level 5 permanently close iptables
Modify the login configuration file of Linux operating system
[root@rhel6 ~] # vi / etc/pam.d/loginsession required pam_limits.so
Modify the Kernel configuration of the Linux kernel
[root@rhel6 ~] # vi / etc/sysctl.conf#kernel.shmmax = 68719476736 / / comment out the previous system configuration; # kernel.shmall = 4294967296fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmax = 858993459 / / greater than SGA, less than physical memory; kernel.shmall = 1048576 / / physical memory% 4K Kernel.shmmni = 4096kernel.sem = 32000 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586 [root@rhel6] # sysctl-p
Configure environment variables for grid and oracle users
[root@rhel6 ~] # su-grid / / grid user environment variable configuration; [grid@rhel6 ~] $vi .bash _ profile PS1= "[`whoami` @ `hostname`:"'$PWD] $'export PS1umask 022export TMP=/tmpexport LANG=en_USexport TMPDIR=$TMPexport ORACLE_HOSTNAME=rhel6ORACLE_SID=+ASM; export ORACLE_SIDORACLE_TERM=xterm; export ORACLE_TERMORACLE_BASE=/u01/app/grid; export ORACLE_BASEORACLE_HOME=/u01/app/11.2.0/grid Export ORACLE_HOMENLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMATPATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATHTHREADS_FLAG=native; export THREADS_FLAGif [$USER = "oracle"] | | [$USER = "grid"]; then if [$SHELL = "/ bin/ksh"] Then ulimit-p 16384 ulimit-n 65536 else ulimit-u 16384-n 65536 fi umask 022 [root@rhel6] # su- Oracle [oracle@rhel6 ~] $vi .bash _ profile TMP=/tmp Export TMPTMPDIR=$TMP; export TMPDIRexport LANG=en_USORACLE_BASE=/u01/app/oracle; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOMEORACLE_SID=itpuxdb; export ORACLE_SIDexport ORACLE_UNQNAME=orclORACLE_TERM=xterm; export ORACLE_TERMPATH=/usr/sbin:$PATH; export PATHPATH=$ORACLE_HOME/bin:$PATH; export PATHLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib Export CLASSPATHNLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMATNLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANGif [$USER = "oracle"] | | [$USER = "grid"]; then if [$SHELL = "/ bin/ksh"]; then ulimit-p 16384 ulimit-n 65536 else ulimit-u 16384-n 65536 fi umask 022fi
Configure udev configure ASM (the disk used in this system is / dev/sda)
[root@rhel6 ~] # fdisk / dev/ (sdb\ sdc\ sdd\ sde\ sdf) / / partition the disk [root@rhel6 ~] # vi / etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL== "sdb1", NAME= "asm_grid1", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sdc1", NAME= "asm_system", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sdd1", NAME= "asm_recovery", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sde1", NAME= "asm_data01", OWNER= "grid", GROUP= "GROUP=", asmadmin "0660" asmadmin "asmadmin" NAME= "asm_data02", OWNER= "grid", GROUP= "asmadmin" MODE= "0660" [root@rhel6 ~] # partprobe / dev/sdb1 [root@rhel6 ~] # partprobe / dev/sdc1 [root@rhel6 ~] # partprobe / dev/sdd1 [root@rhel6 ~] # partprobe / dev/sde1 [root@rhel6 ~] # partprobe / dev/sdf1 [root@rhel6 ~] # udevadm control-reload-rules [root@rhel6 ~] # start_udev Starting udev: [OK] [root@rhel6 ~] # ls-lsa / dev/asm*0 brw-rw----. 1 grid asmadmin 8, 65 May 24 05:48 / dev/asm_data010 brw-rw----. 1 grid asmadmin 8, 81 May 24 05:48 / dev/asm_data020 brw-rw----. 1 grid asmadmin 8, 17 May 24 05:48 / dev/asm_grid10 brw-rw----. 1 grid asmadmin 8, 49 May 24 05:48 / dev/asm_recovery0 brw-rw----. 1 grid asmadmin 8, 33 May 24 05:48 / dev/asm_system
Upload the Oracle installation package to the server
[root@rhel6 ~] # yum-y install lrzsz / / install the FTP software used by xshell; [root@rhel6 ~] # unzip p13390677_112040_Linux-x86-64_3of7.zip [root@rhel6 ~] # chown-R grid:oinstall / opt/grid/
Configure VNC remote Desktop
[root@rhel6 ~] # yum-y install vnc-server [root@rhel6 opt] # su-grid [grid@rhel6:/home/grid] $vncserver You will require a password to access your desktops.Password:Verify:xauth: creating new authority file / home/grid/.XauthorityNew 'rhel6:1 (grid)' desktop is rhel6:1Creating default startup script / home/grid/.vnc/xstartupStarting applications specified in / home/grid/.vnc/xstartupLog file is / home/grid/.vnc/rhel6:1.log
VNC remote Desktop connection configuration installs Grid Infrastructure components
[grid@rhel6 ~] $cd / opt/grid/ [grid@rhel6 grid] $. / runInstaller
Select single node installation configuration Grid Infrastructure
Select the locale
Scan ASM disk
Configure a unified account password
User groups are automatically identified when the environment variable is configured correctly.
Configure the installation directory (can be adjusted manually)
After detecting information such as dependency packages, a warning appears (due to the low memory of the test virtual machine, it can be ignored here that the recommended value of Oracle cannot be reached)
Execute the required script
[root@rhel6] # / u01/app/oraInventory/orainstRoot.shChanging permissions of / u01/app/oraInventory.Adding read,write permissions for group.Removing read,write Execute permissions for world.Changing groupname of / u01/app/oraInventory to oinstall.The execution of the script is complete. [root@rhel6 ~] # / u01/app/11.2.0/grid/root.shPerforming root user operation for Oracle 11gThe following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= / u01/app/11.2.0/gridEnter 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 script.Now product-specific root actions will be performed.Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_paramsCreating trace directoryLOCAL ADD MODE Creating OCR keys for user 'grid', privgrp' oinstall'..Operation successful.LOCAL ONLY MODE Successfully accumulated necessary OCR keys.Creating OCR keys for user 'root' Privgrp 'root'..Operation successful.CRS-4664: Node rhel6 successfully pinned.Adding Clusterware entries to upstartrhel6 07:14:47 on 2017-05-24 / u01/app/11.2.0/grid/cdata/rhel6/backup_20170524_071447.olrSuccessfully configured Oracle Grid Infrastructure for a Standalone Server
Configuration installed successfully
Configure and install the Oracle client
[root@rhel6 opt] # su-oracle [oracle@rhel6 ~] $vncserverYou will require a password to access your desktops.Password:Verify:xauth: creating new authority file / home/oracle/.XauthorityNew 'rhel6:2 (oracle)' desktop is rhel6:2Creating default startup script / home/oracle/.vnc/xstartupStarting applications specified in / home/oracle/.vnc/xstartupLog file is / home/oracle/.vnc/rhel6:2.log [root@rhel6 opt] # unzip p13390677_112040_Linux-x86-64_1of7.zip [root @ rhel6 opt] # unzip p13390677_112040_Linux-x86-64_2of7.zip [root@rhel6 opt] # chown-R oracle.oinstall database/
VNC remote Desktop installs Oracle software
[oracle@rhel6 database] $. / runInstaller
Choose to install only the Oracle software (rebuild the instance later)
Select single instance node installation
Choose to install Enterprise Edition
Oracle database software installation location (environment variables read correctly and do not need to be modified)
Due to the low memory in the test environment, you can ignore the warning here and continue with the installation.
Execute the required script as the root user
[root@rhel6 tmp] # / u01/app/oracle/product/11.2.0/root.shPerforming root user operation for Oracle 11gThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= / u01/app/oracle/product/11.2.0Enter the full pathname of the local bin directory: [/ usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite.The contents of "oraenv" have not changed. No need to overwrite.The contents of "coraenv" have not changed. No need to overwrite.Entries will be added to the / etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.
Installation completed
Oracle and ASM configuration installation is completed, then install and configure ASM, build instance
Log in as grid user remote Desktop and configure ASM disk
[grid@rhel6:/home/grid] $asmca
Log in with oracle user remote Desktop and configure to create a database
[oracle@rhel6 database] $dbca
Choose to create a database
Since this is the first choice in the experimental environment.
Configure instance name
Since this is the experimental environment, choose to enable OEM and uncheck the fast flashback.
Configure a unified password
Select the ASM disk instead of file system here, and select the ASM disk group you created
Check the example of the experimental environment
Configure SGA and PGA space size, configure Chinese character set ZHFS16GBK, configure the number of concurrent connections, configure dedicated shared pool
The data file size, automatic extension and redo log group configuration can be configured here (the lab environment does not do too much configuration here)
Information such as data configuration files can be exported here (to facilitate subsequent document writing)
Create a database.
Database installation completed
View cluster status and monitoring status as grid users
[grid@rhel6:/home/grid] $crsctl status resource-t----NAME TARGET STATE SERVER STATE_DETAILS -Local Resources-- -ora.DATA.dg ONLINE ONLINE rhel6 ora.DSG.dg ONLINE ONLINE rhel6 ora. LISTENER.lsnr ONLINE ONLINE rhel6 ora.asm ONLINE ONLINE rhel6 Started ora.ons OFFLINE OFFLINE rhel6- -Cluster Resources -ora.cssd 1 ONLINE ONLINE rhel6 ora.diskmon 1 OFFLINE OFFLINE ora.evmd 1 ONLINE ONLINE rhel6 Ora.orcl.db 1 ONLINE ONLINE rhel6 Open-[grid@rhel6] : / home/grid] $lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0-Production on 24-MAY-2017 08:28:36Copyright (c) 1991 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1521)) STATUS of the LISTENER----Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.4.0-ProductionStart Date 24-MAY-2017 07:15:42Uptime 0 days 1 hr. 12 min. 53 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / u01/app/11.2.0/grid/network/admin/listener.oraListener Log File / u01/app/grid/diag/tnslsnr/rhel6/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521)) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=rhel6) (PORT=1521)) Services Summary...Service "+ ASM" has 1 instance (s). Instance "+ ASM", status READY, has 1 handler (s) for this service...Service "orcl" has 1 instance (s). Instance "orcl", status READY, has 1 handler (s) for this service...Service "orclXDB" has 1 instance (s). Instance "orcl", status READY, has 1 handler (s) for this service...The command completed successfully
Log in to the database as an oracle user and query the tablespace
[oracle@rhel6 database] $sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed May 24 08:27:56 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing options SQL > select * from V$TABLESPACE TS# NAME INC BIG FLA ENC- 0 SYSTEM YES NO YES 1 SYSAUX YES NO YES 2 UNDOTBS1 YES NO YES 4 USERS YES NO YES 3 TEMP NO NO YES6 EXAMPLE YES NO YES6 rows selected.
Here, the installation and deployment of udev + ASM Oracle 11gR2 under the Rhel Linux environment is complete and the state is normal.
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: 207
*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.