Login to the first node
column is_recovery_dest_file format a25
column name format a60
set linesize 160
select status, name, is_recovery_dest_file from v$controlfile;
check the control file status and names using the above quey,
i my case i had
STATUS NAME IS_RECOVERY_DEST_FILE
------- ------------------------------------------------------------ -------------------------
+DATA_RAJ/rajesh/controlfile/current.986.790135655 NO
hence ,
login in to sqlplus , and alter the system as below with your new place pointed to
alter system set control_files = '+DATA_RAJ/rajesh/controlfile/current.986.790135655','+RECO_RAJ' scope=spfile sid='*';
in my case i have the data and reco groups created on the asm, hence trying to place the controlfiles in to two different disk groups.
once alterd the system , shutdown the instance using srvctl
srvctl stop database -d xxx
after then , login to sql prmpt and startup the instance in no mount stage , once the db came up on nomount stage exit from the sql prompt and login in rman prompt
example
rman
connect target
restore controlfile from '+DATA_RAJ/rajesh/controlfile/current.986.790135655';
it will restore/multiplex our control file to the existing and our new path. once the restore complete, shutdown the instances and startup normal
it should come up with the two controlfiles,
issues i was facing here were, one of the instance spfile was not on the shared drive hence i was failing on the below command
alter system set control_files = '+DATA_RAJ/rajesh/controlfile/current.986.790135655','+RECO_RAJ' scope=spfile sid='*';
as spfile could not be modifiable etc ... after which i have mounted the spfile on the shared drive and followed the same
Good Luck !!
Thanks
Thursday, December 6, 2012
Monday, September 17, 2012
How to backup oracle home
Follow the steps to backup oracle home
say if u have the oracle home like /opt/oracle/product/11.2.0/ then the binaries , and let say u want to have the home backup taken to some backup directory
cd to the home directory
cd /opt/oracle/product/11.2.0
and then issue
tar -cvf - . |compress > /backup/11.2.0.tar.Z
if u want to untar it
u use tar -xvf
say if u have the oracle home like /opt/oracle/product/11.2.0/ then the binaries , and let say u want to have the home backup taken to some backup directory
cd to the home directory
cd /opt/oracle/product/11.2.0
and then issue
tar -cvf - . |compress > /backup/11.2.0.tar.Z
if u want to untar it
u use tar -xvf
How to Clean Up Duplicate Objects Owned by SYS and SYSTEM Schema
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 the database was created manually some way got corrupted when running the immediate scripts after the db creation catproc/catalog like the pupbld etc ..
due with that i was getting issues like memory issue 4031 , and even i am not able to query the dba tables or the register views, followed the above document that resolved the issue simply the below were the steps that i followed
Below is a SQL*Plus script that will list all objects that have been created in both the SYS and SYSTEM schema:
column object_name format a30
select object_name, object_type
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';
The output from this script will either be 'zero rows selected' or will look something like the following:
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------
ALL_DAYS VIEW
CHAINED_ROWS TABLE
COLLECTION TABLE
COLLECTION_ID SEQUENCE
DBA_LOCKS SYNONYM
DBMS_DDL PACKAGE
DBMS_SESSION PACKAGE
DBMS_SPACE PACKAGE
DBMS_SYSTEM PACKAGE
DBMS_TRANSACTION PACKAGE
DBMS_UTILITY PACKAGE
If the select statement returns any rows then this is an indication that at least 1 script has been run as both SYS and SYSTEM.
Since most data dictionary objects should be owned by SYS (see exceptions below) you will want to drop the objects that are owned by SYSTEM in order to clear up this situation.
EXCEPTION TO THE RULE
THE REPLICATION SCRIPTS (XXX) CORRECTLY CREATES OBJECTS WITH THE SAME NAME IN THE SYS AND SYSTEM ACCOUNTS. LISTED BELOW ARE THE OBJECTS USED BY REPLICATION THAT SHOULD BE CREATED IN BOTH ACCOUNTS. DO NOT DROP THESE OBJECTS FROM THE SYSTEM ACCOUNT IF YOU ARE USING REPLICATION. DOING SO WILL CAUSE REPLICATION TO FAIL!
The following objects are duplicates that will show up (and should not be removed) when running this script in 8.1.x and higher.
Without replication installed:
INDEX AQ$_SCHEDULES_PRIMARY
TABLE AQ$_SCHEDULES
If replication is installed by running catrep.sql:
INDEX AQ$_SCHEDULES_PRIMARY
PACKAGE DBMS_REPCAT_AUTH
PACKAGE BODY DBMS_REPCAT_AUTH
TABLE AQ$_SCHEDULES
When database is upgraded to 11g using DBUA, following duplicate objects are also created
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------
Help TABLE
Help_Topic_Seq Index
The objects created by sqlplus/admin/help/hlpbld.sql must be owned by SYSTEM because when sqlplus retrieves the help information, it refers to the SYSTEM schema only. DBCA runs this script as SYSTEM user when it creates the database but DBUA runs this script as SYS user when upgrading the database (reported as an unpublished BUG 10022360). You can drop the ones in SYS schema.
Now that you have a list of duplicate objects you will simply issue the appropriate DROP command to get rid of the object that is owned by the SYSTEM user.
If the list of objects is large then you may want to use the following SQL*Plus script to automatically generate an SQL script that contains the appropriate DROP commands:
set pause off
set heading off
set pagesize 0
set feedback off
set verify off
spool dropsys.sql
select 'DROP ' || object_type || ' SYSTEM.' || object_name || ';'
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';
spool off
exit
You will now have a file in the current directory named dropsys.sql that contains all of the DROP commands. You will need to run this script as a normal SQL script as follows:
$ sqlplus
SQL*Plus: Release 3.3.2.0.0 - Production on Thu May 1 14:54:20 1997
Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
Enter user-name: system
Enter password: manager
SQL> @dropsys
Note: You may receive one or more of the following errors:
ORA-2266 (unique/primary keys in table referenced by enabled foreign keys):
If you encounter this error then some of the tables you are dropping have constrints that prevent the table from being dropped. To fix this problem you will have to manually drop the objects in a different order than the script does.
ORA-2429 (cannot drop index used for enforcement of unique/primary key):
This is similar to the ORA-2266 error except that it points to an index. You will have to manually disable the constraint associated with the index and then drop the index.
ORA-1418 (specified index does not exist):
This occurs because the table that the index was created on has already been dropped which also drops the index. When the script tries to drop the index it is no longer there and thus the ORA-1418 error. You can safely ignore this error.
Hi Had faced an issue where the database was created manually some way got corrupted when running the immediate scripts after the db creation catproc/catalog like the pupbld etc ..
due with that i was getting issues like memory issue 4031 , and even i am not able to query the dba tables or the register views, followed the above document that resolved the issue simply the below were the steps that i followed
Below is a SQL*Plus script that will list all objects that have been created in both the SYS and SYSTEM schema:
column object_name format a30
select object_name, object_type
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';
The output from this script will either be 'zero rows selected' or will look something like the following:
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------
ALL_DAYS VIEW
CHAINED_ROWS TABLE
COLLECTION TABLE
COLLECTION_ID SEQUENCE
DBA_LOCKS SYNONYM
DBMS_DDL PACKAGE
DBMS_SESSION PACKAGE
DBMS_SPACE PACKAGE
DBMS_SYSTEM PACKAGE
DBMS_TRANSACTION PACKAGE
DBMS_UTILITY PACKAGE
If the select statement returns any rows then this is an indication that at least 1 script has been run as both SYS and SYSTEM.
Since most data dictionary objects should be owned by SYS (see exceptions below) you will want to drop the objects that are owned by SYSTEM in order to clear up this situation.
EXCEPTION TO THE RULE
THE REPLICATION SCRIPTS (XXX) CORRECTLY CREATES OBJECTS WITH THE SAME NAME IN THE SYS AND SYSTEM ACCOUNTS. LISTED BELOW ARE THE OBJECTS USED BY REPLICATION THAT SHOULD BE CREATED IN BOTH ACCOUNTS. DO NOT DROP THESE OBJECTS FROM THE SYSTEM ACCOUNT IF YOU ARE USING REPLICATION. DOING SO WILL CAUSE REPLICATION TO FAIL!
The following objects are duplicates that will show up (and should not be removed) when running this script in 8.1.x and higher.
Without replication installed:
INDEX AQ$_SCHEDULES_PRIMARY
TABLE AQ$_SCHEDULES
If replication is installed by running catrep.sql:
INDEX AQ$_SCHEDULES_PRIMARY
PACKAGE DBMS_REPCAT_AUTH
PACKAGE BODY DBMS_REPCAT_AUTH
TABLE AQ$_SCHEDULES
When database is upgraded to 11g using DBUA, following duplicate objects are also created
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------
Help TABLE
Help_Topic_Seq Index
The objects created by sqlplus/admin/help/hlpbld.sql must be owned by SYSTEM because when sqlplus retrieves the help information, it refers to the SYSTEM schema only. DBCA runs this script as SYSTEM user when it creates the database but DBUA runs this script as SYS user when upgrading the database (reported as an unpublished BUG 10022360). You can drop the ones in SYS schema.
Now that you have a list of duplicate objects you will simply issue the appropriate DROP command to get rid of the object that is owned by the SYSTEM user.
If the list of objects is large then you may want to use the following SQL*Plus script to automatically generate an SQL script that contains the appropriate DROP commands:
set pause off
set heading off
set pagesize 0
set feedback off
set verify off
spool dropsys.sql
select 'DROP ' || object_type || ' SYSTEM.' || object_name || ';'
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';
spool off
exit
You will now have a file in the current directory named dropsys.sql that contains all of the DROP commands. You will need to run this script as a normal SQL script as follows:
$ sqlplus
SQL*Plus: Release 3.3.2.0.0 - Production on Thu May 1 14:54:20 1997
Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
Enter user-name: system
Enter password: manager
SQL> @dropsys
Note: You may receive one or more of the following errors:
ORA-2266 (unique/primary keys in table referenced by enabled foreign keys):
If you encounter this error then some of the tables you are dropping have constrints that prevent the table from being dropped. To fix this problem you will have to manually drop the objects in a different order than the script does.
ORA-2429 (cannot drop index used for enforcement of unique/primary key):
This is similar to the ORA-2266 error except that it points to an index. You will have to manually disable the constraint associated with the index and then drop the index.
ORA-1418 (specified index does not exist):
This occurs because the table that the index was created on has already been dropped which also drops the index. When the script tries to drop the index it is no longer there and thus the ORA-1418 error. You can safely ignore this error.
To find if the database is patched with CPU or PSU
Pls run the below query to find which cpu psu patch applied on the database ,
For PSU:
opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU'
FOR CPU:
Issue the following select to list which CPU is implemented into each database:
set linesize 90
set pagesize 100
select substr(action_time,1,30) action_time,
substr(id,1,8) id,
substr(action,1,10) action,
substr(version,1,8) version,
substr(comments,1,20) comments
from registry$history;
col ACTION format a15
col NAMESPACE format a15
col version format a10
col COMMENTS format a42
col BUNDLE_SERIES format a20
col action_time format a30
select * from sys.registry$history;
For PSU:
opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU'
FOR CPU:
Issue the following select to list which CPU is implemented into each database:
set linesize 90
set pagesize 100
select substr(action_time,1,30) action_time,
substr(id,1,8) id,
substr(action,1,10) action,
substr(version,1,8) version,
substr(comments,1,20) comments
from registry$history;
Export errors EXP-00008: ORA-04067: ORA-06508:ORA-06512:ORA-06512:EXP-00083:
While trying to export the db i received the below error
EXP-00008: ORACLE error 4067 encountered
ORA-04067: not executed, package body "SYS.DBMS_REPCAT_UTL" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_REPCAT_UTL"
ORA-06512: at "SYS.DBMS_REPCAT_EXP", line 45
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling
select grantee,owner,table_name,privilege from dba_tab_privs where grantee='EXPORT_USER';
EXP-00008: ORACLE error 4067 encountered
ORA-04067: not executed, package body "SYS.DBMS_REPCAT_UTL" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_REPCAT_UTL"
ORA-06512: at "SYS.DBMS_REPCAT_EXP", line 45
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling
select grantee,owner,table_name,privilege from dba_tab_privs where grantee='EXPORT_USER';
Solution
The workaround for the problem is to grant the two missing privileges explicitly to the user doing the export:GRANT EXECUTE ON SYS.DBMS_DEFER_IMPORT_INTERNAL TO; GRANT EXECUTE ON SYS.DBMS_EXPORT_EXTENSION TO ; There are two execute privileges missing in the DBA role and the EXP_FULL_DATABASE role. There is no fix in this bug because the export utility is not longer supported in 11g and should be replaced by the Data Pump Export.
Sunday, September 16, 2012
Enabling archivelog mode
SQL> SELECT LOG_MODE FROM SYS.V$DATABASE; LOG_MODE ------------ NOARCHIVELOG
show parameter archive
will tell u the archive destination etc ...
so , create spfile from pfile incase of the db running onthe pfile means, then shutdown startup mount and follow the steps
SQL> startup mount ORACLE instance started. Total System Global Area 184549376 bytes Fixed Size 1300928 bytes Variable Size 157820480 bytes Database Buffers 25165824 bytes Redo Buffers 262144 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered.
ou can see here that we put the database in ARCHIVELOG mode by using the SQL statement "alter database archivelog", but Oracle won't let us do this unless the instance is mounted but not open. To make the change we shutdown the instance, and then startup the instance again but this time with the "mount" option which will mount the instance but not open it. Then we can enable ARCHIVELOG mode and open the database fully with the "alter database open" statement.There are several system views that can provide us with information reguarding archives, such as:
- V$DATABASE
- Identifies whether the database is in ARCHIVELOG or NOARCHIVELOG mode and whether MANUAL (archiving mode) has been specified.
- V$ARCHIVED_LOG
- Displays historical archived log information from the control file. If you use a recovery catalog, the RC_ARCHIVED_LOG view contains similar information.
- V$ARCHIVE_DEST
- Describes the current instance, all archive destinations, and the current value, mode, and status of these destinations.
- V$ARCHIVE_PROCESSES
- Displays information about the state of the various archive processes for an instance.
- V$BACKUP_REDOLOG
- Contains information about any backups of archived logs. If you use a recovery catalog, the RC_BACKUP_REDOLOG contains similar information.
- V$LOG
- Displays all redo log groups for the database and indicates which need to be archived.
- V$LOG_HISTORY
- Contains log history information such as which logs have been archived and the SCN range for each archived log.
SQL> select log_mode from v$database; LOG_MODE ------------ ARCHIVELOG SQL> select DEST_NAME,STATUS,DESTINATION from V$ARCHIVE_DEST;
Saturday, September 15, 2012
Last analyzed dates in oracle
Description
Lists the last analyze date for tables, indexes and partitions. This script should be used to determine is any stats are out of date. The Last_analyzed column being NULL indcates no stats are present
Parameters
None
SQL Source
REM Copyright (C) Think Forward.com 1998- 2005. All rights reserved.
set pages 200
col index_owner form a10
col table_owner form a10
col owner form a10
spool checkstat.lst
PROMPT Regular Tables
select owner,table_name,last_analyzed, global_stats
from dba_tables
where owner not in ('SYS','SYSTEM')
order by owner,table_name
/
PROMPT Partitioned Tables
select table_owner, table_name, partition_name, last_analyzed, global_stats
from dba_tab_partitions
where table_owner not in ('SYS','SYSTEM')
order by table_owner,table_name, partition_name
/
PROMPT Regular Indexes
select owner, index_name, last_analyzed, global_stats
from dba_indexes
where owner not in ('SYS','SYSTEM')
order by owner, index_name
/
PROMPT Partitioned Indexes
select index_owner, index_name, partition_name, last_analyzed, global_stats
from dba_ind_partitions
where index_owner not in ('SYS','SYSTEM')
order by index_owner, index_name, partition_name
/
spool off
Wednesday, September 12, 2012
Monday, September 3, 2012
Users having dba role in Oracle database
SQL> desc dba_role_privs
Name Null? Type
------------ -------- ------------
GRANTEE VARCHAR2(30)
GRANTED_ROLE NOT NULL VARCHAR2(30)
ADMIN_OPTION VARCHAR2(3)
DEFAULT_ROLE VARCHAR2(3) select * from dba_role_privs where granted_role='DBA'; GRANTEE GRANTED_ROLE ADM DEF
--------- ------------ --- ---
SYS DBA YES YES
SYSTEM DBA YES YESMonday, August 13, 2012
Oracle import process hanged !! how to handle
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
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
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
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