配置oracle 11g环境,oracle 11g 的安装环境的配置
http://docs.oracle.com/cd/E11882_01/install.112/e24324/toc.htm
1、檢查硬件的要求
內存要求:
內存要求:至少1G,但是安裝11g必須在2G以上
建議: 2G的RAM以及以上
查看內存:grep MemTotal /proc/meminfo
swap分配:
大頁內存的特征是分配非swap內存,如果你開啟的大頁內存,那么在計算swap時排除已經分配的大頁內存
Table 1-1 Swap Space Required for 64-bit Linux and Linux on System z
Available RAM
Swap Space Required
Between 2.5 GB and 32 GB ? ? Equal to the size of RAM
More than 32 GB ? ? ? ? ? ? ?32 GB of RAM
Table 1-2 Swap Space Required for 32-bit Linux
Available RAM
Swap Space Required
Between 2.5 GB and 16 GB ?Equal to the size of RAM
More than 16 G ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?16 GB
The MEMORY_MAX_TARGET and MEMORY_TARGET parameters cannot be used when the LOCK_SGA parameter is enabled, or with HugePages on Linux.
如果sga是自動管理的,那么不能使用lock_sga
或者大頁內存管理
如果遇到了 ORA-00845 error, 需要增加 the /dev/shm的大小.
# mount -t tmpfs shmfs -o size=7g /dev/shm
為了開機時自動生效, 在 /etc/fstab 配置文件中添加
shmfs /dev/shm tmpfs size=7g 0
查看swap的大小:
root@dba ~]# grep SwapTotal /proc/meminfo
SwapTotal: ? ? 4096564 kB
[root@dba ~]# free
total ? ? ? used ? ? ? free ? ? shared ? ?buffers ? ? cached
Mem: ? ? ? ?611428 ? ? 600872 ? ? ?10556 ? ? ? ? ?0 ? ? 138544 ? ? 367632
-/+ buffers/cache: ? ? ?94696 ? ? 516732
Swap: ? ? ?4096564 ? ? ? ? ?0 ? ?4096564
磁盤空間的需求:
/tmp要求:至少1G
軟件所需要的磁盤空間:
Installation Type
Requirement for Software Files (GB)
Enterprise Edition
4.5
Standard Edition
4.4
硬件所需要的磁盤空間:
Installation Type
Requirement for Data Files (GB)
Enterprise Edition
1.7
Standard Edition
1.5
顯卡要求:
The minimum resolution for Oracle Database 11g Release 2 (11.2) is 1024 x 768 or higher
對操作系統的要求:
系統:Red Hat Enterprise Linux 5.5(此處我使用的是linux 5.5)
[root@localhost ~]# cat /proc/version
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))
[root@localhost ~]# lsb_release -id
Distributor ID:
RedHatEnterpriseServer
Description:
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
[root@localhost ~]# uname -m
x86_64
If you plan to install on Oracle ASM, then to ensure high availability of OCR or voting disk files on Oracle ASM, you need to have at least 2 GB of for Oracle Clusterware files in three separate failure groups,
with at least three physical disks. Each disk must have at least 1 GB of capacity to ensure that there is sufficient space to create Oracle Clusterware files.
Ensure you have at least 6.5 GB of space for the Oracle Grid Infrastructure for a Cluster home (Grid home). This includes Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) files and log files,
ACFS log files, and includes the Cluster Health Monitor repository.
2、 安裝oracle必須的軟件置好yum
vi /etc/yum.repo/r
[rhel-server]
name=server
baseurl=file:///misc/cd/Server
enabled=1
gpgcheck=0
[rhel-cluster]
name=cluster
baseurl=file:///misc/cd/Cluster
enabled=1
gpgcheck=0
[rhel-clusterstor]
name=cluster
baseurl=file:///misc/cd/ClusterStorage
enabled=1
gpgcheck=0
[rhel-vt]
name=cluster
baseurl=file:///misc/cd/VT
enabled=1
gpgcheck=0
安裝所需軟件(操作系統不同所需安裝的軟件不同)
yum install binutils-2.17.50.0.6 ? ? ? ? ? ? ? ? ? ? ?-y
yum install compat-libstdc++-33-3.2.3 ? ? ? ? ? ? ? ? -y
yum install elfutils-libelf-0.125 ? ? ? ? ? ? ? ? ? ? -y
yum install elfutils-libelf-devel-0.125 ? ? ? ? ? ? ? -y
yum install elfutils-libelf-devel-static-0.125 ? ? ? ?-y
yum install gcc-4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install gcc-c++-4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install glibc-2.5-24 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?-y
yum install glibc-common-2.5 ? ? ? ? ? ? ? ? ? ? ? ? ?-y
yum install glibc-devel-2.5 ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install glibc-headers-2.5 ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install kernel-headers-2.6.18 ? ? ? ? ? ? ? ? ? ? -y
yum install ksh-20060214 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?-y
yum install libaio-0.3.106 ? ? ? ? ? ? ? ? ? ? ? ? ? ?-y
yum install libaio-devel-0.3.106 ? ? ? ? ? ? ? ? ? ? ?-y
yum install libgcc-4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?-y
yum install libgomp-4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install libstdc++-4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install libstdc++-devel-4.1.2 ? ? ? ? ? ? ? ? ? ? -y
yum install make-3.81 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -y
yum install sysstat-7.0.2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? -y
[root@localhost ~]# yum install unixODBC-2.2.11*
selinux,防火墻,不必要服務,機器名
vi /etc/sysconfig/selinux
SELINUX=enforcing改成SELINUX=disabled
修改此參數后,一定要重啟操作系統。
關掉防火墻
iptables -F
創建安裝所需要的組:
[root@localhost rpm]# groupadd ?-g 501 ?oinstall
建立oinstall 組主要是為了讓屬于這個組的用戶能夠對 oraInventory目錄具有讀寫權限 ,對數據庫能夠重啟資源,其中oracle和grid用戶必須屬于oinstall組
[root@localhost rpm]# groupadd -g 502 dba
創建dba組是為了讓數據庫的管理者oracle用戶,能夠登陸到asm實例上,dba組能夠確定操作系統的用戶能夠管理數據庫的權限
[root@localhost rpm]# useradd -u 1000 -g oinstall -G dba oracle
oracle用戶主要是管理數據庫軟件
給oracle用戶修改密碼:
[root@localhost rpm]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
配置內核參數
vi ? /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
配置內核參數
Parameter Minimum Value File
semmsl 250 /proc/sys/kernel/sem
semmns 32000
semopm 100
semmni 128
shmall 2097152 /proc/sys/kernel/shmall
shmmax Minimum: 536870912 /proc/sys/kernel/shmmax
Maximum: A value that is 1 byte less than 4 GB, or 4294967295
Recommended: More than half the physical memory
See My Oracle Support Note 567506.1 for additional information about configuring shmmax.
shmmni 4096 /proc/sys/kernel/shmmni
file-max 6815744 /proc/sys/fs/file-max
ip_local_port_rangeMinimum: 9000 /proc/sys/net/ipv4/ip_local_port_range
Maximum: 65500
rmem_default 262144/proc/sys/net/core/rmem_default
rmem_max 4194304/proc/sys/net/core/rmem_max
wmem_default 262144/proc/sys/net/core/wmem_default
wmem_max 1048576/proc/sys/net/core/wmem_max
aio-max-nr 1048576
Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.
shmall kernel.shmall 參數是控制共享內存頁數 。Linux 共享內存頁大小為4KB,,可通過命令 getconf PAGESIZE獲取內存頁的大小, 共享內存段的大小都是共享內存頁大小的整數倍。如果一個共享內存段的最大大小是16G,那么需要共享內存頁數是 16GB/4KB=16777216KB/4KB=4194304 (頁),也就是64Bit 系統下16GB 物理內存,設置 kernel.shmall = 4194304 才符合要求(幾乎是原來設置2097152的兩倍)。這時可以將shmmax 參數調整到 16G 了,同時可以修改SGA_MAX_SIZE 和 SGA_TARGET 為 12G(您想設置的SGA 最大大小,當然也可以是2G~14G 等,還要協調PGA參數及OS 等其他內存使用,不能設置太滿,比如16G)。
[root@localhost ~]# getconf PAGESIZE
4096
shmmax 是單個段允許使用的大小,如果該參數設置小于Oracle SGA設置,那么SGA就會被分配多個共享內存段。這在繁忙的系統中可能成為性能負擔,帶來系統問題。 Linux上該參數的缺省值通常為32M。為了避免多個共享內存段,我們可以修改shmmax內核參數,使SGA存在于一個共享內存段中。所以一般來說,1-4G 的物理內存,可以直接設置shmmax 為最大物理內存即可,那么SGA 肯定在一個共享內存段中,32Bit Linux 系統物理內存大于4G 的設置為4G 即可 。總之,一般設置shmmax >=SGA (32Bit 系統是否支持到1.7G 以上SGA 需要注意) 。如果是64Bit 的Linux 操作系統,shmmax 設置為大于SGA_MAX_SIZE 即可。
kernel.shmmni 表示最小共享內存,缺省值為4096
kernel.sem 有四個參數, 這幾個參數為固定值SEMMNS:系統信號量最大數,SEMOPM:每次semopm系統調用操作數,SEMMNI:系統辛苦量集數最大數。這4個參數為固定內容大小
semmsl :設置每個信號燈組中信號燈最大數量,推薦的最小值是250。對于系統中存在大量并發連接的系統,推薦將這個值設置為PROCESSES初始化參數加10。
semmns:SEMMNS=SEMMNU = (SEMMNI * SEMMSL)
semopm:設置每次系統調用可以同時執行的最大信號燈操作的數量。由于一個信號燈組最多擁有SEMMSL個信號燈,因此有推薦將SEMOPM設置為SEMMSL的值。Oracle驗證的10.2和11.1的SEMOPM的配置為100
semmni:設置系統中信號燈組的最大數量。Oracle10g和11g的推薦值為142
net.ipv4.ip_local_port_range tcp端口的范圍 默認值是1024 65000
net.core.rmem_default :默認窗口接收大小
net.core.rmem_max :最大的tcp數據接收緩沖
net.core.wmem_default 默認的發送窗口大小
net.core.wmem_max :最大的tcp數據發送緩沖
ps -ef|grep 3102
pmap 3102
默認查看
ipcs -sa
[root@localhost ~]# ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 67108864
max total shared memory (kbytes) = 17179869184
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 16
max size of message (bytes) = 65536 檢查資源限制: Resource Shell Limit Resource Soft Limit Hard 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 [root@localhost rpm]# cat /etc/security/limits.conf? oracle ? ? ? ? ? ? ?soft ? ?nproc ? 2047 oracle ? ? ? ? ? ? ?hard ? ?nproc ? 16384 oracle ? ? ? ? ? ? ?soft ? ?nofile ?1024 oracle ? ? ? ? ? ? ?hard ? ?nofile ?65536 oracle ? ? ? ? ? ? ?soft ? ?stack ? 10240 設置環境變量: [root@localhost ~]# mkdir -p /u01/app/oracle/product/ [root@localhost ~]# chown -R oracle:oinstall /u01/app/oracle [root@localhost ~]# ?chmod -R 775 /u01/app/oracle vi .bash_profile export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/dbs_1 export ORACLE_SID=orcl export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin export PATH=$ORACLE_HOME/bin:$PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib export CLASSPATH 安裝數據庫: [oracle@localhost database]$ ./runInstaller
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的配置oracle 11g环境,oracle 11g 的安装环境的配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle dataguard in-
- 下一篇: 梦战是什么手游(梦战)