linuxoracle静默安装应答文件修改_Oracle 19c的examples静默安装
Oracle 11g的examples示例schema安裝,在這篇文章《Oracle 11g的examples靜默安裝》介紹過了,Oracle 19c的examples示例schema安裝略有不同。
首先,從官網下載這個壓縮包,
LINUX.X64_193000_examples.zip上傳服務器,解壓縮得到如下目錄結構,
[oracle@bisal examples]$ ls -rlhttotal 20K-rwxrwxr-x. 1 root root 500 Feb 7 2013 welcome.html-rwxr-xr-x. 1 root root 8.7K Apr 17 2019 runInstallerdrwxr-xr-x. 4 root root 191 Apr 17 2019 installdrwxr-xr-x. 13 root root 4.0K Apr 17 2019 stagedrwxrwxr-x. 2 root root 50 Dec 6 22:25 response采用靜默安裝,和11g相同,在response中根據demos_install.rsp,重新生成靜默安裝配置文件,
[root@bisal response]# cat demos_install.rsp | grep -v ^# | grep -v ^$ > install.rsp和11g不同的是,文件就幾行,
[root@bisal response]# vi install.rsp oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v19.0.0UNIX_GROUP_NAME=ORACLE_HOME=ORACLE_BASE=比對一下,這是11g的,
[oracle@app?response]$?cat?install.rsp?oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v11_2_0ORACLE_HOSTNAME=UNIX_GROUP_NAME=dbaINVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/product/11.2.0.4ORACLE_BASE=/u01/app/oracleoracle.installer.autoupdates.option=oracle.installer.autoupdates.downloadUpdatesLoc=AUTOUPDATES_MYORACLESUPPORT_USERNAME=AUTOUPDATES_MYORACLESUPPORT_PASSWORD=PROXY_HOST=PROXY_PORT=PROXY_USER=PROXY_PWD=PROXY_REALM=靜默安裝的指令,11g和19c是相同的,
[oracle@bisal?examples]$?./runInstaller?-silent?-force?-ignorePrereq?-ignoreSysPrereqs?-responseFile?/opt/software/examples/response/install.rspStarting?Oracle?Universal?Installer...Checking Temp space: must be greater than 415 MB. Actual 2438 MB PassedChecking swap space: must be greater than 150 MB. Actual 2860 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2020-12-06_10-27-01PM. Please wait ... [WARNING]?[INS-32056]?The?specified?Oracle?Base?contains?the?existing?Central?Inventory?location:?/opt/oracle/oraInventory. ACTION: Oracle recommends that the Central Inventory location is outside the Oracle Base directory. Specify a different location for the Oracle Base.The response file for this session can be found at:?/opt/oracle/product/19c/dbhome_1/install/response/examples_2020-12-06_10-27-01PM.rspYou can find the log of this install session at:?/opt/oracle/oraInventory/logs/installActions2020-12-06_10-27-01PM.logSuccessfully?Setup?Software.The installation of Oracle Database 19c Examples was successful.Please check '/opt/oracle/oraInventory/logs/silentInstall2020-12-06_10-27-01PM.log' for more details.11g安裝完成,直接執行mksample.sql,就可以完成schema的創建了,但是19c,沒這個腳本,
[oracle@bisal schema]$ pwd/opt/oracle/product/19c/dbhome_1/demo/schema[oracle@bisal schema]$ ls -rlhttotal 60K-rw-r--r--. 1 oracle oinstall 2.3K Apr 4 2009 drop_sch.sql-rw-r--r--. 1 oracle oinstall 17K Jul 1 2014 sted_mkplug.sql.dbl-rw-r--r--. 1 oracle oinstall 27K Jul 1 2014 mkplug.sqldrwxr-xr-x. 2 oracle oinstall 6 Apr 17 2019 log-rw-r--r--. 1 oracle oinstall 1.8K Apr 18 2019 mk_dir.sql.ouibakdrwxr-xr-x. 2 oracle oinstall 205 Dec 6 18:06 human_resources-rw-r-----. 1 oracle oinstall 1.8K Dec 6 22:28 mk_dir.sql從12.2開始,Oracle自帶的examples只是包含了HR這個schema,其他schema,需要自行從github下載和安裝,
Starting with Oracle Database 12c Release 2, the latest version of the sample schema scripts are available on GitHub at https://github.com/oracle/db-sample-schemas/releases/latest.
During a complete installation of Oracle Database, the HR schema can be installed either manually or automatically when creating a database using the dbca option. All the other sample schemas must be installed manually via the scripts available on GitHub.
https://docs.oracle.com/en/database/oracle/oracle-database/19/comsc/installing-sample-schemas.html#GUID-1E645D09-F91F-4BA6-A286-57C5EC66321D
這是19c的地址,
https://github.com/oracle/db-sample-schemas/releases/tag/v19c
這是19.2的地址,
https://github.com/oracle/db-sample-schemas/releases/tag/v19.2
文檔中另外說了,CO(Customer Orders)是從12c開始引入的schema,在mksample.sql不包括他,
The Customer Orders(CO) schema is available from Oracle Database 12c onwards.
The master script @mksample currently does not include the CO schema.
在db-sample-schemas-19.2.zip中customer_orders文件夾,是他的創建腳本,可以參考Readme.txt安裝。
19c的examples安裝完成,可以在這個路徑下創建hr,
$ORACLE_HOME/demo/schema/human_resources
[oracle@bisal human_resources]$ pwd/opt/oracle/product/19c/dbhome_1/demo/schema/human_resources[oracle@bisal human_resources]$ ls -rlhttotal 100K-rw-r--r--. 1 oracle oinstall 1.4K Aug 30 2002 hr_idx.sql-rw-r--r--. 1 oracle oinstall 7.1K Aug 30 2002 hr_comnt.sql-rw-r--r--. 1 oracle oinstall 9.2K Aug 30 2002 hr_cre.sql-rw-r--r--. 1 oracle oinstall 2.7K Aug 30 2002 hr_code.sql-rw-r--r--. 1 oracle oinstall 1.2K Oct 13 2002 hr_analz.sql-rw-r--r--. 1 oracle oinstall 44K Aug 16 2008 hr_popul.sql-rw-r--r--. 1 oracle oinstall 5.0K Nov 7 2015 hr_main_new.sql-rw-r--r--. 1 oracle oinstall 2.6K Nov 7 2015 hr_drop_new.sql-rw-r--r--. 1 oracle oinstall 4.7K Mar 30 2016 hr_main.sql-rw-r--r--. 1 oracle oinstall 2.6K Mar 30 2016 hr_drop.sql執行hr_main.sql,
SQL> @?/demo/schema/human_resources/hr_main.sqlspecify password for HR as parameter 1:Enter?value?for?1:Enter value for 2:Enter temp as the temporary tablespace for HREnter value for 3:Enter?your?SYS?passwordspecify password for SYS as parameter 4:Enter value for 4:specify log path as parameter 5:Enter value for 5:如果安裝db-sample-schemas-19.2.zip,首先需要解壓縮,
[oracle@bisal db-sample-schemas-19.2]$ lsbus_intelligence drop_sch.sql LICENSE.md mksample.sql order_entry README.txtCONTRIBUTING.md human_resources mk_dir.sql mkunplug.sql product_media sales_historycustomer_orders info_exchange mkplug.sql mkverify.sql README.md shippingmksample.sql中,需要對_SUB__CWD__進行替換,
快捷方式,_SUB__CWD__替換為當前路徑,
perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat建議按照如下指令執行mksample.sql,避免一次次交互輸入,因為這種方式下,有些用戶取的賬號出錯,導致不能登錄,另外,connect_string參數是PDB,例如localhost:1521/pdb,但可以是tnsnames.ora中的有效項,
SQL>?@mksample?<SYSTEM_password>?<SYS_password> <HR_password> <OE_password> <PM_password> <IX_password> ????<SH_password>?<BI_password>?EXAMPLE?TEMP?????$ORACLE_HOME/demo/schema/log/(忽略為當前路徑)?localhost:1521/pdb我用的是,
SQL>?@mksample?oracle?oracle?oracle?oracle?oracle?oracle?oracle oracle?EXAMPLE_TBS?TEMP?????空?BISAL(tnsnames.ora配置項)schema創建完成,會自動執行一個校驗腳本,顯示所有相關的數據字典,
...PROMPTPROMPT All granted rolesSELECT granted_role, grantee FROM dba_role_privs WHERE grantee in ('HR','OE','SH','PM','IX','BI') ORDER BY 1,2;PROMPTPROMPT All granted system privilegesSELECT privilege, grantee FROM dba_sys_privs WHERE grantee in ('HR','OE','SH','PM','IX','BI') ORDER BY 1,2;PROMPTPROMPT All granted object privilegesSELECT owner, table_name, privilege, grantee FROM dba_tab_privs WHERE grantee in ('HR','OE','SH','PM','IX','BI') ORDER BY 1,2,3,4;PROMPTPROMPT Space usageSELECT owner, segment_type, sum(bytes) FROM dba_segments WHERE owner in ('HR','OE','SH','PM','IX','BI') GROUP BY ROLLUP (owner, segment_type);...19c的examples之所以是這種安裝方式,我猜其中一點原因可能是github存儲examples的腳本,相比較Oracle官網提供,會更加靈活,隨時有更新,隨時能上傳下載,還可以增加互動,更符合程序員的日常需求。
近期更新的文章:
《sqlplus登錄緩慢的解決》
《VMWare 11安裝RedHat Linux 7過程中碰到的坑》
《COST值相同?是真是假?》
《Oracle 11g的examples靜默安裝》
《同名的同義詞和視圖解惑》
《v$和v_$的一些玄機》
文章分類和索引:
《公眾號700篇文章分類和索引》
總結
以上是生活随笔為你收集整理的linuxoracle静默安装应答文件修改_Oracle 19c的examples静默安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: rust怎么不要的墙拆掉_封阳台,栏杆要
- 下一篇: python 获取json中最大值_详细