Wednesday, September 7, 2016

ORA-00245: control file backup failed; target is likely on a local file system

Error : ORA-00245: control file backup failed; target is likely on a local file system

Cause : the control file is saved on local file system., in case of RAC databases the control file snapshot should be saved on the shared location.

Solution : Make change in RMAN to point the control file snapshot to be saved under shared location

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+DB4_ORADATA/snapcf_db4.f';

ORA-00234,ORA-17503,ORA-15045

RMAN> SHOW SNAPSHOT CONTROLFILE NAME; 

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 09/07/2016 08:41:04
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 09/07/2016 08:41:04
ORA-00234: error in identifying or opening snapshot or copy control file
ORA-00202: control file: '+DB4_ORADATA'
ORA-17503: ksfdopn:2 Failed to open file +DB4_ORADATA
ORA-15045: ASM file name '+DB4_ORADATA' is not in reference form

Everything I run on the catalog database gives me the above error

Solution :

Make the change as sys user

SQL> EXECUTE SYS.DBMS_BACKUP_RESTORE.CFILESETSNAPSHOTNAME ('+DB4_ORADATA/snapcf_db4.f');

PL/SQL procedure successfully completed.

this resolved the rman issue.. 

Thursday, September 1, 2016

"E575: viminfo: Illegal starting char in line:" while opening a file on Linux

Error:
E575: viminfo: Illegal starting char in line: 2015-04-03 12:35:01:64263:1428089701:1428089701:0:ok
E575: viminfo: Illegal starting char in line: 2015-04-03 12:36:01:44948:cronmon.ksh starting as pid 44948 with threshold of 120 seconds.

Reason : 
viminfo file got corrupted

Solution :
viminfo file is present in the user home location, as its hidden file it starts with .viminfo. The solution for this error is deleting this .viminfo file or rename it. This file will get generated again once you open a file.

Wednesday, August 10, 2016

ORA-24324 & ORA-01041 During Database startup

SQL> startup
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist

Problem : Database was being started with old Oracle Home ( Probably the old Oracle Home was not renamed after database was upgraded) 

Solution : Set the environment correct and start the database from correct Oracle Home

ORA-01092 & ORA-39701 during Startup upgrade


SQL> startup upgrade
ORACLE instance started.

Total System Global Area 4.0486E+10 bytes
Fixed Size                  2261968 bytes
Variable Size            6845107248 bytes
Database Buffers         3.3554E+10 bytes
Redo Buffers               84606976 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Process ID: 122696
Session ID: 267 Serial number: 3

Issue : The parameter cluster_database was set to true. We need to change it to false to start the RAC database in upgrade database

SQL> startup
ORACLE instance started.

Total System Global Area 4.0486E+10 bytes
Fixed Size                  2261968 bytes
Variable Size            6845107248 bytes
Database Buffers         3.3554E+10 bytes
Redo Buffers               84606976 bytes
Database mounted.
Database opened.
SQL> alter system set cluster_database=false scope=spfile sid='*';

System altered.

SQL> show parameter cluster

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                     boolean     TRUE
cluster_database_instances           integer     2
cluster_interconnects                string

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

SQL> startup upgrade 
ORACLE instance started.

Total System Global Area 4.0486E+10 bytes
Fixed Size                  2261968 bytes
Variable Size            6845107248 bytes
Database Buffers         3.3554E+10 bytes
Redo Buffers               84606976 bytes
Database mounted.
Database opened.

Tuesday, May 17, 2016

Delete two hours old files in Sun OS


In Sun OS mmin doesnt work to delete the older files..

To delete older files on SunOS use "newer" option

oracle@sev2(1125) db2 /opt/app/db2/oracle/admin/db2/udump
$ date
Tue May 17 18:33:22 EDT 2016
oracle@sev2(1126) db2 /opt/app/db2/oracle/admin/db2/udump
$ touch 05171633 /tmp/TIMESTAMP 
[05=month 17 = date 1633 = 16:33 pm ( 2 hours older than current time)]
oracle@sev2(1128) db2 /opt/app/db2/oracle/admin/db2/udump
$ nohup find . ! -newer /tmp/TIMESTAMP -exec rm {} \;

Tuesday, May 10, 2016

Linux : how to mail all files under a directory

the below command can help sending all the files under a directory

cd /location/where/files/are/present/
for file in .* *; do mailx -s "${file}" -a "${file}" <email@id> < ${file}; done

FYI : each file will be sent as separate email.