Tuesday, 24 November 2015

Resolve Archive gap between PRIMARY and STANDBY

To Check the below query to confirm ARCHIVE GAP Primary and Standby  servers.


A Physical Standby database syncs with Primary by continuous apply of archive logs from a Primary Database.
When the logs are missing on standby difference is huge (Suppose  more than 600 logs), you have to rebuild the standby database from scratch.

Please use below query to find out archive gap on Standby STEP 1:
set time on
set lines 200

prompt ++++++++++++++++++++LAST SEQUENCE RECIEVED FROM PRODUCTION and APPLIED ON STANDBY+++++++++++++++++++++++++

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE
ARCH.THREAD# = APPL.THREAD#
;
OUTPUT ARCHIVE:-
    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         2                  31852                 31852          50
         1                  49127                 49127          50
prompt ++++++++++++++++++++CHECK FOR GAP AT STANDBY+++++++++++++++++++++++++

SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
exit
Find the SCN on the PRIMARY STEP 2:
SQL> select current_scn from v$database;
 
CURRENT_SCN
———–  
222271661
Find the SCN on the STANDBY:
 
SQL> select current_scn from v$database;
CURRENT_SCN
———–  
223762173
Clearly you can see there is difference
In Primary Server will take increment level  backup with SCN STEP 3:-
run {
allocate channel c1 type disk format ‘/oradata/ora_backup/rman/QTSMMDB/%U.bkp’;
backup  AS COMPRESSED BACKUPSET  incremental from scn 223762173 database;
}
run
{
allocate channel c1 type disk format
‘/oradata/ora_backup/rman/QTSMMDB/%U.bkp’;
backup current controlfile for standby;
}
Stop and shutdown the managed standby apply process STEP 4:
SQL> alter database recover managed standby database cancel;
Database altered.
Shutdown the standby database
SQL> shut immediate
Step 5:-
Copy the backup dump to  standby instance.
step 6:-
Connect to RMAN on STANDBY, Catalog backup files to RMAN using below commands STEP 7:
$ rman target /
RMAN> startup nomount;
RMAN> catalog start with ‘/oradata/ora_backup/Standby/c-3875280703-20150907-02’;
RMAN> restore standby controlfile from
'/oradata/ora_backup/Standby/c-3875280703-20150907-02';
RMAN> sql 'alter database mount standby database';
RMAN> catalog start with ‘/oradata/ora_backup/Standby/’;
PERFORM RECOVER:
RMAN> recover database;
Start managed recovery process STEP 8:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Check the SCN’s in primary and standby it should be close to each other.

Tuesday, 17 November 2015

ORA-00600 Internal Error Solution Troubleshooting

Have you observed an ORA-0600 error reported in your alert log?

The ORA-600 error is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition.
The ORA-600 error statement includes a list of arguments in square brackets:
ORA 600 "internal error code, arguments: [%s], [%s],[%s], [%s], [%s]"
The first argument is the internal message number or character string. This argument and the database version number are critical in identifying the root cause and the potential impact to your system.  The remaining arguments in the ORA-600 error text are used to supply further information (e.g. values of internal variables etc).
The first argument may help to narrow your problem to known issues. However, this argument can point to functionality that is referenced by many areas in the Oracle source code. The more detailed call stack information reported in the ORA-600 error trace may be needed to find a solution.

Looking for the best way to diagnose?
Whenever an ORA-600 error is raised, a trace file is generated and an entry is written to the alert.log with details of the trace file location. As of Oracle 11g, the database includes an advanced fault diagnosability infrastructure to manage trace data.
1) Check the Alert Log
The alert log may indicate additional errors or other internal errors at the time of the problem. Focus your analysis of the problem on the first internal error in the sequence. There are some exceptions, but often additional internal errors are side-effects of the first error condition.
The associated trace file may be truncated if the MAX_DUMP_FILE_SIZE parameter is not setup high enough or to „unlimited‟. If you see a message at the end of the trace file
"MAX DUMP FILE SIZE EXCEEDED"
there could be vital diagnostic information missing in the file and finding the root issue may be very difficult. Set the MAX_DUMP_FILE_SIZE appropriately and regenerate the error for complete trace information.

There are alternative checks that can be made to make sure everything's fine because these internal errors can also be because of the following reasons:

  • Timeouts 
  • File corruption 
  • Failed data checks in memory 
  • Hardware, memory, or I/O errors 
  • Incorrectly restored files.

 Note:- we are getting correct solution for ORA-00600 Error , we raised SR to oracle Support  so if you are still left with unsolved ORA-600 then it'll be better to go for Oracle Support.



Tuesday, 26 August 2014

The database is down. Please specify the host credentials to access database restart and diagnostics tools


The database is down. Please specify the host credentials to access database restart and diagnostics tools.
Enterprise manager shows that database is down but in real it is not.
[oracle@grhldb01 trace]$ sqldba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Sep 13 10:38:01 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME    OPEN_MODE
------------
TCHDB   READ WRITE
check the listener status.

[oracle@grhldb01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 26-AUG-2014 13:16:23

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                13-MAR-2014 12:53:12
Uptime                    165 days 23 hr. 23 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /orabin/grid11gR2/grid/network/admin/listener.ora
Listener Log File         /orabin/grid11gR2/base/diag/tnslsnr/grhldb01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.128.0.42)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "TCHDB" has 2 instance(s).
  Instance "TCHDB1", status READY, has 2 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDB1_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDB2_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDBXDB" has 2 instance(s).
  Instance "TCHDB1", status READY, has 1 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_ESP_ORANGE_02_RAC" has 2 instance(s).
  Instance "TCHDB1", status READY, has 2 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_GBR_VODA_02_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_GBR_VODA_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
The command completed successfully

it’s runing.

Solution:
select username, account_status from dba_users order by 2;
shows that
DBSNMP EXPIRED
SYSMAN EXPIRED
SYSTEM EXPIRED.

if they are locked then simple unlock with commands:
alter user DBSNMP account unlock;
alter user SYSTEM account unlock;
alter user SYSMAN account unlock;
it’s all, now enjoy with enterprise manager


Friday, 25 July 2014

To set password limit Unlimited in Oracle 11G.


When You  tried login your user(TEST) it is showing password will expired with 7 Days.


[oracle@k44-db1]$ sqlplus test/test

SQL*Plus: Release 11.2.0.2.0 Production on Mon Mar 11 22:34:42 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password: 
ERROR:
ORA-28002: the password will expire within 7 days
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> 


Get to know which profile the test user is using from dba_users view,

SQL> SELECT profile FROM dba_users WHERE username='TEST';

USERNAME PROFILE
-------- ---------- 
TEST     DEFAULT

Now check the password lifetime of the default profile from dba_profiles

SQL> SELECT resource_name,limit FROM dba_profiles WHERE profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';

and than set default profile limit to unlimited for below query,

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.

after profile limit changed  and Alter user(TEST) password for the below statement,

SQL> alter user test identified by test;

User altered.

after that alter username  and try to connect test user,

[oracle@k44-db1]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 25 11:50:15 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> 

Thank and Advance......

Tuesday, 22 July 2014

ORA-39029: worker 1 with process name "DW01" prematurely terminated



DataPump export is performed using COMPRESSION option. When attempting the import into target database the following errors occur:

Master table "ATLAS_TEMP"."SYS_IMPORT_TABLE_18" successfully loaded/unloaded
Starting "ATLAS_TEMP"."SYS_IMPORT_TABLE_18":  atlas_temp/******** dumpfile=pmbuvsnl_ind_atlas_09Apr2014.dmp logfile=pmbuvsnl_ind_atlas_09Apr2014_imp.log content=data_only version=11.1.0 tables=PMBUVSNL_IND_AGRI_NG.mbl_six,PMBUVSNL_IND_AGRI_NG.dn_six directory=atlas_apr14 remap_schema=PMBUVSNL_IND_AGRI_NG:atlas_temp remap_tablespace=PMBUVSNL_IND_AGRI:ATLAS_TS remap_tablespace=PMBUVSNL_IND_AGRI_IDX:ATLAS_TS table_exists_action=append 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

ORA-39014: One or more workers have prematurely exited.

ORA-39029: worker 1 with process name "DW01" prematurely terminated
ORA-31672: Worker process DW01 died unexpectedly.

ORA-39014: One or more workers have prematurely exited.

ORA-39029: worker 2 with process name "DW01" prematurely terminated
ORA-31672: Worker process DW01 died unexpectedly.
Job "ATLAS_TEMP"."SYS_IMPORT_TABLE_18" stopped due to fatal error at 15:23:01
  • The alert log file confirms: ORA-07445 occured:
Errors in file /u01/app/oracle/admin/TC/bdump/tc_dw01_4583456.trc:
ORA-07445: exception encountered: core dump [kdblcbo+02c0] [SIGSEGV] ..

  • It turned out, that the affected table was compressed:
SQL> select compression from dba_tables where owner='ATLAS_TEMP' and table_name='MBL_SIX';

COMPRESS
--------
ENABLED

Cause:-


Importing a compressed table with Impdp using direct path method generates ORA-7445 [kdblcbo]. Direct path is the default method that Data Pump uses for loading and unloading data.

Solution:-


Issue will be fixed in RDBMS Release 11.2.
  • Alter the table to use NOCOMRESS option 
alter table atlas_temp.mbl_six nocompress;
ACCESS_METHOD=EXTERNAL_TABLE
  • Import the table again it will successfully imported.
Master table "ATLAS_TEMP"."SYS_IMPORT_TABLE_19" successfully loaded/unloaded
Starting "ATLAS_TEMP"."SYS_IMPORT_TABLE_19":  atlas_temp/******** dumpfile=pmbuvsnl_ind_atlas_09Apr2014.dmp logfile=pmbuvsnl_ind_atlas_09Apr2014_imp.log content=data_only version=11.1.0 tables=PMBUVSNL_IND_AGRI_NG.mbl_six,PMBUVSNL_IND_AGRI_NG.dn_six directory=atlas_apr14 remap_schema=PMBUVSNL_IND_AGRI_NG:atlas_temp remap_tablespace=PMBUVSNL_IND_AGRI:ATLAS_TS remap_tablespace=PMBUVSNL_IND_AGRI_IDX:ATLAS_TS table_exists_action=append 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "ATLAS_TEMP"."MBL_SIX":"P_09APR2014"        470.1 MB  953364 rows
. . imported "ATLAS_TEMP"."DN_SIX":"P_09APR2014"         300.0 MB  908503 rows
Job "ATLAS_TEMP"."SYS_IMPORT_TABLE_19" successfully completed at 15:39:28

Monday, 27 January 2014

Enable Archivelog mode in 11G.

Short form DBA: Enable and Disable Archivelog mode in 11G.: ****Enable Archive Log Mode*** Please find the below steps required to enable archive log mode on an 11g database. Verify the database...

Enable and Disable Archivelog mode in 11G.


****Enable Archive Log Mode***

Please find the below steps required to enable archive log mode on an 11g database.

Verify the database log mode.

[oracle@ngqa ~]$ sqldba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 27 19:01:01 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     25
Current log sequence           27
SQL>
The log mode is No Archive Mode. Note that Archive destination is USE_DB_RECOVERY_FILE_DEST. You can determine the path by looking at the parameter RECOVERY_FILE_DEST.

SQL> show parameter recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /orabin/ora11gR2/flash_recovery
                                                 _area
db_recovery_file_dest_size           big integer 3852M
SQL>
By default, archive logs will be written to the flash recovery area. If you do not want to write archive logs to the flash recovery area you can set the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to write archive logs.

SQL> alter system set log_archive_dest_1='LOCATION=/oradata/oraarch/MMINDQA/' scope = both;

System altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /oradata/oraarch/MMINDQA/
Oldest online log sequence     25
Current log sequence           27
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             511708752 bytes
Database Buffers          331350016 bytes
Redo Buffers                5132288 bytes
Database mounted.
SQL>
Lastly all that is needed it set archive log mode and open the database.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /oradata/oraarch/MMINDQA/
Oldest online log sequence     25
Next log sequence to archive   27
Current log sequence           27
SQL>
We can now see that archive log mode is enabled. Notice that Automatic archive is enabled as well.

You can switch to the log file to see that an archive is written to archive log location.

SQL> alter system switch logfile;

System altered.

SQL> host

[oracle@ngqa ~]$ ls /orabin/oraarch/arch
1_27_711369564.dbf
[oracle@ngqa ~]$ exit
exit
SQL>

***Disable Archive Log Mode***

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

The following are the steps required to disable archive log mode on an Oracle 10g or 11g database.

Verify the database log mode.
[oracle@ngqa ~]$ sqldba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 27 19:01:01 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /oradata/oraarch/MMINDQA/
Oldest online log sequence     26
Next log sequence to archive   28
Current log sequence           28
SQL>
The Database log mode is Archive mode. Next we shut down the database and bring up back up in mount mode.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             511708752 bytes
Database Buffers          331350016 bytes
Redo Buffers                5132288 bytes
Database mounted.
SQL>
All that is left is to disable archive log mode and open the database.

SQL> alter database noarchivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /oradata/oraarch/MMINDQA/
Oldest online log sequence     26
Current log sequence           28
SQL>
As you can see, ARCHIVELOG mode has been disabled.