Good Contents Are Everywhere, But Here, We Deliver The Best of The Best.Please Hold on!
In a Data Guard configuration it is very common to these the ‘UNNAMED File Issue/Error’ on Standby Database when you add new datafile on Primary Database and there is no space available on the standby database server or improper parameter settings related to standby file management. This will result in the following Oracle error messages ORA-01111, ORA-01110, ORA-01157 and cause MRP process to crash resulting in Standby database ‘out of sync’ with primary. 

Also note that, If STANDBY_FILE_MANAGEMENT parameter is not configured as ‘AUTO’ in your Data Guard environment and a datafile is created on Primary database,  then the file created on standby server will have unnamed file name and it is created under $ORACLE_HOME/dbs directory. 

Environment Details:

Primary DB HostName / DB Instance : PRD101/ ORCLPRD
Standby DB HostName / DB Instance : STD101/ ORCLSTDY
Database version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0

Alert log on Standby DB:

Sun May 21 15:05:13 2017
Errors in file /u01/app/oracle/diag/rdbms/orclstdy/orclstdy/trace/orclstdy_dbw0_61177.trc:
ORA-01186: file 11 failed verification tests
ORA-01157: cannot identify/lock data file 11 – see DBWR trace file
ORA-01111: name for data file 11 is unknown – rename to correct file
ORA-01110: data file 11: ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’
File 11 not verified due to error ORA-01157
MRP0: Background Media Recovery terminated with error 1111
Errors in file /u01/app/oracle/diag/rdbms/orclstdy/orclstdy/trace/orclstdy_pr00_11317.trc:
ORA-01111: name for data file 11 is unknown – rename to correct file
ORA-01110: data file 11: ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’
ORA-01157: cannot identify/lock data file 11 – see DBWR trace file
ORA-01111: name for data file 11 is unknown – rename to correct file
ORA-01110: data file 11: ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’
Managed Standby Recovery not using Real Time Apply
Recovery Slave PR00 previously exited with exception 1111
MRP0: Background Media Recovery process shutdown (orclstdy)

Troubleshooting Steps:

Let us see how we can fix this error and get Standby In-synch again with Primary.

  • Run following at Standby side. 

SQL> set lines 300
SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
——— ——————– —————-
ORCLSTDY  READ ONLY            PHYSICAL STANDBY

SQL> select PROCESS,THREAD#,SEQUENCE#,STATUS from v$managed_standby where process=’MRP0′;

no rows selected  –> MRP is not Running

SQL> set sqlblanklines on

SQL> 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# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference

———- ———————- ——————— ———-

         1                  13817                 13708        109


  • Stop MRP if it’s not already stopped.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

Database altered.

SQL> show parameter standby_file_management

NAME                                 TYPE                             VALUE
———————————— ——————————– ——————————
standby_file_management              string                           AUTO


SQL> col NAME for a70
SQL>  select * from v$recover_file where error like ‘%UNNAMED%’;

     FILE# NAME
———- ———————————————————————-
        11 /u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011

Here the datafile #11 is renamed to UNNAMED00011 on standby database 


  • Identify the datafile name on primary database

SQL>  select file#,name from v$datafile where file#=11;

FILE#   NAME
—— ———————————————————————-
11  /u02/oradata/datafile/orclprd/users01.dbf


  • Temporary change setting for STANDBY_FILE_MANAGEMENT to MANUAL, we can revert this setting once we finish the activity. 

SQL> alter system set standby_file_management=MANUAL scope=both;

System altered.

SQL> show parameter standby_file_management

NAME                                 TYPE                             VALUE
———————————— ——————————– ——————————
standby_file_management              string 


  • Create a new datafile with same name as of Primary ( Name obtained above)

SQL> alter database create datafile ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’ as ‘/u02/oradata/datafile/orclstdy/users01.dbf’;

Database altered.

SQL> select file#,name from v$datafile where file#=11;

     FILE# NAME
———- ———————————————————————-
        11 /u02/oradata/datafile/orclstdy/users01.dbf


  • Revert STANDBY_FILE_MANAGEMENT to AUTO 

  SQL> alter system set standby_file_management=AUTO scope=both;

System altered.


  • Check if MRP is up 

SQL> select PROCESS,THREAD#,SEQUENCE#,STATUS from v$managed_standby where process=’MRP0′;

no rows selected


  • Start MRP process and monitor lag gap. MRP will start applying logs if archives are available at Standby side.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

Database altered.


  • On Primary database switch log or archive log and check the archive logs are being shipped to Standby database and MRP is applying them

SQL> alter system switch logfile;


  • Verify standby database 

SQL> 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# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference

———- ———————- ——————— ———-

         1                  13818                 13713        105


SQL> /

    Thread Last Sequence Received Last Sequence Applied Difference
———- ———————- ——————— ———-
         1                  13820                 13820          0

You can observe, Standby Database is in synch with Primary and MRP is working perfect. 

Conclusion

In this article we have learned how to fix ‘UNNAMED File Issue/Error’ on Standby Database when you add new datafile on Primary Database and there is no space available on the standby database server or improper parameter settings related to standby file management. To avoid these kind of errors, also ensure that you have correct Data Guard setup as per best practices and there is sufficient file system space on both Primary and Standby servers

1

You want to install some packages on the Exadata Compute nodes running Oracle Enterprise Linux and you don’t have internet access. In those cases you can create a local YUM repository using DVD Image. You simply download the DVD Image on the Desktop/Laptop where you have the internet access, copy it to the server and mount it.

In this article we will demonstrate how create a Local YUM Repository using ISO Image on Exadata Database Machines.

Prerequisites

  1. System with Internet
  2. Sufficient space on the server for Oracle Linux DVD ISO


Steps to create a Local YUM Repository using ISO Image on Exadata Database Machines

Step 1: Download Oracle Linux DVD Image from the Oracle Software Delivery Cloud at http://edelivery.oracle.com/linux

Here I am downloading:
V860937-01.iso Oracle Linux 6 Update 9 for x86 64 bit, 3.8 GB

Step 2: Copy the DVD image to the server to a staging directory using Winscp

Create a staging directory on the server

[root@dm01db01 ~]# mkdir -p /u01/app/oracle/software/ISO

Use Winscp to copy the ISO Image to the server

[root@dm01db01 ~]# ls -l /u01/app/oracle/software/ISO
total 3953672
-rw-r–r– 1 root root 4048551936 Mar 20 04:18 V860937-01.iso

Step 3:  Create a mount point, for example /mnt/OEL6.9, and mount the DVD image on it. 

[root@dm01db01 ~]# mkdir -p /mnt/OEL6.9

[root@dm01db01 ~]# ls -l /mnt/OEL6.9
total 0

[root@dm01db01 ~]# mount -o loop,ro /u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9

[root@dm01db01 ~]# df -h /mnt/OEL6.9
Filesystem            Size  Used Avail Use% Mounted on
/u01/app/oracle/software/ISO/V860937-01.iso
                      3.8G  3.8G     0 100% /mnt/OEL6.9

[root@dm01db01 ~]# cd /mnt/OEL6.9

[root@dm01db01 OEL6.9]# ls -l
total 1686
drwxr-xr-x 3 root root   2048 Mar 24  2017 EFI
-rw-r–r– 1 root root   8529 Mar 24  2017 EULA
-rw-r–r– 1 root root   8529 Mar 24  2017 eula.en_US
-rw-r–r– 1 root root   3334 Mar 24  2017 eula.py
-rw-r–r– 1 root root  18390 Mar 24  2017 GPL
drwxr-xr-x 3 root root   2048 Mar 24  2017 HighAvailability
drwxr-xr-x 3 root root   2048 Mar 24  2017 images
drwxr-xr-x 2 root root   2048 Mar 24  2017 isolinux
drwxr-xr-x 3 root root   2048 Mar 24  2017 LoadBalancer
-rw-r–r– 1 root root     98 Mar 24  2017 media.repo
drwxr-xr-x 2 root root 716800 Mar 24  2017 Packages
-rw-r–r– 1 root root   7193 Mar 24  2017 README-en
-rw-r–r– 1 root root   6016 Mar 24  2017 README-en.html
-rw-r–r– 1 root root  81004 Mar 24  2017 RELEASE-NOTES-en
-rw-r–r– 1 root root 227548 Mar 24  2017 RELEASE-NOTES-en.html
-rw-r–r– 1 root root  81004 Mar 24  2017 RELEASE-NOTES-x86_64-en
-rw-r–r– 1 root root 227548 Mar 24  2017 RELEASE-NOTES-x86_64-en.html
-rw-r–r– 1 root root  81004 Mar 24  2017 RELEASE-NOTES-x86-en
-rw-r–r– 1 root root 227548 Mar 24  2017 RELEASE-NOTES-x86-en.html
lrwxrwxrwx 1 root root     15 Mar 24  2017 repodata -> Server/repodata
drwxr-xr-x 3 root root   2048 Mar 24  2017 ResilientStorage
-rw-r–r– 1 root root   1011 Mar 24  2017 RPM-GPG-KEY
-rw-r–r– 1 root root   1011 Mar 24  2017 RPM-GPG-KEY-oracle
drwxr-xr-x 3 root root   2048 Mar 24  2017 ScalableFileSystem
drwxr-xr-x 4 root root   2048 Mar 24  2017 Server
-rw-r–r– 1 root root    108 Mar 24  2017 supportinfo
-r–r–r– 1 root root   6517 Mar 24  2017 TRANS.TBL
drwxr-xr-x 3 root root   2048 Mar 24  2017 UEK4

Step 4:  Add an entry to the /etc/fstab file, this will to auto mount the DVD image after a reboot. 

/u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9 iso9660 loop,ro 0 0

[root@dm01db01 ~]# vi /etc/fstab

[root@dm01db01 ~]# cat /etc/fstab
LABEL=DBSYS             /                       ext4    defaults        1 1
LABEL=BOOT              /boot                   ext4    defaults,nodev        1 1
LABEL=DBORA             /u01                    ext4    defaults,nodev  1 1
tmpfs                   /dev/shm                tmpfs   defaults,size=258341m 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP              swap                    swap    defaults        0 0
/u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9 iso9660 loop,ro 0 0

Step 5:  Navigate to /etc/yum.repos.d directory, you can edit the existing repository files public-yum-ol6.repo or create a new repo file such as ULN-base.repo, and disable all entries by setting enabled=0. 

[root@dm01db01 ~]# cd /etc/yum.repos.d

[root@dm01db01 yum.repos.d]# ls -l
total 20
-rw-r—– 1 root root  291 Mar 31 22:43 Exadata-computenode.repo
-r–r—– 1 root root  896 Jan 26 06:19 Exadata-computenode.repo.sample
-rw-r–r– 1 root root 7299 Mar 20 05:57 public-yum-ol6.repo

Here I am going to create the OL69.repo repository file and add the entries 

[root@dm01db01 yum.repos.d]# vi OL69.repo

[root@dm01db01 yum.repos.d]# cat OL69.repo
[OL69]
name=Oracle Linux 6.9 x86_64
baseurl=file:///mnt/OEL6.9
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
gpgcheck=1
enabled=1

Step 7:  Perform YUM Cache cleanup as below

[root@dm01db01 yum.repos.d]# yum clean all
Cleaning repos: OL69
Cleaning up Everything

Step 8:  Perform a test to ensure you can access yum repository

[root@dm01db01 yum.repos.d]# yum repolist
OL69                          | 3.7 kB      00:00 …
OL69/primary_db                | 3.1 MB      00:00 …
repo id                        repo name    status    
OL69                          Oracle Linux 6.9 x86_64 3,860
repolist: 3,860


Conclusion

In this article we have learned how to create local YUM repository using DVD ISO Image on Exadata Database Machine. Configuring a local YUM repository comes handy when you want to install packages on the server and you don’t have internet access from the server.

0