Monday 2 December 2019

ORA-00119: invalid specification for system parameter LOCAL_LISTENER

ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_SMRTESTENV'



  • oracle@sgdcplm02:/u01/app/oracle/product/12.1.0/dbhome_1/dbs> sqlplus / as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 2 10:34:36 2019

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

Connected to an idle instance.


  • SQL> startup nomount;

ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_SMRTESTENV'

  • SQL> create pfile from spfile;


File created.

SQL> exit
Disconnected
oracle@sgdcplm02:/u01/app/oracle/product/12.1.0/dbhome_1/dbs> ll



oracle@sgdcplm02:> vi initSMRTESTENV.ora

#*.local_listener='LISTENER_SMRTESTENV'

SQL> startup pfile='/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initSMRTESTENV.ora';
ORACLE instance started.

Total System Global Area 3154116608 bytes
Fixed Size                  3715784 bytes
Variable Size            1543507256 bytes
Database Buffers         1593835520 bytes
Redo Buffers               13058048 bytes
Database mounted.
Database opened.

Friday 29 November 2019

RMAN - Error : ORA-19698: redo01.log is from different database: id


  • ERROR: ORA-19698: /u01/app/oracle/oradata/SMRTESTENV/redo01.log is from different database: id=1055740869, db_name=SMRTESTE


oracle@sgdcpl08:/u02/expdp/smrtestenv> ps -ef |grep pmon
oracle    3460  2965  0 08:13 pts/0    00:00:00 grep --color=auto pmon
oracle@sgdcpl08:/u02/expdp/smrtestenv> . oraenv
ORACLE_SID = [SMRTESTENV] ?
The Oracle base remains unchanged with value /u01/app/oracle

  • oracle@sgdcpl08:/u02/expdp/smrtestenv> sqlplus / as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 29 08:13:55 2019

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

Connected to an idle instance.


  • SQL> startup nomount;

ORACLE instance started.

Total System Global Area 1593835520 bytes
Fixed Size                  2924880 bytes
Variable Size            1275072176 bytes
Database Buffers          301989888 bytes
Redo Buffers               13848576 bytes
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

  • oracle@sgdcpl08:/u02/expdp/smrtestenv> rman target /


Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 29 08:14:14 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SMRTESTE (not mounted)


  • RMAN> restore controlfile from '/u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak';

\
Starting restore at 29-NOV-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1032 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=/u01/app/oracle/oradata/SMRTESTENV/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/SMRTESTENV/control02.ctl
Finished restore at 29-NOV-19


  • RMAN>alter database mount;


Statement processed
released channel: ORA_DISK_1


  • RMAN> catalog start with '/u02/expdp/smrtestenv';


Starting implicit crosscheck backup at 29-NOV-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=693 device type=DISK
Crosschecked 23 objects
Finished implicit crosscheck backup at 29-NOV-19

Starting implicit crosscheck copy at 29-NOV-19
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 29-NOV-19

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /u02/expdp/smrtestenv

List of Files Unknown to the Database
=====================================
File Name: /u02/expdp/smrtestenv/expdp-2019-11-29_02-40-01.dmp
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b0uhvp54_2400_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b1uhvp54_2401_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b2uhvp54_2402_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b3uhvp54_2403_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b4uhvp55_2404_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b5uhvp55_2405_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b7uhvp59_2407_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b8uhvp5a_2408_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bcuhvp71_2412_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bkui2dh7_2420_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bmui2dha_2422_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bnui2dj1_2423_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_boui2dj1_2424_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bpui2dj1_2425_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bqui2dj1_2426_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_brui2dj4_2427_1_20191129
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bduhvp74_20191128.bak
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak
File Name: /u02/expdp/smrtestenv/rman_SMRTESTENV.log

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b0uhvp54_2400_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b1uhvp54_2401_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b2uhvp54_2402_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b3uhvp54_2403_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b4uhvp55_2404_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b5uhvp55_2405_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b7uhvp59_2407_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b8uhvp5a_2408_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bcuhvp71_2412_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bkui2dh7_2420_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bmui2dha_2422_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bnui2dj1_2423_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_boui2dj1_2424_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bpui2dj1_2425_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bqui2dj1_2426_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_brui2dj4_2427_1_20191129
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bduhvp74_20191128.bak
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak

List of Files Which Were Not Cataloged
=======================================
File Name: /u02/expdp/smrtestenv/expdp-2019-11-29_02-40-01.dmp
  RMAN-07520: Reason: Data pump dump file
File Name: /u02/expdp/smrtestenv/rman_SMRTESTENV.log
  RMAN-07517: Reason: The file header is corrupted


  • RMAN> RUN

{
RESTORE DATABASE;
SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
recover database;
}2> 3> 4> 5> 6> 7>

Starting restore at 29-NOV-19
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/SMRTESTENV/ILOG01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/SMRTESTENV/INDX01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/SMRTESTENV/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/SMRTESTENV/users01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/SMRTESTENV/system01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/SMRTESTENV/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/SMRTESTENV/IDATA01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 29-NOV-19



Starting recover at 29-NOV-19
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/29/2019 08:31:22
ORA-19698: /u01/app/oracle/oradata/SMRTESTENV/redo01.log is from different database: id=1055740869, db_name=SMRTESTE


  • RMAN>  alter database open resetlogs;


NOTE : alter database open resetlogs not work here. It will show error below:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/29/2019 08:35:45
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/app/oracle/oradata/SMRTESTENV/system01.dbf'

RMAN> exit


Recovery Manager complete.

###################################################################################################################################################################################################################################################


  • Remove all datafiles, controlfiles, redo log files at OS level.
  • startup nomount;
  • restore controlfile from backup location
  • alter database mount
  • catalog start with
  • restore and recover using rman backup ustility
  • alter database open resetlogs


oracle@sgdcpl08:/u02/expdp/smrtestenv> sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 29 08:42:13 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


  • SQL> shut immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/SMRTESTENV/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
oracle@sgdcpl08:/u02/expdp/smrtestenv> ps -ef |grep pmon
oracle    3481     1  0 08:14 ?        00:00:00 ora_pmon_SMRTESTENV
oracle    7127  2965  0 08:42 pts/0    00:00:00 grep --color=auto pmon
oracle@sgdcpl08:/u02/expdp/smrtestenv> sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 29 08:42:35 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


  • SQL> shut abort;
ORACLE instance shut down.

  • SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1593835520 bytes
Fixed Size                  2924880 bytes
Variable Size            1275072176 bytes
Database Buffers          301989888 bytes
Redo Buffers               13848576 bytes
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

  • oracle@sgdcpl08:/u02/expdp/smrtestenv> rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 29 08:43:00 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SMRTESTE (not mounted)


  • RMAN> restore controlfile from '/u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak';

Starting restore at 29-NOV-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1032 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=/u01/app/oracle/oradata/SMRTESTENV/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/SMRTESTENV/control02.ctl
Finished restore at 29-NOV-19


  • RMAN> alter database mount;

Statement processed
released channel: ORA_DISK_1


  • RMAN> catalog start with '/u02/expdp/smrtestenv';

Starting implicit crosscheck backup at 29-NOV-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=693 device type=DISK
Crosschecked 23 objects
Finished implicit crosscheck backup at 29-NOV-19

Starting implicit crosscheck copy at 29-NOV-19
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 29-NOV-19

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /u02/expdp/smrtestenv

List of Files Unknown to the Database
=====================================
File Name: /u02/expdp/smrtestenv/expdp-2019-11-29_02-40-01.dmp
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b0uhvp54_2400_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b1uhvp54_2401_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b2uhvp54_2402_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b3uhvp54_2403_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b4uhvp55_2404_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b5uhvp55_2405_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b7uhvp59_2407_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b8uhvp5a_2408_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bcuhvp71_2412_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bkui2dh7_2420_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bmui2dha_2422_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bnui2dj1_2423_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_boui2dj1_2424_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bpui2dj1_2425_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bqui2dj1_2426_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_brui2dj4_2427_1_20191129
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bduhvp74_20191128.bak
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak
File Name: /u02/expdp/smrtestenv/rman_SMRTESTENV.log
File Name: /u02/expdp/smrtestenv/o1_mf_1_3846_gy0qwlmm_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3847_gy0rls14_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3848_gy0xqp6j_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3849_gy0xs21o_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3850_gy0xshc3_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3851_gy1196h9_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3852_gy16nnt2_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3853_gy16pkmd_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3854_gy1fpyth_.arc

Do you really want to catalog the above files (enter YES or NO)? YEs
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b0uhvp54_2400_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b1uhvp54_2401_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b2uhvp54_2402_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b3uhvp54_2403_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b4uhvp55_2404_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b5uhvp55_2405_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b7uhvp59_2407_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_b8uhvp5a_2408_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bcuhvp71_2412_1_20191128
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bkui2dh7_2420_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bmui2dha_2422_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bnui2dj1_2423_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_boui2dj1_2424_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bpui2dj1_2425_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bqui2dj1_2426_1_20191129
File Name: /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_brui2dj4_2427_1_20191129
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bduhvp74_20191128.bak
File Name: /u02/expdp/smrtestenv/control01SMRTESTE_bsui2dj6_20191129.bak
File Name: /u02/expdp/smrtestenv/o1_mf_1_3846_gy0qwlmm_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3847_gy0rls14_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3848_gy0xqp6j_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3849_gy0xs21o_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3850_gy0xshc3_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3851_gy1196h9_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3852_gy16nnt2_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3853_gy16pkmd_.arc
File Name: /u02/expdp/smrtestenv/o1_mf_1_3854_gy1fpyth_.arc

List of Files Which Were Not Cataloged
=======================================
File Name: /u02/expdp/smrtestenv/expdp-2019-11-29_02-40-01.dmp
  RMAN-07520: Reason: Data pump dump file
File Name: /u02/expdp/smrtestenv/rman_SMRTESTENV.log
  RMAN-07517: Reason: The file header is corrupted


RMAN> RUN
{
RESTORE DATABASE;
SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
recover database;
}2> 3> 4> 5> 6> 7>

Starting restore at 29-NOV-19
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/SMRTESTENV/ILOG01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bfui2dh5_2415_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/SMRTESTENV/INDX01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bhui2dh5_2417_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/SMRTESTENV/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bjui2dh6_2419_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/SMRTESTENV/users01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_blui2dh9_2421_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/SMRTESTENV/system01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_biui2dh6_2418_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/SMRTESTENV/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_bgui2dh5_2416_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/SMRTESTENV/IDATA01.dbf
channel ORA_DISK_1: reading from backup piece /u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129
channel ORA_DISK_1: piece handle=/u02/expdp/smrtestenv/Backup_SMRTESTE_DB_beui2dh5_2414_1_20191129 tag=FULL_BACKUP_DAILY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 29-NOV-19



Starting recover at 29-NOV-19
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 3853 is already on disk as file /u02/expdp/smrtestenv/o1_mf_1_3853_gy16pkmd_.arc
archived log for thread 1 with sequence 3854 is already on disk as file /u02/expdp/smrtestenv/o1_mf_1_3854_gy1fpyth_.arc
archived log file name=/u02/expdp/smrtestenv/o1_mf_1_3853_gy16pkmd_.arc thread=1 sequence=3853
archived log file name=/u02/expdp/smrtestenv/o1_mf_1_3854_gy1fpyth_.arc thread=1 sequence=3854
unable to find archived log
archived log thread=1 sequence=3855
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/29/2019 08:46:59
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 3855 and starting SCN of 38305278

RMAN>


  • RMAN> alter database open resetlogs;

Statement processed

RMAN>

  • RMAN> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
SMRTESTE  READ WRITE           PRIMARY

RMAN>


Wednesday 27 November 2019

Oracle NID UTILITY TARGET -- Change DBNAME ONLY


  • [oracle@srv3 admin]$ sqlplus sys/system123@rac as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 27 17:11:06 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> sho parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      RAC
SQL> sho parameter db_unique

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      RAC
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


  • [oracle@srv3 admin]$ nid TARGET=sys/system123@RAC DBNAME=STDRAC SETNAME=YES


DBNEWID: Release 12.1.0.2.0 - Production on Wed Nov 27 17:11:30 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to database RAC (DBID=2608333762)

NID-00121: Database should not be open


Change of database name failed during validation - database is intact.
DBNEWID - Completed with validation errors.

  • [oracle@srv3 admin]$ sqlplus sys/system123@rac as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 27 17:11:53 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


  • SQL> shut immediate;

Database closed.
Database dismounted.
ORACLE instance shut down.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor


Warning: You are no longer connected to ORACLE.
SQL> exit

  • [oracle@srv3 admin]$ sqlplus / as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 27 17:13:22 2019

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

Connected to an idle instance.


  • SQL> startup mount;

ORACLE instance started.

Total System Global Area  754974720 bytes
Fixed Size                  2928968 bytes
Variable Size             549457592 bytes
Database Buffers          197132288 bytes
Redo Buffers                5455872 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


  • [oracle@srv3 admin]$ nid TARGET=sys/system123@RAC DBNAME=STDRAC SETNAME=YES


DBNEWID: Release 12.1.0.2.0 - Production on Wed Nov 27 17:13:40 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to database RAC (DBID=2608333762)

Connected to server version 12.1.0

Control Files in database:
    /u01/app/oracle/oradata/RAC/control01.ctl
    /u01/app/oracle/fast_recovery_area/RAC/control02.ctl


  • Change database name of database RAC to STDRAC? (Y/[N]) => Y


Proceeding with operation
Changing database name from RAC to STDRAC
    Control File /u01/app/oracle/oradata/RAC/control01.ctl - modified
    Control File /u01/app/oracle/fast_recovery_area/RAC/control02.ctl - modified
    Datafile /u01/app/oracle/oradata/RAC/system01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/idata01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/sysaux01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/undotbs01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/users01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/ilog01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/indx01.db - wrote new name
    Datafile /u01/app/oracle/oradata/RAC/temp01.db - wrote new name
    Control File /u01/app/oracle/oradata/RAC/control01.ctl - wrote new name
    Control File /u01/app/oracle/fast_recovery_area/RAC/control02.ctl - wrote new name
    Instance shut down

Database name changed to STDRAC.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.


###################   Change CDB Database name Example ###################
[SMRCDB] to [STDRAC]

oracle@srv4:/u01/app/oracle/product/12.2.0/dbhome_1/network/admin> . oraenv
ORACLE_SID = [SMRCDB] ?
The Oracle base remains unchanged with value /u01/app/oracle
oracle@srv4:/u01/app/oracle/product/12.2.0/dbhome_1/network/admin> sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Thu Aug 6 22:55:13 2020

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

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1795162112 bytes
Fixed Size                  8793832 bytes
Variable Size             704643352 bytes
Database Buffers         1073741824 bytes
Redo Buffers                7983104 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
oracle@srv4:/u01/app/oracle/product/12.2.0/dbhome_1/network/admin> nid TARGET=sys/system123@SMRCDB DBNAME=STDRAC SETNAME=YES

DBNEWID: Release 12.2.0.1.0 - Production on Thu Aug 6 22:56:25 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Connected to database SMRCDB (DBID=3280283628)

Connected to server version 12.2.0

Control Files in database:
    /u01/app/oracle/oradata/SMRCDB/control01.ctl
    /u01/app/oracle/fast_recovery_area/SMRCDB/control02.ctl

Change database name of database SMRCDB to STDRAC? (Y/[N]) => Y

Proceeding with operation
Changing database name from SMRCDB to STDRAC
    Control File /u01/app/oracle/oradata/SMRCDB/control01.ctl - modified
    Control File /u01/app/oracle/fast_recovery_area/SMRCDB/control02.ctl - modified
    Datafile /u01/app/oracle/oradata/SMRCDB/system01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/sysaux01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/undotbs01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/pdbseed/system01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/pdbseed/sysaux01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/users01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/pdbseed/undotbs01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/temp01.db - wrote new name
    Datafile /u01/app/oracle/oradata/SMRCDB/pdbseed/temp012020-08-04_22-52-23-393-PM.db - wrote new name
    Control File /u01/app/oracle/oradata/SMRCDB/control01.ctl - wrote new name
    Control File /u01/app/oracle/fast_recovery_area/SMRCDB/control02.ctl - wrote new name
    Instance shut down

Database name changed to STDRAC.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.


  • Create pfile from  SMRCDB pfile change db_name to 'STDRAC' and start database with pfile.

oracle@srv4:/u01/app/oracle/oradata/SMRCDB> cat /u01/app/oracle/product/12.2.0/dbhome_1/dbs/initSTDRAC.ora
STDRAC.__data_transfer_cache_size=0
STDRAC.__db_cache_size=1107296256
STDRAC.__inmemory_ext_roarea=0
STDRAC.__inmemory_ext_rwarea=0
STDRAC.__java_pool_size=16777216
STDRAC.__large_pool_size=33554432
STDRAC.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
STDRAC.__pga_aggregate_target=603979776
STDRAC.__sga_target=1795162112
STDRAC.__shared_io_pool_size=67108864
STDRAC.__shared_pool_size=553648128
STDRAC.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/SMRCDB/adump'
*.audit_trail='db'
*.compatible='12.2.0'
*.control_files='/u01/app/oracle/oradata/SMRCDB/control01.ctl','/u01/app/oracle/fast_recovery_area/SMRCDB/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata/SMRCDB/'
#DB_CREATE_FILE_DEST='/u01/app/oracle/oradata/SMRCDB/'
*.db_name='STDRAC'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area/SMRCDB'
*.db_recovery_file_dest_size=10398m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=STDRACXDB)'
*.enable_pluggable_database=true
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=srv4.example.com)(PORT=1523))'
*.log_archive_format='%t_%s_%r.dbf'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=570m
*.processes=800
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1708m
*.undo_tablespace='UNDOTBS1'
oracle@srv4:/u01/app/oracle/oradata/SMRCDB>


oracle@srv4:/u01/app/oracle/product/12.2.0/dbhome_1/network/admin>
SQL> startup pfile='/u01/app/oracle/product/12.2.0/dbhome_1/dbs/initSTDRAC.ora';
ORACLE instance started.

Total System Global Area 1795162112 bytes
Fixed Size                  8793832 bytes
Variable Size             704643352 bytes
Database Buffers         1073741824 bytes
Redo Buffers                7983104 bytes
Database mounted.
Database opened.
SQL>
SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
STDRAC    READ WRITE           PRIMARY



SQL> sho pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
SQL> select CDB from v$database;

CDB
---
YES