资源描述:
《数据库校验脚本.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、数据库校验脚本--1.DATABASELINKselectx.object_name,x.subobject_name,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_type='DATABASELINK'orderbyobject_type,object_name,x.subobject_name;--2.TABLESPACEselecttablespace_name,status,conten
2、ts,loggingfromdba_tablespacesorderbytablespace_name;--3.PROCEDUREselectx.object_name,x.subobject_name,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_type='PROCEDURE'orderbyobject_type,object_name,x.subobject_name;--4.Packag
3、e&PackageBodyselectx.object_name,x.subobject_name,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_typein('PACKAGE','PACKAGEBODY')orderbyobject_type,object_name,x.subobject_name;--5.TRIGGERselectx.object_name,x.subobject_name
4、,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_type='TRIGGER'orderbyobject_type,object_name,x.subobject_name;SELECTOWNER,trigger_name,statusFROMdba_triggersWHEREOWNER='BLS';--6.JOBSELECTJOB,LOG_USER,PRIV_USER,SCHEMA_USER,N
5、EXT_DATE,NEXT_SEC,BROKENFROMDBA_JOBS;------------------------------------------7.TABLEselectx.object_name,x.subobject_name,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_type='TABLE'orderbyobject_type,object_name,x.subobjec
6、t_name;selectowner,tablespace_name,table_name,num_rows,partitionedfromdba_tableswhereowner='BLS'orderbytablespace_name,table_name;selecttable_name,partition_name,partition_position,tablespace_name,num_rowsfromdba_tab_partitionswheretable_owner='BLS'orderbytable_nam
7、e,partition_name;selectconstraint_name,table_name,statusfromuser_constraintswhereconstraint_type='P'orderbytable_name;--8.INDEXselectx.object_name,x.subobject_name,x.object_type,x.status,x.temporary,x.generated,x.secondaryfromuser_objectsxwherex.object_type='INDEX'
8、orderbyobject_type,object_name,x.subobject_name;selecttable_name,index_name,index_type,tablespace_name,status,num_rows,partitionedfromdba_indexes