1. 权限传递:
系统权限传递:with admin option
对象权限传递:with grant option
2. 查看package的所有方法:
DESC DBMS_WORKLOAD_REPOSITORY;
3. 查看AWR setting
select * from dba_hist_wr_control;
4. package, procedure, function
function有返回值,有参数;
procedure无返回值,有参数;
package可包括function,procedure
package中只有各个方法的定义,package body中涉及具体的实现。
5. 块
DECLARE v_object_id NUMBER(4); v_object_type VARCHAR2(10); BEGIN v_object_type := '&TYPE'; SELECT OBJECT_ID INTO V_OBJECT_ID FROM DBA_OBJECTS WHERE OBJECT_NAME = 'DBA_HIST_WR_CONTROL' AND OBJECT_TYPE = v_object_type; dbms_output.put_line(v_object_id); END;
6. 使用sqlplus 的时候,密码中有特殊字符。
./sqlplus 'user/"#Ee_l!f832"'@SID
7. Wait event
"DFS lock handle": (due to ordered)
"row cache lock": (due to cache size too small)
8. Select space usage for each tablespaces
SELECT A.TABLESPACE_NAME,TOTAL,FREE,(TOTAL-FREE) USDED,ROUND((TOTAL-FREE)/TOTAL,4)*100 "USAGE %" FROM (SELECT TABLESPACE_NAME,SUM(BYTES) FREE FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME ) A, (SELECT TABLESPACE_NAME,SUM(BYTES) TOTAL FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) B WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME ORDER BY TABLESPACE_NAME;
9. 转义 单引号
SELECT CHR(39) FROM DUAL;
select Q'[']' from dual;
10. BULK COLLECT & FORALL
DECLARE TYPE TYPE_INVST_ACCT_NUM IS TABLE OF TMP_SH_ACCT.INVST_ACCT_NUM%TYPE INDEX BY BINARY_INTEGER; V_INVST_ACCT_NUM TYPE_INVST_ACCT_NUM; BEGIN SELECT INVST_ACCT_NUM BULK COLLECT INTO V_INVST_ACCT_NUM FROM TMP_SH_ACCT WHERE FUNCTION_TYPE = 'GFIX_EXEC'; FORALL i IN V_INVST_ACCT_NUM.first..V_INVST_ACCT_NUM.last EXECUTE IMMEDIATE 'BEGIN SC_PRODUCT_CODE_RANDOM(:1, 1);END;' USING V_INVST_ACCT_NUM(i); COMMIT; END; /
11. 最高效的删除重复记录方法 (因为使用了ROWID)例子:
DELETE FROM EMP E WHERE E.ROWID > (SELECT MIN(X.ROWID) FROM EMP X WHERE X.EMP_NO = E.EMP_NO);
相关推荐
This new edition has been expanded to include AWR, Oracle 12c Statistics, interpretation of SQL Monitor reports, Parallel execution, and Exadata-related features. Reading this book and using SQL ...
purpose of a database is to store and retrieve related information 数据库服务器是解决信息管理问题的核心组件。大体上说,数据库服务器 的作用是可靠地管理多用户环境下的大规模数据,使多用户可以并发地访 问...
GOVERNMENT RIGHTSPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" ...
《Oracle 11g 性能调优技巧》是一本深度解析Oracle 11g数据库性能优化的专业书籍,涵盖了从表优化、索引选择与优化、实例内存优化、系统性能监控到SQL执行效率提升等全方位的性能调优策略。本书不仅适合Oracle DBA和...
Oracle R12 Financials Functional Guide, This book is ...analysis of the functionality and best practices related to Oracle's R12 E-Business Suite release. I am pleased to be able to recommend this book.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of ...
- Programs, software, databases, and related documentation are provided under a license agreement containing restrictions on use and disclosure. #### 七、总结 《Oracle Database Administrator's Guide...
### Oracle Interview Questions详解 #### 一、Co-related Subquery与Nested Subquery的区别 **知识点:** - **Co-related Subquery(关联子查询)**: 在这种类型的子查询中,内部查询只执行一次,并根据该结果来...
Fold**: XXEUL_OM_RELATED_INFO **说明**: 完整的订单数据视图整合了与订单相关的所有信息,包括订单头、订单行以及与之关联的客户信息等,为用户提供了一个全面的订单视图。 **6. Fold**: XXEUL_OE_DILIVERY_...
Oracle9i Database Error Messages Release 2 (9.2) Contents Title and Copyright Information Send Us Your Comments Preface Audience Organization Related Documentation Conventions Documentation ...
5. **创建关联表(Creating Related Tables)**: `kc`表代表课程信息,包含课程号(`kch`)、课程名(`kcm`)、开课学期(`kkxq`)、选修人数(`xs`)和学分(`xf`)。同样,`xs_kc`表作为学生和课程成绩的关联表...
- **QUANTITY_RELATED**: NUMBER 类型,相关数量。 - **SO_BASIS**: NUMBER 类型。 - **OPTIONAL**: NUMBER 类型,是否可选(1. 是;2. 否)。 - **MUTUALLY_EXCLUSIVE_OPTIONS**: NUMBER 类型,互斥标识(1. 是;2. 否)...
Entering sales orders for service items typically involves specifying the service type and any related details. 2. **Order Fulfillment**: After the sales order is entered, it needs to be fulfilled ...
The authors first explain the key concepts underlying DBaaS, describe cloud computing implementations related to it, and outline the business and technology benefits. Next, they show how the Oracle ...
database-related design problems that lead to suboptimal performance. Chapter 2, “Key Concepts,” describes the operations carried out by the database engine when parsing and executing SQL statements...
Oracle Database 12c Performance Tuning Recipes is a ready reference for database administrators in need of immediate help with performance issues relating to Oracle Database. The book takes an example...
### Oracle 11g 数据仓库2天培训指南 #### 知识点概览 本文档为Oracle 11g 数据仓库两天培训指南的原版资料,涵盖了数据仓库的基础概念、安装配置过程、基本管理和维护技巧等内容。对于希望快速掌握Oracle 11g 数据...
Typically, questions involving this clause would ask about the implications or operations related to such constraints, such as altering tables or handling errors during constraint enforcement.
database-related design problems that lead to suboptimal performance. Chapter 2, “Key Concepts,” describes the operations carried out by the database engine when parsing and executing SQL statements...