方法不再介绍了,需要安装Github、Vagrant和VirtualBox,然后从这里下载项目。
需要从这里下载Oracle数据库21.3介质,并存放在vagrant-projects\OracleDatabase\21.3.0
目录下。
安装介质只需要数据库的,不需要GI的。也可以从My Oracle Support或edelivery下载,但最终都需要更名为LINUX.X64_213000_db_home.zip
。
运行以下命令开始安装,21c使用的操作系统为Oracle Linux 8,目前是8.5:
vagrant up
安装过程如下,总共耗时不到21分钟:
... oracle-21c-vagrant: [WARNING] [DBT-11219] Maximum of memory percentage (105) is allocated for the database creation, which might lead to "ORA-00700: SOFT INTERNAL ERROR" during database creation. oracle-21c-vagrant: CAUSE: Sum of sga and 2*pga is equal to or exceeding 90% of total physical memory. oracle-21c-vagrant: ACTION: Specify lesser values for memory parameters. oracle-21c-vagrant: Database Information: oracle-21c-vagrant: Global Database Name:ORCLCDB oracle-21c-vagrant: System Identifier(SID):ORCLCDB ... oracle-21c-vagrant: SQL> oracle-21c-vagrant: Disconnected from Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production oracle-21c-vagrant: Version 21.3.0.0.0 oracle-21c-vagrant: INSTALLER: Database created oracle-21c-vagrant: INSTALLER: Oratab configured oracle-21c-vagrant: Created symlink /etc/systemd/system/multi-user.target.wants/oracle-rdbms.service → /etc/systemd/system/oracle-rdbms.service. oracle-21c-vagrant: INSTALLER: Created and enabled oracle-rdbms systemd's service oracle-21c-vagrant: INSTALLER: setPassword.sh file setup oracle-21c-vagrant: INSTALLER: Running user-defined post-setup scripts oracle-21c-vagrant: INSTALLER: Done running user-defined post-setup scripts oracle-21c-vagrant: ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: RpMuTGPiyJM=1 oracle-21c-vagrant: INSTALLER: Installation complete, database ready to use! real 20m26.471s user 0m0.015s sys 0m0.000s
空间占用14.8GB,还是挺多的。
我修改了一些默认设置,虚机内存改为4096,totalMemory改为3072。totalMemory的75%(2304M)被分配给SGA,25%(768M)被分配给PGA。
以下是一些初始化参数:
pga_aggregate_target big integer 768M sga_max_size big integer 2304M sga_min_size big integer 0 sga_target big integer 2304M
为方便,可修改SYS和SYSTEM口令:
cd ~oracle ./setPassword.sh Welcome1
其实空间将近15G并不是都用于数据库了,数据库安装加新数据库需要约12G:
[vagrant@oracle-21c-vagrant ~]$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 0 1.8G 0% /dev/shm tmpfs 1.8G 41M 1.8G 3% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup /dev/mapper/vg_main-lv_root 33G 15G 19G 45% / /dev/sda1 495M 150M 346M 31% /boot tmpfs 365M 0 365M 0% /run/user/1000 vagrant 231G 171G 61G 74% /vagrant [root@oracle-21c-vagrant ~]# du -sh /opt 12G /opt