Monday, March 5, 2012

Encountered file error when copying listeners from home

When try to create new databse using dbca, you can get below error
'Encountered file error when copying listeners from home=/u01/app/oracle/prodouct/

Problem1 :

The problem does not occur

If the $TNS_ADMIN is set.
If the ORACLE_HOME and the ASM_HOME are owned by the same user.

Issue:
In this case the ORACLE_HOME & ASM_HOME were owned by different users.
From the dbca log file residing in the $ORACLE_HOME/cfgtoollogs/dbca directory

file `/home/oracle/oracle/product/11.0/asm/network/admin/listener.ora': Permission denied 

Solution:

Ensure that you have write permission to the network/admin directory under the asm home.
chmod 775 /home/oracle/oracle/product/11.0/asm/network/admin/
Rerun dbca.


Problem 2:

Issue:

Database Configuration Assistant (DBCA) fails to create database at 0% of the "Copying database files" stage.

Pop-up shows:

Encountered file error when copying listeners from home=/home/oracle/oracle/product/11.1/asm_1
                                               [OK]
After clicking on the OK button, DBCA goes back to the last page before it attempted to create the database (Database Configuration Assistant, Step 16 of 16 : Creation Options).

11g by default creates DBCA trace. The DBCA trace file ought to be under the directory $ORACLE_BASE/cfgtoollogs/dbca/<database_name>.

[Thread-240] [17:51:28:709] [NativeSystem.rununixcmd:929] NativeSystem.rununixcmd: RetString 0|scp: /home/oracle/oracle/product/11.1/db_1/network/admin/listener.ora: No such file or directory :failed
[Thread-240] [17:51:28:709] [CopyCommand.execute:79] CopyCommand.execute: native copyFile returns `0|scp: /home/oracle/oracle/product/11.1/db_1/network/admin/listener.ora: No such file or directory :failed'
[Thread-240] [17:51:28:710] [NativeResult.<init>:88] NativeResult: The String obtained is0|scp: /home/oracle/oracle/product/11.1/db_1/network/admin/listener.ora: No such file or directory :failed
[Thread-240] [17:51:28:710] [NativeResult.<init>:96] The status string is: 0

Solution:

The problem was caused by a missing soft link used to link listener.ora in the $ORACLE_HOME/network/admin directory used by the DBCA session to the $ORACLE_HOME/network/admin/listener.ora used by the node's Oracle listener.

Example, On node1
(where DBCA was launched):

[oracle@test1] /home/oracle/oracle/product/11.1/db_1/network/admin> ls -ltr 
lrwxrwxrwx 1 root root 64 Jan 12 17:37 listener.ora -> /home/oracle/oracle/product/11.1/asm_1/network/admin/listener.ora 

Example, On node2 (same $ORACLE_HOME used by DBCA on node1 but that is on node2) :

[oracle@test2] /home/oracle/oracle/product/db_1/network/admin> ls -ltr 
<no listing for a soft link>

Do not use soft links to link Oracle NET configuration files (listener.ora, etc). Instead, configure TNS_ADMIN to point the DBCA session to the proper directory where these configuration files reside:

Example:

1) If your home where you will launch DBCA is '/home/oracle/oracle/product/11.1/db_1', then
2) If the server's listener run from home '/home/oracle/oracle/product/11.1/asm_1', then
3) From the session that will launch DBCA, set its TNS_ADMIN variable to point to the home where the listener runs of:
   $ export TNS_ADMIN=/home/oracle/oracle/product/11.1/asm_1/network/admin
4) Start up DBCA and database creation should now successfuly complete.

No comments:

Post a Comment