2012-11-1 11gR2 "ADMINISTRATOR'S GUIDE" page 509 - 550

来源:互联网 发布:2017年双11淘宝销售额 编辑:程序博客网 时间:2024/05/17 01:28

 


Manually Recompiling Invalid Objects with PL/SQL Package Procedures -- 手动重新编译无效的对象
Examples
Execute the following PL/SQL block to revalidate all invalid objects in the database, in
parallel and in dependency order: -- 编译数据库中所有的无效对象
begin
utl_recomp.recomp_parallel();
end;
/

 

You can also revalidate individual invalid objects using the package DBMS_UTILITY.
The following PL/SQL block revalidates the procedure UPDATE_SALARY in schema
HR: -- 编译某个PROCEDURE
begin
dbms_utility.validate('HR', 'UPDATE_SALARY', namespace=>1);
end;
/

 

The following PL/SQL block revalidates the package body HR.ACCT_MGMT: -- 编译某个包体
begin
dbms_utility.validate('HR', 'ACCT_MGMT', namespace=>2);
end;
/


Using a PL/SQL Package to Display Information About Schema Objects
Example: Using the DBMS_METADATA Package -- DBMS_METADATA包的使用

EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(
DBMS_METADATA.SESSION_TRANSFORM,'STORAGE',false); -- 也就是让STORAGE的创建语法不显示,只显示简单的DDL语句
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
FROM USER_ALL_TABLES u
WHERE u.nested='NO'
AND (u.iot_type is null or u.iot_type='IOT');
EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(
DBMS_METADATA.SESSION_TRANSFORM,'DEFAULT');

The output from DBMS_METADATA.GET_DDL is a LONG data type. When using
SQL*Plus, your output may be truncated by default. Issue the following SQL*Plus
command before issuing the DBMS_METADATA.GET_DDL statement to ensure that
your output is not truncated:
SQL> SET LONG 9999 -- 设置下,不然结果集会被截断


Managing Resumable Space Allocation
Oracle Database provides a means for suspending, and later resuming, the execution
of large database operations in the event of space allocation failures. Therefore, you
can take corrective action instead of the Oracle Database server returning an error to
the user. After the error condition is corrected, the suspended operation automatically
resumes. This feature is called resumable space allocation. The statements that are
affected are called resumable statements. -- 在表空间使用已满的时候,先暂时SUSPEND,之后在手工或者自动加空间大小,

而不是让它直接报错失败