Wednesday, June 8, 2016

How to change the hostname and/or port of the Database Tier using AutoConfig on 11i in Linux


Below Scenario Database and Applications are in different Server.

1. Deregister the current database server

The hostname and/or port will be changed, so database server node needs to be de-registered.

Use below command for deregister:

perl <RDBMS ORACLE_HOME>/appsutil/bin/adgentns.pl appspass=<APPSpwd> \
contextfile=<CONTEXT> -removeserver

We need find SYSTEM_NAME and SERVER_NAME for removing server entries in database.

Find system name:

select DB_NAME from FND_DATABASES;

Find server name:

select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES 
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and 
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('hostname');

Execute below package:

begin
FND_NET_SERVICES.remove_server('<DB_NAME'>, '<NAME>');
end;
/
commit;
/

2. Update the AutoConfig Context files

Create a new context file:

perl <RDBMS ORACLE_HOME>/appsutil/bin/adclonectx.pl contextfile=$CONTEXT_FILE

This will create a new Context file of the format <SID>_<new hostname>.xml in the current working directory

Applications Tier: 

Update the existing Applications Tier Context file on all APPL_TOP nodes with new DB values as below

"Data Server Host" and "Database Port" to new value
"s_apps_jdbc_connect_descriptor" to (" ")

3. Shutdown the Applications

cd $COMMON_TOP/admin/scripts/<SID_hostname>

./adstpall.sh apps/<appspasswd>

4. Run AutoConfig on the Database and Application Nodes

Database Node:

Run AutoConfig on the database node using the following syntax :

cd <RDBMS ORACLE_HOME>/appsutil/bin/

./adconfig.sh contextfile=<RDBMS ORACLE_HOME>/appsutil/<SID>_<new_hostname>.xml

Applications Node:

Run AutoConfig on the Applications tier node using the following syntax :

cd <COMMON_TOP>/admin/scripts/<CONTEXT_NAME>

./adautocfg.sh

5. Shutdown the Listener and Database

-bash-3.2$lsnrctl stop <listener name>

-bash-3.2$ sqlplus '/as sysdba'

SQL> shut immediate

6. Change the hostname

Change old name to new name in /etc/hosts file:

127.0.0.1 localhost.localdomain
<ip_address> <node_name>.<domain_name> 

Verify that the /etc/sysconfig/network file contains an entry that is similar to the following:

Check /etc/sysconfig/network file have entry like hostname as below and change to new hostname

-bash-3.2$ ls -ltr /etc/sysconfig/network
-rw-r--r-- 1 root root 129 Sep 26  2012 /etc/sysconfig/network
-bash-3.2$ cat /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes
HOSTNAME=<node_name>.<domain_name>
GATEWAY=<IP>
GATEWAYDEV=eth0
NETWORKING_IPV6=no

Check and remove /etc/sysconfig/networking/profiles/default/network file.

Reboot the server.

7. Start the Database and listener
     Source you new environment file
    -bash-3.2$ sqlplus '/as sysdba'
     SQL> startup
    -bash-3.2$lsnrctl start <listener name>

8. Start the Applications
cd $COMMON_TOP/admin/scripts/<SID_hostname>
./adstrtal.sh apps/<appspasswd>

Change hostname for E-Business Suite Release 12 on single node in Linux

Below Scenario Database and Applications are in Same Server.

1. DB Tier: Deregister the current database server

Current database server node needs to be de-registered. 

Check server name:

select NAME, SERVER_TYPE 
from FND_APP_SERVERS, FND_NODES 
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID 
and SERVER_TYPE='DB' 
and FND_NODES.NODE_NAME='old_hostname';

NAME SERVER_TYPE 
--------------- ----------- 
host_<SID>_DB DB 

Need to deregister the current database server: 

perl $ORACLE_HOME/appsutil/bin/adgentns.pl appspass=<APPSpwd> contextfile=./<SID>_oldhost.xml -removeserver

Verification:

select NAME, SERVER_TYPE 
from FND_APP_SERVERS, FND_NODES 
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID 
and SERVER_TYPE='DB' 
and FND_NODES.NODE_NAME='old_hostname';

no rows selected.

2. DB Tier: Create a new Context file

You can create the new context file using whichever of the following methods: 

a. Manual Method: 

cd $ORACLE_HOME/appsutil 
cp <SID>_oldhost.xml <SID>_newhost.xml

Edit <SID>_newhost.xml file and replace all oldhost with newhost

b. Script Method:

perl $ORACLE_HOME/appsutil/clone/bin/adclonectx.pl contextfile=$CONTEXT_FILE

Provide values as per new hostname

3. APPS Tier: Deregister the current Applications server

Check server name:

select NAME, SERVER_TYPE 
from FND_APP_SERVERS, FND_NODES 
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID 
and SERVER_TYPE='APPS' 
and FND_NODES.NODE_NAME='old_hostname';

NAME SERVER_TYP 
----------------- ---------- 
oldhost_<SID>_APPS APPS 

Executing following commands to deregister the current Applications server: 
cd $APPL_TOP/admin 
perl $AD_TOP/bin/adgentns.pl appspass=<APPSpwd> contextfile=./<SID>_oldhost.xml -removeserver

Verification:

select NAME, SERVER_TYPE 
from FND_APP_SERVERS, FND_NODES 
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID 
and SERVER_TYPE='APPS' 
and FND_NODES.NODE_NAME='old_hostname';

no rows selected.

4. APPS Tier: Create a new Context file

You can create the new context file using whichever of the following methods: 

a. Manual Method: 

cd $APPL_TOP/admin 
cp <SID>_oldhost.xml <SID>_newhost.xml

Edit <SID>_newhost.xml file and replace all oldhost with newhost

b. Script Method:

cd $INST_TOP/appl/admin 
perl $COMMON_TOP/clone/bin/adclonectx.pl contextfile=./<SID>_oldhost.xml

Provide values as per new hostname

5. Shutdown the Applications

cd $INST_TOP/admin/scripts 

./adstpall.sh apps/<appspasswd>

6. Change the server machine hostname.


7. Run Autocofig on DB and Application Nodes

DB Side:

cd $ORACLE_HOME/appsutil/bin
./adconfig.sh contextfile=./<SID>_newhost.xml

APPS Side:

cd $ADMIN_SCRIPTS_HOME
./adconfig.sh contextfile= <SID>_newhost.xml appspass=<appspasswd>

8. Shutdown the database and listener

-bash-3.2$lsnrctl stop <listener name>

-bash-3.2$ sqlplus '/as sysdba'

SQL> shut immediate

9. Start the listener and database

     Source you new environment file
    
    -bash-3.2$ sqlplus '/as sysdba'
   
     SQL> startup
    
    -bash-3.2$lsnrctl start <listener name>
    
10.Start the Application Tier Services

    cd $ADMIN_SCRIPTS_HOME
    
    ./adstrtal.sh apps/<appspasswd>

Monday, June 6, 2016

CORRUPTION DETECTED: In redo blocks starting at block 135169 count 2048 for thread 1 sequence 15821

Issue:

Faced issue while setup new DR instance, getting below error in standby alert log.

CORRUPTION DETECTED: In redo blocks starting at block 135169 count 2048 for thread 1 sequence 15821
RFS[2]: Possible network disconnect with primary database


Solution:

The default port assignment for SQL*Net is 1521. This value used by Oracle for SQL*Net but Oracle Data Guard uses the same TCP Port – 1521.

For Cisco firewalls you can disable the SQL*Net ALG globally and then enable it as needed per policy using policy-maps.

Need to Turn off SQL*Net inspect.

We can use "fixup protocol sqlnet" for Turn off SQL*Net.

Ex:

no fixup protocol sqlnet 1521