oracle底層字典表obj$及source$與儲存過程procedure系列五
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> create or replace procedure proc_non_sep
2 as
3 begin
4 null;
5 end;
6 /
Procedure created
SQL> create or replace procedure 'proc_non_sep'
2 as
3 begin
4 null;
5 end;
6 /
SQL> create or replace procedure "proc_non_sep"
2 as
3 begin
4 null;
5 end;
6 /
Procedure created
SQL> create or replace procedure "proc_NON_SEP"
2 as
3 begin
4 null;
5 end;
6 /
Procedure created
SQL> select * from user_objects uo where uo.OBJECT_NAME like '%PROC_NON%';
OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
-------------------------------------------------------------------------------- ------------------------------ ---------- -------------- ------------------- ----------- ------------- ------------------- ------- --------- --------- --------- ---------- ------------------------------
PROC_NON_SEP 132741 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:13:17 VALID N N N 1
SQL> select * from user_objects uo where uo.OBJECT_NAME like '%proc%';
OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
-------------------------------------------------------------------------------- ------------------------------ ---------- -------------- ------------------- ----------- ------------- ------------------- ------- --------- --------- --------- ---------- ------------------------------
proc_NON_SEP 132743 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:14:53 VALID N N N 1
proc_non_sep 132742 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:14:33 VALID N N N 1
proc_obj_new 132740 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:05:16 VALID N N N 1
SQL> create or replace procedure proc_test_single
2 as
3 begin
4 null;
5 end;
6 /
Procedure created
SQL> create or replace procedure 'proc_test_single_1'
2 as
3 begin
4 null;
5 end;
6 /
SQL> select length(object_name) from user_objects uo where uo.OBJECT_NAME like '%proc%';
LENGTH(OBJECT_NAME)
-------------------
12
12
12
SQL> select uo.OBJECT_ID from user_objects uo where uo.OBJECT_NAME like '%proc%';
OBJECT_ID
----------
132743
132742
132740
SQL> conn sys/system@orcl as sysdba
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as SYS
SQL> select * from obj$ ob where ob.obj# in
OBJ# DATAOBJ# OWNER# NAME NAMESPACE SUBNAME TYPE# CTIME MTIME STIME STATUS REMOTEOWNER LINKNAME FLAGS OID$ SPARE1 SPARE2 SPARE3 SPARE4 SPARE5 SPARE6
---------- ---------- ---------- ------------------------------ ---------- ------------------------------ ---------- ----------- ----------- ----------- ---------- ------------------------------ -------------------------------------------------------------------------------- ---------- -------------------------------- ---------- ---------- ---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------
132740 84 proc_obj_new 1 7 2012/11/16 2012/11/16 2012/11/16 1 0 6 65535 84
132742 84 proc_non_sep 1 7 2012/11/16 2012/11/16 2012/11/16 1 0 6 65535 84
132743 84 proc_NON_SEP 1 7 2012/11/16 2012/11/16 2012/11/16 1 0 6 65535 84
SQL> select * from source$ sr where sr.obj# in (132743,132742,132740) order by sr.obj#,sr.line;
OBJ# LINE SOURCE
---------- ---------- --------------------------------------------------------------------------------
132740 1 procedure proc_obj_new
132740 2 as
132740 3 begin
132740 4 null;
132740 5 end;
132740 6
132742 1 procedure "proc_non_sep"
132742 2 as
132742 3 begin
132742 4 null;
132742 5 end;
132742 6
132743 1 procedure "proc_NON_SEP"
132743 2 as
132743 3 begin
132743 4 null;
132743 5 end;
132743 6
18 rows selected
SQL> update source$ set source=replace(source,'"','') where obj# in (132743,132742,132740) and line=1;
3 rows updated
SQL> commit;
Commit complete
SQL> select * from source$ sr where sr.obj# in (132743,132742,132740) order by sr.obj#,sr.line;
OBJ# LINE SOURCE
---------- ---------- --------------------------------------------------------------------------------
132740 1 procedure proc_obj_new
132740 2 as
132740 3 begin
132740 4 null;
132740 5 end;
132740 6
132742 1 procedure proc_non_sep
132742 2 as
132742 3 begin
132742 4 null;
132742 5 end;
132742 6
132743 1 procedure proc_NON_SEP
132743 2 as
132743 3 begin
132743 4 null;
132743 5 end;
132743 6
18 rows selected
SQL> conn scott/system@orcl
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> select * from user_objects uo where uo.OBJECT_NAME like '%proc%';
OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
-------------------------------------------------------------------------------- ------------------------------ ---------- -------------- ------------------- ----------- ------------- ------------------- ------- --------- --------- --------- ---------- ------------------------------
proc_obj_new 132740 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:05:16 VALID N N N 1
proc_non_sep 132742 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:14:33 VALID N N N 1
proc_NON_SEP 132743 PROCEDURE 2012/11/16 2012/11/16 19 2012-11-16:19:14:53 VALID N N N 1
SQL>
小結:加雙引號的儲存過程名稱可以用source$和obj$來更新掉
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-749383/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle底層字典表obj$及source$與儲存過程procedure系列一OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列二OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列三OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列四OracleOBJ儲存過程
- [Procedure]Oracle之分頁儲存過程Oracle儲存過程
- Oracle 基礎 ----procedure(儲存過程)Oracle儲存過程
- oracle父儲存過程呼叫子儲存過程procedure與輸出引數Oracle儲存過程
- mysql 儲存過程 procedure 批次建表MySql儲存過程
- oracle procedure 儲存過程輸入及輸出in out示例Oracle儲存過程
- procedure儲存過程呼叫dba字首的字典dba_objects儲存過程Object
- SQL 建立儲存過程PROCEDURESQL儲存過程
- PL/SQL 05 儲存過程 procedureSQL儲存過程
- Oracle 11g系列:函式與儲存過程Oracle函式儲存過程
- mysql檢視儲存過程show procedure status;MySql儲存過程
- MySQL入門--儲存過程(PROCEDURE)和儲存函式(FUNCTION)MySql儲存過程儲存函式Function
- oracle儲存過程(procedure)中執行動態SQL小記Oracle儲存過程SQL
- oracle儲存過程procedure_輸入引數varchar2與char報錯Oracle儲存過程
- Oracle儲存過程Oracle儲存過程
- mysql儲存過程procedure、函式function的用法MySql儲存過程函式Function
- oracle plsql package_body_procedure_構建語法_sp_儲存過程OracleSQLPackage儲存過程
- oracle procedure儲存過程(pl/sql)_使用declare cursor_begin end巢狀Oracle儲存過程SQL巢狀
- Sql Server系列:儲存過程SQLServer儲存過程
- 儲存過程與儲存函式儲存過程儲存函式
- Oracle儲存過程乾貨(一):儲存過程基礎Oracle儲存過程
- Oracle儲存過程-1Oracle儲存過程
- oracle的儲存過程Oracle儲存過程
- Oracle儲存過程例子Oracle儲存過程
- Oracle建立儲存過程Oracle儲存過程
- oracle plsql儲存過程OracleSQL儲存過程
- ORACLE 儲存過程示例Oracle儲存過程
- SQL總結(五)儲存過程SQL儲存過程
- 從sybase的儲存過程轉向oracle的儲存過程儲存過程Oracle
- block底層儲存方式BloC
- 【實驗】【PROCEDURE】一個最簡單的oracle儲存過程"proc_helloworld"Oracle儲存過程
- 通過v$access檢視正在執行的儲存過程procedure儲存過程
- 原創:oracle 儲存過程Oracle儲存過程
- oracle 儲存過程批次提交Oracle儲存過程
- oracle 儲存過程學習Oracle儲存過程