好久没碰11g了,今天(2023年11月16日)因为有个需求又装了一遍。
在OCI上安装了一个Oracle Linux 6实例:
$ uname -a
Linux instance-20231116-1239-db11g 4.1.12-124.80.1.el6uek.x86_64 #2 SMP Mon Oct 9 02:32:10 PDT 2023 x86_64 x86_64 x86_64 GNU/Linux
安装数据库预配置包:
$ sudo yum install oracle-rdbms-server-11gR2-preinstall.x86_64
$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
$ id grid
id: grid: No such user
上传11.2.0.4介质,利用dbca安装数据库软件。以下为部分截图:
配置~oracle/.bash_profile,追加以下语句:
export ORACLE_BASE=/home/oracle/app/oracle
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1/
export PATH=$PATH:$ORACLE_HOME/bin
使用DBCA静默模式创建数据库orcl:
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname orcl -sid orcl -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword Welcome1 \
-systemPassword Welcome1 \
-databaseType MULTIPURPOSE \
-memoryPercentage 20 \
-storageType FS \
-datafileDestination "/home/oracle/app/oracle/oradata/" \
-redoLogFileSize 200 \
-emConfiguration NONE
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 "/home/oracle/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
11g创建数据库的速度比19c快多了。
现在已经有数据库条目了:
$ tail -1 /etc/oratab
orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:N
可以登录数据库了:
$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base remains unchanged with value /home/oracle/app/oracle
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 16 07:36:36 2023
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
再创建一个数据库orcl2:
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname orcl2 -sid orcl2 -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword Welcome1 \
-systemPassword Welcome1 \
-databaseType MULTIPURPOSE \
-memoryPercentage 20 \
-storageType FS \
-datafileDestination "/home/oracle/app/oracle/oradata/" \
-redoLogFileSize 200 \
-emConfiguration NONE
安装2个数据库后的空间使用情况:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 38G 20G 17G 55% /
tmpfs 7.5G 0 7.5G 0% /dev/shm
/dev/sda1 200M 276K 200M 1% /boot/efi
数据库条目:
$ tail -2 /etc/oratab
orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:N
orcl2:/home/oracle/app/oracle/product/11.2.0/dbhome_1:N
参考
- How to Create a 11g Database by DBCA with Silent Mode