一、RHEL6.4安装Oracle 11GR2
1.1 安装文档
详细安装部署点击以下链接查看CSDN博客
1.2 启动数据库
[oracle@rhel64 ~]$ sqlplus / as sysdba idle instance 说明数据库实例没有启动 SYS@PROD>startup SYS@PROD>select status from v$instance;
1.3 正常关闭数据库
[oracle@rhel64 ~]$ sqlplus / as sysdba idle instance 说明数据库实例没有启动 SYS@PROD>startup SYS@PROD>select status from v$instance;
二、RHEL6.4安装Oracle 12C
2.1 安装文档
详细安装部署点击以下链接查看CSDN博客
2.2 登陆cdb
#环境变量ORACLE_SID登陆cdb [oracle@rhel64 ~]$ export ORACLE_SID=cdb11 [oracle@rhel64 ~]$ sql #查看pdb状态 SYS@cdb11> col name for a20 SYS@cdb11> select name,open_mode from v$pdbs;
2.3 cdb登陆pdb
#配置tns [oracle@rhel64 ~]$ cd $ORACLE_HOME/network/admin [oracle@rhel64 admin]$ vi tnsnames.ora prodpdb = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rhel64)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRODPDB) ) )
SYS@cdb11> conn sys/ORACLE@prodpdb as sysdba [oracle@rhel64 admin]$ cd $ORACLE_HOME/rdbms/admin [oracle@rhel64 admin]$ cp utlsampl.sql utlsampl2.sql CONNECT SCOTT/tiger@prodpdb SYS@prodpdb> @?/rdbms/admin/utlsampl2.sql [oracle@rhel64 ~]$ sqlplus scott/tiger@prodpdb
三、RHEL7.4安装Oracle 19C
3.1 安装文档
详细安装部署点击以下链接查看CSDN博客
3.2 开库及关库操作
[oracle@jeames admin]$ export $ORACLE_SID=PDB [oracle@jeames admin]$ sqlplus / as sysdba SQL> show pdbs SQL> alter pluggable database all open; --开PDB库 alter user sys identified by oracle; --cdb中修改 SQL> select name,cdb from v$database;
四、RHEL8.1安装部署Oracle 21C
4.1 安装文档
详细安装部署点击以下链接查看CSDN博客
4.2 开关库相关操作
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB MOUNTED alter session set container=ORCLPDB; SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 ORCLPDB MOUNTED SQL> alter pluggable database ORCLPDB open;
五、5分钟Docker极速安装部署Oracle
5.1 Docker环境部署
详细Docker环境搭建点击以下链接查看CSDN博客
5.2 部署Oracle 10G环境(10.2.0.5)
#可以选择从阿里云下载 docker pull registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora10g_10205 镜像大概2.5G左右,解压后大约7.6G左右,所以请保留充足的空间 #从阿里云下载后可以tag成如下形式: docker tag registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora10g_10205 jemora10g:10205 #创建容器 docker run -itd --name jemora10205 -h jemora10g -p 3380:3389 \ -p 31521:1521 -p 312:22 \ --privileged=true \ jemora10g:10205 init 注意:hostname必须为jemora10g #进入容器 [root@jeames ~]# docker exec -it jemora10205 bash #启动数据库和监听 [root@jemora10205 /]# su - oracle [oracle@jemora10205 ~]$ lsnrctl start [oracle@jemora10205 ~]$ sqlplus / as sysdba SYS@jem10g> startup SYS@jem10g> select * from v$version; #外部连接容器内的数据库 sqlplus sys/jem@192.168.1.54:31521/JEM10G AS SYSDBA 注意:此处访问宿主机端口为31521哈,容器内部是1521,端口映射,系统管理员密码为jem
5.3 部署Oracle 11G企业版环境(11.2.0.4)
#可以选择从阿里云下载 docker pull registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora11g11204 镜像大概3.2G左右,解压后大约7.6G左右,所以请保留充足的空间 #从阿里云下载后可以tag成如下形式: docker tag registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora11g11204 jemora11g:11204 #创建容器 docker run -itd --name jemora11204 -h jemora11204 \ --privileged=true -p 21521:1521 -p 222:22 -p 21158:1158 \ jemora11g:11204 init #进入容器 [root@jeames ~]# docker exec -it jemora11204 bash #启动数据库和监听 [root@jemora11204 /]# su - oracle [oracle@jemora11204 ~]$ lsnrctl start [oracle@jemora11204 ~]$ sqlplus / as sysdba SYS@JEM11G2> startup SYS@JEM11G2> select * from v$version; #外部连接容器内的数据库 sqlplus sys/jem@192.168.1.54:21521/JEM11GR2 AS SYSDBA 注意:此处访问宿主机端口为21521哈,容器内部是1521,端口映射,系统管理员密码为jem
5.4 Oracle 12CR2环境(12.2.0.1)
#可以选择从阿里云下载 docker pull registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora12c_12201 镜像大概2.5G左右,解压后大约7.6G左右,所以请保留充足的空间 #从阿里云下载后可以tag成如下形式: docker tag registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora12c_12201 jemora12c:12201 #创建容器 docker run -itd --name jemora1221 -h jemora1221 \ --privileged=true -p 41521:1521 -p 422:22 -p 15500:5500 -p 15501:5501 \ jemora12c:12201 init #进入容器 [root@jeames ~]# docker exec -it jemora1221 bash #启动数据库和监听 [root@jemora1221 /]# su - oracle [oracle@jemora1221 ~]$ lsnrctl start [oracle@jemora1221 ~]$ sqlplus / as sysdba SYS@jem> startup SYS@jem> select * from v$version;