Fork me on GitHub

centos7静默安装oracle11gR2

检查系统属性

查询系统版本

貌似linux内核版本需要大于 3.10.0

[root@services ~]# uname -a Linux services 3.10.0-957.el7.x86_64 #1
SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

查询hostname

[root@services ~]# hostname
services

查看磁盘

磁盘需要20G左右可用磁盘(4G压缩包+4G解压文件+nG安装的程序)

[root@services ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 50G 2.1G 45G 5% /
devtmpfs 909M 0 909M 0% /dev
tmpfs 920M 24K 920M 1% /dev/shm
tmpfs 920M 468K 919M 1% /run
tmpfs 920M 0 920M 0% /sys/fs/cgroup
tmpfs 184M 0 184M 0% /run/user/0

查看内存和虚拟内存

内存最好2G以上,虚拟内存 1-2倍真是内存即可

[root@services ~]# free
total used free shared buff/cache available
Mem: 1882356 92036 468924 492 1321396 1590516
Swap: 0 0 0
本服务器虚拟内存为0,需要调整虚拟内存 至3G,调整虚拟内存文章见:centos7调整虚拟内存

设置系统属性

更新软件包

1
2
3
4
5
6
7
[root@centosbase ~]# yum -y upgrade
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
No packages marked for update

查看系统名称 并修改为 redhat-7

1
2
3
4
5
6
7
8
[root@centosbase ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@centosbase ~]# vi /etc/redhat-release
redhat-7
#CentOS Linux release 7.6.1810 (Core)
[root@centosbase ~]# cat /etc/redhat-release
redhat-7
#CentOS Linux release 7.6.1810 (Core)

查看hostname

1
2
3
4
5
[root@centosbase ~]# hostname
centosbase
[root@centosbase ~]# hostnamectl set-hostname oracle
[root@centosbase ~]# hostname
oracle

设置hosts

把hostname对应上IP,否则之后pl\sql链接提示无法识别
添加 192.168.0.111 service
[root@VM_0_12_centos ~]# vi /etc/hosts
[root@VM_0_12_centos ~]# cat /etc/hosts
140.143.62.74 service
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

关闭selinux

编辑 /etc/selinux/config文件,设置SELINUX= enforcing 为SELINUX=disabled

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@services ~]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
#SELINUX=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

编辑后保存 :wq。重启系统即可生效。

设置开启1521端口

如果是服务器则单独开启该端口即可,如果是虚拟机则可以直接关闭防火墙
关闭防火墙方法:
(1)查看防火墙状态:systemctl status firewalld
(2)停止防火墙:systemctl stop firewalld
(3)关闭自启动防火墙服务:systemctl disable firewalld

设置安装环境

安装Oracle 11g依赖包

oracle11g依赖包都有版本限制,低于某版本则安装失败,具体版本可查询

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[root@services ~]# yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static elfutils-libelf-devel ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package gcc-4.8.5-36.el7_6.2.x86_64 already installed and latest version
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Package binutils-2.27-34.base.el7.x86_64 already installed and latest version
Package libaio-0.3.109-13.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
---> Package elfutils-libelf-devel.x86_64 0:0.172-2.el7 will be installed
--> Processing Dependency: pkgconfig(zlib) for package: elfutils-libelf-devel-0.172-2.el7.x86_64
---> Package elfutils-libelf-devel-static.x86_64 0:0.172-2.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-36.el7_6.2 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-36.el7_6.2 for package: gcc-c++-4.8.5-36.el7_6.2.x86_64
---> Package ksh.x86_64 0:20120801-139.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
---> Package numactl-devel.x86_64 0:2.0.9-7.el7 will be installed
--> Processing Dependency: numactl-libs = 2.0.9-7.el7 for package: numactl-devel-2.0.9-7.el7.x86_64
--> Processing Dependency: libnuma.so.1()(64bit) for package: numactl-devel-2.0.9-7.el7.x86_64
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
---> Package sysstat.x86_64 0:10.1.5-17.el7 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-17.el7.x86_64
---> Package unixODBC.x86_64 0:2.3.1-11.el7 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-11.el7.x86_64
---> Package unixODBC-devel.x86_64 0:2.3.1-11.el7 will be installed
--> Running transaction check
---> Package libstdc++-devel.x86_64 0:4.8.5-36.el7_6.2 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package lm_sensors-libs.x86_64 0:3.4.0-6.20160601gitf9185e5.el7 will be installed
---> Package numactl-libs.x86_64 0:2.0.9-7.el7 will be installed
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================
Package Arch Version Repository Size
======================================================================================================
Installing:
compat-libstdc++-33 x86_64 3.2.3-72.el7 os 191 k
elfutils-libelf-devel x86_64 0.172-2.el7 os 39 k
elfutils-libelf-devel-static x86_64 0.172-2.el7 os 75 k
gcc-c++ x86_64 4.8.5-36.el7_6.2 updates 7.2 M
ksh x86_64 20120801-139.el7 os 885 k
libaio-devel x86_64 0.3.109-13.el7 os 13 k
numactl-devel x86_64 2.0.9-7.el7 os 23 k
pcre-devel x86_64 8.32-17.el7 os 480 k
sysstat x86_64 10.1.5-17.el7 os 315 k
unixODBC x86_64 2.3.1-11.el7 os 413 k
unixODBC-devel x86_64 2.3.1-11.el7 os 55 k
Installing for dependencies:
libstdc++-devel x86_64 4.8.5-36.el7_6.2 updates 1.5 M
libtool-ltdl x86_64 2.4.2-22.el7_3 os 49 k
lm_sensors-libs x86_64 3.4.0-6.20160601gitf9185e5.el7 os 42 k
numactl-libs x86_64 2.0.9-7.el7 os 29 k
zlib-devel x86_64 1.2.7-18.el7 os 50 k

Transaction Summary
======================================================================================================
Install 11 Packages (+5 Dependent packages)

Total download size: 11 M
Installed size: 33 M
Downloading packages:
(1/16): elfutils-libelf-devel-0.172-2.el7.x86_64.rpm | 39 kB 00:00:00
(2/16): elfutils-libelf-devel-static-0.172-2.el7.x86_64.rpm | 75 kB 00:00:00
(3/16): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm | 191 kB 00:00:00
(4/16): libaio-devel-0.3.109-13.el7.x86_64.rpm | 13 kB 00:00:00
(5/16): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm | 49 kB 00:00:00
(6/16): lm_sensors-libs-3.4.0-6.20160601gitf9185e5.el7.x86_64.rpm | 42 kB 00:00:00
(7/16): numactl-devel-2.0.9-7.el7.x86_64.rpm | 23 kB 00:00:00
(8/16): numactl-libs-2.0.9-7.el7.x86_64.rpm | 29 kB 00:00:00
(9/16): ksh-20120801-139.el7.x86_64.rpm | 885 kB 00:00:00
(10/16): sysstat-10.1.5-17.el7.x86_64.rpm | 315 kB 00:00:00
(11/16): unixODBC-2.3.1-11.el7.x86_64.rpm | 413 kB 00:00:00
(12/16): pcre-devel-8.32-17.el7.x86_64.rpm | 480 kB 00:00:00
(13/16): zlib-devel-1.2.7-18.el7.x86_64.rpm | 50 kB 00:00:00
(14/16): unixODBC-devel-2.3.1-11.el7.x86_64.rpm | 55 kB 00:00:00
(15/16): libstdc++-devel-4.8.5-36.el7_6.2.x86_64.rpm | 1.5 MB 00:00:00
(16/16): gcc-c++-4.8.5-36.el7_6.2.x86_64.rpm | 7.2 MB 00:00:00
------------------------------------------------------------------------------------------------------
Total 24 MB/s | 11 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lm_sensors-libs-3.4.0-6.20160601gitf9185e5.el7.x86_64 1/16
Installing : zlib-devel-1.2.7-18.el7.x86_64 2/16
Installing : elfutils-libelf-devel-0.172-2.el7.x86_64 3/16
Installing : libstdc++-devel-4.8.5-36.el7_6.2.x86_64 4/16
Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64 5/16
Installing : unixODBC-2.3.1-11.el7.x86_64 6/16
Installing : numactl-libs-2.0.9-7.el7.x86_64 7/16
Installing : numactl-devel-2.0.9-7.el7.x86_64 8/16
Installing : unixODBC-devel-2.3.1-11.el7.x86_64 9/16
Installing : gcc-c++-4.8.5-36.el7_6.2.x86_64 10/16
Installing : elfutils-libelf-devel-static-0.172-2.el7.x86_64 11/16
Installing : sysstat-10.1.5-17.el7.x86_64 12/16
Installing : libaio-devel-0.3.109-13.el7.x86_64 13/16
Installing : pcre-devel-8.32-17.el7.x86_64 14/16
Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64 15/16
Installing : ksh-20120801-139.el7.x86_64 16/16
Verifying : elfutils-libelf-devel-0.172-2.el7.x86_64 1/16
Verifying : elfutils-libelf-devel-static-0.172-2.el7.x86_64 2/16
Verifying : numactl-libs-2.0.9-7.el7.x86_64 3/16
Verifying : ksh-20120801-139.el7.x86_64 4/16
Verifying : unixODBC-devel-2.3.1-11.el7.x86_64 5/16
Verifying : unixODBC-2.3.1-11.el7.x86_64 6/16
Verifying : gcc-c++-4.8.5-36.el7_6.2.x86_64 7/16
Verifying : numactl-devel-2.0.9-7.el7.x86_64 8/16
Verifying : compat-libstdc++-33-3.2.3-72.el7.x86_64 9/16
Verifying : pcre-devel-8.32-17.el7.x86_64 10/16
Verifying : libtool-ltdl-2.4.2-22.el7_3.x86_64 11/16
Verifying : libaio-devel-0.3.109-13.el7.x86_64 12/16
Verifying : libstdc++-devel-4.8.5-36.el7_6.2.x86_64 13/16
Verifying : zlib-devel-1.2.7-18.el7.x86_64 14/16
Verifying : lm_sensors-libs-3.4.0-6.20160601gitf9185e5.el7.x86_64 15/16
Verifying : sysstat-10.1.5-17.el7.x86_64 16/16

Installed:
compat-libstdc++-33.x86_64 0:3.2.3-72.el7 elfutils-libelf-devel.x86_64 0:0.172-2.el7
elfutils-libelf-devel-static.x86_64 0:0.172-2.el7 gcc-c++.x86_64 0:4.8.5-36.el7_6.2
ksh.x86_64 0:20120801-139.el7 libaio-devel.x86_64 0:0.3.109-13.el7
numactl-devel.x86_64 0:2.0.9-7.el7 pcre-devel.x86_64 0:8.32-17.el7
sysstat.x86_64 0:10.1.5-17.el7 unixODBC.x86_64 0:2.3.1-11.el7
unixODBC-devel.x86_64 0:2.3.1-11.el7

Dependency Installed:
libstdc++-devel.x86_64 0:4.8.5-36.el7_6.2 libtool-ltdl.x86_64 0:2.4.2-22.el7_3
lm_sensors-libs.x86_64 0:3.4.0-6.20160601gitf9185e5.el7 numactl-libs.x86_64 0:2.0.9-7.el7
zlib-devel.x86_64 0:1.2.7-18.el7

Complete!
[root@services ~]#

新建oracle用户

root用户新建用户和组并授权文件夹

groupadd oinstall  #创建用户组oinstall
groupadd dba   #创建用户组dba
useradd -g oinstall -g dba -m oracle  #创建oracle用户,并加入到oinstall和dba用户组
groups oracle    #查询用户组是否授权成功
passwd oracle   #设置用户oracle的登陆密码,不设置密码,在CentOS的图形登陆界面没法登陆
id oracle #查看新建的oracle用户

执行结果

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@services ~]# groupadd oinstall
[root@services ~]# groupadd dba
[root@services ~]# useradd -g oinstall -G dba oracle
[root@services ~]# groups oracle
oracle : oinstall dba
[root@services ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@services ~]# id oracle
uid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba)

修改内核参数

编辑 /etc/sysctl.conf 文件 末尾添加如下参数

#oracle
io-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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
这个好像是最小系统设置,我这里是个人开发,你可以更具自己服务器性能设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@services ~]# vim /etc/sysctl.conf


#oracle

io-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

:wq保存即可
参数生效:sysctl -p

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
[root@services ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
net.ipv4.conf.all.promote_secondaries = 1
net.ipv4.conf.default.promote_secondaries = 1
net.ipv6.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_thresh3 = 4096
kernel.softlockup_panic = 1
kernel.sysrq = 1
kernel.numa_balancing = 0
kernel.shmmax = 68719476736
kernel.printk = 5
sysctl: cannot stat /proc/sys/io-max-nr: No such file or directory
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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
[root@services ~]#

修改用户的限制文件

编辑 /etc/security/limits.conf 文件末尾添加以下配置:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

1
2
3
4
5
6
7
8
[root@services ~]# vi  /etc/security/limits.conf

#oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

修改用户登陆权限

修改/etc/pam.d/login文件 末尾添加:

session required /lib64/security/pam_limits.so
session required pam_limits.so

1
2
3
4
5
[root@services ~]# vi /etc/pam.d/login

#oracle
session required /lib64/security/pam_limits.so
session required pam_limits.so

:wq保存即可

设置profile文件

修改/etc/profile文件 末尾添加

#oracle 注意格式
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

1
2
3
4
5
6
7
8
9
10
11
[root@services ~]# vim /etc/profile
#oracle

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

:wq保存

创建安装目录、修改文件权限

mkdir -p /u01/app/oracle/product/11.2.0
mkdir /u01/app/oracle/oradata
mkdir /u01/app/inventory
mkdir /u01/app/oracle/fast_recovery_area
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app

执行结果

1
2
3
4
5
6
7
[root@services ~]# mkdir -p /u01/app/oracle/product/11.2.0
[root@services ~]# mkdir /u01/app/oracle/oradata
[root@services ~]# mkdir /u01/app/oracle/inventory
[root@services ~]# mkdir /u01/app/oracle/fast_recovery_area
[root@services ~]# chown -R oracle:oinstall /u01/app/oracle
[root@services ~]# chmod -R 775 /u01/app/oracle
[root@services ~]#

上传oracle软件

上传软件: yum install lrzsz

上传oracle软件包到

/tmp目录下 (rz上传)
解压zip

1
2
3
4
5
6
7
8
9
[root@VM_0_12_centos linux64_database11gR2]# ll
total 2987952
-rw-r--r--. 1 root root 1239269270 Apr 27 03:44 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 Apr 27 05:04 linux.x64_11gR2_database_2of2.zip

[root@VM_0_12_centos linux64_database11gR2]# unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
inflating: database/stage/Components/oracle.sysman.console.db/11.2.0.1.0/1/DataFiles/filegroup13.jar
inflating: database/stage/Components/oracle.sysman.console.db/11.2.0.1.0/1/DataFiles/filegroup8.jar
inflating: database/stage/Components/oracle.sysman.console.db/11.2.0.1.0/1/DataFiles/filegroup9.jar

设置oracle用户环境变量

切换到oracle用户,并配置oracle的环境变量。

su - oracle
vim .bash_profile
添加如下
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@VM_0_12_centos database]# su - oracle
[oracle@VM_0_12_centos ~]$ vim .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

/etc/oraInst.loc

vi /etc/oraInst.loc
添加:
    inventory_loc=/u01/app/oraInventory
    inst_group=oinstall
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc
1
2
3
4
5
6
7
[root@centosbase ~]# vi /etc/oraInst.loc
[root@centosbase ~]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
[root@centosbase ~]# chown oracle:oinstall /etc/oraInst.loc
[root@centosbase ~]# chmod 664 /etc/oraInst.loc
[root@centosbase ~]#

配置oracle答应文件

切换到root 用户进入oracle安装包解压后的目录 /tmp/database/response/下备份db_install.rsp文件。
编辑 /tmp/database/response/db_install.rsp文件
修改以下参数:
oracle.install.option=INSTALL_DB_SWONLY
hostname需要根据机器填写
ORACLE_HOSTNAME=VM_0_12_centos
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
展示结果:

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
[oracle@VM_0_12_centos response]$ su - 
Password:
Last login: Sun May 19 00:36:52 CST 2019 from 14.131.78.132 on pts/0
Last failed login: Sun May 19 01:59:48 CST 2019 on pts/0
There was 1 failed login attempt since the last successful login.
[root@VM_0_12_centos ~]# cd /tmp/database/response/
[root@VM_0_12_centos response]# cp db_install.rsp db_install.rsp.bak
[root@VM_0_12_centos response]# vi db_install.rsp
[root@VM_0_12_centos response]# cat db_install.rsp
####################################################################
## Copyright(c) Oracle Corporation 1998,2008. All rights reserved.##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
## IMPORTANT NOTE: This file contains plain text passwords and ##
## should be secured to have read permission only by oracle user ##
## or db administrator who owns this installation. ##
## ##
####################################################################

#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=VM_0_12_centos

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u01/app/inventory

#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
#
# Example : SELECTED_LANGUAGES=en,fr,ja
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en,zh_CN

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------------
ORACLE_HOME=/u01/app/oracle/product/11.2.0

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle

#------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# EE : Enterprise Edition
# SE : Standard Edition
# SEONE : Standard Edition One
# PE : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE

#------------------------------------------------------------------------------
# This variable is used to enable or disable custom install.
#
# true : Components mentioned as part of 'customComponents' property
# are considered for install.
# false : Value for 'customComponents' is not considered.
#------------------------------------------------------------------------------
oracle.install.db.isCustomInstall=false

#------------------------------------------------------------------------------
# This variable is considered only if 'IsCustomInstall' is set to true.
#
# Description: List of Enterprise Edition Options you would like to install.
#
# The following choices are available. You may specify any
# combination of these choices. The components you choose should
# be specified in the form "internal-component-name:version"
# Below is a list of components you may specify to install.
#
# oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning
# oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining
# oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault
# oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security
# oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing
# oracle.oraolap:11.2.0.1.0 - Oracle OLAP
#------------------------------------------------------------------------------
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0

###############################################################################
# #
# PRIVILEGED OPERATING SYSTEM GROUPS #
# ------------------------------------------ #
# Provide values for the OS groups to which OSDBA and OSOPER privileges #
# needs to be granted. If the install is being performed as a member of the #
# group "dba", then that will be used unless specified otherwise below. #
# #
###############################################################################

#------------------------------------------------------------------------------
# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=dba

#------------------------------------------------------------------------------
# Specify the cluster node names selected during the installation.
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=

#------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING
# - DATA_WAREHOUSE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=

#------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=

#------------------------------------------------------------------------------
# Specify the Starter Database SID.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=

#------------------------------------------------------------------------------
# Specify the Starter Database character set.
#
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=AL32UTF8

#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=true

#------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=

#------------------------------------------------------------------------------
# This variable controls whether to load Example Schemas onto the starter
# database or not.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.installExampleSchemas=false

#------------------------------------------------------------------------------
# This variable includes enabling audit settings, configuring password profiles
# and revoking some grants to public. These settings are provided by default.
# These settings may also be disabled.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableSecuritySettings=true

###############################################################################
# #
# Passwords can be supplied for the following four schemas in the #
# starter database: #
# SYS #
# SYSTEM #
# SYSMAN (used by Enterprise Manager) #
# DBSNMP (used by Enterprise Manager) #
# #
# Same password can be used for all accounts (not recommended) #
# or different passwords for each account can be provided (recommended) #
# #
###############################################################################

#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=

#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=

#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=

#-------------------------------------------------------------------------------
# Specify the SYSMAN password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSMAN=

#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=

#-------------------------------------------------------------------------------
# Specify the management option to be selected for the starter database.
# It can be one of the following:
# 1. GRID_CONTROL
# 2. DB_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.control=DB_CONTROL

#-------------------------------------------------------------------------------
# Specify the Management Service to use if Grid Control is selected to manage
# the database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

#-------------------------------------------------------------------------------
# This variable indicates whether to receive email notification for critical
# alerts when using DB control.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false

#-------------------------------------------------------------------------------
# Specify the email address to which the notifications are to be sent.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.emailAddress=

#-------------------------------------------------------------------------------
# Specify the SMTP server used for email notifications.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=


###############################################################################
# #
# SPECIFY BACKUP AND RECOVERY OPTIONS #
# ------------------------------------ #
# Out-of-box backup and recovery options for the database can be mentioned #
# using the entries below. #
# #
###############################################################################

#------------------------------------------------------------------------------
# This variable is to be set to false if automated backup is not required. Else
# this can be set to true.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.enable=false

#------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if
# automated backups are enabled, a job will be scheduled to run daily at
# 2:00 AM to backup the database. This job will run as the operating system
# user that is specified in this variable.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.osuid=

#-------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if
# automated backups are enabled, a job will be scheduled to run daily at
# 2:00 AM to backup the database. This job will run as the operating system user
# specified by the above entry. The following entry stores the password for the
# above operating system user.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.ospwd=

#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=

#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

#-------------------------------------------------------------------------------
# Specify the backup and recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_SYSTEM
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username.
#
# Example : MYORACLESUPPORT_USERNAME=metalink
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password.
#
# Example : MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=

#------------------------------------------------------------------------------
# Specify whether user wants to give any proxy details for connection.
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example : PROXY_HOST=proxy.domain.com
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and atleast 2 chars.
#
# Example : PROXY_PORT=25
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example : PROXY_USER=username
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example : PROXY_PWD=password
#------------------------------------------------------------------------------
PROXY_PWD=
[root@VM_0_12_centos response]#

安装oracle

执行安装程序

oracle用户 进入~database目录执行 ./runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /tmp/database/response/db_install.rsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[oracle@VM_0_12_centos database]$ ./runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /tmp/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 34486 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3071 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-05-19_03-38-13AM. Please wait ...[oracle@VM_0_12_centos database]$ You can find the log of this install session at:
/u01/app/inventory/logs/installActions2019-05-19_03-38-13AM.log
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run

/u01/app/inventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.

看到如下表示 安装成成功(15分钟左右)
/u01/app/inventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/root.sh
To execute the configuration scripts:

1. Open a terminal window 
2. Log in as "root" 
3. Run the scripts 
4. Return to this window and hit "Enter" key to continue 

安装成功之后执行提示脚本

root用户执行提示路径:
/u01/app/inventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/root.sh

1
2
3
4
5
6
7
8
9
10
[root@VM_0_12_centos ~]# /u01/app/inventory/orainstRoot.sh
Changing permissions of /u01/app/inventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/inventory to oinstall.
The execution of the script is complete.
[root@VM_0_12_centos ~]# /u01/app/oracle/product/11.2.0/root.sh
Check /u01/app/oracle/product/11.2.0/install/root_VM_0_12_centos_2019-05-19_03-49-25.log for the output of root script
[root@VM_0_12_centos ~]#

配置监听

netca -silent -responseFile /tmp/database/response/netca.rsp

**DISPLAY environment variable not set!
Oracle Net Configuration Assistant is a GUI tool
which requires that DISPLAY specify a location
where GUI tools can display.
Set and export DISPLAY, then re-run.

出现下图情况时,则需要配置DISPLAY变量,配完之后重新netca:
export DISPLAY=localhost:0.0 再次执行上一句
执行结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[oracle@VM_0_12_centos database]$ netca -silent -responseFile /tmp/database/response/netca.rsp
****DISPLAY environment variable not set!
Oracle Net Configuration Assistant is a GUI tool
which requires that DISPLAY specify a location
where GUI tools can display.
Set and export DISPLAY, then re-run.
[oracle@VM_0_12_centos database]$ export DISPLAY=localhost:0.0
[oracle@VM_0_12_centos database]$ netca -silent -responseFile /tmp/database/response/netca.rsp

Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /tmp/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
The information provided for this listener is currently in use by other software on this computer.
Listener start failed.
Check the trace file for details: /u01/app/oracle/product/11.2.0/cfgtoollogs/netca/trace-1905194AM0513.log
Oracle Net Services configuration failed. The exit code is 1
[oracle@VM_0_12_centos database]$

成功运行后,会在/u01/app/oracle/product/11.2.0/network/admin/ 中生成listener.ora和sqlnet.ora两个文件。

1
2
3
4
5
6
[oracle@VM_0_12_centos database]$ ll /u01/app/oracle/product/11.2.0/network/admin/
total 16
-rw-r--r-- 1 oracle oinstall 370 May 19 04:05 listener.ora
drwxr-xr-x 2 oracle oinstall 4096 May 19 03:39 samples
-rw-r--r-- 1 oracle oinstall 187 May 7 2007 shrept.lst
-rw-r--r-- 1 oracle oinstall 214 May 19 04:05 sqlnet.ora

启动

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
46
47
48
[oracle@VM_0_12_centos database]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-MAY-2019 04:08:56

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=VM_0_12_centos)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@VM_0_12_centos database]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-MAY-2019 04:09:06

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Starting /u01/app/oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/VM_0_12_centos/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=VM_0_12_centos)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 19-MAY-2019 04:09:08
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/VM_0_12_centos/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=VM_0_12_centos)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@VM_0_12_centos database]$

查看监听端口:

1
2
[root@VM_0_12_centos response]# netstat -tnulp | grep 1521
tcp6 0 0 :::1521 :::* LISTEN 30014/tnslsnr

安装dbch实例库

备份配置实例库应答文件
建立新库,同时建立对应的实例
切换到root用户,编辑 /tmp/database/response/dbca.rsp
修改以下参数:
GDBNAME = “orcl”
SID = “orcl”
SYSPASSWORD = “oracle”
SYSTEMPASSWORD = “oracle”
SYSMANPASSWORD = “oracle”
DBSNMPPASSWORD = “oracle”
DATAFILEDESTINATION =/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area
CHARACTERSET = “ZHS16GBK”
TOTALMEMORY = “1638”

dbca应答文件可以设置多个实例库,只需要修改
GDBNAME = “orcl”
SID = “orcl”
DATAFILEDESTINATION =/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
[root@VM_0_12_centos response]# ll
total 100
-rw-rw-r--. 1 root root 44969 Feb 14 2009 dbca.rsp
-rw-r--r--. 1 root root 22679 May 19 03:10 db_install.rsp
-rw-r--r--. 1 root root 22557 May 19 02:00 db_install.rsp.bak
-rwxrwxr-x. 1 root root 5740 Feb 26 2009 netca.rsp
[root@VM_0_12_centos response]# cp dbca.rsp dbca.rsp.bak
[root@VM_0_12_centos response]# vim dbca.rsp
[root@VM_0_12_centos response]# ll
total 144
-rw-r--r-- 1 root root 44991 May 19 03:52 dbca.rsp
-rw-r--r-- 1 root root 44969 May 19 03:51 dbca.rsp.bak
-rw-r--r--. 1 root root 22679 May 19 03:10 db_install.rsp
-rw-r--r--. 1 root root 22557 May 19 02:00 db_install.rsp.bak
-rwxrwxr-x. 1 root root 5740 Feb 26 2009 netca.rsp
[root@VM_0_12_centos response]#
[root@VM_0_12_centos response]# cat dbca.rsp
##############################################################################
## ##
## DBCA response file ##
## ------------------ ##
## Copyright 1998, 2007, Oracle Corporation. All Rights Reserved. ##
## ##
## Specify values for the variables listed below to customize Oracle ##
## Database Configuration installation. ##
## ##
## Each variable is associated with a comment. The comment identifies the ##
## variable type. ##
## ##
## Please specify the values in the following format : ##
## Type : Example ##
## String : "<value>" ##
## Boolean : True or False ##
## Number : <numeric value> ##
## StringList : {"<value1>","<value2>"} ##
## ##
## Examples : ##
## 1. dbca -progress_only -responseFile <response file> ##
## Display a progress bar depicting progress of database creation ##
## process. ##
## ##
## 2. dbca -silent -responseFile <response file> ##
## Creates database silently. No user interface is displayed. ##
## ##
## 3. dbca -silent -createDatabase -cloneTemplate ##
## -responseFile <response file> ##
## Creates database silently with clone template. The template in ##
## responsefile is a clone template. ##
## ##
## 4. dbca -silent -deleteDatabase -responseFile <response file> ##
## Deletes database silently. ##
##############################################################################

#-----------------------------------------------------------------------------
# GENERAL section is required for all types of database creations.
#-----------------------------------------------------------------------------
[GENERAL]

#-----------------------------------------------------------------------------
# Name : RESPONSEFILE_VERSION
# Datatype : String
# Description : Version of the database to create
# Valid values : "11.1.0"
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
RESPONSEFILE_VERSION = "11.2.0"

#-----------------------------------------------------------------------------
# Name : OPERATION_TYPE
# Datatype : String
# Description : Type of operation
# Valid values : "createDatabase" \ "createTemplateFromDB" \ "createCloneTemplate" \ "deleteDatabase" \ "configureDatabase" \ "addInstance" (RAC-only) \ "deleteInstance" (RAC-only)
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
OPERATION_TYPE = "createDatabase"

#-----------------------*** End of GENERAL section ***------------------------

#-----------------------------------------------------------------------------
# CREATEDATABASE section is used when OPERATION_TYPE is defined as "createDatabase".
#-----------------------------------------------------------------------------
[CREATEDATABASE]

#-----------------------------------------------------------------------------
# Name : GDBNAME
# Datatype : String
# Description : Global database name of the database
# Valid values : <db_name>.<db_domain> - when database domain isn't NULL
# <db_name> - when database domain is NULL
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
GDBNAME = "orcl"

#-----------------------------------------------------------------------------
# Name : POLICYMANAGED
# Datatype : Boolean
# Description : Set to true if Database is policy managed and
# set to false if Database is admin managed
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#POLICYMANAGED = "false"

#-----------------------------------------------------------------------------
# Name : CREATESERVERPOOL
# Datatype : Boolean
# Description : Set to true if new server pool need to be created for database
# if this option is specified then the newly created database
# will use this newly created serverpool.
# Multiple serverpoolname can not be specified for database
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#CREATESERVERPOOL = "false"

#-----------------------------------------------------------------------------
# Name : FORCE
# Datatype : Boolean
# Description : Set to true if new server pool need to be created by force
# if this option is specified then the newly created serverpool
# will be assigned server even if no free servers are available.
# This may affect already running database.
# This flag can be specified for Admin managed as well as policy managed db.
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#FORCE = "false"

#-----------------------------------------------------------------------------
# Name : SERVERPOOLNAME
# Datatype : String
# Description : Only one serverpool name need to be specified
# if Create Server Pool option is specified.
# Comma-separated list of Serverpool names if db need to use
# multiple Server pool
# Valid values : ServerPool name
# Default value : None
# Mandatory : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
#SERVERPOOLNAME =

#-----------------------------------------------------------------------------
# Name : CARDINALITY
# Datatype : Number
# Description : Specify Cardinality for create server pool operation
# Valid values : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
#CARDINALITY =

#-----------------------------------------------------------------------------
# Name : SID
# Datatype : String
# Description : System identifier (SID) of the database
# Valid values : Check Oracle11g Administrator's Guide
# Default value : <db_name> specified in GDBNAME
# Mandatory : No
#-----------------------------------------------------------------------------
SID = "orcl"

#-----------------------------------------------------------------------------
# Name : NODELIST
# Datatype : String
# Description : Comma-separated list of cluster nodes
# Valid values : Cluster node names
# Default value : None
# Mandatory : No (Yes for RAC database-centric database )
#-----------------------------------------------------------------------------
#NODELIST=

#-----------------------------------------------------------------------------
# Name : TEMPLATENAME
# Datatype : String
# Description : Name of the template
# Valid values : Template file name
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
TEMPLATENAME = "General_Purpose.dbc"

#-----------------------------------------------------------------------------
# Name : OBFUSCATEDPASSWORDS
# Datatype : Boolean
# Description : Set to true if passwords are encrypted
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#OBFUSCATEDPASSWORDS = FALSE


#-----------------------------------------------------------------------------
# Name : SYSPASSWORD
# Datatype : String
# Description : Password for SYS user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
SYSPASSWORD = "oracle"

#-----------------------------------------------------------------------------
# Name : SYSTEMPASSWORD
# Datatype : String
# Description : Password for SYSTEM user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
SYSTEMPASSWORD = "oracle"

#-----------------------------------------------------------------------------
# Name : EMCONFIGURATION
# Datatype : String
# Description : Enterprise Manager Configuration Type
# Valid values : CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE
# Default value : NONE
# Mandatory : No
#-----------------------------------------------------------------------------
#EMCONFIGURATION = "NONE"

#-----------------------------------------------------------------------------
# Name : DISABLESECURITYCONFIGURATION
# Datatype : String
# Description : Database Security Settings
# Valid values : ALL|NONE|AUDIT|PASSWORD_PROFILE
# Default value : NONE
# Mandatory : No
#-----------------------------------------------------------------------------
#DISABLESECURITYCONFIGURATION = "NONE"


#-----------------------------------------------------------------------------
# Name : SYSMANPASSWORD
# Datatype : String
# Description : Password for SYSMAN user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if LOCAL specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
SYSMANPASSWORD = "oracle"

#-----------------------------------------------------------------------------
# Name : DBSNMPPASSWORD
# Datatype : String
# Description : Password for DBSNMP user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if EMCONFIGURATION is specified
#-----------------------------------------------------------------------------
DBSNMPPASSWORD = "oracle"

#-----------------------------------------------------------------------------
# Name : CENTRALAGENT
# Datatype : String
# Description : Grid Control Central Agent Oracle Home
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#CENTRALAGENT =

#-----------------------------------------------------------------------------
# Name : HOSTUSERNAME
# Datatype : String
# Description : Host user name for EM backup job
# Default value : None
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#HOSTUSERNAME =

#-----------------------------------------------------------------------------
# Name : HOSTUSERPASSWORD
# Datatype : String
# Description : Host user password for EM backup job
# Default value : None
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#HOSTUSERPASSWORD=

#-----------------------------------------------------------------------------
# Name : BACKUPSCHEDULE
# Datatype : String
# Description : Daily backup schedule in the form of hh:mm
# Default value : 2:00
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#BACKUPSCHEDULE=

#-----------------------------------------------------------------------------
# Name : SMTPSERVER
# Datatype : String
# Description : Outgoing mail (SMTP) server for email notifications
# Default value : None
# Mandatory : Yes, if ALL or NOBACKUP are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#SMTPSERVER =

#-----------------------------------------------------------------------------
# Name : EMAILADDRESS
# Datatype : String
# Description : Email address for email notifications
# Default value : None
# Mandatory : Yes, if ALL or NOBACKUP are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#EMAILADDRESS =

#-----------------------------------------------------------------------------
# Name : DVOWNERNAME
# Datatype : String
# Description : DataVault Owner
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
#DVOWNERNAME = ""

#-----------------------------------------------------------------------------
# Name : DVOWNERPASSWORD
# Datatype : String
# Description : Password for DataVault Owner
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
#DVOWNERPASSWORD = ""

#-----------------------------------------------------------------------------
# Name : DVACCOUNTMANAGERNAME
# Datatype : String
# Description : DataVault Account Manager
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#DVACCOUNTMANAGERNAME = ""

#-----------------------------------------------------------------------------
# Name : DVACCOUNTMANAGERPASSWORD
# Datatype : String
# Description : Password for DataVault Account Manager
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#DVACCOUNTMANAGERPASSWORD = ""



#-----------------------------------------------------------------------------
# Name : DATAFILEJARLOCATION
# Datatype : String
# Description : Location of the data file jar
# Valid values : Directory containing compressed datafile jar
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#DATAFILEJARLOCATION =

#-----------------------------------------------------------------------------
# Name : DATAFILEDESTINATION
# Datatype : String
# Description : Location of the data file's
# Valid values : Directory for all the database files
# Default value : $ORACLE_BASE/oradata
# Mandatory : No
#-----------------------------------------------------------------------------
DATAFILEDESTINATION =/u01/app/oracle/oradata

#-----------------------------------------------------------------------------
# Name : RECOVERYAREADESTINATION
# Datatype : String
# Description : Location of the data file's
# Valid values : Recovery Area location
# Default value : $ORACLE_BASE/flash_recovery_area
# Mandatory : No
#-----------------------------------------------------------------------------
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area

#-----------------------------------------------------------------------------
# Name : STORAGETYPE
# Datatype : String
# Description : Specifies the storage on which the database is to be created
# Valid values : FS (CFS for RAC), ASM
# Default value : FS
# Mandatory : No
#-----------------------------------------------------------------------------
#STORAGETYPE=FS

#-----------------------------------------------------------------------------
# Name : DISKGROUPNAME
# Datatype : String
# Description : Specifies the disk group name for the storage
# Default value : DATA
# Mandatory : No
#-----------------------------------------------------------------------------
#DISKGROUPNAME=DATA

#-----------------------------------------------------------------------------
# Name : ASMSNMP_PASSWORD
# Datatype : String
# Description : Password for ASM Monitoring
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#ASMSNMP_PASSWORD=""

#-----------------------------------------------------------------------------
# Name : RECOVERYGROUPNAME
# Datatype : String
# Description : Specifies the disk group name for the recovery area
# Default value : RECOVERY
# Mandatory : No
#-----------------------------------------------------------------------------
#RECOVERYGROUPNAME=RECOVERY


#-----------------------------------------------------------------------------
# Name : CHARACTERSET
# Datatype : String
# Description : Character set of the database
# Valid values : Check Oracle11g National Language Support Guide
# Default value : "US7ASCII"
# Mandatory : NO
#-----------------------------------------------------------------------------
CHARACTERSET = "ZHS16GBK"

#-----------------------------------------------------------------------------
# Name : NATIONALCHARACTERSET
# Datatype : String
# Description : National Character set of the database
# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle11g National Language Support Guide
# Default value : "AL16UTF16"
# Mandatory : No
#-----------------------------------------------------------------------------
#NATIONALCHARACTERSET= "UTF8"

#-----------------------------------------------------------------------------
# Name : REGISTERWITHDIRSERVICE
# Datatype : Boolean
# Description : Specifies whether to register with Directory Service.
# Valid values : TRUE \ FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#REGISTERWITHDIRSERVICE= TRUE

#-----------------------------------------------------------------------------
# Name : DIRSERVICEUSERNAME
# Datatype : String
# Description : Specifies the name of the directory service user
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
#DIRSERVICEUSERNAME= "name"

#-----------------------------------------------------------------------------
# Name : DIRSERVICEPASSWORD
# Datatype : String
# Description : The password of the directory service user.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
#DIRSERVICEPASSWORD= "password"

#-----------------------------------------------------------------------------
# Name : WALLETPASSWORD
# Datatype : String
# Description : The password for wallet to created or modified.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
#WALLETPASSWORD= "password"

#-----------------------------------------------------------------------------
# Name : LISTENERS
# Datatype : String
# Description : Specifies list of listeners to register the database with.
# By default the database is configured for all the listeners specified in the
# $ORACLE_HOME/network/admin/listener.ora
# Valid values : The list should be space separated names like "listener1 listener2".
# Mandatory : NO
#-----------------------------------------------------------------------------
#LISTENERS = "listener1 listener2"

#-----------------------------------------------------------------------------
# Name : VARIABLESFILE
# Datatype : String
# Description : Location of the file containing variable value pair
# Valid values : A valid file-system file. The variable value pair format in this file
# is <variable>=<value>. Each pair should be in a new line.
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
#VARIABLESFILE =

#-----------------------------------------------------------------------------
# Name : VARIABLES
# Datatype : String
# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
#VARIABLES =

#-----------------------------------------------------------------------------
# Name : INITPARAMS
# Datatype : String
# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
#INITPARAMS =

#-----------------------------------------------------------------------------
# Name : MEMORYPERCENTAGE
# Datatype : String
# Description : percentage of physical memory for Oracle
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
#MEMORYPERCENTAGE = "40"

#-----------------------------------------------------------------------------
# Name : DATABASETYPE
# Datatype : String
# Description : used for memory distribution when MEMORYPERCENTAGE specified
# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP
# Default value : MULTIPURPOSE
# Mandatory : NO
#-----------------------------------------------------------------------------
#DATABASETYPE = "MULTIPURPOSE"

#-----------------------------------------------------------------------------
# Name : AUTOMATICMEMORYMANAGEMENT
# Datatype : Boolean
# Description : flag to indicate Automatic Memory Management is used
# Valid values : TRUE/FALSE
# Default value : TRUE
# Mandatory : NO
#-----------------------------------------------------------------------------
#AUTOMATICMEMORYMANAGEMENT = "TRUE"

#-----------------------------------------------------------------------------
# Name : TOTALMEMORY
# Datatype : String
# Description : total memory in MB to allocate to Oracle
# Valid values :
# Default value :
# Mandatory : NO
#-----------------------------------------------------------------------------
TOTALMEMORY = "1638"


#-----------------------*** End of CREATEDATABASE section ***------------------------

#-----------------------------------------------------------------------------
# createTemplateFromDB section is used when OPERATION_TYPE is defined as "createTemplateFromDB".
#-----------------------------------------------------------------------------
[createTemplateFromDB]
#-----------------------------------------------------------------------------
# Name : SOURCEDB
# Datatype : String
# Description : The source database from which to create the template
# Valid values : The format is <host>:<port>:<sid>
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SOURCEDB = "myhost:1521:orcl"

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SYSDBAUSERNAME = "system"

#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# You can also specify the password at the command prompt instead of here.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD = "password"

#-----------------------------------------------------------------------------
# Name : TEMPLATENAME
# Datatype : String
# Description : Name for the new template.
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
TEMPLATENAME = "My Copy TEMPLATE"

#-----------------------*** End of createTemplateFromDB section ***------------------------

#-----------------------------------------------------------------------------
# createCloneTemplate section is used when OPERATION_TYPE is defined as "createCloneTemplate".
#-----------------------------------------------------------------------------
[createCloneTemplate]
#-----------------------------------------------------------------------------
# Name : SOURCEDB
# Datatype : String
# Description : The source database is the SID from which to create the template.
# This database must be local and on the same ORACLE_HOME.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SOURCEDB = "orcl"

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES, if no OS authentication
#-----------------------------------------------------------------------------
#SYSDBAUSERNAME = "sys"

#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# You can also specify the password at the command prompt instead of here.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD = "password"

#-----------------------------------------------------------------------------
# Name : TEMPLATENAME
# Datatype : String
# Description : Name for the new template.
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
TEMPLATENAME = "My Clone TEMPLATE"

#-----------------------------------------------------------------------------
# Name : DATAFILEJARLOCATION
# Datatype : String
# Description : Location of the data file jar
# Valid values : Directory where the new compressed datafile jar will be placed
# Default value : $ORACLE_HOME/assistants/dbca/templates
# Mandatory : NO
#-----------------------------------------------------------------------------
#DATAFILEJARLOCATION =

#-----------------------*** End of createCloneTemplate section ***------------------------

#-----------------------------------------------------------------------------
# DELETEDATABASE section is used when DELETE_TYPE is defined as "deleteDatabase".
#-----------------------------------------------------------------------------
[DELETEDATABASE]
#-----------------------------------------------------------------------------
# Name : SOURCEDB
# Datatype : String
# Description : The source database is the SID
# This database must be local and on the same ORACLE_HOME.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SOURCEDB = "orcl"

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES, if no OS authentication
#-----------------------------------------------------------------------------
#SYSDBAUSERNAME = "sys"

#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# You can also specify the password at the command prompt instead of here.
# Default value : none
# Mandatory : YES, if no OS authentication
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD = "password"
#-----------------------*** End of deleteDatabase section ***------------------------

#-----------------------------------------------------------------------------
# GENERATESCRIPTS section
#-----------------------------------------------------------------------------
[generateScripts]
#-----------------------------------------------------------------------------
# Name : TEMPLATENAME
# Datatype : String
# Description : Name of the template
# Valid values : Template name as seen in DBCA
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
TEMPLATENAME = "New Database"

#-----------------------------------------------------------------------------
# Name : GDBNAME
# Datatype : String
# Description : Global database name of the database
# Valid values : <db_name>.<db_domain> - when database domain isn't NULL
# <db_name> - when database domain is NULL
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
GDBNAME = "orcl11.us.oracle.com"

#-----------------------------------------------------------------------------
# Name : SCRIPTDESTINATION
# Datatype : String
# Description : Location of the scripts
# Valid values : Directory for all the scripts
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#SCRIPTDESTINATION =

#-----------------------*** End of deleteDatabase section ***------------------------

#-----------------------------------------------------------------------------
# CONFIGUREDATABASE section is used when OPERATION_TYPE is defined as "configureDatabase".
#-----------------------------------------------------------------------------
[CONFIGUREDATABASE]

#-----------------------------------------------------------------------------
# Name : SOURCEDB
# Datatype : String
# Description : The source database is the SID
# This database must be local and on the same ORACLE_HOME.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
#SOURCEDB = "orcl"

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES, if no OS authentication
#-----------------------------------------------------------------------------
#SYSDBAUSERNAME = "sys"


#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# You can also specify the password at the command prompt instead of here.
# Default value : none
# Mandatory : YES, if no OS authentication
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD =

#-----------------------------------------------------------------------------
# Name : REGISTERWITHDIRSERVICE
# Datatype : Boolean
# Description : Specifies whether to register with Directory Service.
# Valid values : TRUE \ FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#REGISTERWITHDIRSERVICE= TRUE

#-----------------------------------------------------------------------------
# Name : UNREGISTERWITHDIRSERVICE
# Datatype : Boolean
# Description : Specifies whether to unregister with Directory Service.
# Valid values : TRUE \ FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#UNREGISTERWITHDIRSERVICE= TRUE

#-----------------------------------------------------------------------------
# Name : REGENERATEDBPASSWORD
# Datatype : Boolean
# Description : Specifies whether regenerate database password in OID/Wallet
# Valid values : TRUE \ FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#REGENERATEDBPASSWORD= TRUE

#-----------------------------------------------------------------------------
# Name : DIRSERVICEUSERNAME
# Datatype : String
# Description : Specifies the name of the directory service user
# Mandatory : YES, if the any of the reg/unreg/regenPasswd options specified
#-----------------------------------------------------------------------------
#DIRSERVICEUSERNAME= "name"

#-----------------------------------------------------------------------------
# Name : DIRSERVICEPASSWORD
# Datatype : String
# Description : The password of the directory service user.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the any of the reg/unreg/regenPasswd options specified
#-----------------------------------------------------------------------------
#DIRSERVICEPASSWORD= "password"

#-----------------------------------------------------------------------------
# Name : WALLETPASSWORD
# Datatype : String
# Description : The password for wallet to created or modified.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the any of the reg/unreg/regenPasswd options specified
#-----------------------------------------------------------------------------
#WALLETPASSWORD= "password"

#-----------------------------------------------------------------------------
# Name : DISABLESECURITYCONFIGURATION
# Datatype : String
# Description : Database Security Settings
# Valid values : ALL|NONE|AUDIT|PASSWORD_PROFILE
# Default value : NONE
# Mandatory : No
#-----------------------------------------------------------------------------
#DISABLESECURITYCONFIGURATION = "NONE"



#-----------------------------------------------------------------------------
# Name : ENABLESECURITYCONFIGURATION
# Datatype : String
# Description : Database Security Settings
# Valid values : true|false
# Default value : true
# Mandatory : No
#-----------------------------------------------------------------------------
#ENABLESECURITYCONFIGURATION = "true"


#-----------------------------------------------------------------------------
# Name : EMCONFIGURATION
# Datatype : String
# Description : Enterprise Manager Configuration Type
# Valid values : CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE
# Default value : NONE
# Mandatory : No
#-----------------------------------------------------------------------------
#EMCONFIGURATION = "NONE"

#-----------------------------------------------------------------------------
# Name : SYSMANPASSWORD
# Datatype : String
# Description : Password for SYSMAN user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if LOCAL specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#SYSMANPASSWORD = "password"

#-----------------------------------------------------------------------------
# Name : DBSNMPPASSWORD
# Datatype : String
# Description : Password for DBSNMP user
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes, if EMCONFIGURATION is specified
#-----------------------------------------------------------------------------
#DBSNMPPASSWORD = "password"

#-----------------------------------------------------------------------------
# Name : CENTRALAGENT
# Datatype : String
# Description : Grid Control Central Agent Oracle Home
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#CENTRALAGENT =

#-----------------------------------------------------------------------------
# Name : HOSTUSERNAME
# Datatype : String
# Description : Host user name for EM backup job
# Default value : None
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#HOSTUSERNAME =

#-----------------------------------------------------------------------------
# Name : HOSTUSERPASSWORD
# Datatype : String
# Description : Host user password for EM backup job
# Default value : None
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#HOSTUSERPASSWORD=

#-----------------------------------------------------------------------------
# Name : BACKUPSCHEDULE
# Datatype : String
# Description : Daily backup schedule in the form of hh:mm
# Default value : 2:00
# Mandatory : Yes, if ALL or NOEMAIL are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#BACKUPSCHEDULE=

#-----------------------------------------------------------------------------
# Name : SMTPSERVER
# Datatype : String
# Description : Outgoing mail (SMTP) server for email notifications
# Default value : None
# Mandatory : Yes, if ALL or NOBACKUP are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#SMTPSERVER =

#-----------------------------------------------------------------------------
# Name : EMAILADDRESS
# Datatype : String
# Description : Email address for email notifications
# Default value : None
# Mandatory : Yes, if ALL or NOBACKUP are specified for EMCONFIGURATION
#-----------------------------------------------------------------------------
#EMAILADDRESS =

#-----------------------*** End of CONFIGUREDATABASE section ***------------------------


#-----------------------------------------------------------------------------
# ADDINSTANCE section is used when OPERATION_TYPE is defined as "addInstance".
#-----------------------------------------------------------------------------
[ADDINSTANCE]

#-----------------------------------------------------------------------------
# Name : DB_UNIQUE_NAME
# Datatype : String
# Description : DB Unique Name of the RAC database
# Valid values : <db_unique_name>
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"

#-----------------------------------------------------------------------------
# Name : INSTANCENAME
# Datatype : String
# Description : RAC instance name to be added
# Valid values : Check Oracle11g Administrator's Guide
# Default value : <sid_prefix>+<highest_current_thread+1>
# Mandatory : No
#-----------------------------------------------------------------------------
#INSTANCENAME = "orcl1"

#-----------------------------------------------------------------------------
# Name : NODELIST
# Datatype : String
# Description : Node on which to add new instance
# (in 10gR2, instance addition is supported on 1 node at a time)
# Valid values : Cluster node name
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
NODELIST=

#-----------------------------------------------------------------------------
# Name : OBFUSCATEDPASSWORDS
# Datatype : Boolean
# Description : Set to true if passwords are encrypted
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#OBFUSCATEDPASSWORDS = FALSE

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SYSDBAUSERNAME = "sys"

#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD = "password"

#-----------------------*** End of ADDINSTANCE section ***------------------------


#-----------------------------------------------------------------------------
# DELETEINSTANCE section is used when OPERATION_TYPE is defined as "deleteInstance".
#-----------------------------------------------------------------------------
[DELETEINSTANCE]

#-----------------------------------------------------------------------------
# Name : DB_UNIQUE_NAME
# Datatype : String
# Description : DB Unique Name of the RAC database
# Valid values : <db_unique_name>
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"

#-----------------------------------------------------------------------------
# Name : INSTANCENAME
# Datatype : String
# Description : RAC instance name to be deleted
# Valid values : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
INSTANCENAME = "orcl11g"

#-----------------------------------------------------------------------------
# Name : NODELIST
# Datatype : String
# Description : Node on which instance to be deleted (SID) is located
# Valid values : Cluster node name
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
#NODELIST=

#-----------------------------------------------------------------------------
# Name : OBFUSCATEDPASSWORDS
# Datatype : Boolean
# Description : Set to true if passwords are encrypted
# Valid values : TRUE\FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
#OBFUSCATEDPASSWORDS = FALSE

#-----------------------------------------------------------------------------
# Name : SYSDBAUSERNAME
# Datatype : String
# Description : A user with DBA role.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
SYSDBAUSERNAME = "sys"

#-----------------------------------------------------------------------------
# Name : SYSDBAPASSWORD
# Datatype : String
# Description : The password of the DBA user.
# Default value : none
# Mandatory : YES
#-----------------------------------------------------------------------------
#SYSDBAPASSWORD = "password"


#-----------------------*** End of DELETEINSTANCE section ***------------------------
[root@VM_0_12_centos response]#

安装实例

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@VM_0_12_centos database]$ dbca -silent -responseFile /tmp/database/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

启动停止数据库

启动

1.# su - oracle        //切换到 oracle 用户且切换到它的环境
2.$ lsnrctl status    //查看监听及数据库状态
3.$ lsnrctl start        //启动监听
4.$ sqlplus / as sysdba        //以 DBA 身份进入 sqlplus
5.SQL> startup    //启动 db

停止

1.# su - oracle        //切换到 oracle 用户且切换到它的环境
2.$ lsnrctl stop        //停止监听
3.$ sqlplus / as sysdba        //以 DBA 身份进入 sqlplus
4.SQL> SHUTDOWN IMMEDIATE        //关闭 db

其他相关

oracle常用命令

ps/sql安装和使用

------本文结束 感谢阅读------
鲁顺德 wechat
欢迎您扫一扫上面的微信公众号,订阅我的分享资源!
坚持原创技术分享,您的支持将鼓励我继续创作!