当前位置:   article > 正文

史上最详细的Oracle 所有版本(本文实例为19c)安装sample schemas ( HR, OE, PM, SH, IX, BI)(12C+)CO, QS(9i+)_19c hr样例数据

19c hr样例数据

 官方文档(请参考不同的版本对脚本进行下载):

Installing Sample Schemas
https://github.com/oracle-samples/db-sample-schemas/releasesReleases · oracle-samples/db-sample-schemas · GitHub

The schemas are:

  • HR: Human Resources
  • OE: Order Entry
  • PM: Product Media
  • IX: Information Exchange
  • SH: Sales History
  • BI: Business Intelligence
  • CO: Customer Orders
  • QS : Queued Shipping

Step 1: 将 db_sample_schemas-19.2的tar包放入环境中.

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

 Step2 : 进行解压缩

[oracle@oracle-db-19c admin]$ tar -zxvf db-sample-schemas-19.2.tar.gz

Step3: 进入被解压缩的文件夹中.

  1. [oracle@oracle-db-19c admin]$ cd db-sample-schemas-19.2/
  2. [oracle@oracle-db-19c db-sample-schemas-19.2]$ pwd
  3. /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2
  4. [oracle@oracle-db-19c db-sample-schemas-19.2]$

Step4: 验证是否安装了perl.(备注可以手动操作Step5,本说明使用perl命令进行路径替换)

  1. [oracle@oracle-db-19c db-sample-schemas-19.2]$ perl -v
  2. This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
  3. (with 57 registered patches, see perl -V for more detail)
  4. Copyright 1987-2018, Larry Wall
  5. Perl may be copied only under the terms of either the Artistic License or the
  6. GNU General Public License, which may be found in the Perl 5 source kit.
  7. Complete documentation for Perl, including FAQ lists, should be found on
  8. this system using "man perl" or "perldoc perl". If you have access to the
  9. Internet, point your browser at http://www.perl.org/, the Perl Home Page.
  10. [oracle@oracle-db-19c db-sample-schemas-19.2]$

Step5: Change all embedded paths to match your working directory

perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat 
  1. [oracle@oracle-db-19c db-sample-schemas-19.2]$ perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat
  2. [oracle@oracle-db-19c db-sample-schemas-19.2]$

Step6: Set the Oracle environment(本文忽略Step6)

Skip this step when running on a client machine (one without an Oracle Database installed).

(在客户端机器(没有安装Oracle数据库的机器)上运行时,请跳过此步骤。)

source /usr/local/bin/oraenv

Note: Oracle's sqlldr utility needs to be in $PATH for correct loading of the Product Media (PM) and Sales History (SH) schemas.

Step7 :检查是否Step5的修正结果是否正确
 

  1. [oracle@oracle-db-19c human_resources]$ pwd
  2. /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/human_resources
  3. [oracle@oracle-db-19c human_resources]$ cat hr_main.sql

HR Human Resources

Step 8: 开始执行HR: Human Resources   sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$
[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 14:22:22 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> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> alter session set container=PDB1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB1
SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/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 password for SYS as parameter 4:
Enter value for 4: sys

specify log path as parameter 5:
Enter value for 5: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify connect string as parameter 6:
Enter value for 6: PDB1

DROP USER hr CASCADE
          *
ERROR at line 1:
ORA-01918: user 'HR' does not exist

User created.


User altered.


User altered.


Grant succeeded.


Grant succeeded.

Step 9: 确认HR sample schema是否创建成功.

  1. SQL> SELECT table_name FROM user_tables;
  2. TABLE_NAME
  3. --------------------------------------------------------------------------------
  4. REGIONS
  5. COUNTRIES
  6. LOCATIONS
  7. DEPARTMENTS
  8. JOBS
  9. EMPLOYEES
  10. JOB_HISTORY
  11. 7 rows selected.
  12. SQL> show user;
  13. USER is "HR"
  14. SQL>

 

OE Order Entry

Step10 开始执行OE: Order Entry sample schema  sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 14:48:03 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> alter session set container=PDB1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB1
SQL> conn hr/hr@PDB1
Connected.
SQL> show user;
USER is "HR"
SQL> conn / as sysdba
Connected.
SQL> show user;
USER is "SYS"
SQL> alter session set container=PDB1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB1
SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/order_entry/oe_main.sql

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

specify default tablespeace for OE as parameter 2:
Enter value for 2: users

specify temporary tablespace for OE as parameter 3:
Enter value for 3: temp

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

specify password for SYS as parameter 5:
Enter value for 5: sys

specify directory path for the data files as parameter 6:
Enter value for 6: /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/order_entry/

writeable directory path for the log files as parameter 7:
Enter value for 7: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify version as parameter 8:
Enter value for 8: v3

specify connect string as parameter 9:
Enter value for 9: PDB1


User dropped.

old   1: CREATE USER oe IDENTIFIED BY &pass
new   1: CREATE USER oe IDENTIFIED BY OE

User created.

old   1: ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new   1: ALTER USER oe DEFAULT TABLESPACE users QUOTA UNLIMITED ON users

User altered.

old   1: ALTER USER oe TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER oe TEMPORARY TABLESPACE temp

User altered.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.

Step 11: 确认OE Order Entry sample schema是否创建成功.

  1. SQL> conn OE/OE@PDB1
  2. Connected.
  3. SQL> show user;
  4. USER is "OE"
  5. SQL> SELECT table_name FROM user_tables;
  6. TABLE_NAME
  7. --------------------------------------------------------------------------------
  8. CUSTOMERS
  9. WAREHOUSES
  10. ORDER_ITEMS
  11. ORDERS
  12. INVENTORIES
  13. PRODUCT_INFORMATION
  14. PRODUCT_DESCRIPTIONS
  15. PROMOTIONS
  16. PRODUCT_REF_LIST_NESTEDTAB
  17. SUBCATEGORY_REF_LIST_NESTEDTAB
  18. 10 rows selected.
  19. SQL>

PM: Product Media

Step12: 开始执行PM: Product Media sample schema  sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 15:22:36 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> alter session set container=PDB1;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDB1
SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/product_media/pm_main.sql

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

specify default tablespeace for PM as parameter 2:
Enter value for 2: users

specify temporary tablespace for PM as parameter 3:
Enter value for 3: temp

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

specify password for SYS as parameter 5:
Enter value for 5: sys

specify directory path for the PM data files as parameter 6:
Enter value for 6: /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/product_media/

specify directory path for the PM load log files as parameter 7:
Enter value for 7: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify work directory path as parameter 8:
Enter value for 8: /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/product_media/

specify connect string as parameter 9:
Enter value for 9: PDB1


User dropped.

old   1: CREATE USER pm IDENTIFIED BY &pass
new   1: CREATE USER pm IDENTIFIED BY PM

User created.

old   1: ALTER USER pm DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new   1: ALTER USER pm DEFAULT TABLESPACE users QUOTA UNLIMITED ON users

User altered.

old   1: ALTER USER pm TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER pm TEMPORARY TABLESPACE temp

User altered.


Grant succeeded.


Grant succeeded.

Connected.

Step 13: 确认PM: Product Media sample schema是否创建成功.

  1. SQL> show user;
  2. USER is "PM"
  3. SQL> SELECT table_name FROM user_tables;
  4. TABLE_NAME
  5. --------------------------------------------------------------------------------
  6. PRINT_MEDIA
  7. 1 row selected.
  8. SQL>

IX: Information Exchange

Step14: 开始执行IX: Information Exchange sample schema  sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$
[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 15:28:32 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> alter session set container=PDB1;

Session altered.

SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/info_exchange/ix_main.sql

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

specify default tablespeace for IX as parameter 2:
Enter value for 2: users

specify temporary tablespace for IX as parameter 3:
Enter value for 3: temp

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

specify path for log files as parameter 5:
Enter value for 5: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify version as parameter 6:
Enter value for 6: v3

specify connect string as parameter 7:
Enter value for 7: PDB1

dropping user ...
DROP USER ix CASCADE
          *
ERROR at line 1:
ORA-01918: user 'IX' does not exist


creating user ...

old   1: CREATE USER ix IDENTIFIED BY &pass
new   1: CREATE USER ix IDENTIFIED BY IX

User created.

old   1: ALTER USER ix DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new   1: ALTER USER ix DEFAULT TABLESPACE users QUOTA UNLIMITED ON users

User altered.

old   1: ALTER USER ix TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER ix TEMPORARY TABLESPACE temp

User altered.


Grant succeeded.

Step 15: 确认IX: Information Exchange sample schema是否创建成功.

  1. SQL> conn IX/IX@PDB1
  2. Connected.
  3. SQL> show user;
  4. USER is "IX"
  5. SQL> SELECT table_name FROM user_tables;
  6. TABLE_NAME
  7. --------------------------------------------------------------------------------------------------------------------------------
  8. ORDERS_QUEUETABLE
  9. AQ$_ORDERS_QUEUETABLE_S
  10. AQ$_ORDERS_QUEUETABLE_T
  11. AQ$_ORDERS_QUEUETABLE_H
  12. AQ$_ORDERS_QUEUETABLE_L
  13. SYS_IOT_OVER_73345
  14. AQ$_ORDERS_QUEUETABLE_G
  15. AQ$_ORDERS_QUEUETABLE_I
  16. 8 rows selected.
  17. SQL>

SH: Sales History

Step16 开始执行SH: Sales History sample schema  sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 15:34:59 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> alter session set container=PDB1;

Session altered.

SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/sales_history/sh_main.sql

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

specify default tablespace for SH as parameter 2:
Enter value for 2: users

specify temporary tablespace for SH as parameter 3:
Enter value for 3: temp

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

specify directory path for the data files as parameter 5:
Enter value for 5: /u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/sales_history/

writeable directory path for the log files as parameter 6:
Enter value for 6: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify version as parameter 7:
Enter value for 7: v3

specify connect string as parameter 8:
Enter value for 8: PDB1


Session altered.

DROP USER sh CASCADE
          *
ERROR at line 1:
ORA-01918: user 'SH' does not exist


old   1: CREATE USER sh IDENTIFIED BY &pass
new   1: CREATE USER sh IDENTIFIED BY SH

User created.

old   1: ALTER USER sh DEFAULT TABLESPACE &tbs
new   1: ALTER USER sh DEFAULT TABLESPACE users
old   2:  QUOTA UNLIMITED ON &tbs
new   2:  QUOTA UNLIMITED ON users

User altered.

old   1: ALTER USER sh TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER sh TEMPORARY TABLESPACE temp

User altered.


Grant succeeded.


Grant succeeded.


Grant succeeded.

Step 17: 确认SH: Sales History sample schema是否创建成功.

  1. SQL> show user;
  2. USER is "SH"
  3. SQL> SELECT table_name FROM user_tables;
  4. TABLE_NAME
  5. --------------------------------------------------------------------------------
  6. SALES
  7. COSTS
  8. TIMES
  9. PRODUCTS
  10. CHANNELS
  11. PROMOTIONS
  12. CUSTOMERS
  13. COUNTRIES
  14. SUPPLEMENTARY_DEMOGRAPHICS
  15. DR$SUP_TEXT_IDX$I
  16. DR$SUP_TEXT_IDX$K
  17. DR$SUP_TEXT_IDX$N
  18. DR$SUP_TEXT_IDX$U
  19. CAL_MONTH_SALES_MV
  20. FWEEK_PSCAT_SALES_MV
  21. 15 rows selected.
  22. SQL>

BI: Business Intelligence

Step18: 开始执行BI: Business Intelligence sample schema  sample 脚本.如下所示(若Step18无法正常执行,请参照下方手动执行操作):

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 15:57:55 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> alter session set container=PDB1;

Session altered.

SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/bus_intelligence/bi_main.sql

specify password for BI as parameter 1:
Enter value for 1: bi

specify default tablespeace for BI as parameter 2:
Enter value for 2: users

specify temporary tablespace for BI as parameter 3:
Enter value for 3: temp

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

specify password for OE as parameter 5:
Enter value for 5: oe

specify password for SH as parameter 6:
Enter value for 6: sh

specify log path as parameter 7:
Enter value for 7: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify version as parameter 8:
Enter value for 8: v3

specify connect string as parameter 9:
Enter value for 9: PDB1

 若手动执行,请打开脚本bi_main.sql,参照如下执行:

  1. [oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba
  2. SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 16:08:36 2022
  3. Version 19.3.0.0.0
  4. Copyright (c) 1982, 2019, Oracle. All rights reserved.
  5. Connected to:
  6. Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
  7. Version 19.3.0.0.0
  8. SQL> alter session set container=PDB1;
  9. Session altered.
  10. SQL> CREATE USER bi IDENTIFIED BY bi;
  11. User created.
  12. SQL> show user
  13. USER is "SYS"
  14. SQL> DROP USER bi CASCADE;
  15. User dropped.
  16. SQL> CREATE USER bi IDENTIFIED BY bi;
  17. User created.
  18. SQL> ALTER USER bi DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  19. User altered.
  20. SQL> ALTER USER bi TEMPORARY TABLESPACE temp;
  21. User altered.
  22. SQL> GRANT CREATE SESSION TO bi;
  23. Grant succeeded.
  24. SQL> GRANT CREATE SYNONYM TO bi;
  25. Grant succeeded.
  26. SQL> GRANT CREATE TABLE TO bi;
  27. Grant succeeded.
  28. SQL> GRANT CREATE VIEW TO bi;
  29. Grant succeeded.
  30. SQL> GRANT CREATE SEQUENCE TO bi;
  31. Grant succeeded.
  32. SQL> GRANT CREATE CLUSTER TO bi;
  33. Grant succeeded.
  34. SQL> GRANT CREATE DATABASE LINK TO bi;
  35. Grant succeeded.
  36. SQL> GRANT ALTER SESSION TO bi;
  37. Grant succeeded.
  38. SQL> GRANT RESOURCE , UNLIMITED TABLESPACE TO bi;
  39. Grant succeeded.
  40. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/bus_intelligence/bi_oe_pr.sql oe PDB1
  41. specify password for oe as parameter 1:
  42. specify connect string as parameter 2:
  43. Connected.
  44. Grant succeeded.
  45. Grant succeeded.
  46. Grant succeeded.
  47. Grant succeeded.
  48. Grant succeeded.
  49. Grant succeeded.
  50. Grant succeeded.
  51. Grant succeeded.
  52. Grant succeeded.
  53. Grant succeeded.
  54. Grant succeeded.
  55. Grant succeeded.
  56. Grant succeeded.
  57. Commit complete.
  58. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/bus_intelligence/bi_sh_pr.sql sh PDB1
  59. specify password for SH as parameter 1:
  60. specify connect string as parameter 2:
  61. Connected.
  62. Grant succeeded.
  63. Grant succeeded.
  64. Grant succeeded.
  65. Grant succeeded.
  66. Grant succeeded.
  67. Grant succeeded.
  68. Grant succeeded.
  69. Grant succeeded.
  70. Grant succeeded.
  71. Grant succeeded.
  72. Grant succeeded.
  73. Commit complete.
  74. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/bus_intelligence/bi_views.sql bi PDB1
  75. specify password for BI as parameter 1:
  76. specify connect string as parameter 2:
  77. Connected.
  78. Synonym created.
  79. Synonym created.
  80. Synonym created.
  81. Synonym created.
  82. Synonym created.
  83. Synonym created.
  84. Synonym created.
  85. Synonym created.
  86. Commit complete.
  87. SQL>

Step 19: 确认BI: Business Intelligence sample schema是否创建成功.

  1. SQL> SET ECHO ON
  2. SQL> COLUMN TABLE_NAME FORMAT A25
  3. SQL> COLUMN COLUMN_NAME FORMAT A30
  4. SQL> conn bi/bi@PDB1
  5. Connected.
  6. SQL> SELECT COUNT(*) FROM customers;
  7. COUNT(*)
  8. ----------
  9. 55500
  10. 1 row selected.
  11. SQL> SELECT COUNT(*) FROM products;
  12. SELECT COUNT(*) FROM promotions;
  13. SELECT COUNT(*) FROM sales;
  14. COUNT(*)
  15. ----------
  16. 72
  17. 1 row selected.
  18. SQL>
  19. COUNT(*)
  20. ----------
  21. 503
  22. 1 row selected.
  23. SQL>
  24. COUNT(*)
  25. ----------
  26. 918843
  27. 1 row selected.
  28. SQL> SELECT COUNT(*) FROM costs;
  29. COUNT(*)
  30. ----------
  31. 0
  32. 1 row selected.
  33. SQL> SELECT COUNT(*) FROM sh.cal_month_sales_mv;
  34. COUNT(*)
  35. ----------
  36. 48
  37. 1 row selected.
  38. SQL> SELECT COUNT(*) FROM sh.fweek_pscat_sales_mv;
  39. COUNT(*)
  40. ----------
  41. 11266
  42. 1 row selected.
  43. SQL> SELECT COUNT(*) FROM channels;
  44. COUNT(*)
  45. ----------
  46. 5
  47. 1 row selected.
  48. SQL> SELECT COUNT(*) FROM countries;
  49. COUNT(*)
  50. ----------
  51. 23
  52. 1 row selected.
  53. SQL> SELECT COUNT(*) FROM times;
  54. COUNT(*)
  55. ----------
  56. 1826
  57. 1 row selected.
  58. SQL> SET ECHO OFF
  59. SQL>
  60. SQL> set pagesize 200
  61. SQL> set linesize 200
  62. SQL>
  63. SQL>
  64. SQL> select * from tab;
  65. TNAME TABTYPE CLUSTERID
  66. -------------------------------------------------------------------------------------------------------------------------------- ------------- ----------
  67. CHANNELS SYNONYM
  68. COUNTRIES SYNONYM
  69. TIMES SYNONYM
  70. COSTS SYNONYM
  71. CUSTOMERS SYNONYM
  72. PRODUCTS SYNONYM
  73. PROMOTIONS SYNONYM
  74. SALES SYNONYM
  75. 8 rows selected.
  76. SQL> show user;
  77. USER is "BI"
  78. SQL>

 

CO: Customer Orders (ORACLE 9i sample schema)

Step20: 开始执行CO: Customer Orders sample schema  sample 脚本.如下所示:

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 16:33:34 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> alter session set container=PDB1;

Session altered.

SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/customer_orders/co_main.sql
Enter value for 1: co
Enter value for 2: PDB1
Enter value for 3: users
Enter value for 4: temp
Dropping user
drop user co
          *
ERROR at line 1:
ORA-01918: user 'CO' does not exist


Creating user

Grant succeeded.


User altered.


User altered.

Connected.
Running DDL
creating tables

Table created.


Comment created.


Comment created.


Comment created.


Comment created.


Table created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Table created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Table created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Table created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.

Creating indexes

Index created.


Index created.


Index created.

Creating views

View created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


View created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


View created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


View created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.

Running DML
Removing existing data

Table truncated.


0 rows deleted.


0 rows deleted.


0 rows deleted.


0 rows deleted.

Inserting data
INSERTING into CUSTOMERS

PL/SQL procedure successfully completed.

INSERTING into PRODUCTS

PL/SQL procedure successfully completed.

INSERTING into STORES

PL/SQL procedure successfully completed.

INSERTING into ORDERS

PL/SQL procedure successfully completed.

INSERTING into ORDER_ITEMS

PL/SQL procedure successfully completed.


Commit complete.

Resetting identity columns

Table altered.


Table altered.


Table altered.


Table altered.
 

  1. Example queries
  2. Store sales analysis
  3. STORE_NAME CONSECUTIVE_DAYS STORE_MX
  4. ------------------------------ ---------------- ----------
  5. Online 95 95
  6. Tokyo 8 8
  7. Tel Aviv 5 5
  8. Bejing 4 4
  9. Buenos Aires 4 4
  10. Bengaluru 3 3
  11. Perth 3 3
  12. San Francisco 3 3
  13. S??o Paulo 3 3
  14. Utrecht 3 3
  15. Berlin 2 2
  16. Chicago 2 2
  17. Johannesburg 2 2
  18. Lagos 2 2
  19. London 2 2
  20. Madrid 2 2
  21. Mexico City 2 2
  22. Mumbai 2 2
  23. New Dehli 2 2
  24. New York City 2 2
  25. Seattle 2 2
  26. Sydney 2 2
  27. Bucharest 1 1
  28. 23 rows selected.
  29. High value customers
  30. CUSTOMER_ID NUM_MONTHS TOTAL_VALUE
  31. ----------- ---------- -----------
  32. 3 3 720.92
  33. 7 3 478.63
  34. 9 3 687.73
  35. 19 3 430.90
  36. 24 3 579.17
  37. 49 3 631.51
  38. 52 3 665.12
  39. 62 4 882.99
  40. 63 4 646.23
  41. 87 3 515.15
  42. 92 3 1,078.31
  43. 104 3 757.34
  44. 111 3 648.26
  45. 119 3 584.34
  46. 123 3 515.07
  47. 131 3 817.67
  48. 133 4 1,152.00
  49. 134 3 703.64
  50. 146 4 1,054.09
  51. 152 4 1,088.09
  52. 154 3 793.01
  53. 160 4 632.68
  54. 166 4 1,537.74
  55. 189 3 746.02
  56. 190 4 948.04
  57. 194 3 760.11
  58. 207 3 730.21
  59. 213 3 734.65
  60. 214 3 561.19
  61. 219 3 773.65
  62. 220 3 470.08
  63. 239 3 573.00
  64. 242 3 813.07
  65. 245 3 492.64
  66. 253 3 460.20
  67. 278 3 1,198.37
  68. 291 3 665.48
  69. 299 3 541.97
  70. 306 3 847.44
  71. 317 3 576.98
  72. 318 3 711.30
  73. 330 4 709.53
  74. 336 3 547.17
  75. 364 3 656.75
  76. 374 3 385.08
  77. 386 3 778.70
  78. 388 3 746.48
  79. 47 rows selected.
  80. Product rating analysis
  81. PRODUCT_NAME NUMBER_OF_REVIEWS PRODUCT_MEAN_RATING PRODUCT_MEDIAN_RATING PRODUCT_MODE_RATING PRODUCT_LOWEST_RATING PRODUCT_HIGHEST_RATING
  82. ------------------------------ ----------------- ------------------- --------------------- ------------------- --------------------- ----------------------
  83. Women's Trousers (Blue) 1 10 10 10 10 10
  84. Men's Jeans (Grey) 4 8.5 8.5 7 7 10
  85. Girl's Pyjamas (White) 6 8.33 8 7 7 10
  86. Women's Coat (Black) 9 7.67 8 8 5 10
  87. Boy's Trousers (Blue) 3 7.67 8 6 6 9
  88. Women's Shirt (Green) 9 7.56 8 8 3 10
  89. Men's Coat (Red) 1 7 7 7 7 7
  90. Boy's Jeans (Black) 6 7 6.5 5 5 10
  91. Girl's Dress (Red) 7 6.86 8 9 2 10
  92. Boy's Shorts (Blue) 6 6.5 6 6 4 10
  93. Men's Hoodie (Red) 5 6.4 5 10 3 10
  94. Girl's Coat (Blue) 8 6.25 8 8 1 10
  95. Boy's Socks (Grey) 8 6.25 6.5 6 1 9
  96. Girl's Trousers (Red) 5 6.2 6 4 4 9
  97. Boy's Coat (Blue) 5 6.2 6 8 4 8
  98. Boy's Pyjamas (Grey) 2 6 6 5 5 7
  99. Girl's Shorts (Green) 6 6 6 4 4 8
  100. Girl's Pyjamas (Black) 7 5.86 6 4 1 10
  101. Women's Skirt (Red) 8 5.75 6.5 7 2 8
  102. Women's Jacket (Black) 2 5.5 5.5 5 5 6
  103. Women's Sweater (Brown) 9 5.44 5 5 2 10
  104. Boy's Shirt (Black) 9 5.33 5 1 1 10
  105. Boy's Trousers (White) 30 5.3 5 2 1 10
  106. Boy's Trousers (Black) 6 5.17 5 3 3 8
  107. Boy's Sweater (Red) 7 5.14 5 7 2 8
  108. Women's Jacket (Blue) 7 5.14 6 1 1 9
  109. Boy's Socks (White) 9 5 3 8 1 10
  110. Women's Socks (Grey) 1 5 5 5 5 5
  111. Girl's Hoodie (White) 8 4.88 4 3 2 10
  112. Girl's Pyjamas (Red) 8 4.88 4 2 2 9
  113. Boy's Hoodie (Grey) 9 4.67 4 4 1 10
  114. Women's Jeans (Brown) 6 4.5 3.5 2 1 9
  115. Women's Dress (Black) 4 4.25 4 4 4 5
  116. Men's Shorts (Black) 4 4.25 4.5 1 1 7
  117. Men's Pyjamas (Blue) 6 4.17 4 1 1 8
  118. Women's Jeans (Red) 3 4 1 1 1 10
  119. Girl's Jeans (Grey) 6 4 3.5 1 1 9
  120. Boy's Sweater (Green) 2 3.5 3.5 2 2 5
  121. Women's Skirt (Brown) 5 3.4 3 3 1 8
  122. Boy's Socks (Black) 8 3.13 2 2 2 8
  123. Women's Pyjamas (Grey) 6 2.67 3 1 1 4
  124. TOTAL 261 5.54 6 8 1 10
  125. 42 rows selected.
  126. Most popular products by volume
  127. PRODUCT_NAME NUMBER_OF_ORDERS TOTAL_VALUE REVENUE_RANK
  128. ------------------------------ ---------------- ----------- ------------
  129. Girl's Trousers (Red) 148 15,794.76 1
  130. Boy's Hoodie (Grey) 100 3,754.08 35
  131. Men's Pyjamas (Blue) 100 3,274.61 36
  132. Men's Coat (Red) 98 4,230.30 31
  133. Boy's Socks (White) 98 3,081.12 38
  134. Most popular products by value
  135. PRODUCT_NAME NUMBER_OF_ORDERS TOTAL_VALUE ORDER_COUNT_RANK
  136. ------------------------------ ---------------- ----------- ----------------
  137. Girl's Trousers (Red) 148 15,794.76 1
  138. Girl's Hoodie (White) 94 14,283.75 7
  139. Women's Trousers (Blue) 82 12,181.76 28
  140. Boy's Coat (Blue) 94 11,214.71 7
  141. Girl's Pyjamas (White) 89 11,118.60 17
  142. Daily order count and value
  143. SALE_DATE NUMBER_OF_ORDERS VALUE_OF_ORDERS
  144. -------------------- ---------------- ---------------
  145. 04-FEB-2018 1 209.38
  146. 05-FEB-2018 0 0.00
  147. 06-FEB-2018 0 0.00
  148. 07-FEB-2018 0 0.00
  149. 08-FEB-2018 1 54.23
  150. 09-FEB-2018 1 43.30
  151. 10-FEB-2018 1 304.98
  152. 11-FEB-2018 1 153.19
  153. 12-FEB-2018 0 0.00
  154. 13-FEB-2018 1 199.48
  155. 14-FEB-2018 0 0.00
  156. 15-FEB-2018 0 0.00
  157. 16-FEB-2018 0 0.00
  158. 17-FEB-2018 0 0.00
  159. 18-FEB-2018 0 0.00
  160. 19-FEB-2018 0 0.00
  161. 20-FEB-2018 0 0.00
  162. 21-FEB-2018 0 0.00
  163. 22-FEB-2018 2 537.23
  164. 23-FEB-2018 2 448.61
  165. 24-FEB-2018 4 413.10
  166. 25-FEB-2018 0 0.00
  167. 26-FEB-2018 2 221.88
  168. 27-FEB-2018 1 351.64
  169. 28-FEB-2018 1 319.20
  170. 01-MAR-2018 4 875.32
  171. 02-MAR-2018 2 247.40
  172. 03-MAR-2018 3 422.83
  173. 04-MAR-2018 0 0.00
  174. 05-MAR-2018 1 239.28
  175. 06-MAR-2018 2 355.04
  176. 07-MAR-2018 2 263.79
  177. 08-MAR-2018 1 96.68
  178. 09-MAR-2018 2 135.39
  179. 10-MAR-2018 2 247.21
  180. 11-MAR-2018 1 132.05
  181. 12-MAR-2018 5 562.18
  182. 13-MAR-2018 2 522.16
  183. 14-MAR-2018 4 601.28
  184. 15-MAR-2018 3 236.50
  185. 16-MAR-2018 2 388.88
  186. 17-MAR-2018 2 285.21
  187. 18-MAR-2018 2 218.53
  188. 19-MAR-2018 1 52.16
  189. 20-MAR-2018 1 130.95
  190. 21-MAR-2018 1 138.20
  191. 22-MAR-2018 5 1,003.52
  192. 23-MAR-2018 2 305.96
  193. 24-MAR-2018 2 240.35
  194. 25-MAR-2018 1 38.28
  195. 26-MAR-2018 1 359.11
  196. 27-MAR-2018 4 912.41
  197. 28-MAR-2018 2 256.71
  198. 29-MAR-2018 3 505.10
  199. 30-MAR-2018 7 1,329.04
  200. 31-MAR-2018 3 303.90
  201. 01-APR-2018 2 275.65
  202. 02-APR-2018 3 544.43
  203. 03-APR-2018 5 755.80
  204. 04-APR-2018 3 466.20
  205. 05-APR-2018 2 140.26
  206. 06-APR-2018 1 78.14
  207. 07-APR-2018 5 910.14
  208. 08-APR-2018 0 0.00
  209. 09-APR-2018 7 1,252.24
  210. 10-APR-2018 7 1,212.61
  211. 11-APR-2018 5 1,111.21
  212. 12-APR-2018 3 815.66
  213. 13-APR-2018 5 777.46
  214. 14-APR-2018 1 57.10
  215. 15-APR-2018 2 460.98
  216. 16-APR-2018 3 375.71
  217. 17-APR-2018 4 497.83
  218. 18-APR-2018 3 527.73
  219. 19-APR-2018 2 104.65
  220. 20-APR-2018 5 700.68
  221. 21-APR-2018 4 769.02
  222. 22-APR-2018 4 838.40
  223. 23-APR-2018 5 850.45
  224. 24-APR-2018 3 470.73
  225. 25-APR-2018 5 543.06
  226. 26-APR-2018 7 962.23
  227. 27-APR-2018 5 681.62
  228. 28-APR-2018 7 1,082.03
  229. 29-APR-2018 4 611.63
  230. 30-APR-2018 2 443.74
  231. 01-MAY-2018 4 433.75
  232. 02-MAY-2018 6 810.51
  233. 03-MAY-2018 5 631.16
  234. 04-MAY-2018 4 703.06
  235. 05-MAY-2018 5 1,304.49
  236. 06-MAY-2018 7 1,568.44
  237. 07-MAY-2018 3 366.23
  238. 08-MAY-2018 2 295.09
  239. 09-MAY-2018 3 357.54
  240. 10-MAY-2018 3 687.55
  241. 11-MAY-2018 3 764.82
  242. SALE_DATE NUMBER_OF_ORDERS VALUE_OF_ORDERS
  243. -------------------- ---------------- ---------------
  244. 12-MAY-2018 3 427.95
  245. 13-MAY-2018 5 810.37
  246. 14-MAY-2018 2 415.91
  247. 15-MAY-2018 5 807.96
  248. 16-MAY-2018 1 150.00
  249. 17-MAY-2018 3 402.88
  250. 18-MAY-2018 4 871.67
  251. 19-MAY-2018 1 104.37
  252. 20-MAY-2018 2 376.42
  253. 21-MAY-2018 6 1,194.02
  254. 22-MAY-2018 5 626.35
  255. 23-MAY-2018 4 710.44
  256. 24-MAY-2018 7 955.61
  257. 25-MAY-2018 3 410.90
  258. 26-MAY-2018 3 445.38
  259. 27-MAY-2018 5 436.81
  260. 28-MAY-2018 3 552.76
  261. 29-MAY-2018 1 101.68
  262. 30-MAY-2018 0 0.00
  263. 31-MAY-2018 4 530.82
  264. 01-JUN-2018 6 683.14
  265. 02-JUN-2018 5 598.83
  266. 03-JUN-2018 4 542.80
  267. 04-JUN-2018 4 774.33
  268. 05-JUN-2018 3 400.90
  269. 06-JUN-2018 5 977.01
  270. 07-JUN-2018 1 26.14
  271. 08-JUN-2018 3 648.46
  272. 09-JUN-2018 3 415.18
  273. 10-JUN-2018 3 520.15
  274. 11-JUN-2018 2 379.92
  275. 12-JUN-2018 4 417.65
  276. 13-JUN-2018 5 903.63
  277. 14-JUN-2018 5 1,112.48
  278. 15-JUN-2018 4 462.06
  279. 16-JUN-2018 5 817.75
  280. 17-JUN-2018 3 532.90
  281. 18-JUN-2018 4 818.02
  282. 19-JUN-2018 6 1,116.91
  283. 20-JUN-2018 6 1,109.11
  284. 21-JUN-2018 6 1,313.93
  285. 22-JUN-2018 7 792.58
  286. 23-JUN-2018 3 488.63
  287. 24-JUN-2018 4 660.64
  288. 25-JUN-2018 5 758.19
  289. 26-JUN-2018 7 1,077.50
  290. 27-JUN-2018 6 1,192.44
  291. 28-JUN-2018 2 443.51
  292. 29-JUN-2018 4 359.01
  293. 30-JUN-2018 1 156.64
  294. 01-JUL-2018 3 544.36
  295. 02-JUL-2018 7 1,076.29
  296. 03-JUL-2018 2 308.14
  297. 04-JUL-2018 5 725.44
  298. 05-JUL-2018 6 1,056.17
  299. 06-JUL-2018 0 0.00
  300. 07-JUL-2018 2 261.43
  301. 08-JUL-2018 11 1,688.50
  302. 09-JUL-2018 5 642.62
  303. 10-JUL-2018 1 155.88
  304. 11-JUL-2018 5 419.96
  305. 12-JUL-2018 3 640.59
  306. 13-JUL-2018 5 980.06
  307. 14-JUL-2018 4 652.81
  308. 15-JUL-2018 1 19.16
  309. 16-JUL-2018 0 0.00
  310. 17-JUL-2018 3 722.53
  311. 18-JUL-2018 4 813.25
  312. 19-JUL-2018 4 715.92
  313. 20-JUL-2018 4 559.31
  314. 21-JUL-2018 4 563.57
  315. 22-JUL-2018 6 690.61
  316. 23-JUL-2018 3 544.45
  317. 24-JUL-2018 4 484.77
  318. 25-JUL-2018 3 402.02
  319. 26-JUL-2018 5 476.93
  320. 27-JUL-2018 4 1,213.76
  321. 28-JUL-2018 5 744.00
  322. 29-JUL-2018 7 1,447.36
  323. 30-JUL-2018 4 594.54
  324. 31-JUL-2018 3 740.03
  325. 01-AUG-2018 5 1,099.93
  326. 02-AUG-2018 3 374.01
  327. 03-AUG-2018 2 223.42
  328. 04-AUG-2018 5 1,079.57
  329. 05-AUG-2018 5 1,077.18
  330. 06-AUG-2018 2 293.20
  331. 07-AUG-2018 4 466.25
  332. 08-AUG-2018 3 490.18
  333. 09-AUG-2018 5 640.42
  334. 10-AUG-2018 3 364.84
  335. 11-AUG-2018 5 713.17
  336. 12-AUG-2018 7 1,125.01
  337. 13-AUG-2018 9 1,545.54
  338. 14-AUG-2018 6 929.81
  339. 15-AUG-2018 3 665.71
  340. 16-AUG-2018 4 643.10
  341. SALE_DATE NUMBER_OF_ORDERS VALUE_OF_ORDERS
  342. -------------------- ---------------- ---------------
  343. 17-AUG-2018 5 709.08
  344. 18-AUG-2018 8 1,303.89
  345. 19-AUG-2018 5 871.74
  346. 20-AUG-2018 4 854.74
  347. 21-AUG-2018 2 166.50
  348. 22-AUG-2018 5 484.46
  349. 23-AUG-2018 11 1,949.52
  350. 24-AUG-2018 4 704.29
  351. 25-AUG-2018 0 0.00
  352. 26-AUG-2018 3 454.58
  353. 27-AUG-2018 6 1,025.92
  354. 28-AUG-2018 5 455.32
  355. 29-AUG-2018 4 668.26
  356. 30-AUG-2018 5 972.71
  357. 31-AUG-2018 8 1,000.66
  358. 01-SEP-2018 4 417.83
  359. 02-SEP-2018 7 1,431.90
  360. 03-SEP-2018 10 1,144.54
  361. 04-SEP-2018 4 678.74
  362. 05-SEP-2018 9 1,509.30
  363. 06-SEP-2018 7 1,282.86
  364. 07-SEP-2018 1 204.46
  365. 08-SEP-2018 9 1,235.66
  366. 09-SEP-2018 8 1,128.13
  367. 10-SEP-2018 7 1,198.13
  368. 11-SEP-2018 3 637.48
  369. 12-SEP-2018 8 1,409.66
  370. 13-SEP-2018 6 1,265.07
  371. 14-SEP-2018 3 749.05
  372. 15-SEP-2018 4 471.35
  373. 16-SEP-2018 5 1,145.17
  374. 17-SEP-2018 2 409.50
  375. 18-SEP-2018 3 696.43
  376. 19-SEP-2018 8 988.78
  377. 20-SEP-2018 4 605.09
  378. 21-SEP-2018 7 816.78
  379. 22-SEP-2018 4 647.82
  380. 23-SEP-2018 3 620.31
  381. 24-SEP-2018 6 1,094.24
  382. 25-SEP-2018 4 917.77
  383. 26-SEP-2018 6 713.95
  384. 27-SEP-2018 4 614.63
  385. 28-SEP-2018 3 823.48
  386. 29-SEP-2018 6 613.57
  387. 30-SEP-2018 6 890.78
  388. 01-OCT-2018 6 1,154.87
  389. 02-OCT-2018 3 226.69
  390. 03-OCT-2018 7 1,155.18
  391. 04-OCT-2018 1 228.76
  392. 05-OCT-2018 3 445.35
  393. 06-OCT-2018 6 846.67
  394. 07-OCT-2018 8 1,082.29
  395. 08-OCT-2018 3 615.53
  396. 09-OCT-2018 8 1,437.97
  397. 10-OCT-2018 9 1,788.72
  398. 11-OCT-2018 7 747.83
  399. 12-OCT-2018 2 305.48
  400. 13-OCT-2018 5 816.43
  401. 14-OCT-2018 5 528.84
  402. 15-OCT-2018 6 725.76
  403. 16-OCT-2018 3 422.58
  404. 17-OCT-2018 9 1,134.96
  405. 18-OCT-2018 6 764.75
  406. 19-OCT-2018 5 760.67
  407. 20-OCT-2018 5 797.36
  408. 21-OCT-2018 2 198.62
  409. 22-OCT-2018 4 723.16
  410. 23-OCT-2018 7 1,412.60
  411. 24-OCT-2018 7 931.38
  412. 25-OCT-2018 8 1,010.50
  413. 26-OCT-2018 6 1,233.25
  414. 27-OCT-2018 6 759.75
  415. 28-OCT-2018 9 1,167.47
  416. 29-OCT-2018 6 771.18
  417. 30-OCT-2018 3 424.11
  418. 31-OCT-2018 7 1,304.17
  419. 01-NOV-2018 5 660.67
  420. 02-NOV-2018 6 1,487.50
  421. 03-NOV-2018 4 580.93
  422. 04-NOV-2018 4 1,014.95
  423. 05-NOV-2018 4 792.70
  424. 06-NOV-2018 7 979.82
  425. 07-NOV-2018 8 839.06
  426. 08-NOV-2018 9 1,360.67
  427. 09-NOV-2018 4 650.25
  428. 10-NOV-2018 4 590.20
  429. 11-NOV-2018 6 865.12
  430. 12-NOV-2018 5 730.06
  431. 13-NOV-2018 3 481.38
  432. 14-NOV-2018 2 320.39
  433. 15-NOV-2018 8 1,336.67
  434. 16-NOV-2018 4 839.44
  435. 17-NOV-2018 5 644.00
  436. 18-NOV-2018 8 1,237.14
  437. 19-NOV-2018 7 1,028.19
  438. 20-NOV-2018 5 828.49
  439. 21-NOV-2018 6 1,384.62
  440. SALE_DATE NUMBER_OF_ORDERS VALUE_OF_ORDERS
  441. -------------------- ---------------- ---------------
  442. 22-NOV-2018 3 236.50
  443. 23-NOV-2018 4 891.24
  444. 24-NOV-2018 3 699.45
  445. 25-NOV-2018 2 318.94
  446. 26-NOV-2018 4 738.78
  447. 27-NOV-2018 4 702.97
  448. 28-NOV-2018 6 870.00
  449. 29-NOV-2018 5 635.92
  450. 30-NOV-2018 10 1,666.31
  451. 01-DEC-2018 2 348.97
  452. 02-DEC-2018 9 1,566.81
  453. 03-DEC-2018 10 1,597.85
  454. 04-DEC-2018 9 919.85
  455. 05-DEC-2018 2 456.58
  456. 06-DEC-2018 8 1,477.13
  457. 07-DEC-2018 5 977.65
  458. 08-DEC-2018 5 890.85
  459. 09-DEC-2018 9 1,450.03
  460. 10-DEC-2018 9 1,541.38
  461. 11-DEC-2018 4 519.10
  462. 12-DEC-2018 8 1,433.59
  463. 13-DEC-2018 10 1,241.31
  464. 14-DEC-2018 4 833.18
  465. 15-DEC-2018 5 839.04
  466. 16-DEC-2018 8 1,236.49
  467. 17-DEC-2018 3 226.37
  468. 18-DEC-2018 9 1,527.34
  469. 19-DEC-2018 3 493.39
  470. 20-DEC-2018 7 1,065.27
  471. 21-DEC-2018 6 920.23
  472. 22-DEC-2018 4 638.16
  473. 23-DEC-2018 6 400.79
  474. 24-DEC-2018 5 854.51
  475. 25-DEC-2018 7 1,222.27
  476. 26-DEC-2018 3 453.00
  477. 27-DEC-2018 4 513.24
  478. 28-DEC-2018 8 1,270.83
  479. 29-DEC-2018 5 795.87
  480. 30-DEC-2018 5 609.17
  481. 31-DEC-2018 9 1,448.28
  482. 01-JAN-2019 7 1,028.36
  483. 02-JAN-2019 6 972.54
  484. 03-JAN-2019 8 1,080.85
  485. 04-JAN-2019 4 753.68
  486. 05-JAN-2019 9 1,613.11
  487. 06-JAN-2019 4 701.82
  488. 07-JAN-2019 7 1,030.74
  489. 08-JAN-2019 6 1,204.56
  490. 09-JAN-2019 1 221.38
  491. 10-JAN-2019 9 1,203.94
  492. 11-JAN-2019 4 402.55
  493. 12-JAN-2019 11 1,884.84
  494. 13-JAN-2019 9 1,612.92
  495. 14-JAN-2019 7 1,293.03
  496. 15-JAN-2019 7 1,103.19
  497. 16-JAN-2019 6 941.68
  498. 17-JAN-2019 4 823.33
  499. 18-JAN-2019 8 1,217.60
  500. 19-JAN-2019 3 929.88
  501. 20-JAN-2019 9 1,353.34
  502. 21-JAN-2019 10 1,357.98
  503. 22-JAN-2019 7 844.70
  504. 23-JAN-2019 10 1,562.43
  505. 24-JAN-2019 8 1,071.97
  506. 25-JAN-2019 11 2,038.57
  507. 26-JAN-2019 7 1,088.72
  508. 27-JAN-2019 4 500.10
  509. 28-JAN-2019 8 1,013.35
  510. 29-JAN-2019 4 346.98
  511. 30-JAN-2019 8 922.87
  512. 31-JAN-2019 9 1,202.63
  513. 01-FEB-2019 6 1,007.87
  514. 02-FEB-2019 6 1,193.55
  515. 03-FEB-2019 6 895.15
  516. 04-FEB-2019 7 713.00
  517. 05-FEB-2019 5 869.79
  518. 06-FEB-2019 3 168.49
  519. 07-FEB-2019 7 1,402.48
  520. 08-FEB-2019 2 277.42
  521. 09-FEB-2019 10 1,196.25
  522. 10-FEB-2019 4 676.61
  523. 11-FEB-2019 4 353.43
  524. 12-FEB-2019 8 1,433.28
  525. 13-FEB-2019 6 1,160.04
  526. 14-FEB-2019 7 1,263.98
  527. 15-FEB-2019 4 767.94
  528. 16-FEB-2019 5 927.73
  529. 17-FEB-2019 3 243.90
  530. 18-FEB-2019 5 826.58
  531. 19-FEB-2019 8 1,076.35
  532. 20-FEB-2019 6 922.16
  533. 21-FEB-2019 4 576.21
  534. 22-FEB-2019 6 1,124.39
  535. 23-FEB-2019 3 369.60
  536. 24-FEB-2019 4 473.60
  537. 25-FEB-2019 7 1,155.70
  538. 26-FEB-2019 5 748.25
  539. SALE_DATE NUMBER_OF_ORDERS VALUE_OF_ORDERS
  540. -------------------- ---------------- ---------------
  541. 27-FEB-2019 7 1,055.80
  542. 28-FEB-2019 7 1,202.08
  543. 01-MAR-2019 6 925.22
  544. 02-MAR-2019 4 751.81
  545. 03-MAR-2019 5 760.03
  546. 04-MAR-2019 8 1,361.05
  547. 05-MAR-2019 4 396.97
  548. 06-MAR-2019 5 667.02
  549. 07-MAR-2019 6 1,291.81
  550. 08-MAR-2019 4 593.47
  551. 09-MAR-2019 9 1,551.99
  552. 10-MAR-2019 5 494.58
  553. 11-MAR-2019 2 390.24
  554. 12-MAR-2019 5 918.08
  555. 13-MAR-2019 4 596.63
  556. 14-MAR-2019 6 914.78
  557. 15-MAR-2019 7 920.92
  558. 16-MAR-2019 5 685.33
  559. 17-MAR-2019 7 952.78
  560. 18-MAR-2019 4 511.17
  561. 19-MAR-2019 6 979.97
  562. 20-MAR-2019 4 602.58
  563. 21-MAR-2019 5 661.32
  564. 22-MAR-2019 3 655.92
  565. 23-MAR-2019 3 277.65
  566. 24-MAR-2019 5 918.06
  567. 25-MAR-2019 7 1,124.52
  568. 26-MAR-2019 2 311.84
  569. 27-MAR-2019 5 531.44
  570. 28-MAR-2019 6 616.94
  571. 29-MAR-2019 6 740.97
  572. 30-MAR-2019 3 654.42
  573. 31-MAR-2019 3 509.66
  574. 01-APR-2019 5 1,059.71
  575. 02-APR-2019 2 234.04
  576. 03-APR-2019 4 726.53
  577. 04-APR-2019 4 374.67
  578. 05-APR-2019 3 668.16
  579. 06-APR-2019 3 420.33
  580. 07-APR-2019 2 401.84
  581. 08-APR-2019 3 468.68
  582. 09-APR-2019 0 0.00
  583. 10-APR-2019 5 673.99
  584. 11-APR-2019 3 148.67
  585. 12-APR-2019 1 309.36
  586. 433 rows selected.
  587. Month and year sales matrix
  588. ORDER_YEAR JAN_VALUE FEB_VALUE MAR_VALUE APR_VALUE MAY_VALUE JUN_VALUE JUL_VALUE AUG_VALUE SEP_VALUE OCT_VALUE NOV_VALUE DEC_VALUE
  589. ---------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- -----------
  590. 2018 3,256.22 11,405.42 18,317.39 18,254.94 20,500.44 19,884.46 23,353.01 26,362.46 25,922.88 25,412.36 29,768.53
  591. 2019 33,323.64 24,081.63 23,269.17 5,485.98
  592. SQL>

Step 21: 确认CO: Customer Orders sample schema是否创建成功.

  1. SQL>
  2. SQL> show user;
  3. USER is "CO"
  4. SQL> select * from tab;
  5. TNAME TABTYPE CLUSTERID
  6. -------------------------------------------------------------------------------------------------------------------------------- ------------- ----------
  7. CUSTOMERS TABLE
  8. STORES TABLE
  9. PRODUCTS TABLE
  10. ORDERS TABLE
  11. ORDER_ITEMS TABLE
  12. CUSTOMER_ORDER_PRODUCTS VIEW
  13. STORE_ORDERS VIEW
  14. PRODUCT_REVIEWS VIEW
  15. PRODUCT_ORDERS VIEW
  16. 9 rows selected.
  17. SQL>

QS : Queued Shipping (ORACLE 9i sample schema)

Step22: 开始执行QS : Queued Shipping sample schema  sample 脚本.如下所示(若Step22无法正常执行,请参考下方的手动执行操作):

[oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 16:45:36 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> alter session set container=PDB1;

Session altered.

SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_main.sql

Session altered.


specify one password for the users QS,QS_ADM,QS_CBADM,
QS_WS,QS_ES,QS_OS,QS_CS and QS_CB as parameter 1:
Enter value for 1: qs

specify default tablespeace for QS as parameter 2:
Enter value for 2: users

specify temporary tablespace for QS as parameter 3:
Enter value for 3: temp

specify password for SYSTEM as parameter 4:
Enter value for 4: system

specify password for OE as parameter 5:
Enter value for 5: oe

specify password for SYS as parameter 6:
Enter value for 6: sys

specify log directory path as parameter 7:
Enter value for 7: /u01/app/oracle/product/19.3.0/dbhome_1/demo/schema/log/

specify connect string as parameter 8:
Enter value for 8: PDB1

DROP USER qs_adm CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_ADM' does not exist


DROP USER qs CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS' does not exist


DROP USER qs_ws CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_WS' does not exist


DROP USER qs_es CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_ES' does not exist


DROP USER qs_os CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_OS' does not exist


DROP USER qs_cbadm CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_CBADM' does not exist


DROP USER qs_cb CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_CB' does not exist


DROP USER qs_cs CASCADE
          *
ERROR at line 1:
ORA-01918: user 'QS_CS' does not exist

System altered.

old   1: CREATE USER qs_adm IDENTIFIED BY &pass
new   1: CREATE USER qs_adm IDENTIFIED BY qs

User created.

old   1: ALTER USER qs_adm DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new   1: ALTER USER qs_adm DEFAULT TABLESPACE users QUOTA UNLIMITED ON users

User altered.

old   1: ALTER USER qs_adm TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER qs_adm TEMPORARY TABLESPACE temp

User altered.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.

以下为手动执行的脚本:

  1. [oracle@oracle-db-19c db-sample-schemas-19.2]$ sqlplus / as sysdba
  2. SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 26 16:52:46 2022
  3. Version 19.3.0.0.0
  4. Copyright (c) 1982, 2019, Oracle. All rights reserved.
  5. Connected to:
  6. Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
  7. Version 19.3.0.0.0
  8. SQL> alter session set container=PDB1;
  9. Session altered.
  10. SQL> ALTER SESSION SET NLS_LANGUAGE=American;
  11. Session altered.
  12. SQL> DROP USER qs_adm CASCADE;
  13. DROP USER qs CASCADE;
  14. DROP USER qs_ws CASCADE;
  15. DROP USER qs_es CASCADE;
  16. DROP USER qs_os CASCADE;
  17. DROP USER qs_cbadm CASCADE;
  18. DROP USER qs_cb CASCADE;
  19. User dropped.
  20. SQL> DROP USER qs CASCADE
  21. *
  22. ERROR at line 1:
  23. ORA-01918: user 'QS' does not exist
  24. SQL> DROP USER qs_ws CASCADE
  25. *
  26. ERROR at line 1:
  27. ORA-01918: user 'QS_WS' does not exist
  28. SQL> DROP USER qs_es CASCADE
  29. *
  30. ERROR at line 1:
  31. ORA-01918: user 'QS_ES' does not exist
  32. SQL> DROP USER qs_os CASCADE
  33. *
  34. ERROR at line 1:
  35. ORA-01918: user 'QS_OS' does not exist
  36. SQL> DROP USER qs_cbadm CASCADE
  37. *
  38. ERROR at line 1:
  39. ORA-01918: user 'QS_CBADM' does not exist
  40. SQL> DROP USER qs_cb CASCADE
  41. *
  42. ERROR at line 1:
  43. ORA-01918: user 'QS_CB' does not exist
  44. SQL> DROP USER qs_cs CASCADE;
  45. DROP USER qs_cs CASCADE
  46. *
  47. ERROR at line 1:
  48. ORA-01918: user 'QS_CS' does not exist
  49. SQL> alter system set job_queue_processes=4;
  50. System altered.
  51. SQL> CREATE USER qs_adm IDENTIFIED BY qs;
  52. User created.
  53. SQL> ALTER USER qs_adm DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  54. User altered.
  55. SQL> ALTER USER qs_adm TEMPORARY TABLESPACE temp;
  56. User altered.
  57. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_adm;
  58. Grant succeeded.
  59. SQL> GRANT aq_administrator_role TO qs_adm;
  60. Grant succeeded.
  61. SQL> GRANT EXECUTE ON dbms_aq TO qs_adm;
  62. Grant succeeded.
  63. SQL> GRANT EXECUTE ON dbms_aqadm TO qs_adm;
  64. Grant succeeded.
  65. SQL> show user;
  66. USER is "SYS"
  67. SQL> GRANT execute ON sys.dbms_stats TO qs_adm;
  68. Grant succeeded.
  69. SQL> GRANT execute ON dbms_lock to qs_adm;
  70. Grant succeeded.
  71. SQL> conn system/system@PDB1
  72. ERROR:
  73. ORA-01017: invalid username/password; logon denied
  74. Warning: You are no longer connected to ORACLE.
  75. SQL> conn system/system as sysdba
  76. Connected.
  77. SQL> alter session set container=PDB1;
  78. Session altered.
  79. SQL> execute dbms_aqadm.grant_system_privilege('ENQUEUE_ANY','qs_adm',FALSE);
  80. PL/SQL procedure successfully completed.
  81. SQL> execute dbms_aqadm.grant_system_privilege('DEQUEUE_ANY','qs_adm',FALSE);
  82. PL/SQL procedure successfully completed.
  83. SQL> CREATE USER qs IDENTIFIED BY qs;
  84. User created.
  85. SQL> ALTER USER qs DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  86. User altered.
  87. SQL> ALTER USER qs TEMPORARY TABLESPACE temp;
  88. User altered.
  89. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs;
  90. Grant succeeded.
  91. SQL> GRANT EXECUTE ON dbms_aq to qs;
  92. Grant succeeded.
  93. SQL> GRANT EXECUTE ON dbms_aqadm to qs;
  94. Grant succeeded.
  95. SQL> CREATE USER qs_ws IDENTIFIED BY qs;
  96. User created.
  97. SQL> ALTER USER qs_ws DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  98. User altered.
  99. SQL> ALTER USER qs_ws TEMPORARY TABLESPACE temp;
  100. User altered.
  101. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_ws;
  102. Grant succeeded.
  103. SQL> GRANT EXECUTE ON dbms_aq to qs_ws;
  104. Grant succeeded.
  105. SQL> GRANT EXECUTE ON dbms_aqadm to qs_ws;
  106. Grant succeeded.
  107. SQL> CREATE USER qs_es IDENTIFIED BY qs;
  108. User created.
  109. SQL> ALTER USER qs_es DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  110. User altered.
  111. SQL> ALTER USER qs_es TEMPORARY TABLESPACE temp;
  112. User altered.
  113. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_es;
  114. Grant succeeded.
  115. SQL> GRANT EXECUTE ON dbms_aq TO qs_es;
  116. Grant succeeded.
  117. SQL> GRANT EXECUTE ON dbms_aqadm TO qs_es;
  118. Grant succeeded.
  119. SQL> CREATE USER qs_os IDENTIFIED BY qs;
  120. User created.
  121. SQL> ALTER USER qs_os DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  122. User altered.
  123. SQL> ALTER USER qs_os TEMPORARY TABLESPACE temp;
  124. User altered.
  125. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_os;
  126. Grant succeeded.
  127. SQL> GRANT EXECUTE ON dbms_aq TO qs_os;
  128. Grant succeeded.
  129. SQL> GRANT EXECUTE ON dbms_aqadm TO qs_os;
  130. Grant succeeded.
  131. SQL> CREATE USER qs_cbadm IDENTIFIED BY qs;
  132. User created.
  133. SQL> ALTER USER qs_cbadm DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  134. User altered.
  135. SQL> ALTER USER qs_cbadm TEMPORARY TABLESPACE temp;
  136. User altered.
  137. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_cbadm;
  138. Grant succeeded.
  139. SQL> GRANT EXECUTE ON dbms_aq to qs_cbadm;
  140. Grant succeeded.
  141. SQL> GRANT EXECUTE ON dbms_aqadm to qs_cbadm;
  142. Grant succeeded.
  143. SQL> CREATE USER qs_cb IDENTIFIED BY qs;
  144. User created.
  145. SQL> ALTER USER qs_cb DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  146. User altered.
  147. SQL> ALTER USER qs_cb TEMPORARY TABLESPACE temp;
  148. User altered.
  149. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_cb;
  150. Grant succeeded.
  151. SQL> GRANT EXECUTE ON dbms_aq TO qs_cb;
  152. Grant succeeded.
  153. SQL> GRANT EXECUTE ON dbms_aqadm TO qs_cb;
  154. Grant succeeded.
  155. SQL> CREATE USER qs_cs IDENTIFIED BY qs;
  156. ALTER USER qs_cs DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
  157. User created.
  158. SQL>
  159. User altered.
  160. SQL>
  161. SQL> ALTER USER qs_cs TEMPORARY TABLESPACE temp;
  162. User altered.
  163. SQL>
  164. SQL> GRANT CONNECT, RESOURCE , UNLIMITED TABLESPACE TO qs_cs;
  165. Grant succeeded.
  166. SQL> GRANT EXECUTE ON dbms_aq TO qs_cs;
  167. Grant succeeded.
  168. SQL> GRANT EXECUTE ON dbms_aqadm TO qs_cs;
  169. Grant succeeded.
  170. SQL> conn oe/oe@PDB1
  171. Connected.
  172. SQL> GRANT REFERENCES, SELECT ON customers TO qs_adm;
  173. Grant succeeded.
  174. SQL> GRANT REFERENCES, SELECT ON product_information TO qs_adm;
  175. Grant succeeded.
  176. SQL> conn qs_adm/qs@PDB1
  177. Connected.
  178. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_adm.sql
  179. Type created.
  180. Type created.
  181. Type created.
  182. Type created.
  183. Grant succeeded.
  184. Grant succeeded.
  185. Grant succeeded.
  186. Grant succeeded.
  187. PL/SQL procedure successfully completed.
  188. Grant succeeded.
  189. Grant succeeded.
  190. Grant succeeded.
  191. Grant succeeded.
  192. PL/SQL procedure successfully completed.
  193. Grant succeeded.
  194. Grant succeeded.
  195. Grant succeeded.
  196. Grant succeeded.
  197. PL/SQL procedure successfully completed.
  198. Grant succeeded.
  199. Grant succeeded.
  200. Grant succeeded.
  201. Grant succeeded.
  202. PL/SQL procedure successfully completed.
  203. Grant succeeded.
  204. Grant succeeded.
  205. Grant succeeded.
  206. Grant succeeded.
  207. Grant succeeded.
  208. Grant succeeded.
  209. Grant succeeded.
  210. Grant succeeded.
  211. Grant succeeded.
  212. Grant succeeded.
  213. Grant succeeded.
  214. Grant succeeded.
  215. Commit complete.
  216. SQL> CONNECT qs/qs@PDB1;
  217. Connected.
  218. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_cre.sql
  219. PL/SQL procedure successfully completed.
  220. PL/SQL procedure successfully completed.
  221. PL/SQL procedure successfully completed.
  222. PL/SQL procedure successfully completed.
  223. PL/SQL procedure successfully completed.
  224. SQL> CONNECT qs_es/qs@PDB1
  225. Connected.
  226. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_es.sql
  227. PL/SQL procedure successfully completed.
  228. PL/SQL procedure successfully completed.
  229. PL/SQL procedure successfully completed.
  230. PL/SQL procedure successfully completed.
  231. PL/SQL procedure successfully completed.
  232. Commit complete.
  233. SQL> CONNECT qs_ws/qs@PDB1
  234. Connected.
  235. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_ws.sql
  236. PL/SQL procedure successfully completed.
  237. PL/SQL procedure successfully completed.
  238. PL/SQL procedure successfully completed.
  239. PL/SQL procedure successfully completed.
  240. PL/SQL procedure successfully completed.
  241. PL/SQL procedure successfully completed.
  242. PL/SQL procedure successfully completed.
  243. PL/SQL procedure successfully completed.
  244. PL/SQL procedure successfully completed.
  245. PL/SQL procedure successfully completed.
  246. Commit complete.
  247. SQL> CONNECT qs_os/qs@PDB1
  248. Connected.
  249. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_os.sql
  250. PL/SQL procedure successfully completed.
  251. PL/SQL procedure successfully completed.
  252. PL/SQL procedure successfully completed.
  253. PL/SQL procedure successfully completed.
  254. PL/SQL procedure successfully completed.
  255. Commit complete.
  256. SQL> CONNECT qs_cbadm/qs@PDB1
  257. Connected.
  258. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_cbadm.sql
  259. PL/SQL procedure successfully completed.
  260. PL/SQL procedure successfully completed.
  261. PL/SQL procedure successfully completed.
  262. PL/SQL procedure successfully completed.
  263. PL/SQL procedure successfully completed.
  264. Commit complete.
  265. SQL> CONNECT qs_cs/qs@PDB1
  266. Connected.
  267. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_cs.sql
  268. Table created.
  269. PL/SQL procedure successfully completed.
  270. SQL> CONNECT qs_adm/qs@PDB1
  271. Connected.
  272. SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/db-sample-schemas-19.2/shipping/qs_run.sql
  273. Type created.
  274. Package created.
  275. No errors.
  276. Package body created.
  277. No errors.
  278. Grant succeeded.
  279. Grant succeeded.
  280. Grant succeeded.
  281. Grant succeeded.
  282. Grant succeeded.
  283. Grant succeeded.
  284. SQL> show user;
  285. USER is "QS_ADM"
  286. SQL>

Step 23: 确认QS : Queued Shipping sample schema是否创建成功.

  1. SQL> set pagesize 200
  2. SQL> set linesize 200
  3. SQL> conn qs/qs@PDB1
  4. Connected.
  5. SQL> select * from tab;
  6. TNAME TABTYPE CLUSTERID
  7. -------------------------------------------------------------------------------------------------------------------------------- ------------- ----------
  8. QS_ORDERS_SQTAB TABLE
  9. AQ$_QS_ORDERS_SQTAB_F VIEW
  10. AQ$QS_ORDERS_SQTAB VIEW
  11. QS_ORDERS_PR_MQTAB TABLE
  12. AQ$_QS_ORDERS_PR_MQTAB_S TABLE
  13. AQ$_QS_ORDERS_PR_MQTAB_T TABLE
  14. AQ$QS_ORDERS_PR_MQTAB_S VIEW
  15. AQ$_QS_ORDERS_PR_MQTAB_H TABLE
  16. AQ$_QS_ORDERS_PR_MQTAB_L TABLE
  17. SYS_IOT_OVER_73738 TABLE
  18. AQ$_QS_ORDERS_PR_MQTAB_G TABLE
  19. AQ$_QS_ORDERS_PR_MQTAB_I TABLE
  20. AQ$_QS_ORDERS_PR_MQTAB_F VIEW
  21. AQ$QS_ORDERS_PR_MQTAB VIEW
  22. AQ$QS_ORDERS_PR_MQTAB_R VIEW
  23. AQ$_MEM_MC TABLE
  24. AQ$_AQ$_MEM_MC_S TABLE
  25. AQ$_AQ$_MEM_MC_T TABLE
  26. AQ$AQ$_MEM_MC_S VIEW
  27. AQ$_AQ$_MEM_MC_H TABLE
  28. AQ$_AQ$_MEM_MC_L TABLE
  29. SYS_IOT_OVER_73768 TABLE
  30. AQ$_AQ$_MEM_MC_G TABLE
  31. AQ$_AQ$_MEM_MC_I TABLE
  32. AQ$_AQ$_MEM_MC_F VIEW
  33. AQ$AQ$_MEM_MC VIEW
  34. 26 rows selected.
  35. SQL>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/585875
推荐阅读
相关标签
  

闽ICP备14008679号