编程知识 cdmana.com

Examples silent installation of Oracle 19C

Oracle 11g Of examples Example schema install , In this article 《Oracle 11g Of examples Silent installation 》 Introduced. ,Oracle 19c Of examples Example schema The installation is slightly different .

First , Download this package from the official website ,

LINUX.X64_193000_examples.zip

Upload server , Decompress to get the following directory structure ,

[oracle@bisal examples]$ ls -rlht
total 20K
-rwxrwxr-x.  1 root root  500 Feb  7  2013 welcome.html
-rwxr-xr-x.  1 root root 8.7K Apr 17  2019 runInstaller
drwxr-xr-x.  4 root root  191 Apr 17  2019 install
drwxr-xr-x. 13 root root 4.0K Apr 17  2019 stage
drwxrwxr-x.  2 root root   50 Dec  6 22:25 response

Silent installation , and 11g identical , stay response According to the demos_install.rsp, Regenerate the silent installation configuration file ,

[root@bisal response]# cat demos_install.rsp | grep -v ^# | grep -v ^$ > install.rsp

and 11g The difference is , The file is just a few lines ,

[root@bisal response]# vi install.rsp 
oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v19.0.0
UNIX_GROUP_NAME=
ORACLE_HOME=
ORACLE_BASE=

Comparison , This is a 11g Of ,

[oracle@app response]$ cat install.rsp 
oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4
ORACLE_BASE=/u01/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=

Silent installation instructions ,11g and 19c It's the same ,

[oracle@bisal examples]$ ./runInstaller -silent -force -ignorePrereq -ignoreSysPrereqs -responseFile /opt/software/examples/response/install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB.   Actual 2438 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2860 MB    Passed
Preparing 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.rsp
You can find the log of this install session at:
 /opt/oracle/oraInventory/logs/installActions2020-12-06_10-27-01PM.log


Successfully 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 installation is complete , Direct execution mksample.sql, You can do it schema Created , however 19c, There's no script ,

[oracle@bisal schema]$ pwd
/opt/oracle/product/19c/dbhome_1/demo/schema
[oracle@bisal schema]$ ls -rlht
total 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.sql
drwxr-xr-x. 2 oracle oinstall    6 Apr 17  2019 log
-rw-r--r--. 1 oracle oinstall 1.8K Apr 18  2019 mk_dir.sql.ouibak
drwxr-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

from 12.2 Start ,Oracle Self contained examples It just includes HR This schema, other schema, You need to go from github Download and install ,

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

This is a 19c The address of ,

https://github.com/oracle/db-sample-schemas/releases/tag/v19c

This is a 19.2 The address of ,

https://github.com/oracle/db-sample-schemas/releases/tag/v19.2

The document says otherwise ,CO(Customer Orders) It's from 12c Introduced schema, stay mksample.sql Not including him ,

The Customer Orders(CO) schema is available from Oracle Database 12c onwards. The master script @mksample currently does not include the CO schema.

stay db-sample-schemas-19.2.zip in customer_orders Folder , It's his creation script , You can refer to Readme.txt install .

19c Of examples installation is complete , You can create... In this path 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 -rlht
total 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

perform hr_main.sql,

SQL> @?/demo/schema/human_resources/hr_main.sql


specify password for HR as parameter 1:
Enter value for 1:


Enter value for 2:
Enter temp as the temporary tablespace for HR


Enter value for 3:
Enter your SYS password


specify password for SYS as parameter 4:
Enter value for 4:


specify log path as parameter 5:
Enter value for 5:

If installed db-sample-schemas-19.2.zip, First you need to decompress ,

[oracle@bisal db-sample-schemas-19.2]$ ls
bus_intelligence  drop_sch.sql     LICENSE.md  mksample.sql  order_entry    README.txt
CONTRIBUTING.md   human_resources  mk_dir.sql  mkunplug.sql  product_media  sales_history
customer_orders   info_exchange    mkplug.sql  mkverify.sql  README.md      shipping

mksample.sql in , Need to be right _SUB__CWD__ Replace ,

Shortcut ,_SUB__CWD__ Replace with the current path ,

perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat

It is recommended that the following instructions be followed mksample.sql, Avoid interactive input over and over again , Because in this way , Some users get wrong accounts , You can't log in , in addition ,connect_string Parameter is PDB, for example localhost:1521/pdb, But it can be tnsnames.ora Valid items in ,

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/( Ignore for current path ) localhost:1521/pdb

I use it ,

SQL> @mksample oracle oracle oracle oracle oracle oracle oracle oracle EXAMPLE_TBS TEMP 
     empty  BISAL(tnsnames.ora Configuration item )

schema The creation is complete , A validation script is automatically executed , Display all relevant data dictionaries ,

...


PROMPT
PROMPT All granted roles


SELECT    granted_role, grantee
 FROM     dba_role_privs
 WHERE    grantee in ('HR','OE','SH','PM','IX','BI')
 ORDER BY 1,2;


PROMPT
PROMPT All granted system privileges


SELECT    privilege, grantee
 FROM     dba_sys_privs
 WHERE    grantee in ('HR','OE','SH','PM','IX','BI')
 ORDER BY 1,2;


PROMPT
PROMPT All granted object privileges


SELECT    owner, table_name, privilege, grantee
 FROM     dba_tab_privs
 WHERE    grantee in ('HR','OE','SH','PM','IX','BI')
 ORDER BY 1,2,3,4;


PROMPT
PROMPT Space usage


SELECT    owner, segment_type, sum(bytes)
 FROM     dba_segments
 WHERE    owner in ('HR','OE','SH','PM','IX','BI')
 GROUP BY ROLLUP (owner, segment_type);


...

19c Of examples The reason for this installation is , I guess one of the reasons might be github Storage examples Script for , Comparison Oracle Provided on the official website , Will be more flexible , It's always up to date , You can upload and download at any time , It can also increase interaction , More in line with the daily needs of programmers .

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[bisal]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225111921875O.html

Scroll to Top