一、环境准备
|
系统版本 |
Oracle版本 |
|
Suse11SP3 |
Oracle11gr2 |
系统配置要求
1)物理内存1GB以上,交换空间大约为物理内存的2倍。
2)安装目录(/data/oracle)建议有8GB以上、/tmp目录建议有1GB以上可用空间。
3)提前配置好主机名、IP地址,完成安装以后不要再改主机名。
二、前期准备
2.1 创建oracle用户组、程序目录
|
1
2
3
4
5
|
mkdir /data/oracle -pgroupadd dbagroupadd oinstalluseradd -g oinstall -G dba -m -d /data/oracle oracleecho 'oracle' |passwd --stdin oracle |
2.2 修改hosts文件(本机主机名 IP地址)
|
1
2
|
TEST:/home # cat /etc/hosts127.0.0.1 TEST |
2.3 优化内核参数
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
cat >>/etc/sysctl.conf <<EOFkernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144fs.file-max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.wmem_max = 1048576fs.aio-max-nr = 1048576EOF tail -20 /etc/sysctl.confsysctl -p |
2.4 调整会话限制
|
1
2
3
4
5
6
7
8
9
10
|
cat >>/etc/security/limits.conf <<EOForacle soft nproc 8192oracle hard nproc 16384oracle soft nofile 32768oracle hard nofile 65536EOF cat >> /etc/pam.d/login <<EOFsession required pam_limits.soEOF |
2.5 调整用户环境变量
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
su - oraclecat >> .bash_profile <<EOFexport PATH=\$PATH:/data/oracle/product/11gr2/dbhome_1/binexport ORACLE_HOME=/data/oracle/product/11gr2/dbhome_1export ORACLE_SID=orclEOFcat .bash_profilesource .bash_profile su - rootcat >> /etc/profile <<EOFexport PATH=\$PATH:/data/oracle/product/11gr2/dbhome_1/binexport ORACLE_HOME=/data/oracle/product/11gr2/dbhome_1export ORACLE_SID=orclEOFtail /etc/profilesource /etc/profile |
2.6 应答文件(!)
|
1
2
3
4
|
cat >>/etc/oraInst.loc <<EOFinventory_loc=/data/oracle/oraInventoryinst_group=oinstallEOF |
2.7 依赖库安装
|
1
2
3
4
|
注意:以下安装需要挂载系统镜像盘zypper in binutils gcc gcc-c++ glibc glibc-devel ksh-93t libstdc++33 libstdc++43 libstdc++43-devel libaio libaio-devel libgcc43 libstdc++-devel make sysstat -y |
2.8 修改交换分区配置
|
1
2
3
|
vi /etc/fstab新增如下:tmpfs /dev/shm tmpfs defaults,size=1024m 0 0 |
三、正式安装oracle
3.1 解压安装包
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
TEST:/tmp # cd /tmpTEST:/tmp # mkdir oracleTEST:/tmp # mv linux.x64_11gR2_database_* oracle/TEST:/tmp # cd oracle/TEST:/tmp/oracle # lltotal 2297844-rw-r--r-- 1 root root 1239269270 Oct 28 11:20 linux.x64_11gR2_database_1of2.zip-rw-r--r-- 1 root root 1111416131 Oct 28 11:20 linux.x64_11gR2_database_2of2.zipTEST:/tmp/oracle # unzip linux.x64_11gR2_database_1of2.zipTEST:/tmp/oracle # unzip linux.x64_11gR2_database_2of2.zip TEST:/tmp/oracle # cd ..TEST:/tmp # chown -R oracle.oinstall oracle/* |
3.2 安装
|
1
2
3
4
|
TEST:/tmp # su - oracleoracle@TEST:~> cd /tmp/oracle/database#执行以下命令安装:./runInstaller -silent -debug -force DECLINE_SECURITY_UPDATES=true oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/data/oracle/oraInventory ORACLE_HOME=/data/oracle/product/11gr2/dbhome_1 ORACLE_BASE=/data/oracle oracle.install.db.InstallEdition=EE oracle.install.db.EEOptionsSelection=true oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0 oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=dba oracle.install.db.isRACOneInstall=false DECLINE_SECURITY_UPDATES=true |
3.3 检查日志安装情况
|
1
2
3
4
5
6
7
8
|
oracle@TEST:~/oraInventory/logs> pwd/data/oracle/oraInventory/logsoracle@TEST:~/oraInventory/logs> lltotal 9844-rw-rw---- 1 oracle oinstall 9381410 Oct 28 13:35 installActions2016-10-28_01-30-33PM.log-rw-rw---- 1 oracle oinstall 2055 Oct 28 13:35 oraInstall2016-10-28_01-30-33PM.err-rw-rw---- 1 oracle oinstall 666083 Oct 28 13:35 oraInstall2016-10-28_01-30-33PM.out-rw-rw---- 1 oracle oinstall 183 Oct 28 13:31 silentInstall2016-10-28_01-30-33PM.log |
3.4 执行root.sh脚本
|
1
2
3
4
|
oracle@TEST:~/oraInventory/logs> su -Password:TEST:~ # sh /data/oracle/product/11gr2/dbhome_1/root.shCheck /data/oracle/product/11gr2/dbhome_1/install/root_TEST_2016-10-28_13-53-55.log for the output of root script |
3.5 启动监听
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
TEST:~ # su - oracleoracle@TEST:~> netca /silent /responsefile /tmp/oracle/database/response/netca.rsp Parsing command line arguments: Parameter "silent" = true Parameter "responsefile" = /tmp/oracle/database/response/netca.rspDone parsing command line arguments.Oracle Net Services Configuration:Profile configuration complete.Oracle Net Listener Startup: Running Listener Control: /data/oracle/product/11gr2/dbhome_1/bin/lsnrctl start LISTENER Listener Control complete. Listener started successfully.Listener configuration complete.Oracle Net Services configuration successful. The exit code is 0 oracle@TEST:~> netstat -lnpt|grep 1521(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)tcp 0 0 :::1521 :::* LISTEN 9094/tnslsnr oracle@TEST:~> lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-OCT-2016 13:59:16 Copyright (c) 1991, 2009, 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.1.0 - ProductionStart Date 28-OCT-2016 13:56:23Uptime 0 days 0 hr. 2 min. 53 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /data/oracle/product/11gr2/dbhome_1/network/admin/listener.oraListener Log File /data/oracle/diag/tnslsnr/TEST/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TEST)(PORT=1521)))The listener supports no servicesThe command completed successfully |
3.6 配置静默数据库配置文件
|
1
2
3
4
5
6
7
8
9
|
oracle@TEST:~> cp /tmp/oracle/database/response/dbca.rsp .oracle@TEST:~> vim dbca.rsp GDBNAME = "orcl.locahost" //全局数据库的名字=SID+主机域名SID="orcl" // SIDCHARACTERSET="AL32UTF8" //编码NATIONALCHARACTERSET="UTF8" //编码SYSPASSWORD = "Oracle" //密码SYSTEMPASSWORD = "Oracle" //密码 |
3.7 进行静默安装数据库
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
oracle@TEST:~> dbca -silent -responseFile dbca.rsp Copying database files1% complete3% complete11% complete18% complete26% complete37% completeCreating and starting Oracle instance40% complete45% complete50% complete55% complete56% complete60% complete62% completeCompleting Database Creation66% complete70% complete73% complete85% complete96% complete100% completeLook at the log file "/data/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details. |
3.8 登录数据并修改用户密码永不过期
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
oracle@TEST:~> dbca -silent -responseFile dbca.rsp Copying database files1% complete3% complete11% complete18% complete26% complete37% completeCreating and starting Oracle instance40% complete45% complete50% complete55% complete56% complete60% complete62% completeCompleting Database Creation66% complete70% complete73% complete85% complete96% complete100% completeLook at the log file "/data/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details. |
3.9 创建dba用户,加大数据库连接数
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#创建pgm用户,dba权限。oracle@TEST:~> sqlplus "/as sysdba"SQL> create user pgm identified by pgmfetion;User created.SQL> grant dba to pgm;Grant succeeded. #加大数据库连接数SQL> alter system set processes=6000 scope=spfile;System altered.SQL> alter system set sessions=6605 scope=spfile;System altered.SQL> create pfile from spfile;File created.#重启数据库SQL> shutdow immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsoracle@TEST:~> lsnrctl stopLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-OCT-2016 14:49:33Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))The command completed successfullyoracle@TEST:~> lsnrctl start......SQL> startup;ORACLE instance started. Total System Global Area 3290345472 bytesFixed Size 2217832 bytesVariable Size 2248149144 bytesDatabase Buffers 1023410176 bytesRedo Buffers 16568320 bytesDatabase mounted.Database opened. #检查连接数配置show parameter processes;show parameter sessions; #查看当前连接数select count(*) from v$process where program='ORACLE.EXE(SHAD)'; |
477

被折叠的 条评论
为什么被折叠?



