Monday, January 30, 2012

RMAN-06445: cannot connect to recovery catalog after NOCATALOG has been used

 

Error: RMAN-06445: cannot connect to recovery catalog after NOCATALOG has been used

Cause:

1. We can not connect to a catalog, after we started RMAN with the NOCATALOG option.

2. If we executed some command that used control file to show the results, and after this if we try to connect to the catalog.

For example As, 'list backup summary;' and after this, We try 'connect catalog rman/rman@rmandb;', this return the RMAN-06445 error.

Alternatively use rman target / catalog rman/rmanpwd@rmandb;

How to find top 10 largest sized tables in Oracle

col    owner format a15
col    segment_name format a30
col    segment_type format a15
col    gb format 999,999,999
select  owner
,    segment_name
,    segment_type
,    gb
from    (
    select    owner
    ,    segment_name
    ,    segment_type
    ,    bytes / 1024 / 1024 / 1024 "gb"
    from    dba_segments
    where segment_type = 'TABLE'
    order    by bytes desc
    )
where    rownum < 10

Wednesday, January 25, 2012

RMAN-08138: WARNING: archived log not deleted - must create more backups

 

Error: RMAN-08138: WARNING: archived log not deleted - must create more backups
        archived log file

Resolution:
1. Connect to Catalog database'
2. CROSSCHECK BACKUP

Crosscheck command determine if files managed by RMAN, such as archived log, datafile copies and backup pieces still exist on disk or tape.

Friday, January 20, 2012

ORA-00257: archiver is stuck. CONNECT INTERNAL only, until freed


ORA-00257: archiver is stuck. CONNECT INTERNAL only, until freed

Cause: The ARCH process received an error while trying to archive a redo log file. If the problem is not resolved soon, the database will stop executing transactions.
The most likely cause of this message is that the destination device is out of space to store the redo log file.

Action: Check the archiver trace file for a detailed description of the problem. Also, verify that the device specified in the initialization parameter ARCHIVE_LOG_DEST is set up properly for archiving.

ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

 

Error: ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

Cause: An attempt was made to archive a redo log file manually without specifying the sequence number, group number, or filename while the database was in NOARCHIVELOG mode.

Action: The name, group number, or thread and sequence number of redo log files must be specified to archive redo log files manually while the database is in NOARCHIVELOG mode.

Source: http://docs.oracle.com/cd/A58617_01/server.804/a58312/newch2a6.htm

Tuesday, January 17, 2012

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at

 

Error:

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "SIV.PKG1_CHG_DB_CNFG",

Investigation:
Find the locking sessions

select do.owner,do.object_name,do.object_type,dl.session_id,vs.serial#, vs.program,vs.machine,vs.osuser
from dba_locks dl,dba_objects do,v$session vs
where do.object_name ='SIV.PKG1_CHG_DB_CNFG' and
do.object_type='TABLE' and
dl.lock_id1 =do.object_id and
vs.sid = dl.session_id;

Solution:
Kill the session locking the object then resubmit

alter system kill sessions 'sid,serial#' immediate;

Friday, January 06, 2012

Query to check the database backup details

 

The query will return the backup status and timings of database backups -

Run the query run in the database, not on the catalog.

Login as sysdba -

This script will report on all backups – full, incremental and archivelog backups -

col STATUS format a9
col hrs format 999.99
select
SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,
elapsed_seconds/3600                   hrs
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;

Thursday, January 05, 2012

Generate DDL to create user – reverse engineer

 

Query

SQL> SET long 200000000
SQL> SELECT dbms_metadata.get_ddl('USER','SIVA') from dual;


Output

DBMS_METADATA.GET_DDL('USER','SIVA')
--------------------------------------------------------------------------------

   CREATE USER "SIVA" IDENTIFIED BY VALUES 'S:1A6727A1D45324587FCFCFEAD63BBD96B
8DBBE0C6D1754259FE954EB9459;0FE66EDD5C4FF3D5'
      DEFAULT TABLESPACE "DATA01"
      TEMPORARY TABLESPACE "TEMP"

Query to determine which privileges, grants, roles, and tablespace quotas are granted to the users

 

SET lines 120 pages 100

select * from DBA_ROLE_PRIVS where GRANTEE = 'SIVA';

select * from DBA_SYS_PRIVS where GRANTEE = 'SIVA';

select * from DBA_TAB_PRIVS where GRANTEE = ‘SIVA’';

select * from  dba_ts_quotas where username = 'SIVA';

Query to find list of users not schemas

 

select username from dba_users
minus
select distinct owner from dba_objects ;

Oracle Query to find listing of Schema Owners


select distinct owner from dba_objects

In Oracle Schema defined as;

A schema is a collection of logical structures of data, or schema objects.
A schema is owned by a database user and has the same name as that user.

Wednesday, January 04, 2012

Oracle 11g Interactive Quick Reference guide

 

I just came across an essential Oracle 11g Interactive Quick Reference guide – which has the key dictionary views, background processes and architecture diagram.
Hope you may find it useful.  It can be downloaded from

http://www.oracle.com/webapps/dialogue/ns/dlgwelcome.jsp?p_ext=Y&p_dlg_id=9575302&src=7027600&Act=54

Sunday, January 01, 2012

RMAN-06169: could not read file header for datafile nn error reason 4

 

RMAN-06169: could not read file header for datafile nn error reason 4
RMAN-06169: could not read file header for datafile nn error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 10/20/2011 07:41:54
RMAN-06056: could not access datafile nn

The reason code of 4 meant for DBWR could not find the file. After investigating found that the new data file added on locally for a RAC database. That data file not available on other node cause this backup failure.

To resolve this, the locally create data file moved to ASM.