升级到11.2.0.4的一些发现-3-catalog.sql的主要内容

联系:QQ(5163721)

标题:升级到11.2.0.4的一些发现-3-catalog.sql的主要内容

作者:Lunar©版权所有[文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.]

升级到11.2.0.4的一些发现-1-catupgrd.sql大致解读
升级到11.2.0.4的一些发现-2-其他发现

升级脚本catupgrd.sql中,首先调用的catupstr.sql主要用于更新数据字典(里面还调用很多重要的创建基表的语句),例如:

[oracle@lunar admin]$ grep "create table obj" *
c1002000.sql:create table objerror$
dcore.bsq:create table obj$                                            /* object table */
dcore.bsq:create table objerror$
dcore.bsq:create table objauth$                           /* table authorization table */
dcore.bsq:create table objpriv$                       /* privileges granted to objects */
dmanage.bsq:create table object_usage                         /* object usage statistics */
utlmmig.sql:create table obj$mig                                         /* object table */
[oracle@lunar admin]$ 

之后,就是调用catalog.sql来创建各种数据字典,大概看了一下,记录如下:

--CATCTL -S    Initial scripts single process
@@cdstrt ---依次调用 :
						Rem Run CATALOG and CATPROC session initialization script
						@@catpses.sql
									--catpses.sql - CATalog and CATProc SESsion script
									--Rem Assure CHAR semantics are not used in the dictionary
									ALTER SESSION SET NLS_LENGTH_SEMANTICS=BYTE;								
						
						rem Load PL/SQL Package STANDARD first, so views can depend upon it
						@@standard
								[root@ebsdba1 admin]# cat standard.sql 
								@@stdspec.sql   ---里面是各种标准数据类型
								@@stdbody.sql   ---一些标准函数
								grant execute on STANDARD to public;
								[root@ebsdba1 admin]# 								

						@@dbmsstdx --调用stdext.sql - Kernel extensions to package standard
															--Rem    DESCRIPTION
															--Rem      Routines in this package do not need to be qualified by the owner or package name, 
															--Rem      similar to the behaviour of package 'standard'.  This package mostly contains utility routines for triggers.

						
						Rem Load registry so catalog component can be defined
						@@catcr --这个脚本本身是创建加载到数据库中的部件的registry信息相关的数据字典和存储过程等的(CATalog Component Registry)
										--This script creates the data dictionary elements and package for the registry of components that have been loaded into the database
										--例如CREATE TABLE registry$,CREATE TABLE registry$schemas,CREATE TABLE registry$log,PACKAGE dbms_registry等等
										--它调用catcrsc.sql(	Rem Server Components script)
										@@catcrsc : catcrsc.sql - CATalog Component Registry Server Components
																This script contains constants used to identify SERVER components and the associated upgrade/downgrade/patch/reload scripts
																--即,PACKAGE dbms_registry_server,其包含了已经注册的一些服务器部件的常量的定义,比如:
																-- Path names
																				JAVAVM_path   CONSTANT VARCHAR2(50) := '?/javavm/install/';
																				CATJAVA_path  CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				XML_path      CONSTANT VARCHAR2(50) := '?/xdk/admin/';
																				XDB_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				RAC_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				OLS_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				EXF_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				OWM_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				ORDIM_path    CONSTANT VARCHAR2(50) := '?/ord/im/admin/';
																				SDO_path      CONSTANT VARCHAR2(50) := '?/md/admin/';
																				CONTEXT_path  CONSTANT VARCHAR2(50) := '?/ctx/admin/';
																				ODM_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				WK_path       CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				MGW_path      CONSTANT VARCHAR2(50) := '?/mgw/admin/';
																				AMD_path      CONSTANT VARCHAR2(50) := '?/olap/admin/';
																				APS_path      CONSTANT VARCHAR2(50) := '?/olap/admin/';
																				XOQ_path      CONSTANT VARCHAR2(50) := '?/olap/admin/';
																				EM_path       CONSTANT VARCHAR2(50) := '?/sysman/admin/emdrep/sql/';
																				RUL_path      CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
																				APEX_path     CONSTANT VARCHAR2(50) := '?/apex/';
																				DV_path       CONSTANT VARCHAR2(50) := '?/rdbms/admin/';
								
								
@@cdfixed.sql   --Catalog FIXED views,Objects which reference fixed views
								--即,该脚本创建了大部分的gv_和v_的动态性能视图,例如:
													create or replace view v_$dataguard_status as select * from v$dataguard_status;
													create or replace public synonym v$dataguard_status for v_$dataguard_status;
													grant select on v_$dataguard_status to SELECT_CATALOG_ROLE;
													
													create or replace view v_$thread as select * from v$thread;
													create or replace public synonym v$thread for v_$thread;
													grant select on v_$thread to select_catalog_role;
													
													create or replace view v_$process as select * from v$process;
													create or replace public synonym v$process for v_$process;
													grant select on v_$process to select_catalog_role;
													
													create or replace view v_$bgprocess as select * from v$bgprocess;
													create or replace public synonym v$bgprocess for v_$bgprocess;
													grant select on v_$bgprocess to select_catalog_role;
													
													create or replace view v_$session as select * from v$session;
													create or replace public synonym v$session for v_$session;
													grant select on v_$session to select_catalog_role;
													。。。。。。。。。。。
													create or replace view gv_$sqltext as select * from gv$sqltext;
													create or replace public synonym gv$sqltext for gv_$sqltext;
													grant select on gv_$sqltext to select_catalog_role;
													
													create or replace view gv_$sqltext_with_newlines as
													      select * from gv$sqltext_with_newlines;
													create or replace public synonym gv$sqltext_with_newlines
													   for gv_$sqltext_with_newlines;
													grant select on gv_$sqltext_with_newlines to select_catalog_role;
													
													create or replace view gv_$sql as select * from gv$sql;
													create or replace public synonym gv$sql for gv_$sql;
													grant select on gv_$sql to select_catalog_role;

													。。。。。。。。。。。
													
													
@@cdcore.sql  --Catalog DCORE.bsq views,core objects。
							--This script contains catalog views for objects in dcore.bsq
							--即,基于dcore.bsq(在sql.bsq中调用)中的对象而创建的数据字典(DBA_, ALL_, USER_)
							--  _CURRENT_EDITION_OBJ  _ACTUAL_EDITION_OBJ   _BASE_USER   USER_CONS_COLUMNS   ALL_CONS_COLUMNS
							--- DBA_CONS_COLUMNS LOG_GROUP_COLUMNS  ALL_LOG_GROUP_COLUMNS  DBA_LOG_GROUP_COLUMNS
							---  syscatalog_    syscatalog   catalog   
							---  tab  col  syssegobj  sysfiles  synonyms  publicsyn
							--- TABLE_PRIVILEGES  COLUMN_PRIVILEGES  USER_LOBS, ALL_LOBS, and DBA_LOBS
							--- USER_CATALOG  ALL_CATALOG  DBA_CATALOG
							--- USER_INDEXES  ALL_INDEXES  DBA_INDEXES
							---  等等,大部分的 DBA_, ALL_, USER_

--CATCTL -M
@@cdplsql.sql   ---cdplsql.sql - Catalog DPLSQL.bsq views,libraries, procedure, etc。
								---This script contains catalog views for objects in dplsql.bsq.
								--即,基于DPLSQL.bsq(在sql.bsq中被调用。dplsql.bsq包含了procedure,function等的相关基表)中的对象而创建的数据字典
								--DPLSQL.bsq包含类似:create table procedure$ ,create table procedureinfo$ ,create table source$等等
								
@@cdsqlddl.sql  --- Catalog DSQLDDL.bsq views. database links, dictionary, recyclebin objects, etc.
								--- This script contains Catalog Views for objects in dsqlddl.bsq
								--- 即,基于dsqlddl.bsq(在sql.bsq中被调用)中的对象而创建的数据字典。例如,database links, dictionary, recyclebin等等。
								---例如 create or replace view DICTIONARY(Online documentation for data dictionary tables and views )
								------- create or replace view USER_RECYCLEBIN(List of objects in recycle bin)
												[oracrp3@ebscrp3 admin]$ cat dsqlddl.bsq|grep recycle
												create table recyclebin$
												create index recyclebin$_obj on recyclebin$(obj#)
												create index recyclebin$_ts on recyclebin$(ts#)
												create index recyclebin$_owner on recyclebin$(owner#)
												[oracrp3@ebscrp3 admin]$ 




@@cdmanage.sql  --Catalog DMANAGE.bsq views. SQL tuning, SQL text, SQL profile, etc. This script contains catalog views for objects in dmanage.bsq
								-- create or replace view V$OBJECT_USAGE

@@cdtxnspc.sql  --Catalog DTXNSPC.bsq views. two phase commit objects. This script contains catalog views for objects in dtxnspc.bsq
								-- create or replace view ps1$   create or replace view DBA_2PC_PENDING create or replace view DBA_2PC_NEIGHBORS

@@cdenv.sql  ----- Catalog DENV.bsq views. profiles, resources, etc. This script contains catalog views for objects in denv.bsq
						 ----- DBA_PROFILES USER_RESOURCE_LIMITS  USER_PASSWORD_LIMITS  
						 ----- USER_USERS  ALL_USERS  DBA_USERS
@@cdrac.sql  ------ DBA_SERVICES  ALL_SERVICES

@@cdsec.sql  ----- Catalog DSEC.bsq views .  Privilege objects
						------- SESSION_PRIVS   SESSION_ROLES  ROLE_SYS_PRIVS    ROLE_TAB_PRIVS  ROLE_ROLE_PRIVS
						------- DBA_ROLES  USER_SYS_PRIVS   USER_PROXIES   DBA_PROXIES   PROXY_USERS_AND_ROLES
						------- DBA_CONNECT_ROLE_GRANTEES
						
@@cdobj.sql  ------- Catalog DOBJ.bsq views. Nested tables, directories, operators, types, etc .This script contains catalog views for objects in dobj.bsq
						----- 调用 Rem Object views 
											@@catadt --- This SQL script creates data dictionary views for showing meta-data information for types and other object features in the RDBMS
															 ---This script must be run while connected as SYS or INTERNAL
															 ---  USER_TYPES, ALL_TYPES, and DBA_TYPES
															 --- USER_NESTED_TABLE_COLS  ALL_NESTED_TABLE_COLS     DBA_NESTED_TABLE_COLS   USER_NESTED_TABLES  ALL_NESTED_TABLES
															 --- ALL_DIRECTORIES
															 --- USER_REFS, ALL_REFS, and DBA_REFS
															 --- USER_VARRAYS   DBA_VARRAYS   ALL_VARRAYS
															 --- USER_OPERATORS  DBA_OPERATORS  ALL_OPERATORS
						

@@cdjava.sql
@@cdpart.sql
@@cdrep.sql
@@cdaw.sql
@@cdsummgt.sql
@@cdtools.sql


此条目发表在 Installation and Deinstall 分类目录,贴了 , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注