mysql14创建asm磁盘_【DB宝7】如何在Docker容器中一步一步安装配置Oracle19c的ASM+DB环境...
一、安装Docker软件CentOS 7安装Docker: https://docs.docker.com/engine/install/centos/1--1、卸载掉旧版本的 Docker:2yumremove-ydockerdocker-clientdocker-client-latestdocker-commondocker-latestdocker-latest-logro...
一、安装Docker软件
CentOS 7安装Docker: https://docs.docker.com/engine/install/centos/
1--1、卸载掉旧版本的 Docker:
2yum remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
3
4--2、执行以下安装命令去安装依赖包:
5yum install -y yum-utils device-mapper-persistent-data lvm2
6yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
7
8yum -y install docker-ce docker-ce-cli containerd.io
9
10# 若执行报错,则配置yum源
11wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
12wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
13
14--或一键安装:
15curl -fsSL get.docker.com -o get-docker.sh
16sh get-docker.sh
17
18--启动Docker软件
19systemctl start docker
20systemctl status docker
21
22
23--3、检查版本
24docker version
25docker info
二、创建CentOS7.6的容器
1--CentOS镜像
2https://hub.docker.com/_/centos?tab=tags
3
4--拉取镜像
5docker pull centos:7.6.1810
6
7--创建容器
8docker run -d --name lhr2019ocpasm -h lhr2019ocpasm -p 5500-5510:5500-5510 -p 1521:1521 -p 222:22 --privileged=true centos:7.6.1810 /usr/sbin/init
9
10--修改时区
11docker cp /usr/share/zoneinfo/Asia/Shanghai lhr2019ocpasm:/etc/localtime
12
13--进入容器
14docker exec -it lhr2019ocpasm /bin/bash
15
16--安装一些必要的系统包
17yum install -y openssh-clients openssh-server initscripts net-tools telnet which wget passwd e4fsprogs lrzsz sudo unzip lvm2 tree traceroute bridge-utils dos2unix rlwrap xdpyinfo
18yum -y install vim redhat-lsb
19
20--解决agetty进程cpu占用率100%,宿主机和容器都需要执行
21systemctl stop getty@tty1.service
22systemctl mask getty@tty1.service
23
24--启动ssh进程
25systemctl restart sshd
26--修改root用户密码
27echo "root:lhr" | chpasswd
28
29--远程登录
30ssh root@192.168.1.35 -p222
31
32-- 配置容器内的yum源:阿里云
33wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
34wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
35
36yum clean all
37rpm --rebuilddb
三、操作系统配置部分
3.1、关闭防火墙(Docker中一般不需要)
1--关闭防火墙:
2systemctl disable firewalld
3systemctl stop firewalld
4systemctl stop firewalld.service
5systemctl disable firewalld.service
6--验证:
7systemctl list-unit-files | grep fire
3.2、禁用selinux(Docker中一般不需要)
1--临时关闭(不用重启机器):
2setenforce 0
3--查看SELinux状态:
41、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
5SELinux status: enabled
62、getenforce ##也可以用这个命令检查
7
8# 示例
9[root@lhr2019ocpasm ~] /usr/sbin/sestatus -v
10SELinux status: disabled
11[root@lhr2019ocpasm ~] getenforce
12Disabled
13[root@lhr2019ocpasm ~]
14
15--手工修改/etc/selinux/config中SELINUX=disabled,或使用下面命令:
16sed -i '/^SELINUX=.*/ s//SELINUX=disabled/' /etc/selinux/config
3.3、添加组和用户
3.3.1、添加oracle和grid用户
官网:https://docs.oracle.com/en/database/oracle/oracle-database/18/ladbi/creating-operating-system-privileges-groups.html#GUID-3A3C9191-4187-41D4-98C4-400746023F6B
1--创建组
2groupadd -g 54321 oinstall
3groupadd -g 54322 dba
4groupadd -g 54323 oper
5groupadd -g 54324 backupdba
6groupadd -g 54325 dgdba
7groupadd -g 54326 kmdba
8groupadd -g 54327 asmdba
9groupadd -g 54328 asmoper
10groupadd -g 54329 asmadmin
11groupadd -g 54330 racdba
12
13-- 创建用户并添加用户到组
14useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
15useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba,racdba grid
16
17-- 修改oracle和grid用户的密码为lhr
18echo "oracle:lhr" | chpasswd
19echo "grid:lhr" | chpasswd
3.3.2、创建安装目录
1# root用户创建目录并赋权:
2mkdir -p /u01/app/19.3.0/grid
3mkdir -p /u01/app/grid
4mkdir -p /u01/app/oracle
5mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
6chown -R grid:oinstall /u01
7chown -R oracle:oinstall /u01/app/oracle
8chmod -R 775 /u01/
9
10mkdir -p /u01/app/oraInventory
11chown -R grid:oinstall /u01/app/oraInventory
12chmod -R 775 /u01/app/oraInventory
3.3.3、配置grid和oracle用户的环境变量文件
修改grid、oracle用户的.bash_profile文件,直接使用root用户执行。
1、配置oracle用户的环境变量:
1cat >> /home/oracle/.bash_profile <
2
3umask 022
4export ORACLE_SID=lhr19cdb
5export ORACLE_BASE=/u01/app/oracle
6export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
7export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
8export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
9export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
10
11
12export TNS_ADMIN=$ORACLE_HOME/network/admin
13export ORACLE_PATH=.:$ORACLE_BASE/dba_scripts/sql:$ORACLE_HOME/rdbms/admin
14export SQLPATH=$ORACLE_HOME/sqlplus/admin
15
16
17#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
18#AL32UTF8 SELECT userenv('LANGUAGE') db_NLS_LANG FROM DUAL;
19export NLS_LANG="AMERICAN_CHINA.ZHS16GBK"
20
21alias sqlplus='rlwrap sqlplus'
22alias rman='rlwrap rman'
23alias asmcmd='rlwrap asmcmd'
24alias dgmgrl='rlwrap dgmgrl'
25alias sas='sqlplus / as sysdba'
26
27EOF
2、配置oracle用户的glogin.sql文件,用于修改SQL提示符:
1cat >>/u01/app/oracle/product/19.3.0/dbhome_1/sqlplus/admin/glogin.sql <
2
3set linesize 9999 pagesize 9999
4set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "
5
6EOF
3、配置grid用户的环境变量:
1cat >> /home/grid/.bash_profile <
2
3umask 022
4export ORACLE_SID=+ASM
5export ORACLE_BASE=/u01/app/grid
6export ORACLE_HOME=/u01/app/19.3.0/grid
7export LD_LIBRARY_PATH=$ORACLE_HOME/lib
8export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
9export PATH=$ORACLE_HOME/bin:$PATH
10alias sqlplus='rlwrap sqlplus'
11alias asmcmd='rlwrap asmcmd'
12alias dgmgrl='rlwrap dgmgrl'
13alias sas='sqlplus / as sysdba'
14
15EOF
4、配置grid用户的glogin.sql文件,用于修改SQL提示符:
1cat >>/u01/app/19.3.0/grid/sqlplus/admin/glogin.sql <
2
3set linesize 9999 pagesize 9999
4set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "
5
6EOF
3.3.4、配置root用户的环境变量
分别修改/etc/profile和/root/.bashrc文件:
1#修改/etc/profile
2cat >> /etc/profile <
3
4export ORACLE_BASE=/u01/app/grid
5export ORACLE_HOME=/u01/app/19.3.0/grid
6export GRID_HOME=$ORACLE_HOME
7export PATH=$PATH:$ORACLE_HOME/bin
8
9EOF
10
11
12#修改/root/.bashrc
13cat >> /root/.bashrc <
14
15export ORACLE_BASE=/u01/app/grid
16export ORACLE_HOME=/u01/app/19.3.0/grid
17export GRID_HOME=$ORACLE_HOME
18export PATH=$PATH:$ORACLE_HOME/bin
19
20EOF
3.4、安装依赖包
检查缺失的依赖包:
1rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
2compat-libcap1 \
3compat-libstdc++-33 \
4gcc \
5gcc-c++ \
6glibc \
7glibc-devel \
8ksh \
9libgcc \
10libstdc++ \
11libstdc++-devel \
12libaio \
13libaio-devel \
14libXext \
15libXtst \
16libX11 \
17libXau \
18libxcb \
19libXi \
20make \
21elfutils-libelf-devel \
22sysstat | grep "not installed"
推荐使用yum安装缺失的依赖包:
1yum install -y elfutils-libelf-devel*
2yum install -y compat-libstdc++*
3yum install -y libaio-devel*
4yum install -y ksh*
5
6# 最后重新检查,确保所有的包已安装。需要注意的是,有的时候由于版本的问题导致检查有问题,所以需要用rpm -qa | grep libstdc 来分别对每个包检查。
3.5、配置内核参数
3.5.1、修改/etc/sysctl.conf文件
1echo "
2vm.swappiness = 1
3vm.dirty_background_ratio = 3
4vm.dirty_ratio = 80
5vm.dirty_expire_centisecs = 500
6vm.dirty_writeback_centisecs = 100
7kernel.shmmni = 4096
8kernel.shmall = 1073741824
9kernel.shmmax = 4398046511104
10kernel.sem = 250 32000 100 128
11net.ipv4.ip_local_port_range = 9000 65500
12fs.aio-max-nr = 1048576
13fs.file-max = 6815744
14kernel.panic_on_oops = 1
15" >> /etc/sysctl.conf
16
17--使修改参数立即生效:
18/sbin/sysctl -p
3.5.2、修改/etc/security/limits.conf文件
1-- 修改OS用户grid和oracle资源限制:
2cp /etc/security/limits.conf /etc/security/limits.conf.`date +%Y%m%d`
3
4echo "grid soft nofile 1024
5grid hard nofile 65536
6grid soft stack 10240
7grid hard stack 32768
8grid soft nproc 2047
9grid hard nproc 16384
10oracle soft nofile 1024
11oracle hard nofile 65536
12oracle soft stack 10240
13oracle hard stack 32768
14oracle soft nproc 2047
15oracle hard nproc 16384
16root soft nproc 2047 " >> /etc/security/limits.conf
3.5.3、修改/etc/pam.d/login文件
1echo "session required pam_limits.so" >> /etc/pam.d/login
3.6、配置/dev/shm大小
如果不配置的话会报错:ORA-00845: MEMORY_TARGET not supported on this system,这个错误简单来说就是 MEMORY_MAX_TARGET 的设置不能超过 /dev/shm 的大小。
由于docker容器中没有/etc/fstab文件,所以我们只能每次重启容器后都修改一下/dev/shm大小。
1mount -o remount,size=4G /dev/shm
2echo "mount -o remount,size=4G /dev/shm" >> /etc/rc.local
3chmod +x /etc/rc.d/rc.local #Linux7需要修改权限保证开机启动
4
5--结果
6[root@lhr2019ocpasm /]# df -h
7Filesystem Size Used Avail Use% Mounted on
8... ...
9shm 4.0G 637M 3.4G 16% /dev/shm
10... ...
四、配置ASM磁盘
在docker中,我们使用asmlib+loop设备来配置ASM磁盘。
4.1、安装oracleasm
先安装kmod-oracleasm,再安装oracleasmlib和oracleasm-support
1--------------- rhel7安装asmlib:https://www.oracle.com/search
2--1、安装kmod-oracleasm
3yum install -y kmod-oracleasm
4# http://rpmfind.net/linux/rpm2html/search.php
5# wget http://rpmfind.net/linux/centos/7.7.1908/os/x86_64/Packages/kmod-oracleasm-2.0.8-26.el7.x86_64.rpm
6
7--2、安装oracleasmlib和oracleasm-support
8--下载地址:https://www.oracle.com/linux/downloads/linux-asmlib-rhel7-downloads.html
9wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
10wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
11rpm -ivh *.rpm
12
13--3、配置asmlib
14systemctl enable oracleasm.service
15
16oracleasm configure -i # 依次输入grid,asmadmin,y,y
17oracleasm configure -d
18oracleasm configure -e
19
20oracleasm init #若初始化失败,则尝试重启OS
21oracleasm status
22
23--结果示例
24[root@lhr2019ocpasm /]# oracleasm status
25Checking if ASM is loaded: yes
26Checking if /dev/oracleasm is mounted: yes
4.2、创建loop设备
1mkdir /asmdisk
2dd if=/dev/zero of=/asmdisk/disk1 bs=1024k count=2000
3dd if=/dev/zero of=/asmdisk/disk2 bs=1024k count=2000
4dd if=/dev/zero of=/asmdisk/disk3 bs=1024k count=2000
5dd if=/dev/zero of=/asmdisk/disk4 bs=1024k count=2000
6dd if=/dev/zero of=/asmdisk/disk5 bs=1024k count=2000
7dd if=/dev/zero of=/asmdisk/disk6 bs=1024k count=8000
8dd if=/dev/zero of=/asmdisk/disk7 bs=1024k count=8000
9
10
11mknod -m 0660 /dev/loop1 b 7 1
12mknod -m 0660 /dev/loop2 b 7 2
13mknod -m 0660 /dev/loop3 b 7 3
14mknod -m 0660 /dev/loop4 b 7 4
15mknod -m 0660 /dev/loop5 b 7 5
16mknod -m 0660 /dev/loop6 b 7 6
17mknod -m 0660 /dev/loop7 b 7 7
18
19
20/sbin/losetup /dev/loop1 /asmdisk/disk1
21/sbin/losetup /dev/loop2 /asmdisk/disk2
22/sbin/losetup /dev/loop3 /asmdisk/disk3
23/sbin/losetup /dev/loop4 /asmdisk/disk4
24/sbin/losetup /dev/loop5 /asmdisk/disk5
25/sbin/losetup /dev/loop6 /asmdisk/disk6
26/sbin/losetup /dev/loop7 /asmdisk/disk7
27
28
29losetup -a
30
31-- 结果示例
32[root@lhr2019ocpasm /]# losetup -a
33/dev/loop1: [0109]:17694792 (/asmdisk/disk1)
34/dev/loop2: [0109]:17694793 (/asmdisk/disk2)
35/dev/loop3: [0152]:16131608 (/asmdisk/disk3)
36/dev/loop4: [0152]:16131609 (/asmdisk/disk4)
37/dev/loop5: [0152]:16131611 (/asmdisk/disk5)
38/dev/loop6: [0152]:16164617 (/asmdisk/disk6)
39/dev/loop7: [0152]:16164622 (/asmdisk/disk7)
4.3、创建ASM磁盘
1oracleasm createdisk ASM1 /dev/loop1
2oracleasm createdisk ASM2 /dev/loop2
3oracleasm createdisk ASM3 /dev/loop3
4oracleasm createdisk ASM4 /dev/loop4
5oracleasm createdisk ASM5 /dev/loop5
6oracleasm createdisk ASM6 /dev/loop6
7oracleasm createdisk ASM7 /dev/loop7
8
9--在创建完成后,结果示例
10[root@lhr2019ocpasm /]# oracleasm listdisks
11ASM1
12ASM2
13ASM3
14ASM4
15ASM5
16ASM6
17ASM7
4.4、配置开机启动脚本
最好配置单独启动脚本,否则容器启动可能不会自动配置ASM磁盘。
1、配置shell脚本并赋权
1-- 1、编写shell脚本
2
3echo "
4#!/bin/bash
5mknod -m 0660 /dev/loop1 b 7 1
6mknod -m 0660 /dev/loop2 b 7 2
7mknod -m 0660 /dev/loop3 b 7 3
8mknod -m 0660 /dev/loop4 b 7 4
9mknod -m 0660 /dev/loop5 b 7 5
10mknod -m 0660 /dev/loop6 b 7 6
11mknod -m 0660 /dev/loop7 b 7 7
12
13systemctl restart oracleasm.service
14
15/sbin/losetup -d /dev/loop1
16/sbin/losetup -d /dev/loop2
17/sbin/losetup -d /dev/loop3
18/sbin/losetup -d /dev/loop4
19/sbin/losetup -d /dev/loop5
20/sbin/losetup -d /dev/loop6
21/sbin/losetup -d /dev/loop7
22/sbin/losetup /dev/loop1 /asmdisk/disk1
23/sbin/losetup /dev/loop2 /asmdisk/disk2
24/sbin/losetup /dev/loop3 /asmdisk/disk3
25/sbin/losetup /dev/loop4 /asmdisk/disk4
26/sbin/losetup /dev/loop5 /asmdisk/disk5
27/sbin/losetup /dev/loop6 /asmdisk/disk6
28/sbin/losetup /dev/loop7 /asmdisk/disk7
29
30oracleasm scandisks
31
32/u01/app/19.3.0/grid/bin/crsctl start res -all
33
34" > /etc/initASMDISK.sh
35
36-- 2、赋予可执行权限
37chmod +x /etc/initASMDISK.sh
38
2、配置系统服务并设置开机启动
1echo "
2
3[Unit]
4Description=Run a Custom Script at Startup
5After=default.target
6
7[Service]
8ExecStart=/etc/initASMDISK.sh
9
10[Install]
11WantedBy=default.target
12
13" > /etc/systemd/system/initASMDISK.service
14
15
16systemctl daemon-reload
17systemctl enable initASMDISK.service
18
五、数据库软件包准备
5.1、上传安装文件
打开SecureFX软件:
复制粘贴数据库文件到/soft目录下并等待上传完成。
注意,在上传完成后,最好对安装包进行MD5值校验,防止安装文件上传出现错误:
1[root@lhr2019ocpasm soft]# ll
2total 5809476
3-rw-r--r-- 1 root root 3059705302 Apr 26 2019 LINUX.X64_193000_db_home.zip
4-rw-r--r-- 1 root root 2889184573 Apr 26 2019 LINUX.X64_193000_grid_home.zip
5[root@lhr2019ocpasm soft]# md5sum LINUX.X64_193000_db_home.zip
61858bd0d281c60f4ddabd87b1c214a4f LINUX.X64_193000_db_home.zip
7[root@lhr2019ocpasm soft]# md5sum LINUX.X64_193000_grid_home.zip
8b7c4c66f801f92d14faa0d791ccda721 LINUX.X64_193000_grid_home.zip
5.2、解压安装文件
注意:从18c开始,解压后的文件所在目录就是GRID_HOME。所以解压的时候,就要把文件解压到之前配置的GRID_HOME下。
1--grid用户:
2unzip /soft/LINUX.X64_193000_grid_home.zip -d /u01/app/19.3.0/grid
3--oracle用户:
4unzip /soft/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/dbhome_1
六、图形化安装grid和db
设置DISPLAY环境变量,打开“Xmanager - Passive”软件,分别执行gridSetup.sh和runInstaller即可。
这里不再详细演示,我们本文主要使用静默方式来安装。
1--安装grid
2[grid@asm19clhr ~]$ export DISPLAY=192.168.1.1:0.0
3[grid@asm19clhr ~]$ /u01/app/19.3.0/grid/gridSetup.sh
4
5--安装db
6[root@raclhr-18c-n1 ~]# su - oracle
7Last login: Fri Sep 14 15:39:02 CST 2018 on pts/3
8[oracle@raclhr-18c-n1 ~]$ cd $ORACLE_HOME
9[oracle@raclhr-18c-n1 dbhome_1]$ export DISPLAY=192.168.59.1:0.0
10[oracle@raclhr-18c-n1 dbhome_1]$ ./runInstaller
七、静默安装grid和db
7.1、静默安装grid
7.1.1、开始安装grid软件
使用grid用户执行:
1[grid@lhr2019ocpasm ~]$ /u01/app/19.3.0/grid/gridSetup.sh -silent -force -noconfig -ignorePrereq \
2> oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0 \
3> INVENTORY_LOCATION=/u01/app/oraInventory \
4> oracle.install.option=HA_CONFIG \
5> ORACLE_BASE=/u01/app/grid \
6> oracle.install.asm.OSDBA=asmdba \
7> oracle.install.asm.OSOPER=asmoper \
8> oracle.install.asm.OSASM=asmadmin \
9> oracle.install.asm.SYSASMPassword=lhr \
10> oracle.install.asm.monitorPassword=lhr \
11> oracle.install.crs.config.scanType=LOCAL_SCAN \
12> oracle.install.crs.config.ClusterConfiguration=STANDALONE \
13> oracle.install.crs.config.configureAsExtendedCluster=false \
14> oracle.install.crs.config.useIPMI=false \
15> oracle.install.asm.storageOption=ASM \
16> oracle.install.asm.diskGroup.name=DATA \
17> oracle.install.asm.diskGroup.redundancy=EXTERNAL \
18> oracle.install.asm.diskGroup.AUSize=4 \
19> oracle.install.asm.diskGroup.disksWithFailureGroupNames=ORCL:ASM1,,ORCL:ASM2,,ORCL:ASM3, \
20> oracle.install.asm.diskGroup.disks=ORCL:ASM1,ORCL:ASM2,ORCL:ASM3 \
21> oracle.install.asm.diskGroup.diskDiscoveryString=ORCL:* \
22> oracle.install.crs.rootconfig.executeRootScript=false
23Launching Oracle Grid Infrastructure Setup Wizard...
24
25[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
26 CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
27 ACTION: Provide a password that conforms to the Oracle recommended standards.
28[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
29 CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
30 ACTION: Provide a password that conforms to the Oracle recommended standards.
31[WARNING] [INS-13014] Target environment does not meet some optional requirements.
32 CAUSE: Some of the optional prerequisites are not met. See logs for details. gridSetupActions2020-06-24_10-35-38AM.log
33 ACTION: Identify the list of failed prerequisite checks from the log: gridSetupActions2020-06-24_10-35-38AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
34The response file for this session can be found at:
35 /u01/app/19.3.0/grid/install/response/grid_2020-06-24_10-35-38AM.rsp
36
37You can find the log of this install session at:
38 /tmp/GridSetupActions2020-06-24_10-35-38AM/gridSetupActions2020-06-24_10-35-38AM.log
39
40As a root user, execute the following script(s):
41 1. /u01/app/oraInventory/orainstRoot.sh
42 2. /u01/app/19.3.0/grid/root.sh
43
44Execute /u01/app/19.3.0/grid/root.sh on the following nodes:
45[lhr2019ocpasm]
46
47
48
49Successfully Setup Software with warning(s).
50As install user, execute the following command to complete the configuration.
51 /u01/app/19.3.0/grid/gridSetup.sh -executeConfigTools -responseFile /u01/app/19.3.0/grid/install/response/grid_2020-06-24_10-35-38AM.rsp [-silent]
52Note: The required passwords need to be included in the response file.
53
54
55Moved the install session logs to:
56 /u01/app/oraInventory/logs/GridSetupActions2020-06-24_10-35-38AM
根据提示,使用root跑脚本:
11. /u01/app/oraInventory/orainstRoot.sh
22. /u01/app/19.3.0/grid/root.sh
再使用grid跑脚本:
1/u01/app/19.3.0/grid/gridSetup.sh -silent -executeConfigTools -responseFile /u01/app/19.3.0/grid/install/response/grid_2020-06-24_10-35-38AM.rsp
有警告忽略即可。
执行完成后,查看资源:
1[root@lhr2019ocpasm /]# crsctl stat res -t
2--------------------------------------------------------------------------------
3Name Target State Server State details
4--------------------------------------------------------------------------------
5Local Resources
6--------------------------------------------------------------------------------
7ora.ons
8 OFFLINE OFFLINE lhr2019ocpasm STABLE
9--------------------------------------------------------------------------------
10Cluster Resources
11--------------------------------------------------------------------------------
12ora.cssd
13 1 ONLINE ONLINE lhr2019ocpasm STABLE
14ora.diskmon
15 1 OFFLINE OFFLINE STABLE
16ora.evmd
17 1 ONLINE ONLINE lhr2019ocpasm STABLE
18--------------------------------------------------------------------------------
7.1.2、静默创建ASM实例
创建ASM实例可以使用图形界面创建:
1export DISPLAY=192.168.59.1:0.0
2/u01/app/19.3.0/grid/bin/asmca
可以静默创建ASM实例:
1/u01/app/19.3.0/grid/bin/asmca -silent -configureASM -sysAsmPassword lhr -asmsnmpPassword lhr -diskString 'ORCL:*' -diskGroupName DATA -diskList ORCL:ASM1,ORCL:ASM2,ORCL:ASM3 -redundancy EXTERNAL
日志:/u01/app/grid/cfgtoollogs/asmca/asmca-200403PM091415.log
7.1.3、静默创建监听
1netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp
7.1.4、创建DATA和FRA磁盘组
可以使用命令,也可以使用图形化界面来创建。
1#使用sqlplus / as sysasm登陆来创建磁盘组
2su - grid
3sqlplus / as sysasm
4alter system set asm_diskstring='ORCL:*';
5
6col name format a10
7set line 9999
8col path format a25
9select GROUP_NUMBER,path,name,disk_number,total_mb,free_mb,CREATE_DATE,MOUNT_STATUS,MOUNT_DATE from v$asm_disk order by GROUP_NUMBER desc,disk_number;
10select name,state,free_mb,required_mirror_free_mb,usable_file_mb from v$asm_diskgroup;
11
12--创建磁盘组
13create diskgroup FRA external redundancy disk 'ORCL:ASM4','ORCL:ASM5' ATTRIBUTE 'compatible.rdbms' = '19.0', 'compatible.asm' = '19.0';
14
15--给磁盘组添加磁盘
16alter diskgroup fra add disk 'ORCL:ASM7';
17alter diskgroup data add disk 'ORCL:ASM6';
查询ASM磁盘和磁盘组:
1[root@lhr2019ocpasm /]# export GRID_HOME=$ORACLE_HOME
2[root@lhr2019ocpasm /]# $GRID_HOME/bin/kfod disks=asm st=true ds=true cluster=true
3--------------------------------------------------------------------------------
4 Disk Size Header Path Disk Group User Group
5================================================================================
6 1: 2000 MB MEMBER ORCL:ASM1 DATA
7 2: 2000 MB MEMBER ORCL:ASM2 DATA
8 3: 2000 MB MEMBER ORCL:ASM3 DATA
9 4: 2000 MB MEMBER ORCL:ASM4 FRA
10 5: 2000 MB MEMBER ORCL:ASM5 FRA
11 6: 8000 MB MEMBER ORCL:ASM6 DATA
12 7: 8000 MB MEMBER ORCL:ASM7 FRA
13--------------------------------------------------------------------------------
14ORACLE_SID ORACLE_HOME HOST_NAME
15================================================================================
16 +ASM /u01/app/19.3.0/grid lhr2019ocpasm
17
18[root@lhr2019ocpasm /]# su - grid asmcmd lsdg
19Last login: Tue Jun 30 12:28:46 CST 2020 on pts/1
20State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
21MOUNTED EXTERN N 512 512 4096 1048576 14000 10448 0 10448 0 N DATA/
22MOUNTED EXTERN N 512 512 4096 1048576 12000 11303 0 11303 0 N FRA/
23
24[root@lhr2019ocpasm /]# crsctl stat res -t
25--------------------------------------------------------------------------------
26Name Target State Server State details
27--------------------------------------------------------------------------------
28Local Resources
29--------------------------------------------------------------------------------
30ora.DATA.dg
31 ONLINE ONLINE lhr2019ocpasm STABLE
32ora.FRA.dg
33 ONLINE ONLINE lhr2019ocpasm STABLE
34ora.LISTENER.lsnr
35 ONLINE ONLINE lhr2019ocpasm STABLE
36ora.asm
37 ONLINE ONLINE lhr2019ocpasm Started,STABLE
38ora.ons
39 OFFLINE OFFLINE lhr2019ocpasm STABLE
40--------------------------------------------------------------------------------
41Cluster Resources
42--------------------------------------------------------------------------------
43ora.cssd
44 1 ONLINE ONLINE lhr2019ocpasm STABLE
45ora.diskmon
46 1 OFFLINE OFFLINE STABLE
47ora.evmd
48 1 ONLINE ONLINE lhr2019ocpasm STABLE
49--------------------------------------------------------------------------------
7.2、静默安装db
1[oracle@asm19clhr ~]$ /u01/app/oracle/product/19.3.0/dbhome_1/runInstaller -silent -force -noconfig -ignorePrereq oracle.install.responseFileVersion=oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=oper oracle.install.db.OSBACKUPDBA_GROUP=backupdba oracle.install.db.OSDGDBA_GROUP=dgdba oracle.install.db.OSKMDBA_GROUP=kmdba
2Launching Oracle Database Setup Wizard...
3
4[FATAL] [INS-35344] The value is not specified for Real Application Cluster administrative (OSRACDBA) group.
5 ACTION: Specify a valid group name for Real Application Cluster administrative (OSRACDBA) group.
6[oracle@asm19clhr ~]$ /u01/app/oracle/product/19.3.0/dbhome_1/runInstaller -silent -force -noconfig -ignorePrereq oracle.install.responseFileVersion=oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=oper oracle.install.db.OSBACKUPDBA_GROUP=backupdba oracle.install.db.OSDGDBA_GROUP=dgdba oracle.install.db.OSKMDBA_GROUP=kmdba oracle.install.db.OSRACDBA_GROUP=racdba
7Launching Oracle Database Setup Wizard...
8
9[WARNING] [INS-13014] Target environment does not meet some optional requirements.
10 CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2020-03-27_03-51-38PM/installActions2020-03-27_03-51-38PM.log
11 ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2020-03-27_03-51-38PM/installActions2020-03-27_03-51-38PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
12The response file for this session can be found at:
13 /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_2020-03-27_03-51-38PM.rsp
14
15You can find the log of this install session at:
16 /u01/app/oraInventory/logs/InstallActions2020-03-27_03-51-38PM/installActions2020-03-27_03-51-38PM.log
17
18As a root user, execute the following script(s):
19 1. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
20
21Execute /u01/app/oracle/product/19.3.0/dbhome_1/root.sh on the following nodes:
22[asm19clhr]
23
24
25Successfully Setup Software with warning(s).
根据提示,使用root用户执行以下脚本:
1/u01/app/oracle/product/19.3.0/dbhome_1/root.sh
至此,ASM和db软件都已经安装完成了,接下来我们创建数据库。
八、dbca静默建库及配置
1-- 删除数据库
2dbca -silent -deleteDatabase -sourceDB lhr19cdb -sysDBAUserName sys -sysDBAPassword lhr -forceArchiveLogDeletion
3
4--创建lhr19cdb,是一个cdb的库
5dbca -silent -ignorePreReqs -ignorePrereqFailure -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
6-gdbname lhr19cdb -sid lhr19cdb \
7-createAsContainerDatabase TRUE \
8-sysPassword lhr -systemPassword lhr -pdbAdminPassword lhr -dbsnmpPassword lhr \
9-datafileDestination '+DATA' -recoveryAreaDestination '+FRA' \
10-storageType ASM \
11-characterset AL32UTF8 \
12-sampleSchema true \
13-totalMemory 1024 \
14-databaseType MULTIPURPOSE \
15-emConfiguration NONE
16
17--创建lhr19sdb,是一个非cdb的库
18dbca -silent -ignorePreReqs -ignorePrereqFailure -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
19-gdbname lhr19sdb -sid lhr19sdb \
20-createAsContainerDatabase FALSE \
21-sysPassword lhr -systemPassword lhr -dbsnmpPassword lhr \
22-datafileDestination '/u01/app/oracle/oradata' -recoveryAreaDestination '/u01/app/oracle/flash_recovery_area' \
23-storageType FS \
24-characterset ZHS16GBK \
25-sampleSchema true \
26-totalMemory 1024 \
27-databaseType MULTIPURPOSE \
28-emConfiguration NONE
使用oracle用户执行过程:
1[oracle@lhr2019ocpasm ~]$ dbca -silent -ignorePreReqs -ignorePrereqFailure -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
2> -gdbname lhr19cdb -sid lhr19cdb \
3> -createAsContainerDatabase TRUE \
4> -sysPassword lhr -systemPassword lhr -pdbAdminPassword lhr -dbsnmpPassword lhr \
5> -datafileDestination '+DATA' -recoveryAreaDestination '+FRA' \
6> -storageType ASM \
7> -characterset AL32UTF8 \
8> -sampleSchema true \
9> -totalMemory 1024 \
10> -databaseType MULTIPURPOSE \
11> -emConfiguration NONE
12[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
13 CAUSE:
14a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
15b.The password entered is a keyword that Oracle does not recommend to be used as password
16 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
17[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
18 CAUSE:
19a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
20b.The password entered is a keyword that Oracle does not recommend to be used as password
21 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
22Prepare for db operation
2310% complete
24Registering database with Oracle Restart
2514% complete
26Copying database files
2743% complete
28Creating and starting Oracle instance
2945% complete
3049% complete
3154% complete
3258% complete
3362% complete
34Completing Database Creation
3568% complete
3670% complete
3771% complete
38Executing Post Configuration Actions
39100% complete
40Database creation complete. For details check the logfiles at:
41 /u01/app/oracle/cfgtoollogs/dbca/lhr19cdb.
42Database Information:
43Global Database Name:lhr19cdb
44System Identifier(SID):lhr19cdb
45Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/lhr19cdb/lhr19cdb.log" for further details.
46
47
48[oracle@lhr2019ocpasm ~]$ dbca -silent -ignorePreReqs -ignorePrereqFailure -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
49> -gdbname lhr19sdb -sid lhr19sdb \
50> -createAsContainerDatabase FALSE \
51> -sysPassword lhr -systemPassword lhr -dbsnmpPassword lhr \
52> -datafileDestination '/u01/app/oracle/oradata' -recoveryAreaDestination '/u01/app/oracle/flash_recovery_area' \
53> -storageType FS \
54> -characterset ZHS16GBK \
55> -sampleSchema true \
56> -totalMemory 600 \
57> -databaseType MULTIPURPOSE \
58> -emConfiguration NONE
59[WARNING] [DBT-11205] Specified shared pool size does not meet the recommended minimum size requirement. This might cause database creation to fail.
60 ACTION: Specify at least (600 MB) for shared pool size.
61[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
62 CAUSE:
63a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
64b.The password entered is a keyword that Oracle does not recommend to be used as password
65 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
66[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
67 CAUSE:
68a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
69b.The password entered is a keyword that Oracle does not recommend to be used as password
70 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
71Prepare for db operation
7210% complete
73Registering database with Oracle Restart
7414% complete
75Copying database files
7643% complete
77Creating and starting Oracle instance
7845% complete
7949% complete
8053% complete
8157% complete
8260% complete
8362% complete
84Completing Database Creation
8568% complete
8670% complete
8771% complete
88Executing Post Configuration Actions
89100% complete
90Database creation complete. For details check the logfiles at:
91 /u01/app/oracle/cfgtoollogs/dbca/lhr19sdb.
92Database Information:
93Global Database Name:lhr19sdb
94System Identifier(SID):lhr19sdb
95Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/lhr19sdb/lhr19sdb.log" for further details.
创建完成后:
1[root@lhr2019ocpasm ~]# crsctl stat res -t
2--------------------------------------------------------------------------------
3Name Target State Server State details
4--------------------------------------------------------------------------------
5Local Resources
6--------------------------------------------------------------------------------
7ora.DATA.dg
8 ONLINE ONLINE lhr2019ocpasm STABLE
9ora.FRA.dg
10 ONLINE ONLINE lhr2019ocpasm STABLE
11ora.LISTENER.lsnr
12 ONLINE ONLINE lhr2019ocpasm STABLE
13ora.asm
14 ONLINE ONLINE lhr2019ocpasm Started,STABLE
15ora.ons
16 OFFLINE OFFLINE lhr2019ocpasm STABLE
17--------------------------------------------------------------------------------
18Cluster Resources
19--------------------------------------------------------------------------------
20ora.cssd
21 1 ONLINE ONLINE lhr2019ocpasm STABLE
22ora.diskmon
23 1 OFFLINE OFFLINE STABLE
24ora.evmd
25 1 ONLINE ONLINE lhr2019ocpasm STABLE
26ora.lhr19cdb.db
27 1 ONLINE ONLINE lhr2019ocpasm Open,HOME=/u01/app/o
28 racle/product/19.3.0
29 /dbhome_1,STABLE
30ora.lhr19sdb.db
31 1 ONLINE ONLINE lhr2019ocpasm Open,HOME=/u01/app/o
32 racle/product/19.3.0
33 /dbhome_1,STABLE
34--------------------------------------------------------------------------------
8.1、配置db自动启动
可以保证,无论在何种情况下,只要HAS启动,那么数据库都可以自动启动:
1crsctl modify resource ora.lhr19cdb.db -attr AUTO_START=always -unsupported
2crsctl modify resource ora.lhr19sdb.db -attr AUTO_START=always -unsupported
3
4
5--结果
6[root@lhr2019ocpasm ~]# crsctl stat res ora.lhr19cdb.db -p | grep AUTO_START
7AUTO_START=always
8[root@lhr2019ocpasm ~]# crsctl stat res ora.lhr19sdb.db -p | grep AUTO_START
9AUTO_START=always
8.2、19c EM配置
19c EM需要做额外的配置,2个数据库都需要配置:
1exec dbms_xdb_sethttsport(5500); --lhr19cdb
2# exec dbms_xdb_sethttsport(5501); --lhr19sdb
3@?/rdbms/admin/execemx emx
4
5chmod 777 /u01/app/oracle/product/19.3.0/dbhome_1/admin/lhr19cdb/xdb_wallet/*
6
7
8*/
9-- 监听中的示例
10
11[root@lhr2019ocpasm /]# lsnrctl status
12
13LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 30-JUN-2020 12:36:18
14
15Copyright (c) 1991, 2019, Oracle. All rights reserved.
16
17Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lhr2019ocpasm)(PORT=1521)))
18STATUS of the LISTENER
19------------------------
20Alias LISTENER
21Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
22Start Date 30-JUN-2020 10:54:35
23Uptime 0 days 1 hr. 41 min. 42 sec
24Trace Level off
25Security ON: Local OS Authentication
26SNMP OFF
27Listener Parameter File /u01/app/19.3.0/grid/network/admin/listener.ora
28Listener Log File /u01/app/grid/diag/tnslsnr/lhr2019ocpasm/listener/alert/log.xml
29Listening Endpoints Summary...
30 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhr2019ocpasm)(PORT=1521)))
31 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
32 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=lhr2019ocpasm)(PORT=5501))(Security=(my_wallet_directory=/u01/app/oracle/product/19.3.0/dbhome_1/admin/lhr19sdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
33 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=lhr2019ocpasm)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/19.3.0/dbhome_1/admin/lhr19cdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
34Services Summary...
35Service "+ASM" has 1 instance(s).
36 Instance "+ASM", status READY, has 1 handler(s) for this service...
37Service "+ASM_DATA" has 1 instance(s).
38 Instance "+ASM", status READY, has 1 handler(s) for this service...
39Service "+ASM_FRA" has 1 instance(s).
40 Instance "+ASM", status READY, has 1 handler(s) for this service...
41Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
42 Instance "lhr19cdb", status READY, has 1 handler(s) for this service...
43Service "lhr19cdb" has 1 instance(s).
44 Instance "lhr19cdb", status READY, has 1 handler(s) for this service...
45Service "lhr19cdbXDB" has 1 instance(s).
46 Instance "lhr19cdb", status READY, has 1 handler(s) for this service...
47Service "lhr19sdb" has 1 instance(s).
48 Instance "lhr19sdb", status READY, has 1 handler(s) for this service...
49Service "lhrsdbXDB" has 1 instance(s).
50 Instance "lhr19sdb", status READY, has 1 handler(s) for this service...
51The command completed successfully
EM访问地址:https://192.168.1.35:5500/em/
笔记本登录数据库:
1Microsoft Windows [版本 10.0.17134.765]2(c) 2018 Microsoft Corporation。保留所有权利。34C:\Users\lhrxxt>sqlplus sys/lhr@192.168.1.35:1521/lhr19cdb as sysdba56SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 30 14:25:05 202078Copyright (c) 1982, 2014, Oracle. All rights reserved.91011Connected to:12Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production1314SYS@192.168.1.35:1521/lhr19cdb> show pdbs1516 CON_ID CON_NAME OPEN MODE RESTRICTED17---------- ------------------------------ ---------- ----------18 2 PDB$SEED READ ONLY NO19SYS@192.168.1.35:1521/lhr19cdb> exit20Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production2122C:\Users\lhrxxt>sqlplus sys/lhr@192.168.1.35:1521/lhr19sdb as sysdba2324SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 30 14:25:13 20202526Copyright (c) 1982, 2014, Oracle. All rights reserved.272829Connected to:30Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production3132SYS@192.168.1.35:1521/lhr19sdb> show pdbs33SYS@192.168.1.35:1521/lhr19sdb>
8.3、提交容器镜像供别人下载使用
1--上传到Docker Hub
2docker container stop lhr2019ocpasm
3docker commit lhr2019ocpasm lhrbest/oracle19casm_lhr:1.0
4docker login
5docker push lhrbest/oracle19casm_lhr:1.0
6
7
8-- 从docker hub下载
9docker pull lhrbest/oracle19casm_lhr:1.0
10docker run -itd -h lhr2019ocpasm --name oracle19casmlhr -p 222:22 -p 1521:1521 -p 5500:5500 -p 5501:5501 --privileged=true lhrbest/oracle19casm_lhr:1.0 /usr/sbin/init
11
12docker exec -it oracle19casmlhr bash
13-- 执行其他数据库操作
14
这里有几个注意事项非常重要:
1-- ① 使用二进制包的方式安装Oracle 19c企业版的ASM和db,包括一个CDB,名称为lhr19cdb,一个非cdb,名称为lhr19sdb,所有密码均为lhr
2-- ② ASM磁盘脚本:/etc/initASMDISK.sh,请确保脚本/etc/initASMDISK.sh中的内容都可以正常执行
3-- ③ 若oracleasmlib初始化错误,则需要在安装Docker的主机上也配置oracleasmlib并初始化正常。
4yum install -y kmod-oracleasm
5wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
6wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
7rpm -ivh *.rpm
8
9
10systemctl enable oracleasm.service
11
12oracleasm init
13oracleasm status
14
15-- 返回yes
16[root@docker36 ~]# oracleasm init
17[root@docker36 ~]# oracleasm status
18Checking if ASM is loaded: yes
19Checking if /dev/oracleasm is mounted: yes
若Docker Hub上传和下载慢,则也可以使用阿里云:
1-- 上传到阿里云
2--https://cr.console.aliyun.com/cn-hangzhou/instances/repositories
3docker login --username=lhrbest@qq.com registry.cn-hangzhou.aliyuncs.com
4
5docker tag 1a46885aa4e7 registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19casm_lhr:1.0
6docker push registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19casm_lhr:1.0
7
8
9-- 从阿里云下载
10docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19casm_lhr:1.0
11docker run -itd -h lhr2019ocpasm --name oracle19casmlhr -p 222:22 -p 1521:1521 -p 5500:5500 -p 5501:5501 --privileged=true lhrbest/oracle19casm_lhr:1.0 /usr/sbin/init
更多推荐
所有评论(0)