Monday, November 30, 2020

 Check The status of the cold backup before Perform Clone by creating control file method

=================================================================


select hxfil FILENUMBER, fhsta STATUS, fhscn SCN, fhrba_seq SEQUENCE,fhafs,FHDBI,fhdbn from x$kcvfh order by fhsta;

FILENUMBER STATUS SCN SEQUENCE FHAFS FHDBI FHDBN
---------- ---------- ---------------- ---------- ---------------- ---------- ---------
6 4 2401335881 1 0 3300273167 PROD
2 4 2401335881 1 0 3300273167 PROD
3 4 2401335881 1 0 3300273167 PROD
4 4 2401335881 1 0 3300273167 PROD
5 4 2401335881 1 0 3300273167 PROD
11 4 2401335881 1 0 3300273167 PROD
7 4 2401335881 1 0 3300273167 PROD
8 4 2401335881 1 0 3300273167 PROD
9 4 2401335881 1 0 3300273167 PROD
10 4 2401335881 1 0 3300273167 PROD
1 8196 2401335881 1 0 3300273167 PROD

11 rows selected.
================================================================================================================================================================

See the status column, its 8194 (for system datafile) and 4 for non system datafiles,
the value 8196 and 4 denoted, online fuzzy, means that the database was opened, when the datafiles were copied,
if it was a cold backup, in that case the status column must be 8192 and 0 (Zero)



Tuesday, November 3, 2020

Startup Fails With ORA-01012: Not Logged On


Problem Description
Users cant able to login to database server. Though it allow sysdba to login, it does not allow to run any query. Sometimes it will show database is connected to an idle instance. But when we startup database it shall throw error ORA-01081: cannot start already-running .

[oracle@mezon01 ~]$ sqlplus sys/System_2018@IIRDB

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 24 08:03:07 2018

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

ERROR:
ORA-12520: TNS:listener could not find available handler for requested type of
server


[oracle@mezon01 ~]$ sqlplus -prelim “/as sysdba”

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 24 08:04:06 2018

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

SQL> show parameter sga_t;
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0

 

SQL> startup;
ORA-01012: not logged on
SQL> shutdown immediate;
ORA-01012: not logged on


[oracle@mezon01 ~]$
Changes
Oracle has been forcefully shutdown at OS level or crashed.

CAUSE
An orphaned shared memory segment belonging to the ORACLE_SID still exists from a previous instance startup.

The command
ps -ef | grep $ORACLE_SID

shows no processes but with ORACLE_SID set the Oracle ‘sysresv’ utility shows a shared memory segment for a non-existing instance, e.g.

$ sysresv

IPC Resources for ORACLE_SID “IIRDB” :

Shared Memory:
ID              KEY
100270098 0x00000000
100302867 0x00000000
100335643 0x14203f64

Semaphores:
ID              KEY
No semaphore resources used
Oracle Instance not alive for sid “IIRDB”

Solution
On OS level, remove the orphaned shared memory segment using:

ipcrm -m <problem shared memory id>

ipcrm -m 100270098
ipcrm -m 100302867
ipcrm -m 100335643

$sqlplus ‘/as sysdba’

Connected to an idle instance.

SQL> startup Oracle instance started
Total System Global Area   10689474560 bytes
Fixed Size                     2237776 bytes
Variable Size               6375344816 bytes
Database Buffers            4294967296 bytes
Redo Buffers                  16924672 bytes
Oracle Instance Started.
Oracle Database Opened.

Monday, November 2, 2020

 

Deleting the files between particular dates

Code:

find ./ -mtime +30 -type f -print

 

The above command will show all files modified 30 days ago or more - use the print statement first to be sure that you find the correct files and do check it's what you want. Then you can run the command again with the delete function added like this;


Code:

find ./ -mtime +30 -type f -exec rm {} \;


  RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time https://shivanandarao-oracle.com/2012/12/05/rman-20207-until-time-or-re...