Hi
Some times, i use to do a dev refreshes without checking the pre- requisites like size , object counts etc .. but i will pay my time for the same when i see the import taking long time than i expected.
so the below query can be used to see what actually the import process is currently doing inside the db , like which table is getting loaded how many rows are getting updated till now and we can calculate how long the processs could take etc .. it is a use full quey which i frequently use
select substr(sql_text,instr(sql_text,'INTO "'),30) table_name,
rows_processed,
round((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60,1) minutes,
trunc(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60)) rows_per_min
from sys.v_$sqlarea
where sql_text like 'INSERT %INTO "%'
and command_type = 2
and open_versions > 0;
and basically check if the imp process still exist on the server
ps -ef | grep imp
Monday, August 13, 2012
oracle user password expired locked
In 11 r2 , were facing this user lock and expire issue frequently to override it
select profile from dba_users where username ='xxxx';
alter profile default limit passsword_life_time unlimited;
alter profile default limit failed_login_attempts unlimited;
select profile from dba_users where username ='xxxx';
alter profile default limit passsword_life_time unlimited;
alter profile default limit failed_login_attempts unlimited;
select resource_name,limit from dba_profiles where profile='' ;
Wednesday, March 28, 2012
Oracle Database scripts basic
| Database Scripts Library Index [ID 131704.1] | |||||
| Modified 03-NOV-2011 Type REFERENCE Status ARCHIVED | |||||
| Database Scripts | Last updated on October 23, 2009 | |
| This document has been archived and will no longer be updated. |
AdvancedQueueing - Advanced Queuing
- AQ PL/SQL Notification: PL/SQL Callback and Email Notification (Note:225749.1)
- AQBasicCleanup.sql (Note:116841.1)
- AQBasicDequeue.sql (Note:116840.1)
- AQBasicEnqueue.sql (Note:116838.1)
- AQBasicSetupQueue.sql (Note:116837.1)
- AQBasicSetupUser.sql (Note:116834.1)
- AQMultiConsumerCleanup.sql (Note:117062.1)
- AQMultiConsumerDequeue.sql (Note:117061.1)
- AQMultiConsumerEnqueue.sql (Note:117056.1)
- AQMultiConsumerRegisterSubscribers.sql (Note:117053.1)
- AQMultiConsumerSetupQueue.sql (Note:117051.1)
- AQMultiConsumerSetupUser.sql (Note:117050.1)
- Advanced Queueing Propagation using PL/SQL (Note:102771.1)
- Dequeuing Messages from an Exception Queue (Note:233103.1)
- How To List All Subscribers For a Multi-Consumer Queue (Note:209069.1)
- PATCHAQ.SQL : Script 2 of 3 to workaround Bug:2757441 (Note:233993.1)
- PATCHRULES.SQL: Script 1 of 3 to workaround Bug:2757441 (Note:233991.1)
- Patch817Rules.sql : Script to remove duplicate rules prior to an upgrade to 9.2 (Note:233985.1)
- Procedure to Dequeue Messages from any Queue not using Message Grouping (Note:243665.1)
- UPGRADE-PATCH-92.SQL: Script 3 of 3 to workaround Bug:2757441 (Note:236899.1)
[Top]
ContentMgmt.Spatial - Oracle Intermedia Spatial and Spatial Data Option
- Cancer Ontology Brief Example (Note:453628.1)
- Re-validation of Spatial Schema Owner MDSYS Objects (Note:132104.1)
- Script To Collect Semantic Metadata (Note:453620.1)
- Verification of an Oracle 8i Release 3 (8.1.7) Spatial Installation (Note:132102.1)
- Verification of an Oracle 9i (Release 1 - 9.0.1) Spatial Installation (Note:221180.1)
- Verification of an Oracle 9i (Release 2 - 9.2.0) Spatial Installation (Note:221174.1)
[Top]
ContentMgmt.Text - Oracle Text (formerly interMedia Text)
- Contents Check for an Index (Note:99881.1)
- HOW TO INDEX DOCUMENTS WITH CERTAIN TYPE OF DATA IN BLOB COLUMNS (Note:170999.1)
-
TXTSUP_UTIL - Oracle Text diagnostics utility
(Note:150546.1)
[Top]
ContentMgmt.UltraSearch - Oracle Ultra Search
- Ultra Search Health Script (Note:763925.1)
- Verifying Oracle JVM has no problem with Runtime.exec spawning child process (Note:402661.1)
[Top]
ContentMgmt.XDB - XML Database
-
Example Of Storing/Accesing Uri-refs In/From The Database
(Note:137044.1)
[Top]
ContentMgmt.interMedia - Oracle interMedia (Image, Video, Sound etc)
- Script To Remove The VIR (Or VIR Compatible) Feature Objects (Note:291970.1)
- Script To Verify interMedia NCOMP Libraries Are Loaded And Active (Note:308579.1)
[Top]
DBA.Admin - General DBA Activities (Copying DB etc...)
- GENERATE VIEW CREATION SCRIPT (Note:1016346.102) Script: To create a Database Schema Summary (Note:1019462.6) TFTS: VIEWING ORACLE PROCESS FROM WITHIN THE DATABASE (Note:1039299.6)
- Toolkit for dynamic marking of Library Cache objects as Kept (PIND) (Note:301171.1)
[Top]
DBA.Architecture - Oracle Server Architecture (processes and SGA)
- SCRIPT: Calculating Buffer Cache Hit Ratio without Inputing Parameters (Note:1039290.6) SCRIPT: Script to Report SGA Buffer Summary (Note:1019635.6)
- Script to Extract SQL Statements for all V$ Views (Note:132793.1)
- Script: To list Running Jobs (Note:1020283.6) *
[Top]
DBA.DBCreationAndConfiguration - Database Create and Configuration
[Top]
DBA.Monitoring - Database Monitoring
- SCRIPT: REGENERATING PACKAGE and PROCEDURE CODE from DBA_SOURCE (Note:1012473.7) Script To Convert Hexadecimal Input Into a Decimal Value (Note:1019580.6)
- Script To Monitor Memory Usage By Database Sessions (Note:239846.1)
- Script to Monitor Current User Activity in the Database (Note:135749.1) Script: To Report Number of Tables/Indexes for Each User Per Tablespace (Note:1019998.6)
- Script: V8.0 Report the Largest Segments in the Database (Note:222464.1)
- Script: V8i/9i Report the Largest Segments in the Database (Note:222525.1)
- Script: Batch Interface to the ORADIM utility on Windows NT (Note:74000.1) Script: Computing Table Size (Note:70183.1)
- Script: Detemine Segment Order of Columns (Note:1020345.6)
- Script: Display SQL text from Locked Transactions (Note:1020010.6) Script: Finding Objects in both SYSTEM and SYS schemas (Note:68080.1)
- Script: For Data & Index Block Distribution and Selectivity (Note:1019718.6)
- Script: List Inactive Users (Note:1020004.6) Script: Report Cluster Information (Note:90396.1)
- Script: Report Open Cursors by User (Note:111415.1)
- Script: Report Statistics for a Table, its Columns and Indexes with DBMS_STATS (Note:130688.1) Script: Report sessions waiting for Locks (Note:1020088.6) Script: To Calculate Business Days between two Dates (Note:1019589.6)
- Script: To Capture Index Stat Information (Note:1020281.6) Script: To Capture Table Constraints (Note:1019469.6) Script: To Create a CREATE ROLLBACK SEGMENT Script (Note:18075.1) Script: To Derive the Name of a Session Generated Trace File on Windows NT or Unix (Note:73419.1)
- Script: To Describe all Indexes in a User's Schema (Note:1019464.6) Script: To Determine the Number of Commits made by a Specific Session (Note:108273.1)
- Script: To Display Active Transactions in Rollback Segments (Note:1019467.6)
- Script: To Eliminate Non-Unique Rows from a Table (Note:1019920.6)
- Script: To Extract Schema Information (Note:90449.1)
- Script: To Find Invalid Objects in the Database (Note:1014072.102)
- Script: To Format the Select of the Explain Plan Table (Note:1020282.6) Script: To List Tablespace, Datafiles and Free Space (Note:1019999.6) Script: To Monitor Session Idle Time (Note:97515.1) Script: To Obtain Rollback Segment Information (Note:1019485.6)
- Script: To Obtain Session Information (Note:1019526.6) Script: To Report All Events Set in a Session (Note:1020308.6)
- Script: To Report Dispatcher & Process Mapping Using MTS (Note:1019594.6)
- Script: To Report Information on Indexes (Note:1019722.6) Script: To Report Instance Statistics (Note:1019624.6)
- Script: To Report Map of all Database File (Note:1019714.6) Script: To Report Tables with many Extents (Note:1020085.6) Script: To Report Users and Number of Objects in Tablespaces (Note:1019994.6)
- Script: To Report Users who Own Objects in a Database (Note:1019919.6) Script: To Show Data Selectivity for a Column (Note:1019622.6)
- Script: To Show SGA Parameters and Statistics (Note:1020076.6) Script: To create a view to display all Open Pipes (Note:1020087.6)
- Script: To determine an Object's Dependencies (Note:1020289.6)
- Script: To display Wrap Time for Rollback Segments (Note:1019993.6)
- Script: To export User Definitions (Note:1019554.6)
- Script: To fully Describe a Table (Note:1020077.6) Script: To generate a Synonym Creations Script (Note:1020179.6)
- Script: To generate a list of Table Dependencies (Note:1020089.6) Script: To provide a listing of all Database Files (Note:1020082.6) Script: To report Statistics for a Table (Note:1020003.6)
- Script: To report Table Constraints (Note:1019930.6)
- Script: To verify Stored Procedures (Note:1019928.6)
- Script: Unload Data to Fixed-Width Text (Note:1019522.6)
- Script: V7.3 To Report the Largest Segments in the Database (Note:1020083.6)
- Script:Locating the Primary & Foreign Key Relationships (Note:16414.1)
- Script:SQL DIAG- Determining Dependency Information (Note:62435.1)
- TFTS: CONVERT MM/DD/YYYY HH:MI:SS TO REDO DUMP TIME (Note:1020342.6)
- TFTS: CONVERT REDO DUMP TIME TO MM/DD/YYYY HH:MI:SS (Note:1020343.6)
- TFTS: COUNT HOW MANY OF EACH OBJECT USERS HAVE (Note:1020185.6)
- TFTS: FINDING THE NTH MAXIMUM VALUE OF FIELD (Note:1039306.6)
[Top]
DBA.SQL - SQL Scripts, Examples and Reference Information
- Finding The Top 'N' Values (Using SQL) (Note:30953.1)
- How to Ignore Case and Accent in a Select Without Using interMedia (Note:156831.1)
- PL/SQL script for cascade delete (Note:274219.1)
- SCRIPT: Listing Trigger Errors and Line Numbers (Note:1050821.6)
- Script For Recreating Referential Integrity Constraints for a Table (Note:1050254.6) Script to Analyze all Tables and Columns in Database (Note:124834.1)
- Script to Create Numeric to Word Conversion Function (Note:1019544.6)
- Script to Create SQL*Plus demo tables (Note:102635.1)
- Script to Generate a Delete Cascade Report (Note:1019471.6)
- Script to Generate a report of the users defined in a database (Note:111527.1) Script: Delete Commit Procedure (Note:1020306.6)
- Script: Delete Statistics for All Tables in a Schema in Oracle 7.3 to 8.0 (Note:1020190.6) Script: How to Change a Sequence Starting Number Without Dropping the Sequence (Note:117387.1)
- Script: How to Spool SQL*Plus Output to File (Note:120878.1)
- Script: PL/SQL Block to Find VARCHAR2 Values that Cannot be Converted to Number (Note:149942.1)
- Script: Report SQL Area Memory Usage by Users/Statement (Note:111322.1)
- Script: SQL Area Summary Memory Usage Statistics by User (Note:111341.1)
- Script: Select Distinct Row Data (Note:100658.1)
- Script: To check Tables for Statistics (Note:1020188.6)
- Script: To select the Top N values of Column 2 for each Distinct value of Column 1 (Note:114347.1)
- Script: Tree Walking Examples (Note:29704.1)
- Using DBMS_METADATA To Get The DDL For Objects (Note:188838.1)
[Top]
DBA.Storage - Space Management and Object Storage
- Database Report - Space Usage (Note:121632.1)
- Script to Calculate Blocks Needed by a Table (Note:1019585.6)
- Script to Detect Tablespace Fragmentation (Note:1020182.6)
- Script to Determine Objects Per Tablespace (Note:1047952.6)
- Script to Generate CREATE TABLESPACE (Note:1020180.6)
- Script to List Percentage Utilization of Index Tablespace (Note:1039284.6)
- Script to List the Details of Database Growth per Month (Note:135294.1)
- Script to Print Block Map of Entire Database (Note:1019710.6)
- Script to Report Extents and Contiguous Free Space (Note:162994.1)
- Script to Report Segment Storage Parameters (Note:1019918.6)
- Script to Report Segments in a Given Datafile (Note:1019720.6)
- Script to Report Size of Stored Objects (8.x) (Note:111156.1)
-
Script to Report Space Distribution and utilization
(Note:135677.1)
- Script to Report Space Used in a Tablespace (Note:1019524.6)
- Script to Report Table Extents & Storage Parameters (Note:1019505.6)
- Script to Report Table Fragmentation (Note:1019716.6)
- Script to Report Tables Approaching MAXEXTENTS in Oracle 9 and earlier (Note:1019721.6)
- Script to Report Tablespace Free and Fragmentation (Note:1019709.6)
- Script to Report Tablespace Use by Segment Type and User (Note:1019711.6)
- Script to Report on Segment Extents (Note:1019915.6)
- Script to Report on Space in Tablespaces (Note:1020090.6)
- Script to Report on Tablespace Storage Parameters (Note:1019506.6)
- Script to Show Which Tables Cannot Extend On Dictionary Manged Tablespaces (Note:1019553.6)
- Script to Sort the Physical Rows of a Table (Note:1019924.6)
- Script to capture INDEX_STAT Information (Note:35492.1)
- Script to view Graphically the Occupied Space in a Tablespace (Note:1039298.6)
[Top]
DBWarehouse.MaterialView - Materialized Views - Distributed & Local Summary
- Script to create Snapshot Replication groups and objects (Note:123560.1)
- Scripts to Report Information about Materialized View Logs at the Master Site (Note:236292.1)
- Scripts to create Trusted / Untrusted Updateable Snapshot Replication Sites (Note:120094.1)
[Top]
DBWarehouse.ParallelExecution - Parallel Execution
- Display Execution plans from Statement's in V$SQL_PLAN (Note:260942.1)
- Procedure PqStat to monitor Current PX Queries (Note:240762.1)
- Report for the Degree of Parallelism on Tables and Indexes (Note:270837.1)
- Script to map Parallel Execution Server to User Session (Note:344196.1)
- Script to map Senderid in PX Wait Event to an Oracle Process (Note:304317.1)
- Script to map parallel query coordinators to slaves (Note:202219.1)
- Script to monitor PX limits from Resource Manager for active sessions (Note:240877.1)
- Script to monitor parallel queries (Note:457857.1)
[Top]
DBWarehouse.Partitioning - Partitioning
- Example of Script to Create Local Prefixed Partitioned Index (Note:165938.1)
- Example of Script to Create a Composite RANGE-HASH Partition Table (Note:165924.1)
- Example of Script to Create a Global Prefixed Partitioned Index (Note:165656.1)
- Example of Script to Create a Hash Partition Table (Note:164873.1)
- Example of Script to Create a Range Partition Table (Note:164874.1)
- Example of Script to Maintain Partitioned Indexes (Note:166755.1)
- Example of Script to Maintain Range Partitioned Table (Note:166652.1)
- How to Merge Partitions Script Example (Note:62847.1)
- Oracle8i Partitioning - Updatable Partition key example (Note:219815.1)
- Oracle8i-9i Partitioning - Updatable Partition key example (Note:62848.1)
- SCRIPT: To Automate the Composite-Partitioned Table Exchange (Note:100701.1)
- Script to Create Local Non-Prefixed Partitioned Index (Note:166112.1)
[Top]
Distributed.General - Distributed Database Issues
- Script to show Active Distributed Transactions (Note:104420.1) *
[Top]
Distributed.Replication - Master Replication
-
Multi Master Replication Set-up Scripts for Oracle8.0.x on Unix
(Note:74165.1) [Top]
Distributed.Streams - Streams
- How To Rebuild 9.2 Streams Queue Tables via Export/Import (Note:373994.1)
- Script to Prevent Excessive Spill of Message From the Streams Buffer Queue To Disk (Note:259609.1)
[Top]
Globalization - Globalization Technology (NLS) on data storage, data access and server utilities
- DATECHECK script to locate date columns requiring careful date handling (Note:76626.1)
-
Finding out your NLS Setup
(Note:226692.1)
- SCRIPT: Changing columns to CHAR length semantics ( NLS_LENGTH_SEMANTICS ) (Note:313175.1)
- search.sql: a script for searching strings or characters in the database (Note:243096.1)
[Top]
Globalization.DST - Daylight Savings Time (DST) Issues
[Top]
HighAvailability.BR - eneric RDBMS Backup and Recovery Issues
- HotBackup Script (Note:221630.1)
- Sample Hot Backup Script for Unix (Note:30454.1)
-
Script To Identify Files Needed For Hot Backups
(Note:220509.1) [Top]
HighAvailability.Corruption - Diagnosing and Addressing Corruption Problems
- "hcheck.sql" script to check for known problems in Oracle8i, Oracle9i, Oracle10g and Oracle 11g (Note:136697.1)
- Baddata Script To Check Database For Corrupt column data (Note:428526.1)
- Baddate Script To Check Database For Corrupt dates (Note:95402.1)
- SALVAGE8i.PC - Oracle8i,Oracle9i Pro*C Code to Extract Data from a Corrupt Table. (Note:97357.1)
- SCRIPT: For Bug:970640 to check if Target Database has been corrupted (Note:76746.1)
- SCRIPT: VALIDATE.SQL to ANALYZE .. VALIDATE STRUCTURE objects in a Tablespace (Note:100419.1)
[Top]
HighAvailability.DataGuard - Data Guard
- Script to Collect Data Guard Logical Standby Diagnostic Information (Note:241512.1)
- Script to Collect Data Guard Logical Standby Table Information (Note:269954.1)
- Script to Collect Data Guard Physical Standby Diagnostic Information (Note:241438.1)
- Script to Collect Data Guard Primary Site Diagnostic Information (Note:241374.1)
[Top]
HighAvailability.RMAN - Recovery Manager
- RMAN Backup Shell Script Example (Note:137181.1)
- RMAN: How to Delete Obsolete Backups in 8.0.X Releases (Note:131973.1)
- RMAN: Set Maxcorrupt For a Whole Database Backup (Note:130605.1)
[Top]
Install.Installer - Oracle Server Installer issues
- WIN: Invoking OUI in JAVA's Verbose Mode (Note:107551.1)
[Top]
Install.UnixGeneric - Oracle Server Installation and Configuration Unix Generic issues
- UNIX: Script to Verify Installation Requirements for Oracle 8.0.5 to 9.2 versions of RDBMS (Note:189256.1)
[Top]
JVM - Oracle JServer
[Top]
Manageability.MemoryMgmt - ORA-4030/ORA-4031 errors
- Script: Listing Memory Used By All Sessions (Note:1070975.6)
[Top]
Manageability.Utilities.ExportImport - Oracle Utilities (Export/Import) Technical Notes
-
How to Export Tables for a specific Tablespace
(Note:1039292.6)
- SCRIPT: Where to Find Specifications of Character Encoding Schemes (Note:93358.1)
- Unix Script: IMPSHOW2SQL - Extracting SQL from an EXPORT file (Note:29765.1)
[Top]
Manageability.Utilities.SqlLoader - SQL Loader
- SCRIPT TO DUMP A TABLE TO AN ASCII FILE FOR SQL*LOADER LOAD (Note:1050919.6)
- SCRIPT TO GENERATE SQL*LOADER CONTROL FILE (Note:1019523.6)
- Script to Dump Non-Printable Data to a File to Be Used by SQL*Loader (Note:74947.1)
[Top]
OLAP.ExpressServer - Oracle Express Server Generic
- Calculating Time for Individual Object Exports in Express Databases (Note:98563.1)
- How to troubleshoot OCI Connections for Express Server on UNIX (Note:99448.1)
[Top]
Performance.Database - Tuning, Optimization and Other Performance Issues
- AWR diagnostic collection script (Note:733655.1)
- Formated V$SQL_SHARED_CURSOR Report by SQLID or Hash Value (Note:438755.1)
- Reactive Performance Overview Report (Note:1020046.6)
- SCRIPT - to Gauge the Impact of the SESSION_CACHED_CURSORS Parameter (Note:208918.1) SCRIPT: LATCH PERFORMANCE (Note:1019627.6)
- SCRIPT: LIBRARY CACHE INFO (Note:1019934.6)
- SCRIPT: REPORT FILE I/O STATISTICS (Note:1019629.6)
- SCRIPT: REPORT ONLINE REDO LOG STATISTICS (Note:1020002.6)
- SCRIPT: REPORT SESSION & SYSTEM WAITS (Note:1019936.6)
- SCRIPT: REPORT SESSION STATS (Note:1020001.6)
- SCRIPT: SGA TUNING INFORMATION (Note:1019935.6)
- SCRIPT:ESTIMATE SHARED POOL UTILIZATION (Note:105004.1)
- USING ORACLE SCRIPTS TO TUNE INDEX (Note:1061888.6)
- VMS: UTLBSTAT/UTLESTAT Script Generator for Parallel Reporting (Note:174553.1)
- ashdump* scripts and post-load processing of MMNL traces (Note:555303.1)
[Top]
Performance.Locking - Database Lock and Latch Information and Diagnoses
- APPLICATION TUNING AND LOCKING CONFLICTS SCRIPTS (Note:2062842.102)
- SCRIPT TO CHECK FOR FOREIGN KEY LOCKING ISSUES (Note:1019527.6)
- SCRIPT TO RETURN MEDIUM DETAIL LOCKING INFO (Note:1020012.6)
- SCRIPT: FULLY DECODED LOCKING (Note:1020008.6)
- SCRIPT: LOW COMPLEXITY LOCKING INFO (Note:1020011.6)
- SCRIPT: VIEWING LOCKS ON OBJECTS HELD BY SPECIFIC USER (Note:1039273.6)
- Script: To display Locks and give the SID and Serial# of the Session to Kill (Note:1020007.6) *
[Top]
Performance.SqlTuning - Tuning SQL and application access - including CBO
- "hcursor8.sql" script to install the "hCursor" helper package for Oracle8 (Note:101471.1)
- "hdesc8.sql" script to install the "hDesc" helper package for Oracle8 (Note:101469.1)
- "hinstall8.sql" script to install the "h*" helper packages for Oracle8 (Note:101467.1)
- "hout.sql" script to install the "hOut" helper package (Note:101468.1)
- "hplan8.sql" script to install the "hPlan" helper package for Oracle8 (Note:101470.1)
- "hsession8.sql" script to install the "hSession" helper package for Oracle8 (Note:134231.1)
- "hstat.sql" script to install "hStat" helper (Note:132946.1)
- Introduction to the "H*" Helper Scripts (Note:101466.1)
[Top]
Scalability.OPS - Oracle Parallel Server (including MPP)
-
Script to Collect OPS Diagnostic Information (opsdiag.sql)
(Note:205809.1)
- Script to help diagnose OPS hanging issues (utlopslt.sql) (Note:115595.1)
- TFTS: Example Script to Create an OPS Database on UNIX (Note:90321.1)
[Top]
Scalability.RAC - Real Application Clusters
-
Script to Collect RAC Diagnostic Information (racdiag.sql)
(Note:135714.1)
[Top]
Security.DBSecurity - User and Security Issues
- Example Code Encrypting Credit Card Numbers (Note:197400.1)
- How often tables are accessed (AUDIT) (Note:74725.1)
- How to use DBMS_OBFUSCATION_TOOLKIT.DES3Encrypt and DES3Decrypt procedures. (Note:166884.1)
- SCRIPT: Generate ROLE Creation Script for 8.XX (Note:107182.1)
- SCRIPT: How to grant select on dictionary tables only (Note:138232.1)
- SCRIPT: Report Roles Granted to Users (Note:1019486.6)
- SCRIPT: Script to Generate object privilege GRANTS (Note:1020176.6)
- SCRIPT: Script to show table privileges for users and roles (Note:1050267.6)
- SCRIPT: Show Tablespace Quota Used by User (Note:1019712.6)
- SCRIPT: To Report Privileges Granted To a User (Note:1020086.6)
- SCRIPT: Workaround For ORA-28112 Error by Reformatting the Predicate String Returned (Note:262882.1)
- Script To Capture System Privilege Grants (Note:18074.1)
- Script to Capture Role Grants (Note:18079.1)
- Script to Check for Default Passwords Being Used for Common Usernames (Note:227010.1)
- Script to Create Roles (Note:18080.1)
- Script to Create View to Show All User Privs (Note:1020286.6)
- Script to Show System and Object Privs for a User (Note:1019508.6)
- Script to list profile resources and limits (Note:1019933.6)
- Script to move SYS.AUD$ table out of SYSTEM tablespace (Note:1019377.6)
- Script to prevent a user from changing his password (Note:135878.1)
- UNIX: Diagnostic C program for ORA-1031 from CONNECT INTERNAL / AS SYSDBA (Note:67984.1)
[Top]
Storage.Exadata - Exadata issues
- Oracle Exadata Diagnostic Information required for Disk Failures (Note:761868.1)
[Top]
* - indicates Enterprise Manager provides similar functionality to this script
Email us your comments!
Email the Web Page Manager to report broken hyperlinks or to share your comments and ideas. Your comments will be routed to the Knowledge Team for evaluation. The Web Page Manager cannot process requests for information, technical support or other questions. For technical support click on the Service Request tab and log an SR.
Use the MetaLink Feedback button for all other requests including licensing issues.
ACROBAT files ending with extension .PDF can be read with an Acrobat Reader. Readers for many platforms are available without fee from the Adobe web site.
External sites are not endorsed by Oracle Corporation. All company or product names mentioned are used for identification purposes only and may be trademarks of their respective owners.
Related
Products
- Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Personal Edition
- Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
ORA-4031; ORA-28112; ORA-1031; ORA-4030
Back to top
Tuesday, March 27, 2012
To check the instance details in real application clusters
To check the instance details in real application clusters
select INST_NAME,INST_NUMBER from gv$active_instances;
select INST_NAME,INST_NUMBER from gv$active_instances;
Monday, March 26, 2012
Rman Perfromance views
Rman Performance views :
select sid, serial#, username , status, inst_id, PROGRAM,to_char(LOGON_TIME,'DD-MM-YY HH24:MI S') from gv$session
where sid='&sid' order by 7; 2
Enter value for sid: 259
old 2: where sid='&sid' order by 7
new 2: where sid='259' order by 7
select sid, serial#, username , status, inst_id, PROGRAM,to_char(LOGON_TIME,'DD-MM-YY HH24:MI S') from gv$session
where sid='&sid' order by 7; 2
Enter value for sid: 259
old 2: where sid='&sid' order by 7
new 2: where sid='259' order by 7
COLUMN CLIENT_INFO FORMAT a30 COLUMN SID FORMAT 999 COLUMN SPID FORMAT 9999 SELECT s.SID, p.SPID, s.CLIENT_INFO FROM V$PROCESS p, V$SESSION s WHERE p.ADDR = s.PADDR AND CLIENT_INFO LIKE 'rman%' /
COLUMN CLIENT_INFO FORMAT a30 COLUMN SID FORMAT 999 COLUMN SPID FORMAT 9999 SELECT s.SID, p.SPID, s.CLIENT_INFO FROM V$PROCESS p, V$SESSION s WHERE p.ADDR = s.PADDR AND CLIENT_INFO LIKE 'rman%' /
SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK;
Saturday, March 24, 2012
ASM
select name , group_number , disk_number , total_mb , free_mb from v$asm_disk order by group_number /
IN DETAIL
Back in 2009 I posted a script which I found very useful to review ASM disks. I gave that post the low-key title of The ASM script of all ASM scripts. Now that script has been improved I have to go a bit further with the hyperbole and we have the The Mother of all ASM scripts. If it ever gets improved then the next post will just be called ‘Who’s the Daddy’.
I have been using the current script across all our systems for the last 3 years and I find it very useful, a colleague, Allan Webster, has added a couple of improvements and it is now better than before.
The improvements show current disk I/O statistics and a breakdown of the types of files in each disk group and the total sizes of that filetype. The I/O statistics are useful when you have a lot of databases, many of which are test and development and so you do not look at them as that often. It just gives a quick overview that allows you to get a feel if anything is wrong and to see what the system is actually doing. There are also a few comments at the beginning defining the various ASM views available.
REM ASM views: |
REM VIEW |ASM INSTANCE |DB INSTANCE |
REM ---------------------------------------------------------------------------------------------------------- |
REM V$ASM_DISKGROUP |Describes a disk group (number, name, size |Contains one row for every open ASM |
REM |related info, state, and redundancy type) |disk in the DB instance. |
REM V$ASM_CLIENT |Identifies databases using disk groups |Contains no rows. |
REM |managed by the ASM instance. | |
REM V$ASM_DISK |Contains one row for every disk discovered |Contains rows only for disks in the |
REM |by the ASM instance, including disks that |disk groups in use by that DB instance. |
REM |are not part of any disk group. | |
REM V$ASM_FILE |Contains one row for every ASM file in every |Contains rows only for files that are |
REM |disk group mounted by the ASM instance. |currently open in the DB instance. |
REM V$ASM_TEMPLATE |Contains one row for every template present in |Contains no rows. |
REM |every disk group mounted by the ASM instance. | |
REM V$ASM_ALIAS |Contains one row for every alias present in |Contains no rows. |
REM |every disk group mounted by the ASM instance. | |
REM v$ASM_OPERATION |Contains one row for every active ASM long |Contains no rows. |
REM |running operation executing in the ASM instance. | |
set wrap off |
set lines 155 pages 9999 |
col "Group Name" for a6 Head "Group|Name" |
col "Disk Name" for a10 |
col "State" for a10 |
col "Type" for a10 Head "Diskgroup|Redundancy" |
col "Total GB" for 9,990 Head "Total|GB" |
col "Free GB" for 9,990 Head "Free|GB" |
col "Imbalance" for 99.9 Head "Percent|Imbalance" |
col "Variance" for 99.9 Head "Percent|Disk Size|Variance" |
col "MinFree" for 99.9 Head "Minimum|Percent|Free" |
col "MaxFree" for 99.9 Head "Maximum|Percent|Free" |
col "DiskCnt" for 9999 Head "Disk|Count" |
prompt |
prompt ASM Disk Groups |
prompt =============== |
SELECT g.group_number "Group" |
, g.name "Group Name" |
, g.state "State" |
, g.type "Type" |
, g.total_mb/1024 "Total GB" |
, g.free_mb/1024 "Free GB" |
, 100*(max((d.total_mb-d.free_mb)/d.total_mb)-min((d.total_mb-d.free_mb)/d.total_mb))/max((d.total_mb-d.free_mb)/d.total_mb) "Imbalance" |
, 100*(max(d.total_mb)-min(d.total_mb))/max(d.total_mb) "Variance" |
, 100*(min(d.free_mb/d.total_mb)) "MinFree" |
, 100*(max(d.free_mb/d.total_mb)) "MaxFree" |
, count(*) "DiskCnt" |
FROM v$asm_disk d, v$asm_diskgroup g |
WHERE d.group_number = g.group_number and |
d.group_number <> 0 and |
d.state = 'NORMAL' and |
d.mount_status = 'CACHED' |
GROUP BY g.group_number, g.name, g.state, g.type, g.total_mb, g.free_mb |
ORDER BY 1; |
prompt ASM Disks In Use |
prompt ================ |
col "Group" for 999 |
col "Disk" for 999 |
col "Header" for a9 |
col "Mode" for a8 |
col "State" for a8 |
col "Created" for a10 Head "Added To|Diskgroup" |
--col "Redundancy" for a10 |
--col "Failure Group" for a10 Head "Failure|Group" |
col "Path" for a19 |
--col "ReadTime" for 999999990 Head "Read Time|seconds" |
--col "WriteTime" for 999999990 Head "Write Time|seconds" |
--col "BytesRead" for 999990.00 Head "GigaBytes|Read" |
--col "BytesWrite" for 999990.00 Head "GigaBytes|Written" |
col "SecsPerRead" for 9.000 Head "Seconds|PerRead" |
col "SecsPerWrite" for 9.000 Head "Seconds|PerWrite" |
select group_number "Group" |
, disk_number "Disk" |
, header_status "Header" |
, mode_status "Mode" |
, state "State" |
, create_date "Created" |
--, redundancy "Redundancy" |
, total_mb/1024 "Total GB" |
, free_mb/1024 "Free GB" |
, name "Disk Name" |
--, failgroup "Failure Group" |
, path "Path" |
--, read_time "ReadTime" |
--, write_time "WriteTime" |
--, bytes_read/1073741824 "BytesRead" |
--, bytes_written/1073741824 "BytesWrite" |
, read_time/reads "SecsPerRead" |
, write_time/writes "SecsPerWrite" |
from v$asm_disk_stat |
where header_status not in ('FORMER','CANDIDATE') |
order by group_number |
, disk_number |
/ |
Prompt File Types in Diskgroups |
Prompt ======================== |
col "File Type" for a16 |
col "Block Size" for a5 Head "Block|Size" |
col "Gb" for 9990.00 |
col "Files" for 99990 |
break on "Group Name" skip 1 nodup |
select g.name "Group Name" |
, f.TYPE "File Type" |
, f.BLOCK_SIZE/1024||'k' "Block Size" |
, f.STRIPED |
, count(*) "Files" |
, round(sum(f.BYTES)/(1024*1024*1024),2) "Gb" |
from v$asm_file f,v$asm_diskgroup g |
where f.group_number=g.group_number |
group by g.name,f.TYPE,f.BLOCK_SIZE,f.STRIPED |
order by 1,2; |
clear break |
prompt Instances currently accessing these diskgroups |
prompt ============================================== |
col "Instance" form a8 |
select c.group_number "Group" |
, g.name "Group Name" |
, c.instance_name "Instance" |
from v$asm_client c |
, v$asm_diskgroup g |
where g.group_number=c.group_number |
/ |
prompt Free ASM disks and their paths |
prompt ============================== |
col "Disk Size" form a9 |
select header_status "Header" |
, mode_status "Mode" |
, path "Path" |
, lpad(round(os_mb/1024),7)||'Gb' "Disk Size" |
from v$asm_disk |
where header_status in ('FORMER','CANDIDATE') |
order by path |
/ |
prompt Current ASM disk operations |
prompt =========================== |
select * |
from v$asm_operation |
/ |
Added To Total Free Seconds Seconds |
Group Disk Header Mode State Diskgroup GB GB Disk Name Path PerRead PerWrite |
----- ---- --------- -------- -------- ---------- ------ ------ ---------- ------------------- ------- -------- |
1 0 MEMBER ONLINE NORMAL 20-FEB-09 89 88 FRA_0000 /dev/oracle/disk388 .004 .002 |
1 1 MEMBER ONLINE NORMAL 31-MAY-10 89 88 FRA_0001 /dev/oracle/disk260 .002 .002 |
1 2 MEMBER ONLINE NORMAL 31-MAY-10 89 88 FRA_0002 /dev/oracle/disk260 .007 .002 |
2 15 MEMBER ONLINE NORMAL 04-MAR-10 89 29 DATA_0015 /dev/oracle/disk203 .012 .023 |
2 16 MEMBER ONLINE NORMAL 04-MAR-10 89 29 DATA_0016 /dev/oracle/disk203 .012 .021 |
2 17 MEMBER ONLINE NORMAL 04-MAR-10 89 29 DATA_0017 /dev/oracle/disk203 .007 .026 |
2 27 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0027 /dev/oracle/disk260 .011 .023 |
2 28 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0028 /dev/oracle/disk259 .009 .020 |
2 38 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0038 /dev/oracle/disk190 .012 .025 |
2 39 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0039 /dev/oracle/disk189 .014 .015 |
2 40 MEMBER ONLINE NORMAL 31-MAY-10 89 30 DATA_0040 /dev/oracle/disk260 .011 .024 |
2 41 MEMBER ONLINE NORMAL 31-MAY-10 89 30 DATA_0041 /dev/oracle/disk260 .009 .022 |
2 42 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0042 /dev/oracle/disk260 .011 .018 |
2 43 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0043 /dev/oracle/disk260 .003 .026 |
2 44 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0044 /dev/oracle/disk260 .008 .019 |
2 45 MEMBER ONLINE NORMAL 31-MAY-10 89 30 DATA_0045 /dev/oracle/disk193 .008 .018 |
2 46 MEMBER ONLINE NORMAL 31-MAY-10 89 30 DATA_0046 /dev/oracle/disk192 .007 .024 |
2 47 MEMBER ONLINE NORMAL 31-MAY-10 89 30 DATA_0047 /dev/oracle/disk191 .005 .022 |
2 48 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0048 /dev/oracle/disk190 .008 .021 |
2 49 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0049 /dev/oracle/disk189 .008 .026 |
2 50 MEMBER ONLINE NORMAL 31-MAY-10 89 29 DATA_0050 /dev/oracle/disk261 .009 .030 |
56 rows selected. |
File Types in Diskgroups |
======================== |
Group Block |
Name File Type Size STRIPE Files Gb |
------ ---------------- ----- ------ ------ -------- |
DATA CONTROLFILE 16k FINE 1 0.01 |
DATAFILE 16k COARSE 404 2532.58 |
ONLINELOG 1k FINE 3 6.00 |
PARAMETERFILE 1k COARSE 1 0.00 |
TEMPFILE 16k COARSE 13 440.59 |
FRA AUTOBACKUP 16k COARSE 2 0.02 |
CONTROLFILE 16k FINE 1 0.01 |
ONLINELOG 1k FINE 3 6.00 |
Subscribe to:
Posts (Atom)
How to Trouble shoot Logfile_sync wait event
First Identify and break down LGWR wait events. Query wait events for LGWR. In this instance LGWR sid is 3 (and usually it is). select s...
-
Refference with the document How to Clean Up Duplicate Objects Owned by SYS and SYSTEM Schema [ID 1030426.6] Hi Had faced an issue where ...
-
Login to the first node column is_recovery_dest_file format a25 column name format a60 set linesize 160 select status, name, is_recover...
-
SQL> SELECT LOG_MODE FROM SYS.V$DATABASE; LOG_MODE ------------ NOARCHIVELOG show parameter archive will tell u the archive...
Rate this document