Oracle 11g R2 Sample Schemas 安裝

来源:https://www.cnblogs.com/dbabd/archive/2019/05/20/10892435.html
-Advertisement-
Play Games

最近準備對之前學習SQL Loader的筆記進行整理,希望通過官方文檔中的示例學習(Case Studies)來進行,但是官方文檔中示例學習相關的腳本文件在資料庫軟體安裝完成之後預設並沒有提供,而是整合在另外一個安裝介質中,需通過安裝Oracle Examples介質來獲取相應的示例學習腳本。 數據 ...


最近準備對之前學習SQL*Loader的筆記進行整理,希望通過官方文檔中的示例學習(Case Studies)來進行,但是官方文檔中示例學習相關的腳本文件在資料庫軟體安裝完成之後預設並沒有提供,而是整合在另外一個安裝介質中,需通過安裝Oracle Examples介質來獲取相應的示例學習腳本。

資料庫示例(Oracle Database Examples)包含了一系列的示例腳本和產品功能演示的Schema信息,在學習Oracle資料庫的過程中可以通過這些示例更好的掌握資料庫相關的選項和功能特性。關於Oracle的示例Schema,更詳細的說明可以參考官方文檔:Database Sample Schemas

根據我的資料庫版本,需要下載Oracle 11g R2對應的examples安裝介質。如果資料庫版本是11.2.0.1,則可以到官網上進行下載示例安裝介質:Oracle Database 11g Release 2 Examples。本文使用的資料庫版本為11.2.0.4,相應的examples安裝介質可通過Oracle MOS上進行獲取,根據11.2.0.4的Patch說明,對應的examples安裝介質為:p13390677_112040_platform_6of7.zip

安裝準備

首先上傳對應壓縮包p13390677_112040_platform_6of7.zip到相應的目錄下。

# rz
rz waiting to receive.
Upload Zmodem
p13390677_112040_Linux-x86-64_6of7.zip                                                  (465.75 MB, 0:10 min = 46.57 MB/sec)

對壓縮包進行解壓,將文件放在/tmp目錄下。

# unzip p13390677_112040_Linux-x86-64_6of7.zip -d /tmp/

# ls /tmp/examples/
install  readme.html  response  runInstaller  stage  welcome.html

變更安裝文件的屬主和屬組。

# chown -R oracle.oinstall /tmp/examples/

# ls -ld /tmp/examples/
drwxr-xr-x 5 oracle oinstall 109 Aug 27  2013 /tmp/examples/

查看安裝介質解壓後的文件結構,Oracle Database Examples可以使用Oracle Installer軟體安裝器進行安裝,其中安裝種類可以通過圖形界面或是靜默安裝的方式,為了更快速的完成安裝,這裡通過靜默安裝,同時需要結合response響應文件指定安裝選項。

準備響應文件

安裝介質中提供了一個響應文件模板,位於response目錄下。

$ ls /tmp/examples/response/
demos_install.rsp

查看響應文件對應的文件內容,其中有各個選項的說明。

$ cat /tmp/examples/response/demos_install.rsp

###############################################################################
## Copyright(c) Oracle Corporation 1998,2013. All rights reserved.           ##
##                                                                           ##
## Specify values for the variables listed below to customize                ##
## your installation.                                                        ##
##                                                                           ##
## Each variable is associated with a comment. The comment                   ##
## can help to populate the variables with the appropriate                   ##
## values.                                                                   ##
##                                                                           ##
###############################################################################

#-------------------------------------------------------------------------------
# Do not change the following system generated value.
#-------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v11_2_0

#-------------------------------------------------------------------------------
# This variable holds the hostname of the system as set by the user.
# It can be used to force the installation to use an alternative
# hostname rather than using the first hostname found on the system
# (e.g., for systems with multiple hostnames and network interfaces).
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=

#-------------------------------------------------------------------------------
# Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=

#-------------------------------------------------------------------------------
# Inventory location.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=

#-------------------------------------------------------------------------------
# Languages in which the components will be installed.
#
# en   : English                  ja   : Japanese
# fr   : French                   ko   : Korean
# ar   : Arabic                   es   : Latin American Spanish
# bn   : Bengali                  lv   : Latvian
# pt_BR: Brazilian Portuguese     lt   : Lithuanian
# bg   : Bulgarian                ms   : Malay
# fr_CA: Canadian French          es_MX: Mexican Spanish
# ca   : Catalan                  no   : Norwegian
# hr   : Croatian                 pl   : Polish
# cs   : Czech                    pt   : Portuguese
# da   : Danish                   ro   : Romanian
# nl   : Dutch                    ru   : Russian
# ar_EG: Egyptian                 zh_CN: Simplified Chinese
# en_GB: English (Great Britain)  sk   : Slovak
# et   : Estonian                 sl   : Slovenian
# fi   : Finnish                  es_ES: Spanish
# de   : German                   sv   : Swedish
# el   : Greek                    th   : Thai
# iw   : Hebrew                   zh_TW: Traditional Chinese
# hu   : Hungarian                tr   : Turkish
# is   : Icelandic                uk   : Ukrainian
# in   : Indonesian               vi   : Vietnamese
# it   : Italian
#
# all_langs   : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs
#-------------------------------------------------------------------------------
SELECTED_LANGUAGES=en

#-------------------------------------------------------------------------------
# Complete path of the Oracle Home
#-------------------------------------------------------------------------------
ORACLE_HOME=

#-------------------------------------------------------------------------------
# Complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=

#------------------------------------------------------------------------------
# Specify the auto-updates option. It can be one of the following:
#   - MYORACLESUPPORT_DOWNLOAD
#   - OFFLINE_UPDATES
#   - SKIP_UPDATES
#------------------------------------------------------------------------------
oracle.installer.autoupdates.option=

#------------------------------------------------------------------------------
# In case MYORACLESUPPORT_DOWNLOAD option is chosen, specify the location where
# the updates are to be downloaded.
# In case OFFLINE_UPDATES option is chosen, specify the location where the updates
# are present.
#------------------------------------------------------------------------------
oracle.installer.autoupdates.downloadUpdatesLoc=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username which has the patches download privileges
# to be used for software updates.
#  Example   : [email protected]
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password which has the patches download privileges
# to be used for software updates.
#
# Example    : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example    : PROXY_HOST=proxy.domain.com
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and at least 2 chars.
#
# Example    : PROXY_PORT=25
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_USER=username
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_PWD=password
#------------------------------------------------------------------------------
PROXY_PWD=

#------------------------------------------------------------------------------
# Specify the proxy realm.
#
# Example    : PROXY_REALM=metalink
#------------------------------------------------------------------------------
PROXY_REALM=

可以對模版響應文件進行簡化處理,去掉相應的註釋內容和空行,複製生成一份響應文件dbabd_demos_install.rsp,關於響應文件中選項的設置可以參考另一篇博文關於響應文件的部分說明:CentOS 7靜默安裝Oracle 11g R2資料庫軟體

$ cat /tmp/examples/response/demos_install.rsp | grep -v '^$' | grep -v '^#' > /tmp/examples/response/dbabd_demos_install.rsp

$ cat /tmp/examples/response/dbabd_demos_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=dbabd
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/data/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/data/app/oracle
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=

執行靜默安裝

響應文件完成之後就可以進行靜默安裝了,需要使用oracle用戶進行安裝。

# su - oracle

$ cd /tmp/examples/

$ /tmp/examples/runInstaller -silent -force -ignorePrereq -ignoreSysPrereqs -responseFile /tmp/examples/response/dbabd_demos_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 36731 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 5103 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-05-18_08-54-52PM. Please wait ...

You can find the log of this install session at:
 /data/app/oraInventory/logs/installActions2019-05-18_08-54-52PM.log
The installation of Oracle Database 11g Examples was successful.
Please check '/data/app/oraInventory/logs/silentInstall2019-05-18_08-54-52PM.log' for more details.
Successfully Setup Software.

通過簡要的安裝信息可以看出安裝成功,如果需要詳細的日誌信息可以查詢提示信息中涉及的日誌文件。

完成安裝

至此,關於資料庫示例(Oracle Database Examples)對應的安裝介質就安裝完成了。通過查看目錄$ORACLE_HOME/rdbms/demo下的以ulcase命名的一系列文件就是Oracle針對SQL*Loader示例學習文件。在沒有安裝之前,這個目錄下是沒有文件的。

$ cd $ORACLE_HOME/rdbms/demo
$ ls ulcase*
ulcase10.ctl  ulcase11.sql  ulcase2.dat  ulcase4.dat  ulcase5.sql  ulcase7.ctl   ulcase8.ctl   ulcase92.dat  ulcase96.dat
ulcase10.sql  ulcase1.ctl   ulcase3.ctl  ulcase4.sql  ulcase6.ctl  ulcase7.dat   ulcase8.dat   ulcase93.dat  ulcase9.ctl
ulcase11.ctl  ulcase1.sql   ulcase3.sql  ulcase5.ctl  ulcase6.dat  ulcase7e.sql  ulcase8.sql   ulcase94.dat  ulcase9.sql
ulcase11.dat  ulcase2.ctl   ulcase4.ctl  ulcase5.dat  ulcase6.sql  ulcase7s.sql  ulcase91.dat  ulcase95.dat  ulcase.sh

其中ulcase.sh的內容如下:

$ cat ulcase.sh
#!/bin/sh
#
# $Header: ulcase.sh 06-sep-2007.13:54:17 jstenois Exp $
#
# ulcase.sh
#
# Copyright (c) 1999, 2007, Oracle. All rights reserved.
#
#    NAME
#      ulcase.sh - run sqlldr demos
#
#    DESCRIPTION
#      Shell script to run sqlldr demos.
#      Please append to script as more ulcase* demos are added.
#
#    MODIFIED   (MM/DD/YY)
#    jstenois    09/06/07 - remove password from demo script
#    krich       01/26/04 - adding case study 11
#    cmlim       07/20/99 - create shell script for running all sqlldr demos
#    cmlim       07/20/99 - Creation
#

echo "  "
echo "- This script runs through all of the SQL Loader demos."
echo "- It uses SQLPlus to create the necessary objects and then"
echo "- calls SQL Loader to load data.  This script uses schema"
echo "- SCOTT for all of the tests.  Whenever the script executes"
echo "- SQLPlus or SQL Loader utilities, it will prompt you for"
echo "- password of the SCOTT user.  You will need to enter this"
echo "- password every time for the script to continue.  The"
echo "- default password for user SCOTT is TIGER."
echo "  "

# CASE1
echo "  "
echo "  Starting case 1"
echo "  Calling SQL Plus to do setup for case 1"
sqlplus scott @ulcase1
echo "  Calling SQL Loader to load data for case 1"
sqlldr scott ulcase1.ctl

# CASE2
echo "  "
echo "  Starting case 2"
echo "  Calling SQL Loader to load data for case 2"
sqlldr scott ulcase2

# CASE3
echo "  "
echo "  Starting case 3"
echo "  Calling SQL Plus to do setup for case 3"
sqlplus scott @ulcase3
echo "  Calling SQL Loader to load data for case 3"
sqlldr scott ulcase3

# CASE4
echo "  "
echo "  Starting case 4"
echo "  Calling SQL Plus to do setup for case 4"
sqlplus scott @ulcase4
echo "  Calling SQL Loader to load data for case 4"
sqlldr scott ulcase4

# CASE5
echo "  "
echo "  Starting case 5"
echo "  Calling SQL Plus to do setup for case 5"
sqlplus scott @ulcase5
echo "  Calling SQL Loader to load data for case 5"
sqlldr scott ulcase5

# CASE6
echo "  "
echo "  Starting case 6"
echo "  Calling SQL Plus to do setup for case 6"
sqlplus scott @ulcase6
echo "  Calling SQL Loader to load data for case 6"
sqlldr scott ulcase6 direct=true

# CASE7
echo "  "
echo "  Starting case 7"
echo "  Calling SQL Plus to do setup for case 7"
sqlplus scott @ulcase7s
echo "  Calling SQL Loader to load data for case 7"
sqlldr scott ulcase7
echo "  Calling SQL Plus to do cleanup for case 7"
sqlplus scott @ulcase7e

# CASE8
echo "  "
echo "  Starting case 8"
echo "  Calling SQL Plus to do setup for case 8"
sqlplus scott @ulcase8
echo "  Calling SQL Loader to load data for case 8"
sqlldr scott ulcase8

# CASE9
echo "  "
echo "  Starting case 9"
echo "  Calling SQL Plus to do setup for case 9"
sqlplus scott @ulcase9
echo "  Calling SQL Loader to load data for case 9"
sqlldr scott ulcase9

# CASE10
echo "  "
echo "  Starting case 10"
echo "  Calling SQL Plus to do setup for case 10"
sqlplus scott @ulcase10
echo "  Calling SQL Loader to load data for case 10"
sqlldr scott ulcase10

# CASE11
echo "  "
echo "  Starting case 11"
echo "  Calling SQL Plus to do setup for case 11"
sqlplus scott @ulcase11
echo "  Calling SQL Loader to load data for case 11"
sqlldr scott ulcase11

參考

https://docs.oracle.com/cd/E11882_01/server.112/e10831/toc.htm
https://docs.oracle.com/cd/E11882_01/install.112/e24501/toc.htm#BABGFCIH
https://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html

☆〖本人水平有限,文中如有錯誤還請留言批評指正!〗☆


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 主從複製的問題 當master節點發生故障時,需要手動進行故障轉移 寫能力與存儲能力受限,寫能力和存儲能力都依賴於master節點 當master節點發生故障時,需要手動進行故障轉移 寫能力與存儲能力受限,寫能力和存儲能力都依賴於master節點 Redis Sentinel架構 在主從複製的基礎上 ...
  • 1、說明 生成列是由已存在的欄位通過表達式計算得來的 2、生成列類型 VIRTUAL,即 類型,欄位值不實際存儲,當讀取行時再計算,虛擬列類型不占存儲 STORED,即 類型,欄位值會實際存儲起來,當插入或更新時,欄位值會計算出來並存儲起來 3、用法 如: 再如: 詳見 https://dev.my ...
  • 大數據應該學什麼?如果是有基礎就根據個人情況來定,如果是零基礎想學習大數據,大數據應該學什麼?大數據要學的東西有很多,下麵列舉了一些學習大數據就該學習的技術,許多想學習大數據不知道大數據應該學什麼的,可以參考一下。 首先學習大數據,先瞭解什麼是大數據,瞭解大數據大概的運用,自己是否對大數據感興趣,因 ...
  • 根據多個可能的答案檢查一個值或變數。 舉例說明: SELECT [type],CASE [type] WHEN 'TT' THEN 'TYPE_TABLE' WHEN 'FN' THEN 'SQL_SCALAR_FUNCTION' WHEN 'C' THEN 'CHECK_CONSTRAINT' W ...
  • SQL Server 2017的Linked Server配置觸發的bug“Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION” 現象描述: 資料庫版本:SQL Server 2017 (RTM-CU14) (KB4484710) - 14.0.... ...
  • 從sys.objects對象表中,可以獲取當前資料庫所有觸發器: SELECT * FROM sys.objects WHERE [type] = 'tr' ...
  • 關係運算 關係代數 關係代數的基本操作 並 使用條件:兩個關係滿足並相容性 操作結果:將兩個關係合併,並刪除重覆的元組 差 使用條件:兩個關係滿足並相容性 操作結果:R-S產生一個元組在R中但不在S中的關係 笛卡爾積 操作結果:RxS表示將R與S中所有元組拼接的可能。 選擇 操作結果:選擇出滿足條件 ...
  • caement Archaic spelling of cement. caement Alternative forms[edit] caement (archaic) cæment (archaic) Hyphenation: cement Noun cement (countable and ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...