11 April 2014

How to change RMAN Global script

Connect to Catalog database 

rman target / catalog rman/rman@RMAN

Print RMAN global script 

PRINT GLOBAL SCRIPT level0_backup_full;

Print RMAN global script to a text file


PRINT GLOBAL SCRIPT level0_backup_full TO FILE '/usr/tmp/level0_backup_full.txt';

Modify your text file. 

Update global script from modified file.


REPLACE GLOBAL SCRIPT level0_backup_full FROM FILE '/usr/tmp/level0_backup_full.txt';

Verify again new global script

rman target / catalog rman/rman@RMAN


PRINT GLOBAL SCRIPT level0_backup_full;

9 April 2014

How to configure Enterprise Manager in 11gR2 Database

 Steps to configure Enterprise Manager in 11gR2

[oracle@dev1 bin]$ export ORACLE_HOME=/u01/app/oracle/product/11.3.0
[oracle@dev1 bin]$ export ORACLE_SID=PROD
[oracle@dev1 bin]$ cd $ORACLE_HOME/bin
[oracle@dev1 bin]$

De-register database from emconsole repository

[oracle@dev1 bin]$ ./emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 9, 2014 11:47:46 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 9, 2014 11:48:00 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD/emca_2014_04_09_11_47_46.log.
Apr 9, 2014 11:48:00 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Apr 9, 2014 11:48:00 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 9, 2014 11:49:57 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 9, 2014 11:49:57 AM
[oracle@dev1 bin]$

Register database from emconsole repository

[oracle@dev1 bin]$ ./emca -config dbcontrol db -repos create

STARTED EMCA at Apr 9, 2014 11:50:32 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.3.0 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.3.0

Local hostname ................ dev1.localdomain.com
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.3.0
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 9, 2014 11:51:24 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD/emca_2014_04_09_11_50_31.log.
Apr 9, 2014 11:51:25 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 9, 2014 11:59:04 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 9, 2014 11:59:27 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 9, 2014 12:00:49 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 9, 2014 12:00:58 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 9, 2014 12:01:09 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 9, 2014 12:01:09 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 9, 2014 12:02:21 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 9, 2014 12:02:21 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://dev1.localdomain.com:5500/em <<<<<<<<<<<
Apr 9, 2014 12:02:23 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.3.0/dev1.localdomain.com_PROD/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 9, 2014 12:02:24 PM
[oracle@dev1 bin]$

8 April 2014

How to change IP address of Oracle EBS Instance

1. Change the IP Address in the Server; 

2. Verify the current ip address setup in the Oracle Applications environment. 
Connect as apps user into SQL*Plus and run:

select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from fnd_nodes where node_name = upper('hostname');

3. Run the following command to remove the old ip address from the Oracle Applications tables:

perl $AD_TOP/bin/adgentns.pl appspass=apps contextfile=$CONTEXT_FILE -removeserver 

replace _hostname.xml for the context file name under the $APPL_TOP/admin directory;

then connect to SQL*Plus as apps user and run:

begin
FND_NET_SERVICES.remove_server('', '');
end;
/
commit;
/

replace by the SID of the environment and by hostname in the environment. Both must be entered in upper case.

4. Run autoconfig to populate the values using new IP Address.

5. Confirm the ip address has been changed to the new value changed in the step 1:

select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from fnd_nodes where node_name = upper('hostname');

How to change priority of concurrent request

Change the priority of the concurrent request

By changing priority of concurrent request you can run the important concurrent request before non-priority concurrent request.

  1. Open "System Administrator" responsibility. Go to Concurrent > Requests
  2. Select "Specific Requests". In the field called "Requester" put the User ID for whom you want to change priority.
  3. Select "View Details". Change the Priority from default "50". Change it to "10" for high priority. [1 for highest and 99 for lowest].

Change the User priority

You can set the priority of individual user priority. For high priority user [CFO or CEO :-)] the report will get completed the request will soon start to run than a normal priority user. Change the value of profile option "Concurrent:Request Priority" in User level to make him or her a high or low priority user.

Alternatively you can change the priority of a "Concurrent Request" in define concurrent request screen.

You can do the following two steps to increase the performance of concurrent manager.


1. Schedule the following concurrent request program "Purge Concurrent Requests And/Or Manager Data".

2. Concurrent manager performance can also be enhanced by increasing the manager cache size to be at lease twice the number of target processes.

Change Concurrent Manager log and output file default location in R12

By default in R12, the Logs and Output are located in $APPLCSF/$APPLLOG and  $APPLCSF/$APPLOUT. 

Change the value of APPLCSF, APPLLOG and APPLOUT  in the context file to your desired location in context file. Make sure the path you have mentioned is accessible from every application node.

Run autoconfig and bounce the concurrent managers for the changes to be implemented.

After this test whether log is getting generated in desired location or not by submitting some sample request.

5 April 2014

Steps to create RMAN Active duplicate in 11gR2

Steps to create RMAN Active duplicate in 11gR2

Introduction
RMAN has the ability to duplicate, or clone, a database from a backup or from an active database. It is possible to create a duplicate database on a remote server with the same file structure, a remote server will a different file structure or the local server with a different file structure.
The article assumes the active duplicate database is being created on a separate server. In this test case the target database is PROD and duplicate database will be TEST.

Preparation of PROD database
  • Create password file on PROD and scp to TEST DB ($ORACLE_HOME/dbs location)
orapwd file=$ORACLE_HOME/dbs/orapwTEST password=password entries=10

scp password file to TEST server ($ORACLE_HOME/dbs location)
  • Make proper entries in tnsnames.ora in both PROD and TEST database
Sample entry as below mention:-
# Generated by Oracle configuration tools.
PROD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dev1.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD) (UR=A)
    )
  )

TEST =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dev2.localdomain.com)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = TEST)(UR=A)
 )
 )

Preparation of TEST database.
  • Create pfile (ORACLE_HOME/dbs/initTEST.ora)
*.DB_NAME=TEST
*.DB_UNIQUE_NAME=TEST
*.diagnostic_dest='/u01/app/oracle'
*.db_block_size=8192
*.Memory_TARGET=843055104
*.COMPATIBLE= 11.2.0.0.0
*.local_listener='(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dev2.localdomain.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TEST)(UR=A)))'
*.log_file_name_convert='/u01/app/oracle/oradata/ora11g/','/u01/app/oracle/oradata/TEST/','/u01/app/oracle/oradata/PROD/','/u01/app/oracle/oradata/TEST/'
*.db_file_name_convert='/u01/app/oracle/oradata/ora11g/','/u01/app/oracle/oradata/TEST/','/u01/app/oracle/oradata/PROD/','/u01/app/oracle/oradata/TEST/'


  • Make proper entries in tnsnames.ora and listener.ora
Sample entry is as below mention
cat tnsnames.ora
# Generated by Oracle configuration tools.
PROD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dev1.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD) (UR=A)
    )
  )

TEST =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dev2.localdomain.com)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = TEST)(UR=A)
 )
)

cat listener.ora
INBOUND_CONNECT_TIMEOUT_LISTENER = 0
TEST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = dev2.localdomain.com)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
    )
  )

SID_LIST_TEST =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/11.3.0)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = TEST)
      (ORACLE_HOME = /u01/app/oracle/product/11.3.0)
      (SID_NAME = TEST)
    )
  )

ADR_BASE_REPL = /u01/app/oracle

  • Make proper directory structure on TEST DB for Datafile and logfile
  •  Test connection from both database (PROD/TEST). We should be able to connect sqlplus from both PROD and TEST database.
sqlplus sys/Welcome123@PROD as sysdba
sqlplus sys/Welcome123@TEST as sysdba

  • Start TEST database in nomount
export ORACLE_HOME= /u01/app/oracle/product/11.3.0
export ORACLE_SID=TEST
export PATH=$ORACLE_HOME/bin:$PATH

sqlplus >startup nomount pfile=’$ORACLE_HOME/dbs/initTEST.ora’
  • Connect with RMAN
rman target sys/Welcome123@PROD
connect auxiliary sys/Welcome123@TEST

[oracle@dev2 dbs]$ rman target sys/Welcome123@PROD

Recovery Manager: Release 11.2.0.3.0 - Production on Sat Apr 5 11:45:02 2014

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

connected to target database: PROD (DBID=255635113)

RMAN> connect auxiliary sys/Welcome123@TEST

connected to auxiliary database: TEST (not mounted)

RMAN>

DUPLICATE TARGET DATABASE TO "TEST" FROM ACTIVE DATABASE;

SQL> select name from v$database;

NAME
---------
TEST

Sqlplus > create pfile from spfile;

Your TEST database is ready now.