当前位置:网站首页>Install HR schema, example, and Scott schema on Oracle and MySQL
Install HR schema, example, and Scott schema on Oracle and MySQL
2022-07-26 08:35:00 【YaoYuan ace】
This article is introduced in Oracle and MySQL Installation on hr Method of sample database , And in Oracle Installation on example Method of sample database , as well as Scott How to install the sample database .
List of articles
stay oracle Installation on hr schema
19c examples installation is complete , stay $ORACLE_HOME/demo/schema/human_resources Execute under directory hr_main.sql File creation hr user :
[email protected](CDB$ROOT)> alter session set container=pdb1;
Session altered.
[email protected](CDB$ROOT)> create tablespace users datafile '/u01/app/oracle/oradata/ORCL/pdb1/user01.dbf' size 100m autoextend on;
Tablespace created.
[email protected]/pdb1.yaoyuan.com(PDB1)> @?/demo/schema/human_resources/hr_main.sql
specify password for HR as parameter 1:
Enter value for 1: hr
specify default tablespeace for HR as parameter 2:
Enter value for 2: users
specify temporary tablespace for HR as parameter 3:
Enter value for 3: temp
specify log path as parameter 4:
Enter value for 4: /tmp
Check after installation :
$ sqlplus hr/[email protected]
...
SQL> select table_name from user_tables;
TABLE_NAME
--------------------------------------------------------------------------------
COUNTRIES
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
7 rows selected.
SQL> select count(*) from employees;
COUNT(*)
----------
107
stay MySQL Installation on hr schema
stay MySQL It can also be installed and Oracle alike hr schema, See :https://github.com/nomemory/hr-schema-mysql. Installation method: :
wget https://github.com/nomemory/hr-schema-mysql/archive/refs/heads/master.zip
unzip master.zip
[[email protected] hr-schema-mysql-master]$ ll
total 36
-rw-r--r--. 1 oracle oinstall 31342 Feb 15 2021 hr-schema-mysql.sql
-rw-r--r--. 1 oracle oinstall 231 Feb 15 2021
[[email protected] hr-schema-mysql-master]$ mysql < hr-schema-mysql.sql
Check after installation :
mysql> use hr;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+------------------+
| Tables_in_hr |
+------------------+
| countries |
| departments |
| emp_details_view |
| employees |
| job_history |
| jobs |
| locations |
| regions |
+------------------+
8 rows in set (0.00 sec)
mysql> select count(*) from employees;
+----------+
| count(*) |
+----------+
| 107 |
+----------+
1 row in set (0.01 sec)
install examples
stay Oracle There is an installation document in the official document 《Database Examples Installation Guide》, This document has only one chapter !
Download from the official website LINUX.X64_193000_examples.zip Compressed package , And upload the server , The decompression directory structure is as follows
$ cd /home/oracle/examples/
[[email protected] examples]$ ls
install response runInstaller stage welcome.html
function runInstaller Install the image interface
Character silent installation
$ /directory_path/runInstaller [-silent] -responseFile responsefilename
[[email protected] examples]$ pwd
/media/sf_oracle/19c/examples
[[email protected] examples]$ ./runInstaller -silent -force -ignorePrereq -ignoreSysPrereqs -responseFile /media/sf_oracle/19c/examples/response/demos_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB. Actual 28381 MB Passed
Checking swap space: must be greater than 150 MB. Actual 7935 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-03-28_06-45-48PM. Please wait ...[[email protected] examples]$
[[email protected] examples]$ The response file for this session can be found at:
/u01/app/oracle/product/19.3.0/db_1/install/response/examples_2022-03-28_06-45-48PM.rsp
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2022-03-28_06-45-48PM.log
Successfully Setup Software.
The installation of Oracle Database 19c Examples was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2022-03-28_06-45-48PM.log' for more details.
The database is not directly modified during installation , Instead, install the script .
install HR、OE、PM、IX、SH、BI user
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 ,19c Address :
https://github.com/oracle/db-sample-schemas/releases/tag/v19c
Reference resources file : https://docs.oracle.com/en/database/oracle/oracle-database/19/comsc/toc.htm
decompression
unzip db-sample-schemas-19c.zip
Check it out readme.txt and readme.md file
Move to the corresponding directory
[[email protected] ~]$ cp -r /media/sf_oracle/19c/db-sample-schemas-19c $ORACLE_HOME/demo/schema
mv db-sample-schemas-19c $ORACLE_HOME/demo/schema/
Put the _SUB__CWD__ Replace with the current path :
[[email protected] db-sample-schemas-19c] pwd
/u01/app/oracle/product/19.3.0/db_1/demo/schema/db-sample-schemas-19c
[[email protected] db-sample-schemas-19c]$ perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat
according to readme.md Install according to the installation method prompted in the document
sqlplus system/[email protected]_string
@mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /your/path/to/log/ connect_string
[[email protected] db-sample-schemas-19c]$ sqlplus system/[email protected]/pdb1.yaoyuan.com
...
[email protected]/pdb1.yaoyuan.com(PDB1)> @?/demo/schema/db-sample-schemas-19c/mksample oracle oracle hr oe pm ix sh bi users temp $ORACLE_HOME/demo/schema/log/ oracleace:1521/pdb1.yaoyuan.com
install scott schema
modify utlsampl.sql file , hold CONNECT SCOTT/tiger Change it to
CONNECT SCOTT/[email protected]/pdb1.yaoyuan.com
[[email protected] ~]$ sqlplus system/[email protected]/pdb1.yaoyuan.com
[email protected]/pdb1.yaoyuan.com(PDB1)> @/u01/app/oracle/product/19.3.0/db_1/rdbms/admin/utlsampl.sql
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Query the installed table :
[email protected]/pdb1.yaoyuan.com(PDB1)> select table_name from user_tables;
TABLE_NAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
At the bottom of the article is my wechat , Welcome to join me ( toeic 890 Points of Oracle ACE).
边栏推荐
- 请问现在flinkcdc支持sqlserver实例名方式连接吗?
- Guitar staff link Jasmine
- 【C语言】程序员筑基功法——《函数栈帧的创建与销毁》
- Date and time function of MySQL function summary
- Nodejs2day (modularization of nodejs, NPM download package, module loading mechanism)
- 2022-7-8 personal qualifying 5 competition experience (supplementary)
- 随机分布学习笔记
- Flutter text is left aligned with no blank space in the middle
- 关于期刊论文所涉及的一些概念汇编+期刊查询方法
- Leetcode and query question summary
猜你喜欢
随机推荐
苹果强硬新规:用第三方支付也要抽成,开发者亏大了!
CV learning notes (optical flow)
Sed job
BGP routing principle
【C语言】程序员筑基功法——《函数栈帧的创建与销毁》
matplotlib学习笔记
memorandum...
sed作业
22-07-14 personal training match 2 competition experience
2022 national vocational college skills competition "network security" competition question file upload penetration test answer flag
Basic configuration of BGP
Basic music theory rhythm connection problem, very important
When developing flutter, idea_ ID cannot solve the problem
23.8 using the applicationrunner or commandlinerunner to implement applicationrunner and commandlinerunner
2022-7-9 personal qualifying 6 competition experience
[GUI] swing package (window, pop-up window, label, panel, button, list, text box)
Run file command
Guitar staff link Jasmine
QT note 2
Alphabetic string









