一、安装docker
yum install -y yum-utils
yum-config-manager \
> --add-repo \
> https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
二、获取docker的Oracle镜像
docker pull jaspeen/oracle-11g
三、上传Oracle11g安装包
/install目录是默认安装目录,不然安装时会报错(Installation files not found. Unzip installation files into mounted(/install) folder)
mkdir /install
-rw-r--r--. 1 root root 1239269270 4月 29 15:52 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 4月 29 15:54 linux.x64_11gR2_database_2of2.zip
[root@localhost install]unzip linux.x64_11gR2_database_1of2.zip
[root@localhost install]unzip linux.x64_11gR2_database_2of2.zip
[root@localhost install]
总用量 2295592
drwxr-xr-x. 8 root root 128 8月 21 2009 database
-rw-r--r--. 1 root root 1239269270 4月 29 15:52 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 4月 29 15:54 linux.x64_11gR2_database_2of2.zip
四、安装Oracle11g
[root@localhost install]
Database is not installed. Installing...
Installing Oracle Database 11g
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 29054 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2045 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-04-29_08-36-50AM. Please wait ...You can find the log of this install session at:
/opt/oracle/oraInventory/logs/installActions2022-04-29_08-36-50AM.log
The following configuration scripts need to be executed as the "root" user.
/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/app/product/11.2.0/dbhome_1/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.
Changing permissions of /opt/oracle/oraInventory.
····································
······················
等它慢慢安装
五,初始化数据库
5.1,连接到容器,
docker exec -it oracle11g /bin/bash
3.2,切换到oracle用户,然后连接到sql控制台
su - oracle
sqlplus / as sysdba
SQL>
3.3,解锁账户
SQL> alter user scott account unlock;
User altered.
SQL> commit;
Commit complete.
SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL>
|