Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Oracle 9i & 10g notes

Oracle 9i & 10g notes



|Views: 20,581|Likes:
Published by vrbala

More info:

Categories:Types, Research
Published by: vrbala on Jun 21, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less





/***********************************************************************//* Document : Oracle 8i,9i,10g queries, information, and tips *//* Doc. Versie : 58 *//* File : oracle9i10g.txt *//* Date : 23-05-2008 *//* Content : Just a series of handy DBA queries. *//* Compiled by : Albert *//***********************************************************************/CONTENTS:0. Common data dictionary queries for sessions, locks, perfoRMANce etc..1. DATA DICTIONARY QUERIES m.b.t. files, tablespaces, logs:2. NOTES ON PERFORMANCE:3. Data dictonary queries m.b.t perfoRMANce:4. IMP and EXP, 10g IMPDB and EXPDB, and SQL*Loader Examples5. Add, Move AND Size Datafiles,logfiles, create objects etc..:6. Install Oracle 92 on Solaris:7. install Oracle 9i on Linux:8. Install Oracle on OpenVMS:9. Install Oracle on AIX9. Installation Oracle 8i - 9i:10. CONSTRAINTS:11. DBMS_JOB and scheduled Jobs:12. Net8,9,10 / SQLNet:13. Datadictionary queries Rollback segments:14. Data dictionary queries m.b.t. security, permissions:15. INIT.ORA parameters:16. Snapshots:17. Triggers:19. BACKUP RECOVERY, TROUBLESHOOTING:20. TRACING:21. Overig:22. DBA% and v$ views23 TUNING:24 RMAN:25. UPGRADE AND MIGRATION26. Some info on Rdb:27. Some info on IFS28. Some info on 9iAS rel. 229 - 35 9iAS configurations and troubleshooting30. BLOBS31. BLOCK CORRUPTION32. iSQL*Plus and EM 10g33. ADDM34. ASM and 10g RAC35. CDC and Streams36. X$ Tables============================================================================================
0. QUICK INFO/VIEWS ON SESSIONS, LOCKS, AND UNDO/ROLLBACK INFORMATION IN A SINGLEINSTANCE:===========================================================================================SINGLE INSTANCE QUERIES:========================-- ----------------------------- 0.1 QUICK VIEW ON SESSIONS:-- ---------------------------SELECT substr(username, 1, 10), osuser, sql_address, to_char(logon_time, 'DD-MM-YYYY;HH24:MI'),sid, serial#, command, substr(program, 1, 30), substr(machine, 1, 30),substr(terminal, 1, 30)FROM v$session;SELECT sql_text, rows_processed from v$sqlarea where address=''-- -------------------------- 0.2 QUICK VIEW ON LOCKS: (use the sys.obj$ to find ID1:)-- ------------------------First, lets take a look at some important dictionary views with respect to locks:SQL> desc v$lock;Name Null? Type----------------------------- -------- --------------------ADDR RAW(8)KADDR RAW(8)SID NUMBERTYPE VARCHAR2(2)ID1 NUMBERID2 NUMBERLMODE NUMBERREQUEST NUMBERCTIME NUMBERBLOCK NUMBERThis view stores all information relating to locks in the database. Theinteresting columns in this view are sid (identifying the sessionholding or aquiring the lock), type, and the lmode/request pair. Importantpossible values of type are TM (DML or Table Lock),TX (Transaction), MR (Media Recovery), ST (Disk Space Transaction). Exactly one ofthe lmode, request pair is either 0 or 1while the other indicates the lock mode. If lmode is not 0 or 1, then the sessionhas aquired the lock, while it waits to aquire the lockif request is other than 0 or 1. The possible values for lmode and request are:1: null,2: Row Share (SS),3: Row Exclusive (SX),4: Share (S),
5: Share Row Exclusive (SSX) and6: Exclusive(X)If the lock type is TM, the column id1 is the object's id and the name of theobject can then be queried like so:select name from sys.obj$ where obj# = id1 A lock type of JI indicates that amaterialized view is beingSQL> desc v$locked_object;Name Null? Type----------------------------- -------- --------------------XIDUSN NUMBERXIDSLOT NUMBERXIDSQN NUMBEROBJECT_ID NUMBERSESSION_ID NUMBERORACLE_USERNAME VARCHAR2(30)OS_USER_NAME VARCHAR2(30)PROCESS VARCHAR2(12)LOCKED_MODE NUMBERSQL> desc dba_waiters;Name Null? Type----------------------------- -------- --------------------WAITING_SESSION NUMBERHOLDING_SESSION NUMBERLOCK_TYPE VARCHAR2(26)MODE_HELD VARCHAR2(40)MODE_REQUESTED VARCHAR2(40)LOCK_ID1 NUMBERLOCK_ID2 NUMBERSQL> desc v$transaction;Name Null? Type----------------------------- -------- --------------------ADDR RAW(8)XIDUSN NUMBERXIDSLOT NUMBERXIDSQN NUMBERUBAFIL NUMBERUBABLK NUMBERUBASQN NUMBERUBAREC NUMBERSTATUS VARCHAR2(16)START_TIME VARCHAR2(20)START_SCNB NUMBERSTART_SCNW NUMBERSTART_UEXT NUMBERSTART_UBAFIL NUMBERSTART_UBABLK NUMBERSTART_UBASQN NUMBERSTART_UBAREC NUMBERSES_ADDR RAW(8)FLAG NUMBERSPACE VARCHAR2(3)