Showing posts with label rman. Show all posts
Showing posts with label rman. Show all posts

Friday, 24 July 2015

Duplicate database fail with RMAN-04014 ORA-01127: database name '/SIDDEVLOP' exceeds size limit of 8 characters

During cloning of Oracle DB using rman auxilary command got below error.

ERROR:
connected to auxiliary database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/24/2015 01:43:21
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-01127: database name '/SIDDEVLOP' exceeds size limit of 8 characters
RMAN-04017: startup error description: ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance

Solution:
Step1: Create text control file trace and edit as per requirement.
Step2: Edit init.ora with proper SID.
Step3: Startnomont,create controlfile and open database in resetlogs.

++ startup mount the db create text controlfile.
alter database backup controlfile to trace as '/tmp/controlSIDDEVLOP.txt';

edit initSIDDEVLOP.ora of db_name and db_unique_name

++Take out the block of 
 CREATE CONTROLFILE REUSE DATABASE "SIDDEVLOP" RESETLOGS NOARCHIVELOG
....
....
to 
CHARACTER SET WE8MSWIN1252
/

++ Edit the file as below.
 CREATE CONTROLFILE SET DATABASE "SIDDEVLOP" RESETLOGS NOARCHIVELOG
   MAXLOGFILES 192
     MAXLOGMEMBERS 3
     MAXDATAFILES 1024
     MAXINSTANCES 32
     MAXLOGHISTORY 5840
 LOGFILE
  GROUP 1 (
......
......
DATAFILE
  '+ASM_DATA01
....
....
CHARACTER SET WE8MSWIN1252
;

++ Now,Stop the DB and nomount the DB.
Then using above create controlfile command create the control file.
SQL>shut immediate
SQL> statup nomount

SQL> CREATE CONTROLFILE SET DATABASE "SIDDEVLOP" RESETLOGS NOARCHIVELOG
   MAXLOGFILES 192
     MAXLOGMEMBERS 3
     MAXDATAFILES 1024
     MAXINSTANCES 32
     MAXLOGHISTORY 5840
 LOGFILE
  GROUP 1 (
......
......
DATAFILE
  '+ASM_DATA01
....
....
CHARACTER SET WE8MSWIN1252
;

Control file created.

SQL>  alter database open resetlogs;

Database altered.

Ref: Manual Completion of a Failed RMAN Backup based Duplicate (Doc ID 360962.1)

Wednesday, 3 June 2015

ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim

During RMAN restoration on UAT got the below error.

ERROR:
RMAN-03002: failure of restore command at 06/03/2015 09:42:32
ORA-19870: error while restoring backup piece /dump/RMANBK/backupfile/Db_.39373.1.881387571.20150603.bak
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 18874368 bytes disk space from 32212254720 limit

Solution:
Increase the size of DB_RECOVERY_FILE_DEST_SIZE in initSID.ora file and then restart the recovery.
SQL> shut immediate
#Increase the value DB_RECOVERY_FILE_DEST_SIZE in init file
SQL> startup nomount
RMAN>  start the recovery.

Note: If you use spfile then change using

alter system set DB_RECOVERY_FILE_DEST_SIZE=g scope=BOTH;
then start the recovery

Friday, 13 March 2015

RMAN-03009 ORA-19504 ORA-27040 ORA-27040: file create error, unable to create file

Error:

While taking RMAN backup getting below error

channel d29 disabled, job failed on it will be run on another channel
RMAN-03009: failure of backup command on d31 channel at 03/13/2015 11:24:48
ORA-19504: failed to create file "/u01/EODdump/DBSID/RMAN/backup/fullbkp/Db_DBSID.3826.1.874236286.20150313.bak"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
channel d31 disabled, job failed on it will be run on another channel
RMAN-03009: failure of backup command on d32 channel at 03/13/2015 11:24:48
ORA-19504: failed to create file "/u01/EODdump/DBSID/RMAN/backup/fullbkp/Db_DBSIDD.3827.1.874236287.20150313.bak"

Solution:

Check the path(/u01/EODdump/DBSID/RMAN/backup/fullbkp) is valid and permission in OS level for oracle.

Wednesday, 16 July 2014

RMAN Backup fails with DBGSQL: TARGET - RMAN-03014 ORA-01008 sqlcode = 1008

Rman backup script fails with

Error:
DBGSQL:     TARGET> select  nvl(max(al.recid), '0'),nvl(max(al.recid), 0)   into  :txtparmvalue, :parmvalue   from  v$archived_log al  where  al.status in
 ('X', 'A')    and  al.is_recovery_dest_file = 'YES'    and  al.creator = 'RMAN'
DBGSQL:        sqlcode = 1008

......
RMAN-03014: implicit resync of recovery catalog failed
ORA-01008: not all variables bound


Work around:

SQL> alter system flush shared_pool;

After flushing shared pool rerun the backup script.

Monday, 7 July 2014

Rman backup falis with RMAN-00601 fatal error in recovery manager

Rman backup fails with fatal error.
In the log we can see the connection was terminated from db level.

channel d12: starting compressed full datafile backup set
channel d22: finished piece 1 at 05-JUL-14
RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database:
ORA-03135: connection lost contact

Process ID: 31173
Session ID: 494 Serial number: 62117
...
...
..
channel d13: backup set complete, elapsed time: 01:59:05
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command


++ It looks like some one killed the inactive sessions in the db level.But the backup from RMAN was ran due to OS process,When we check the size of backup and validating backup it was convincing that backup ran successfully.So i ignored this fatal error and from next run it was not showing this error.

Monday, 9 June 2014

Refresh of PROD database using RMAN duplicate

Refresh of PROD database using RMAN 

Backup Prod database:
=======================
rman target / 
host 'date';
run
{
sql "alter system archive log current";
sql "alter system switch logfile";
allocate channel d11 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d12 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d13 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d14 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d15 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d16 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d17 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d18 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d19 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d20 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d21 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d22 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d23 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d24 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d25 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d26 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d27 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d28 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d29 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d30 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d31 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';         
allocate channel d32 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d33 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d34 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d35 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d36 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';
allocate channel d37 type disk format '/u01/EODDmp/PRODDB/RMAN/backup/Db_%d.%s.%p.%t.%T.bak';

Drop database for RAC and NON RAC

Drop database for non-Rac Database for cloning.

To know what are the files will be droped.
select name from v$datafile;
select member from v$logfile;
select name from v$controlfile;

in SQL>
SQL> shutdown abort;
SQL> startup mount exclusive restrict;
SQL> DROP DATABASE; -- to delete datafile,logfile and controlfile.


RMAN> DROP DATABASE INCLUDING BACKUPS; -- Will delete archivelogs and backup pieces.

Drop database for FOR RAC Database for cloning

srvctl stop database -d <DB NAME> -o abort
from one node
sqlplus "/as sysdba"
SQL>alter system set cluster_database=false scope=spfile sid='*'; 

SQL> shutdown abort;
SQL> startup mount exclusive restrict;
SQL> DROP DATABASE; -- to delete datafile,logfile and controlfile.


RMAN> DROP DATABASE INCLUDING BACKUPS; -- Will delete archivelogs and backup pieces.

Saturday, 7 June 2014

Cross platform migration from windows to linux of oracle database

Cross platform migration from windows to linux


1.Using RMAN convert command we can make this very simple.
create the working directory for example

C:\oracle\product\10.2.0\Migrate\DB_NAME

Login to the database to check the datafiles,redofie,controlfile status,init file,invalid objects,DB links and directories

set ORACLE_SID=DB_NAME
sqlplus sys/****** as sysdba

spool C:\oracle\product\10.2.0\Migrate\DB_NAME\pre_migration_DB_NAME.log
--Checking datafile status
select checkpoint_time,fuzzy,count(*),status
from ( select checkpoint_time,fuzzy,status
       from v$datafile_header
       union all
       select controlfile_time,'CTL',null from v$database)
group by checkpoint_time,fuzzy,status;
--checking invalid objects
select count(*),owner from dba_objects where status='INVALID' group by owner;
select * from v$logfile;
select name from v$controlfile;
--Switching logfile
alter system checkpoint;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;

select member from v$logfile;
select name from v$controlfile;
select name from v$datafile;

--Init file Backup
create pfile='C:\oracle\product\10.2.0\Migrate\DB_NAME\init_bkDB_NAME.ora' from spfile;
--controlfile backup in text format
alter database backup controlfile to trace as 'C:\oracle\product\10.2.0\Migrate\DB_NAME\controlfilefromprd_bk_DB_NAME.trc' resetlogs;
-- Checking external table
set serveroutput on;
 declare x boolean; begin x := dbms_tdb.check_external; end;
 /