oracle底層字典表obj$及source$與儲存過程procedure系列一
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> show user
User is "scott"
SQL> create or replace procedure proc_test_special
2 as
3 begin
4 null;
5 end;
6 /
Procedure created
SQL> desc obj$;
Object obj$ does not exist.
SQL> conn sys/s@orcl as syssdba
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as SYS
SQL> grant dba to scott;
Grant succeeded
SQL> conn scott/system@orcl
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> desc obj$;
Object obj$ does not exist.
desc obj$;
小結:
1,此底層字典僅sysdba可以查詢
SQL> conn sys/system@orcl as sysdba
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as SYS
SQL> desc obj$;
Name Type Nullable Default Comments
----------- -------------- -------- ------- --------
OBJ# NUMBER
DATAOBJ# NUMBER Y
OWNER# NUMBER
NAME VARCHAR2(30)
NAMESPACE NUMBER
SUBNAME VARCHAR2(30) Y
TYPE# NUMBER
CTIME DATE
MTIME DATE
STIME DATE
STATUS NUMBER
REMOTEOWNER VARCHAR2(30) Y
LINKNAME VARCHAR2(128) Y
FLAGS NUMBER Y
OID$ RAW(16) Y
SPARE1 NUMBER Y
SPARE2 NUMBER Y
SPARE3 NUMBER Y
SPARE4 VARCHAR2(1000) Y
SPARE5 VARCHAR2(1000) Y
SPARE6 DATE Y
SQL> select OBJ#,status,name from obj$ ob where ob.name='PROC_TEST_SPECIAL';
OBJ# STATUS NAME
---------- ---------- ------------------------------
132739 1 PROC_TEST_SPECIAL
SQL> conn scott/system@orcl
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> drop procedure PROC_TEST_SPECIAL;
Procedure dropped
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 OBJ#,status,name from obj$ ob where ob.name='PROC_TEST_SPECIAL';
OBJ# STATUS NAME
---------- ---------- ------------------------------
132739 1 PROC_TEST_SPECIAL
SQL> desc dba_objects;
Name Type Nullable Default Comments
-------------- ------------- -------- ------- ----------------------------------------------------------------------------
OWNER VARCHAR2(30) Y Username of the owner of the object
OBJECT_NAME VARCHAR2(128) Y Name of the object
SUBOBJECT_NAME VARCHAR2(30) Y Name of the sub-object (for example, partititon)
OBJECT_ID NUMBER Y Object number of the object
DATA_OBJECT_ID NUMBER Y Object number of the segment which contains the object
OBJECT_TYPE VARCHAR2(19) Y Type of the object
CREATED DATE Y Timestamp for the creation of the object
LAST_DDL_TIME DATE Y Timestamp for the last DDL change (including GRANT and REVOKE) to the object
TIMESTAMP VARCHAR2(19) Y Timestamp for the specification of the object
STATUS VARCHAR2(7) Y Status of the object
TEMPORARY VARCHAR2(1) Y Can the current session only see data that it place in this object itself?
GENERATED VARCHAR2(1) Y Was the name of this object system generated?
SECONDARY VARCHAR2(1) Y Is this a secondary object created as part of icreate for domain indexes?
NAMESPACE NUMBER Y Namespace for the object
EDITION_NAME VARCHAR2(30) Y Name of the edition in which the object is actual
SQL> select do.OWNER,do.object_name,do.object_id,status from dba_objects do where do.object_name='PROC_TEST_SPECIAL';
OWNER OBJECT_NAME OBJECT_ID STATUS
------------------------------ -------------------------------------------------------------------------------- ---------- -------
SQL> desc obj$;
Name Type Nullable Default Comments
----------- -------------- -------- ------- --------
OBJ# NUMBER
DATAOBJ# NUMBER Y
OWNER# NUMBER
NAME VARCHAR2(30)
NAMESPACE NUMBER
SUBNAME VARCHAR2(30) Y
TYPE# NUMBER
CTIME DATE
MTIME DATE
STIME DATE
STATUS NUMBER
REMOTEOWNER VARCHAR2(30) Y
LINKNAME VARCHAR2(128) Y
FLAGS NUMBER Y
OID$ RAW(16) Y
SPARE1 NUMBER Y
SPARE2 NUMBER Y
SPARE3 NUMBER Y
SPARE4 VARCHAR2(1000) Y
SPARE5 VARCHAR2(1000) Y
SPARE6 DATE Y
SQL> select * from obj$ where name='PROC_TEST_SPECIAL';
OBJ# DATAOBJ# OWNER# NAME NAMESPACE SUBNAME TYPE# CTIME MTIME STIME STATUS REMOTEOWNER LINKNAME FLAGS OID$ SPARE1 SPARE2 SPARE3 SPARE4 SPARE5 SPARE6
---------- ---------- ---------- ------------------------------ ---------- ------------------------------ ---------- ----------- ----------- ----------- ---------- ------------------------------ -------------------------------------------------------------------------------- ---------- -------------------------------- ---------- ---------- ---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------
SQL> SHOW USER
User is "SYS"
SQL> /
OBJ# DATAOBJ# OWNER# NAME NAMESPACE SUBNAME TYPE# CTIME MTIME STIME STATUS REMOTEOWNER LINKNAME FLAGS OID$ SPARE1 SPARE2 SPARE3 SPARE4 SPARE5 SPARE6
---------- ---------- ---------- ------------------------------ ---------- ------------------------------ ---------- ----------- ----------- ----------- ---------- ------------------------------ -------------------------------------------------------------------------------- ---------- -------------------------------- ---------- ---------- ---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------
SQL> select * from obj$ where name='PROC_TEST_SPECIAL';
OBJ# DATAOBJ# OWNER# NAME NAMESPACE SUBNAME TYPE# CTIME MTIME STIME STATUS REMOTEOWNER LINKNAME FLAGS OID$ SPARE1 SPARE2 SPARE3 SPARE4 SPARE5 SPARE6
---------- ---------- ---------- ------------------------------ ---------- ------------------------------ ---------- ----------- ----------- ----------- ---------- ------------------------------ -------------------------------------------------------------------------------- ---------- -------------------------------- ---------- ---------- ---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------
SQL>
SQL> select OBJ#,status,name from obj$ ob where ob.name='PROC_TEST_SPECIAL';
OBJ# STATUS NAME
---------- ---------- ------------------------------
SQL>
小結:如果馬上刪除儲存過程,在底層字典表沒有馬上刪除,還可以看到相關的資訊,所以還有恢復的可能性
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-749379/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 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函式儲存過程
- Oracle儲存過程乾貨(一):儲存過程基礎Oracle儲存過程
- mysql檢視儲存過程show procedure status;MySql儲存過程
- MySQL入門--儲存過程(PROCEDURE)和儲存函式(FUNCTION)MySql儲存過程儲存函式Function
- oracle儲存過程(procedure)中執行動態SQL小記Oracle儲存過程SQL
- 【實驗】【PROCEDURE】一個最簡單的oracle儲存過程"proc_helloworld"Oracle儲存過程
- 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儲存過程-1Oracle儲存過程
- oracle的儲存過程Oracle儲存過程
- Oracle儲存過程例子Oracle儲存過程
- Oracle建立儲存過程Oracle儲存過程
- oracle plsql儲存過程OracleSQL儲存過程
- ORACLE 儲存過程示例Oracle儲存過程
- 從sybase的儲存過程轉向oracle的儲存過程儲存過程Oracle
- block底層儲存方式BloC
- 通過v$access檢視正在執行的儲存過程procedure儲存過程
- SQL 儲存過程裡呼叫另一個儲存過程SQL儲存過程
- 原創:oracle 儲存過程Oracle儲存過程
- oracle 儲存過程批次提交Oracle儲存過程
- oracle 儲存過程學習Oracle儲存過程