Showing posts with label sql developer. Show all posts
Showing posts with label sql developer. Show all posts

Thursday, August 7, 2008

Useful SQLs

Child tables not having index on foreign key columns
select table_name,column_name from user_cons_columns where constraint_name in (select constraint_name from user_constraints where r_constraint_name in (select constraint_name from user_constraints where table_name='table_name') and constraint_type='R') minus (select table_name,column_name from user_ind_columns);



child tables of a parent table

select table_name from user_constraints where r_constraint_name in (select constraint_name from user_constraints where table_name='table name');


Tuesday, July 1, 2008

Dictionary Scripts

To resolve
ORA-39127: unexpected error from call to export_string
:=WMSYS.LT_EXPORT_PKG.schema_info_exp('SYS',1,1,'10.02.00.03.00',newblock)
ORA-04063: package "WMSYS.LTADM" has errors
ORA-06508: PL/SQL: could not find program unit being called: "WMSYS.LTADM"

run

@?/rdbms/admin/owmcpkgb.plb
@?/rdbms/admin/catexp
@?/rdbms/admin/utlrp

OLAP component invalid
@?/olap/admin/olap.sql SYSAUX TEMP;

Spatial component invalid
@?/md/admin/catmd

InterMedia component invlaid
@?/ord/im/admin/iminst.sql


to resolve
ORA-04063: View "SYS.DBA_REGISTRY" has errors..
$ORACLE_HOME/rdbms/admin/prvtcr.plb

Other dictionary scripts

catadt.sql - Creates views that support user-defined types and object components.
cataudit.sql - Creates the sys.aud$ dictionary table,
catexp.sql - Creates views for the import/export utilities
catldr.sql - Creates views for the sql*loader tool
catpart.sql - Creates views for partitioning oracle option,

catalog.sql - create data dictionary views.
cataudit.sql - data dictionary views for auditing. (catnoaud.sql will remove)
catblock.sql - create views of oracle locks
catclust.sql - create cluster database specific views definitions
catdbsyn.sql - catalog dba synonyms (dba_synonyms.sql)
catexp7.sql - create v7 style export/import views
catexp81.sql - create internal views for export/import utility
catio.sql - collect i/o per table/object stats by statistical sampling
catjava.sql - catalog scripts for java
catjobq.sql - catalog views for the job queue
catjvm.sql - create user|dba|all_java_* views
catldap.sql - catalog for ldap pl/sql api
catldr.sql - views for the direct path of the loader
catlsby.sql - logical standby tables and views
catpart.sql - creates data dictionary views for the partitioning table.
catoctk.sql - catalog - oracle cryptographic toolkit
catol.sql - outline views and synonyms
catparr.sql - parallel-server specific views, performance queries, etc
catpatch.sql - script to apply catalog patch set
catpitr.sql - tablespace point in time specific views
catplug.sql - pluggable tablespace check views
catprc.sql - creates data dictionary views for types, stored procedures, and triggers.
catproc.sql - run all sql scripts for the procedural option
catqm.sql - creates the tables and views needed to run the xdb system
catqueue.sql - contains the queue dictionary information
catrep.sql - run all sql scripts for replication option
catrepc.sql - repcat tables, views, and sequences
catrepm.sql - catalog script for master replication packages
catrepr.sql - catalog replication remove
catreps.sql - installs pl/sql packages for snapshot functionality.
catrls.sql - catalog views for row level security
catrm.sql - packages for the dbms resource manager
catrpc.sql - rpc procedural option
catrule.sql - rules catalog creation
catsnap.sql - data dictionary views for snapshots
catsnmp.sql - creates an snmpagent role
catspace.sql - catalog space management (remove with catspaced.sql)
catsum.sql - data dictionary views for summary management
catsvrmg.sql - create the views and tables required for server manager
catblock.sql - creates the view blocking_locks, which shows which locks are blocking the system
catnoaud.sql - removes the database audit trail created by cataudit.sql, including its data and views
catnoprc.sql - removes data dictionary structures that were created by catprc.sql

Tuesday, June 3, 2008

Remote Debugging with SQL Developer

1. Create a remote debugging session on SQL Developer.


2. Give a port and a IP of the machine or localhost if the debugging client is also on the same machine.




3. Create break points on the PL/SQL function, trigger, package etc.

4. On the client session run
exec DBMS_DEBUG_JDWP.CONNECT_TCP( '192.168.0.124', 4000 );

Remember to change the port and IP accordingly. User needs
DEBUG CONNECT SESSION
prvilege so grant it to the user.

5. Execute the function,package or trigger event from the client session

6. Use SQL Developer to trace the execution path, monitor values, change values and etc.