没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle 12C SQL语言参考指南
"Oracle® Database SQL Language Reference 12c Release 1 (12.1) E41329-25"
Oracle 12c SQL手册是一部详细讲解Oracle数据库12c版本SQL语言的权威参考文档。12c是Oracle数据库的一个重要版本,它在SQL支持、性能优化和云服务方面进行了多项改进和增强。本手册由MaryBeth Roeser为主要作者,众多贡献者共同编纂,旨在为开发者、DBA和数据专业人士提供全面的SQL语法和功能指南。
手册内容涵盖以下几个主要方面:
1. **SQL语法基础**:包括基本的查询语句(SELECT)、数据插入(INSERT)、更新(UPDATE)、删除(DELETE)以及数据定义(CREATE、ALTER、DROP)等操作。此外,还详细介绍了如何使用DML(Data Manipulation Language)和DDL(Data Definition Language)语句进行数据库对象的管理。
2. **高级查询**:讨论了联接(JOINs)、子查询、集合运算符(UNION、INTERSECT、EXCEPT)以及窗口函数(Window Functions),这些功能使得复杂的数据分析和报表生成成为可能。
3. **聚合与分组**:涵盖了GROUP BY、HAVING子句以及各种聚合函数(COUNT、SUM、AVG、MIN、MAX等),用于对数据进行统计和汇总。
4. **索引与查询优化**:解释了如何创建和管理索引,以及如何使用 Explain Plan 和 SQL Tuning Advisor 来分析和优化SQL查询性能。
5. **视图与物质化视图**:介绍了视图的概念,如何创建和使用视图,以及物质化视图(Materialized Views)在提高查询速度和数据同步中的作用。
6. **游标与PL/SQL**:解释了如何使用游标处理单条记录,以及PL/SQL(Oracle的Procedural Language/SQL)的使用,包括过程、函数、异常处理等。
7. **事务与并发控制**:讨论了事务管理(BEGIN、COMMIT、ROLLBACK)以及乐观锁和悲观锁的概念,确保数据的一致性和完整性。
8. **安全性与权限**:涵盖了用户管理、角色、权限、对象权限和系统权限的设定,以及如何通过GRANT和REVOKE语句控制数据访问。
9. **XML与JSON支持**:随着Web服务的普及,Oracle 12c对XML和JSON的支持得到增强,包括XML类型、XML索引和XML查询功能。
10. **数据仓库与OLAP**:介绍了Oracle的数据仓库构建和在线分析处理(OLAP)特性,如星型模式、雪花模式和OLAP立方体。
11. **分区与表空间**:解释了如何通过分区技术提高大规模数据的管理和查询效率,以及表空间的管理。
12. **备份与恢复**:涵盖了Oracle的备份策略、数据泵(Data Pump)导出导入、RMAN(Recovery Manager)以及闪回技术。
本手册还包含了大量示例代码和实践指导,帮助读者更好地理解和应用SQL在Oracle 12c环境中的各种功能。无论是初学者还是经验丰富的数据库管理员,都能从中受益,提升对Oracle SQL的掌握和使用水平。
xvi
XMLCOMMENT ................................................................................................................................ 7-412
XMLCONCAT ..................................................................................................................................... 7-413
XMLDIFF ............................................................................................................................................. 7-414
XMLELEMENT ................................................................................................................................... 7-416
XMLEXISTS ......................................................................................................................................... 7-419
XMLFOREST ....................................................................................................................................... 7-420
XMLISVALID ..................................................................................................................................... 7-421
XMLPARSE ......................................................................................................................................... 7-422
XMLPATCH ........................................................................................................................................ 7-423
XMLPI ................................................................................................................................................... 7-424
XMLQUERY ........................................................................................................................................ 7-425
XMLROOT ........................................................................................................................................... 7-427
XMLSEQUENCE ................................................................................................................................ 7-428
XMLSERIALIZE ................................................................................................................................. 7-430
XMLTABLE ......................................................................................................................................... 7-432
XMLTRANSFORM ............................................................................................................................ 7-435
ROUND and TRUNC Date Functions ............................................................................................ 7-437
About User-Defined Functions ....................................................................................................... 7-438
Prerequisites................................................................................................................................... 7-439
Name Precedence ......................................................................................................................... 7-440
Naming Conventions ........................................................................................................... 7-440
8 Common SQL DDL Clauses
allocate_extent_clause ............................................................................................................................ 8-2
constraint ................................................................................................................................................... 8-4
deallocate_unused_clause .................................................................................................................... 8-27
file_specification ................................................................................................................................... 8-29
logging_clause ........................................................................................................................................ 8-38
parallel_clause........................................................................................................................................ 8-41
physical_attributes_clause .................................................................................................................. 8-44
size_clause .............................................................................................................................................. 8-47
storage_clause ........................................................................................................................................ 8-48
9 SQL Queries and Subqueries
About Queries and Subqueries ............................................................................................................ 9-1
Creating Simple Queries ........................................................................................................................ 9-2
Hierarchical Queries ............................................................................................................................... 9-3
Hierarchical Query Examples .......................................................................................................... 9-5
The UNION [ALL], INTERSECT, MINUS Operators ...................................................................... 9-8
Sorting Query Results ......................................................................................................................... 9-10
Joins ......................................................................................................................................................... 9-11
Join Conditions ............................................................................................................................... 9-11
Equijoins .......................................................................................................................................... 9-11
Self Joins .......................................................................................................................................... 9-12
Cartesian Products ......................................................................................................................... 9-12
Inner Joins ....................................................................................................................................... 9-12
Outer Joins ....................................................................................................................................... 9-12
xvii
Antijoins .......................................................................................................................................... 9-14
Semijoins .......................................................................................................................................... 9-14
Using Subqueries ................................................................................................................................. 9-14
Unnesting of Nested Subqueries ...................................................................................................... 9-15
Selecting from the DUAL Table ........................................................................................................ 9-16
Distributed Queries ............................................................................................................................. 9-16
10 SQL Statements: ADMINISTER KEY MANAGEMENT to ALTER JAVA
Types of SQL Statements .................................................................................................................... 10-1
Data Definition Language (DDL) Statements ............................................................................ 10-2
Data Manipulation Language (DML) Statements ..................................................................... 10-3
Transaction Control Statements ................................................................................................... 10-3
Session Control Statements ........................................................................................................... 10-3
System Control Statement ............................................................................................................. 10-3
Embedded SQL Statements .......................................................................................................... 10-4
How the SQL Statement Chapters are Organized ......................................................................... 10-4
ADMINISTER KEY MANAGEMENT.............................................................................................. 10-5
ALTER AUDIT POLICY (Unified Auditing)................................................................................. 10-24
ALTER CLUSTER .............................................................................................................................. 10-28
ALTER DATABASE .......................................................................................................................... 10-32
ALTER DATABASE LINK ............................................................................................................... 10-73
ALTER DIMENSION ........................................................................................................................ 10-75
ALTER DISKGROUP ........................................................................................................................ 10-78
ALTER FLASHBACK ARCHIVE .................................................................................................. 10-103
ALTER FUNCTION ......................................................................................................................... 10-106
ALTER INDEX .................................................................................................................................. 10-107
ALTER INDEXTYPE ........................................................................................................................ 10-127
ALTER JAVA .................................................................................................................................... 10-130
11 SQL Statements: ALTER LIBRARY to ALTER SYSTEM
ALTER LIBRARY .................................................................................................................................. 11-2
ALTER MATERIALIZED VIEW ....................................................................................................... 11-3
ALTER MATERIALIZED VIEW LOG ........................................................................................... 11-20
ALTER MATERIALIZED ZONEMAP............................................................................................ 11-27
ALTER OPERATOR .......................................................................................................................... 11-31
ALTER OUTLINE .............................................................................................................................. 11-34
ALTER PACKAGE ............................................................................................................................. 11-36
ALTER PLUGGABLE DATABASE ................................................................................................. 11-38
ALTER PROCEDURE ........................................................................................................................ 11-50
ALTER PROFILE ................................................................................................................................ 11-52
ALTER RESOURCE COST ............................................................................................................... 11-55
ALTER ROLE ...................................................................................................................................... 11-58
ALTER ROLLBACK SEGMENT ..................................................................................................... 11-60
ALTER SEQUENCE ........................................................................................................................... 11-63
ALTER SESSION ............................................................................................................................... 11-65
Initialization Parameters and ALTER SESSION....................................................................... 11-71
xviii
Session Parameters and ALTER SESSION ............................................................................... 11-72
ALTER SYNONYM............................................................................................................................. 11-79
ALTER SYSTEM ................................................................................................................................. 11-81
12 SQL Statements: ALTER TABLE to ALTER TABLESPACE
ALTER TABLE ...................................................................................................................................... 12-2
ALTER TABLESPACE ..................................................................................................................... 12-114
13 SQL Statements: ALTER TRIGGER to COMMIT
ALTER TRIGGER ................................................................................................................................ 13-2
ALTER TYPE ......................................................................................................................................... 13-4
ALTER USER ........................................................................................................................................ 13-6
ALTER VIEW ...................................................................................................................................... 13-16
ANALYZE ............................................................................................................................................ 13-19
ASSOCIATE STATISTICS .............................................................................................................. 13-27
AUDIT (Traditional Auditing) ........................................................................................................ 13-31
AUDIT (Unified Auditing)................................................................................................................ 13-45
CALL ..................................................................................................................................................... 13-50
COMMENT ......................................................................................................................................... 13-54
COMMIT ............................................................................................................................................. 13-57
14 SQL Statements: CREATE AUDIT POLICY to CREATE JAVA
CREATE AUDIT POLICY (Unified Auditing)................................................................................ 14-2
CREATE CLUSTER ............................................................................................................................ 14-11
CREATE CONTEXT .......................................................................................................................... 14-19
CREATE CONTROLFILE ................................................................................................................. 14-22
CREATE DATABASE ........................................................................................................................ 14-29
CREATE DATABASE LINK ............................................................................................................ 14-44
CREATE DIMENSION ..................................................................................................................... 14-49
CREATE DIRECTORY ...................................................................................................................... 14-54
CREATE DISKGROUP ..................................................................................................................... 14-56
CREATE EDITION ............................................................................................................................ 14-64
CREATE FLASHBACK ARCHIVE ................................................................................................. 14-68
CREATE FUNCTION ........................................................................................................................ 14-71
CREATE INDEX ................................................................................................................................. 14-73
CREATE INDEXTYPE ..................................................................................................................... 14-103
CREATE JAVA .................................................................................................................................. 14-107
15 SQL Statements: CREATE LIBRARY to CREATE SPFILE
CREATE LIBRARY .............................................................................................................................. 15-2
CREATE MATERIALIZED VIEW .................................................................................................... 15-4
CREATE MATERIALIZED VIEW LOG ........................................................................................ 15-31
CREATE MATERIALIZED ZONEMAP......................................................................................... 15-41
CREATE OPERATOR ....................................................................................................................... 15-49
CREATE OUTLINE ............................................................................................................................ 15-52
CREATE PACKAGE .......................................................................................................................... 15-55
xix
CREATE PACKAGE BODY ............................................................................................................. 15-57
CREATE PFILE ................................................................................................................................... 15-59
CREATE PLUGGABLE DATABASE .............................................................................................. 15-61
CREATE PROCEDURE ..................................................................................................................... 15-75
CREATE PROFILE ............................................................................................................................. 15-77
CREATE RESTORE POINT ............................................................................................................. 15-84
CREATE ROLE ................................................................................................................................... 15-87
CREATE ROLLBACK SEGMENT .................................................................................................. 15-91
CREATE SCHEMA ............................................................................................................................ 15-94
CREATE SEQUENCE ........................................................................................................................ 15-96
CREATE SPFILE ............................................................................................................................... 15-101
16 SQL Statements: CREATE SYNONYM to CREATE TRIGGER
CREATE SYNONYM ........................................................................................................................... 16-2
CREATE TABLE ................................................................................................................................... 16-6
CREATE TABLESPACE .................................................................................................................. 16-102
CREATE TRIGGER ......................................................................................................................... 16-118
17 SQL Statements: CREATE TYPE to DROP ROLLBACK SEGMENT
CREATE TYPE ...................................................................................................................................... 17-3
CREATE TYPE BODY ......................................................................................................................... 17-5
CREATE USER ...................................................................................................................................... 17-7
CREATE VIEW ................................................................................................................................... 17-15
DELETE ................................................................................................................................................ 17-28
DISASSOCIATE STATISTICS ....................................................................................................... 17-36
DROP AUDIT POLICY (Unified Auditing) .................................................................................. 17-38
DROP CLUSTER ................................................................................................................................ 17-40
DROP CONTEXT ............................................................................................................................... 17-42
DROP DATABASE ............................................................................................................................ 17-43
DROP DATABASE LINK ................................................................................................................. 17-44
DROP DIMENSION .......................................................................................................................... 17-45
DROP DIRECTORY .......................................................................................................................... 17-46
DROP DISKGROUP ......................................................................................................................... 17-47
DROP EDITION ................................................................................................................................. 17-49
DROP FLASHBACK ARCHIVE ..................................................................................................... 17-51
DROP FUNCTION ............................................................................................................................ 17-52
DROP INDEX....................................................................................................................................... 17-54
DROP INDEXTYPE ........................................................................................................................... 17-56
DROP JAVA ........................................................................................................................................ 17-57
DROP LIBRARY ................................................................................................................................. 17-58
DROP MATERIALIZED VIEW........................................................................................................ 17-59
DROP MATERIALIZED VIEW LOG ............................................................................................ 17-61
DROP MATERIALIZED ZONEMAP ............................................................................................. 17-63
DROP OPERATOR ............................................................................................................................ 17-64
DROP OUTLINE ................................................................................................................................ 17-65
DROP PACKAGE .............................................................................................................................. 17-66
xx
DROP PLUGGABLE DATABASE................................................................................................... 17-68
DROP PROCEDURE ......................................................................................................................... 17-70
DROP PROFILE .................................................................................................................................. 17-71
DROP RESTORE POINT ................................................................................................................. 17-72
DROP ROLE ........................................................................................................................................ 17-73
DROP ROLLBACK SEGMENT ...................................................................................................... 17-74
18 SQL Statements: DROP SEQUENCE to ROLLBACK
DROP SEQUENCE .............................................................................................................................. 18-2
DROP SYNONYM ............................................................................................................................... 18-3
DROP TABLE ........................................................................................................................................ 18-5
DROP TABLESPACE .......................................................................................................................... 18-9
DROP TRIGGER................................................................................................................................. 18-12
DROP TYPE ......................................................................................................................................... 18-13
DROP TYPE BODY ............................................................................................................................ 18-15
DROP USER ........................................................................................................................................ 18-16
DROP VIEW ........................................................................................................................................ 18-18
EXPLAIN PLAN .................................................................................................................................. 18-20
EXPLAIN WORK ................................................................................................................................ 18-24
FLASHBACK DATABASE................................................................................................................ 18-26
FLASHBACK TABLE ........................................................................................................................ 18-29
GRANT ................................................................................................................................................. 18-35
INSERT ................................................................................................................................................. 18-62
LOCK TABLE ...................................................................................................................................... 18-79
MERGE ................................................................................................................................................. 18-82
NOAUDIT (Traditional Auditing) .................................................................................................. 18-87
NOAUDIT (Unified Auditing)......................................................................................................... 18-92
PURGE .................................................................................................................................................. 18-96
RENAME .............................................................................................................................................. 18-98
REVOKE ............................................................................................................................................. 18-100
ROLLBACK ....................................................................................................................................... 18-110
19 SQL Statements: SAVEPOINT to UPDATE
SAVEPOINT ......................................................................................................................................... 19-2
SELECT ................................................................................................................................................... 19-4
SET CONSTRAINT[S] ...................................................................................................................... 19-79
SET ROLE ............................................................................................................................................ 19-81
SET TRANSACTION ........................................................................................................................ 19-84
TRUNCATE CLUSTER ..................................................................................................................... 19-87
TRUNCATE TABLE .......................................................................................................................... 19-89
UPDATE ............................................................................................................................................... 19-93
A How to Read Syntax Diagrams
Graphic Syntax Diagrams...................................................................................................................... A-1
Required Keywords and Parameters ............................................................................................ A-2
Optional Keywords and Parameters ............................................................................................. A-3
剩余1919页未读,继续阅读
2022-03-26 上传
2011-10-14 上传
2020-09-17 上传
2022-09-14 上传
2021-08-11 上传
2022-09-24 上传
2010-03-12 上传
2022-09-23 上传
2018-12-26 上传
freedom_824
- 粉丝: 24
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Raspberry Pi OpenCL驱动程序安装与QEMU仿真指南
- Apache RocketMQ Go客户端:全面支持与消息处理功能
- WStage平台:无线传感器网络阶段数据交互技术
- 基于Java SpringBoot和微信小程序的ssm智能仓储系统开发
- CorrectMe项目:自动更正与建议API的开发与应用
- IdeaBiz请求处理程序JAVA:自动化API调用与令牌管理
- 墨西哥面包店研讨会:介绍关键业绩指标(KPI)与评估标准
- 2014年Android音乐播放器源码学习分享
- CleverRecyclerView扩展库:滑动效果与特性增强
- 利用Python和SURF特征识别斑点猫图像
- Wurpr开源PHP MySQL包装器:安全易用且高效
- Scratch少儿编程:Kanon妹系闹钟音效素材包
- 食品分享社交应用的开发教程与功能介绍
- Cookies by lfj.io: 浏览数据智能管理与同步工具
- 掌握SSH框架与SpringMVC Hibernate集成教程
- C语言实现FFT算法及互相关性能优化指南
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功