【无标题】使用Oracle官方提供的ova文件建立Oracle 19c学习环境
Oracle官方提供了安裝好的Oracle 19c虛擬機,打包成ova文件。可以使用這個文件建立一個oracle 19c的學習環境。
下載Oracle官方的虛擬機(OVA文件)
Oracle官方提供了ova文件創建虛擬機,其中安裝好Oracle 19c 的ova完的下載地址是:https://www.oracle.com/database/technologies/databaseappdev-vm.html
使用OVA文件創建新的虛擬機
可以使用Oracle提供的OVA在VirtualBox上創建虛擬機。在VirtualBox中選擇File 再選擇 Import Appliance ,然后選擇前面下載的ova文件,如下圖:
接著出現配置界面:
這里的配置可以修改,我把2GB的內存改成了4GB。然后點擊import,同意協議后導入:
導入后啟動虛擬機,增加了一個bridge的網卡:
登錄oracle用戶,密碼也是oracle,配置網絡:
檢查環境
看看Oracle為我們提供的虛擬機的環境:
[oracle@localhost network-scripts]$ chkconfig --list oracle ? 注:該輸出結果只顯示 SysV 服務,并不包含 原生 systemd 服務。SysV 配置數據 可能被原生 systemd 配置覆蓋。要列出 systemd 服務,請執行 'systemctl list-unit-files'。查看在具體 target 啟用的服務請執行'systemctl list-dependencies [target]'。oracle 0:關 1:關 2:開 3:開 4:開 5:開 6:關可以看到多了一個oracle的服務,這樣一開機oracle數據庫就啟動了,這個服務的管理腳本是/etc/rc.d/init.d/oracle文件。
查看一個oracle工具用到的配置文件:
發現已經有了一個sid為orclcdb的實例。
檢查一下oracle用戶的環境變量,發現居然沒有配置:
[oracle@localhost ~]$ env|grep -i oracle USER=oracle MAIL=/var/spool/mail/oracle PATH=/home/oracle/Desktop/Database_Track/coffeeshop:/home/oracle/java/jdk1.8.0_201/bin:/home/oracle/bin:/home/oracle/sqlcl/bin:/home/oracle/sqldeveloper:/home/oracle/datamodeler:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/sqlcl/bin:/home/oracle/sqldeveloper:/home/oracle/bin:/home/oracle/.local/bin:/home/oracle/bin PWD=/home/oracle JAVA_HOME=/home/oracle/java/jdk1.8.0_201 HOME=/home/oracle LOGNAME=oracle XDG_DATA_DIRS=/home/oracle/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share手工增加下面的配置到.bash_profile文件中:
export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/version/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$PATH:$ORACLE_HOME/bin:$JAVA_HOME/bin export ORACLE_SID=orclcdb export PATH=$JAVA_HOME/bin:$ORACLE_HOME/bin:$PATH檢查監聽的狀態:
[oracle@localhost ~]$ lsnrctl status ? LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 16-MAR-2022 01:59:51 ? Copyright (c) 1991, 2019, Oracle. All rights reserved. ? Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 16-MAR-2022 09:42:48 Uptime 496 days 18 hr. 44 min. 56 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service orclcdb Listener Parameter File /u01/app/oracle/product/version/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=8081))(Presentation=HTTP)(Session=RAW)) Services Summary... Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).Instance "orclcdb", status READY, has 1 handler(s) for this service... Service "8a34def16cd55c76e0530100007f040c" has 1 instance(s).Instance "orclcdb", status READY, has 1 handler(s) for this service... Service "orcl" has 1 instance(s).Instance "orclcdb", status READY, has 1 handler(s) for this service... Service "orclcdb" has 2 instance(s).Instance "orclcdb", status UNKNOWN, has 1 handler(s) for this service...Instance "orclcdb", status READY, has 1 handler(s) for this service... Service "orclcdbXDB" has 1 instance(s).Instance "orclcdb", status READY, has 1 handler(s) for this service... The command completed successfully使用操作系統認證登錄sqlplus,居然登錄失敗:
[oracle@localhost ~]$ sqlplus / as sysdba ? SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 16 01:59:59 2022 Version 19.3.0.0.0 ? Copyright (c) 1982, 2019, Oracle. All rights reserved. ? ERROR: ORA-01017: invalid username/password; logon denied檢查一下TWO_TASK環境變量的設置,果然是設置了TWO_TASK,取消設置后就可以使用操作系統認證登錄了:
[oracle@localhost ~]$ echo $TWO_TASK ORCL [oracle@localhost ~]$ unset TWO_TASK [oracle@localhost ~]$ echo $TWO_TASK ? [oracle@localhost ~]$ sqlplus / as sysdba ? SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 16 02:06:56 2022 Version 19.3.0.0.0 ? Copyright (c) 1982, 2019, Oracle. All rights reserved. ? ? Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 ? SQL>TWO_TASK設置了默認的服務名連接,例如下面的連接使用了TWO_TASK指定的服務:?
[oracle@localhost ~]$ sqlplus oracleace/oracleace ? SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 16 02:11:42 2022 Version 19.3.0.0.0 ? Copyright (c) 1982, 2019, Oracle. All rights reserved. ? ? Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 ? SQL>結束
好了,現在一套Oracle 19c的模版已經建好了,可以開始學習了!
文章下方是我的微信,歡迎加我(托業890分的Oracle ACE)。👇
總結
以上是生活随笔為你收集整理的【无标题】使用Oracle官方提供的ova文件建立Oracle 19c学习环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10无法将设置应用到计算机,Win
- 下一篇: 如何删除右键“新建”菜单中的不需要的菜单