Thursday, 30 June 2011

R12 Log Files


R12 – Various LogFiles Locations :

Startup/Shutdown Log files for Application Tier in R12
$LOG_HOME/appl/admin/log/
ServiceLogfile Name
TNS Listener Start/Stop logadalnctl.txt
Fulfillment Server Start/Stop logjtffmctl.txt
Oracle HTTP Server start/stop logadapcctl.txt
Concurrent Managers and ICM start/stop logadcmctl.txt
Forms OC4J start/stop logadformsctl.txt
OACore OC4J start/stop logadoacorectl.txtq
OAFM OC4J start/stop logadoafmctl.txt
OPMN start/stop logadopmnctl.txt
Tech Stack  10.1.3 (Web/HTTP Server) Logs
Log File NameLog File Location
AD script log files (e.g.from adapcctl.sh)$INST_TOP/logs/appl/admin/log
CM Log Files ($APPLCSF/$APPLLOG)$INST_TOP/logs/appl/conc/log
AD tools log files (e.g. ADPATCH)$APPL_CONFIG_HOME/admin/$TWO_TASK/log
OPMN Log Files (text and ODL)$ORA_CONFIG_HOME/10.1.3/opmn/logs (may move to  $INST_TOP/logs/10.1.3/opmn)
Apache Log Files (text and ODL)$INST_TOP/logs/10.1.3/Apache/
OC4J Log Files (text)$INST_TOP/logs/10.1.3/j2ee/oacore/
OC4J Log Files (ODL)$INST_TOP/logs/10.1.3/j2ee/oacore/log/oacore_default_group_1/oc4j
Log files related to cloning in R12:
Preclone log files in source instance
– Database Tier – /$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/(StageDBTier_MMDDHHMM.log)
– Application Tier – $INST_TOP/apps/$CONTEXT_NAME/admin/log/ (StageAppsTier_MMDDHHMM.log)
Clone log files in target instance
– Database Tier – $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ApplyDBTier_.log
– Apps Tier – $INST_TOP/apps/$CONTEXT_NAME/admin/log/ApplyAppsTier_.log
Patching related log files in R12
– Application Tier adpatch log – $APPL_TOP/admin/$SID/log/
– Developer (Developer/Forms & Reports 10.1.2) Patch – $ORACLE_HOME/.patch_storage
– Web Server (Apache) patch – $IAS_ORACLE_HOME/.patch_storage
– Database Tier opatch log – $ORACLE_HOME/.patch_storage
Autoconfig related log files in R12
Database Tier Autoconfig log :
– $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/MMDDHHMM/adconfig.log
– $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/MMDDHHMM/NetServiceHandler.log
Application Tier Autoconfig log :
– $INST_TOP/apps/$CONTEXT_NAME/admin/log/$MMDDHHMM/adconfig.log
Autoconfig context file location in R12
– $INST_TOP/apps/$CONTEXT_NAME/appl/admin/$CONTEXT_NAME.xml
Other log files in R12
Database Tier
Relink Log files :
– $ORACLE_HOME/appsutil/log/$CONTEXT_NAME /MMDDHHMM/ make_$MMDDHHMM.log
Alert Log Files:
– $ORACLE_HOME/admin/$CONTEXT_NAME/bdump/alert_$SID.log
Network Logs:
– $ORACLE_HOME/network/admin/$SID.log
OUI Logs
OUI Inventory Logs :
– $ORACLE_HOME/admin/oui/$CONTEXT_NAME/oraInventory/logs
Application Tier
– $ORACLE_HOME/j2ee/DevSuite/log
– $ORACLE_HOME/opmn/logs
– $ORACLE_HOME/network/logs

Thursday, 16 June 2011

Difference Between Oracle Apps 11i and R12

Difference Between Oracle Apps 11i and R12

Changes at Database Level:
Database Version in 11i  (11.5.9 & 11.5.10) was 9i
In  Oracle Apps Release 12 its  10g R2 (10.2.0.2)
R12 uses Oracle Applications Tablespace Model (OATM)
In R12 Objects are classified by object type and access patterns

Difference between directory structures


In 11i

In R12 New top INSTANCE_TOP added in Release 12 for configuration and log files

In Oracle Apps R12, new TOP is added INSTANCE_TOP in Application Tier.
This TOP contains configuration files (specific to that server) , Certificates (If
SSL is enabled SSL Certificates & any other certificates specific to that server) and
related log files or PID files (for Apache or any other process).
INST_TOP provides following features
1. It provides information about location of data, configuration files.
2. Configuration and log files are centrally contained in the instance configuration home.
3. share code between Applications, Technology Stack.
4. Collection of configuration, logs is much easier since they are centrally located.
5. Can split ownership of apps and technology stack file systems.
6. Ability to place the configuration home on a Network or a local file system for
performance improvement
Tech Stack in 12i
Tech Stack in 11i Application Tier consist of iAS(1.0.2.2.2) & Developer 6i (Forms &
Reports 8.0.6) but in Applications R12 it is build on Fusion Middleware (10g Web
Server and 10g Forms & Reports)
Components differences in Application Tier
A) HTTP Server or Web Server in R12 is Version 10.1.3 which is built on Apache
version 1.3.34. In apps 11i it is Version 1.0.2.2.2 built on Apache Version 1.3.19
B) JServ in apps 11i is replaced by OC4J (mod_jserv is replaced by mod_OC4J)
C) Forms Version 6i in Apps 11i is replaced by Forms 10.1.2.0.2 in R12
D) Reports Version 6i in Apps 11i is replaced by Reports 10.1.2.0.2 in R12
E) JDBC version is changed from version 9 in apps 11i to version 10.2.0 in Apps R12
F) modplsql or mod_pls is removed from Apps R12
G) Java processes use JDK/JRE version 1.5.0 in R12 where as JDK 1.3.1 or 1.4.2 in apps 11i.
Forms Servlet default deployment / communication mode
Default Forms connection mode in Oracle Applications R12 is “SERVLET” where as in
Oracle Apps 11i default form connect mode is “SOCKET”
Oracle Form Servlet Overview in apps R12
Refer to Oracle Metalink Note # 384241.1 Using Forms Socket Mode with Oracle E-
Business Suite Release 12
Metalink Note # 311091.1 Understanding the Network Overhead Of Forms Servlet
Listener Architecture Compared to Forms Server, covers some interesting points w.r.t.
network traffic

Advantage & Disadvantages of Forms Servlet Mode

Simple SSL Configuration (as no separate SSL configuration is required for Forms as
connections are via web/http server)
No port need to open to access forms in firewall.
More secure method of deployment over Internet
Result in more network traffic because of HTTP is more chatty than socket (dedicated)
so not preferred in WAN implementation.

Unified APPL_TOP in Oracle Applications R12

Unified APPL_TOP in Oracle Applications R12 which is different from Separate
APPL_TOP in Oracle Applications 11i.
Unified APPL_TOP make more sense if you are using multi node Oracle Applications R12.
In Oracle Applications 11i , in multi node installation each APPL_TOP have its different
name and files in each APPL_TOP will depend on type of Node (i.e. Forms Node will
have fmx or forms related files where as APPL_TOP belonging to CM only node will
have .rdf or files required to run CM node)
Starting from R12, it will use Unified APPL_TOP which means all files required for all middle tier services are included in all nodes of Multi Node installation (irrespective of services running on that node)
Advantages of Unified APPL_TOP
Cloningof multi node Oracle Application install, only one copy (any one APPL_TOP)
of Application Node files need to copied to target instance.
Cloning of Multi Node to Single Node you don’t have to merge APPL_TOP in R12 as
required in 11i .
Services start/stopIf you are using adstrtall.sh to start services on a node then it will
start services which were configured to start during install on that node (You can still
start a specific service even though it was not suppose to configure/start by calling startup
script of that specific services).
To explain this better, let’s assume you installed multi node R12 instance with Node 1 as
Forms & Web Server where as Node 2 was installed with Concurrent Manager. Now on
Node1 when you use adstrtall.sh script to start services as expected it will start Forms and
Web services but unlike 11i, You can still start Concurrent Manager on Node1 by
running  adcmctl.sh
FND_NODESFrom R12 all nodes will have Y against all services (For multi Node) in
FND_NODES table.

Additional New Feature in R12 

Rapid install
Store Base Configuration in Database
No need to copy config.txt
Multiple Domain Support for Database and Middle Tier
Rapid Install supports deploying the database node and the middle tier node into
different domains.
Shared File System Support
Rapid install allows you to select if app servers are using shared APPL_TOP
No hardcode apps password on Unix file system
FNDCPASS Utility New Feature: Enhance Security With Non-Reversible Hash
Password (enhance FND_USER password security)
Improved Forgot password feature
–Retrieve user_name and password
–no workflow inbound process needed
New environment variables e.g. FORMS_TRACE_DIR
FORMS_ environment variables replace FORMS60_
Delivers native runtime executables for Forms (frmweb) (11i: frmwebx)
Forms Trace in addition to Forms Runtime Diagnostics (FRD) record both built-in Formsdata and performance data in a single output (profile: Forms Runtime Parameters)
Reports Only available through Concurrent Manager
Reports Server is not used
Reports executable rwrun is used directly
APPS Password change made easy, no need to change the password in any files as in
11i.
How to change Oracle Applications Products/Schema Password including APPS ?
As most of you might already be aware that you use FNDCPASS utility on Concurrent
Manager Node to change the password.
FNDCPASS logon 0 Y system/password mode username new_password
WhereMODE is SYSTEM/USER/ORACLE/
ALLORACLE (Introduced with patch 4745998)

Changing APPS Password using FNDCPASS

example FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS  WELCOME
In 11i we need to change the passwords in the below files as it was used and hard coded,
in R12i there is no files where the password is stored, so we need not worry about
changing the passwords in any file, this is due to the security reason,
Only recommended is to run the autoconfig on the Middle Tier after changing the APPS Password.
In 11i files to change after changing Apps Password ?
Once you change apps password you need to change apps password stored in file
wdbsvr.app at $IAS_ORACLE_HOME/Apache/modplsql/cfg
Following Metalink Notes are useful & related to Oracle Applications or Apps Password
–303621.1 How to Change and Which Apps Database Users Passwords Can Be Changed
in a Multi – Node Apps Installation?
–159244.1 How To Use FNDCPASS to Change The Oracle Users, APPS, APPLSYS
and Application Module Passwords (INV, AR, AP, etc.) For Applications 11.5 in UNIX.
– 437260.1 – How to Change Oracle Applications Release 12 Passwords using Oracle
Applications Schema Password Change Utility (FNDCPASS)

Sunday, 8 May 2011

Non-RAC to RAC Conversion

There are several methods  that every one use for Non-RAC to RAC Conversion database . 
Here iam going to use a "rconfig" utility for the conversion.
Steps:-
1>  Convert from Non-ASM to ASM filesystem as per my previous post .


2>  Go to ORACLE_HOME/assistants/rconfig/sampleXMLS
      In the above path we get to see a file " convertToRac.xml "

3> Copy the above file to some location as below
     cp $ORACLE_HOME/assistants/rconfig/sampleXMLS/convertToRac.xml  /tmp/convert2RAC.xml

4> Change the following parameters in /tmp/convert2RAC.xml file
     a) Database SID  b) ASM SID  c) ASM pwd  d) Node names e) Listener port (accordingly)
 
     Sample file:-
========================================================================
xml version="1.0" encoding="UTF-8"?
--n:RConfig xmlns:n="http://www.oracle.com/rconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oracle.com/rconfig"--
--n:ConvertToRAC--
--!-- Verify does a precheck to ensure all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY ----
--n:Convert verify="YES"--
--!--Specify current OracleHome of non-rac database for SourceDBHome ----
--n:SourceDBHome--/u01/app/oracle/product/10g/db_1--/n:SourceDBHome-----your source database home
--!--Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome ----
--n:TargetDBHome--/u01/app/oracle/product/10g/db_1--/n:TargetDBHome-- ---your target database home
--!--Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion ----
--n:SourceDBInfo SID="PROD"---------------your database name
--n:Credentials--
--n:User--sys--/n:User--
--n:Password--oracle--/n:Password--
--n:Role--sysdba--/n:Role--
--/n:Credentials--
--/n:SourceDBInfo--
--!--ASMInfo element is required only if the current non-rac database uses ASM Storage ----
--n:ASMInfo SID="+ASM1"---------------------your ASM Instance name
--n:Credentials--
--n:User--sys--/n:User--
--n:Password--oracle--/n:Password-- ----your ASM instance password
--n:Role--sysdba--/n:Role--
--/n:Credentials--
--/n:ASMInfo--
--!--Specify the list of nodes that should have rac instances running. LocalNode should be the first node in this nodelist. ----
--n:NodeList--
--n:Node name="rac1"/-------your rac1 hostname--n:Node name="rac2"/------your rac2 hostname
--/n:NodeList--
--!--Specify prefix for rac instances. It can be same as the instance name for non-rac database or different. The instance number will be attached to this prefix. ----
--n:InstancePrefix--
PROD--/n:InstancePrefix-----your database name
--!--Specify port for the listener to be configured for rac database.If port="", alistener existing on localhost will be used for rac database.The listener will be extended to all nodes in the nodelist ----
--n:Listener port="1551"/-----listener port number
--!--Specify the type of storage to be used by rac database. Allowable values are CFS|ASM. The non-rac database should have same storage type. ----
--n:SharedStorage type="ASM"------your storage type
--!--Specify Database Area Location to be configured for rac database.If this field is left empty, current storage will be used for rac database. For CFS, this field will have directory path. ----
--n:TargetDatabaseArea-- --/n:TargetDatabaseArea------leave blank
--!--Specify Flash Recovery Area to be configured for rac database. If this field is left empty, current recovery area of non-rac database will be configured for rac database. If current database is not using recovery Area, the resulting rac database will not have a recovery area. ----
--n:TargetFlashRecoveryArea-- --/n:TargetFlashRecoveryArea---leave blank
--/n:SharedStorage--
--/n:Convert--
--/n:ConvertToRAC--
--/n:RConfig--

=================================================================================
5> After modifying the convert2RAC.xml file as above under  /tmp/convert2RAC.xml , run rconfig tool as below


cd $ORACLE_HOME/bin
./rconfig /tmp/convert2RAC.xml


6> Change SID in /etc/oratab as PROD1 in rac1 m/c & PROD2 in rac2 m/c .


7> Finally run srvctl to configure the database
     srvctl config database -d PROD
     srvctl config database -d PROD




Thanks

Saturday, 7 May 2011

Convert ASM to Non-ASM File system

Steps:-
1>
 /u01/oracle>export ORACLE_SID=PROD
/u01/oracle>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 06 13:09:07 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

2> 

Go to init file or spfile , then modify the parameters mentioned above.
/u01/oracle/product/10.2.0/db_1>
/u01/oracle/product/10.2.0/db_1/database>vi initprod.ora
Eg: control_files='/U01/ORACLE/PRODUCT/10.2.0/ORADATA/PROD/CONTROL01.CTL','/U01/ORACLE/PRODUCT/10.2.0/ORADATA/PROD/CONTROL02.CTL’,’/U01/ORACLE/PRODUCT/10.2.0/ORADATA/PROD/CONTROL03.CTL'

3>
Accordingly change the other paths ASM DISK GROUP to normal file system.
u01/oracle/product/10.2.0/db_1/database>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 18 13:24:33 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.

SQL> STARTUP NOMOUNT PFILE='/u01/oracle/product/10.2.0/db_1/database/initPROD.ora
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 192940932 bytes
Database Buffers 411041792 bytes
Redo Buffers 7135232 bytes

4>
Open a new session and connect to RMAN and then copy the controlfile from older location to non-ASM location using the following command:
/u01/oracle/rman>export ORACLE_SID=PROD
/u01/oracle/rman>rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 06 13:27:40 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: prod (not mounted)

RMAN> restore controlfile from '+data/control01.ctl';
Starting restore at 06-MAY-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=/u01/oracle/product/10.2.0/oradata/PROD/CONTROL01.CTL
output filename=/u01/oracle/product/10.2.0/oradata/PROD/CONTROL02.CTL
output filename=/u01/oracle/product/10.2.0/oradata/PROD/CONTROL03.CTL
Finished restore at 06-MAY-11

5>
Now mount the database from existing RMAN session
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1

6>
Now take a backup copy into a file system location, this copied file system Database backup will be used as the actual non-ASM database files .
RMAN> backup as copy database format '/u01/oracle/product/10.2.0/oradata/prod/%U.dbf';
Starting backup at 06-MAY-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=154 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=+DATA/prod/datafile/system.259.711293871
output filename=/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-SYSTEM_FNO-1_08L6C22K.DBF tag=TAG20100218
T233755 recid=11 stamp=711329913
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile fno=00003 name=+DATA/prod/datafile/sysaux.260.711293917
output filename=/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-SYSAUX_FNO-3_09L6C242.DBF tag=TAG20100218
T233755 recid=12 stamp=711329942
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=+DATA/prod/datafile/undotbs1.261.711293941
output filename=/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-UNDOTBS1_FNO-2_0AL6C24R.DBF tag=TAG201002
18T233755 recid=13 stamp=711329949
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=+DATA/prod/datafile/users.262.711293945
output filename=/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-USERS_FNO-4_0BL6C24U.DBF tag=TAG20100218T
233755 recid=14 stamp=711329952
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=/u01/oracle/product/10.2.0/oradata/PROD/CF_D-PROD_ID-2256105880_0CL6C252.DBF tag=TAG20100218T233755 recid=15
stamp=711329955
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 06-MAY-11

7>
RMAN> switch database to copy;
datafile 1 switched to datafile copy "/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-SYSTEM_FNO-1_08L6C2
2K.DBF"
datafile 2 switched to datafile copy "/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-UNDOTBS1_FNO-2_0AL6
C24R.DBF"
datafile 3 switched to datafile copy "/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-SYSAUX_FNO-3_09L6C2
42.DBF"
datafile 4 switched to datafile copy "/u01/oracle/product/10.2.0/oradata/PROD/DATA_D-PROD_I-2256105880_TS-USERS_FNO-4_0BL6C24
U.DBF"

8>
Switch the tempfiles from ASM to non-ASM ,
RMAN> run{
2> set newname for tempfile 1 to '/u01/oracle/product/10.2.0/oradata/PROD/tempfile';
3> switch tempfile all;
4> }
executing command: SET NEWNAME
renamed tempfile 1 to /u01/oracle/product/10.2.0/oradata/PROD/tempfile in control file

9>
Now our database is switched from ASM to non- ASM
Now you can open the database
RMAN> ALTER DATABASE OPEN (RESETLOGS);
database opened

Now, and create new redo log files in the non-ASM file system and drop the existing ASM ONLINE LOG FILES:
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- --------------------------------------------------
3 +DATA/prod/onlinelog/group_3.265.711296273
2 +DATA/prod/onlinelog/group_2.266.711296283
1 +DATA/prod/onlinelog/group_1.265.711296273

SQL> ALTER DATABASE ADD LOGFILE GROUP 4 ('/u01/oracle/product/10.2.0/oradata/PROD/REDO04.LOG');
Database altered.
SQL> ALTER DATABASE ADD LOGFILE GROUP 5 ('/u01/oracle/product/10.2.0/oradata/PROD/REDO05.LOG');
Database altered.
SQL> ALTER DATABASE ADD LOGFILE GROUP 6 ('/u01/oracle/product/10.2.0/oradata/PROD/REDO06.LOG');
Database altered.

SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- --------------------------------------------------
6 /u01/oracle/product/10.2.0/oradata/PROD/REDO06.LOG
5 /u01/oracle/product/10.2.0/oradata/PROD/REDO05.LOG
4 /u01/oracle/product/10.2.0/oradata/PROD/REDO04.LOG
1 +DATA/prod/onlinelog/group_1.265.711296273
2 +DATA/prod/onlinelog/group_2.266.711296283
3 +DATA/prod/onlinelog/group_3.267.711296293
6 rows selected.

Make sure that the ASM online redo logfiles are not in current/active state.
SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
Database altered.
SQL> ALTER DATABASE DROP LOGFILE GROUP 2;
Database altered.
SQL> ALTER DATABASE DROP LOGFILE GROUP 3;

SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- ---------------------------------------------
6 /u01/oracle/product/10.2.0/oradata/PROD/REDO06.LOG
5 /u01/oracle/product/10.2.0/oradata/PROD/REDO05.LOG
4 /u01/oracle/product/10.2.0/oradata/PROD/REDO04.LOG


Convert Non-ASM to ASM File system


Overview:-

1.configure flash recovery area.

2.Migrate datafiles to ASM.
3.Control file to ASM.
4.Create Temporary tablespace.
5.Migrate Redo logfiles
6.Migrate spfile to ASM.


Innerview:-
step 1:Configure flash recovery area.

SQL> connect sys/sys@prod1 as sysdba
Connected.
SQL> alter database disable block change tracking;
Database altered.
SQL> alter system set db_recovery_file_dest_size=500m;
System altered.

SQL> alter system set db_recovery_file_dest=’+RECOVERYDEST’;
System altered
step 2& 3: Migrate data files and control file to ASM.

use RMAN to migrate the data files to ASM disk groups.
All data files will be migrated to the newly created disk group, DATA
SQL> alter system set db_create_file_dest='+DATA';
System altered.

SQL> alter system set control_files='+DATA/cnt1.dbf' scope=spfile;
System altered.

SQL> shut immediate

[oracle@rac1 bin]$ rman target/XXXX


RMAN> startup nomount
Oracle instance started


RMAN> restore controlfile from '/u01/oracle/oradata/PROD/control01.ctl';
Starting restore at 06-MAY-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=256 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/cnt1.dbf
Finished restore at 06-MAY-11
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1

RMAN> backup as copy database format '+DATA';Starting backup at 06-MAY-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=256 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/oracle/oradata/PROD/system01.dbf
output file name=+DATA/PROD/datafile/system.257.705063763 tag=TAG20091208T110241 RECID=1 STAMP=705064274
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:08:39
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/oracle/oradata/PROD/sysaux01.dbf
output file name=+DATA/PROD/datafile/sysaux.258.705064283 tag=TAG20091208T110241 RECID=2 STAMP=705064812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:08:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/oracle/oradata/PROD/undotbs01.dbf
output file name=+DATA/PROD/datafile/undotbs1.259.705064821 tag=TAG20091208T110241 RECID=3 STAMP=705064897
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/PROD/controlfile/backup.260.705064907 tag=TAG20091208T110241 RECID=4 STAMP=705064912
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/oracle/oradata/PROD/users01.dbf
output file name=+DATA/PROD/datafile/users.261.705064915 tag=TAG20091208T110241 RECID=5 STAMP=705064915
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 06-MAY-11
channel ORA_DISK_1: finished piece 1 at 06-MAY-11
piece handle=+DATA/PROD/backupset/2009_12_08/nnsnf0_tag20091208t110241_0.262.705064919 tag=TAG20091208T110241 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-MAY-11
RMAN> switch database to copy;datafile 1 switched to datafile copy "+DATA/PROD/datafile/system.257.705063763"
datafile 2 switched to datafile copy "+DATA/PROD/datafile/sysaux.258.705064283"
datafile 3 switched to datafile copy "+DATA/PROD/datafile/undotbs1.259.705064821"
datafile 4 switched to datafile copy "+DATA/PROD/datafile/users.261.705064915"
RMAN> alter database open;
database opened

RMAN> exit
Recovery Manager complete.
SQL> conn sys/oracle as sysdba
Connected.

SQL> select tablespace_name,file_name from dba_data_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ---------------------------------------------

USERS                          +DATA/PROD/datafile/users.261.705064915

UNDOTBS1                       +DATA/PROD/datafile/undotbs1.259.705064821

SYSAUX                         +DATA/PROD/datafile/sysaux.258.705064283

SYSTEM                         +DATA/PROD/datafile/system.257.705063763

SQL> select name from v$controlfile;
NAME
----
+DATA/cnt1.dbf

NO       16384            594
step 4:Migrate temp tablespace to ASM.

SQL> alter tablespace temp add tempfile size 100m;
Tablespace altered.

SQL> select file_name from dba_temp_files;
FILE_NAME
---------------------------------------------
+DATA/PROD/tempfile/temp.263.705065455

otherwise,Create temporary tablespace in ASM disk group.

SQL> CREATE TABLESPACE temp1 ADD TEMPFILE ‘+diskgroup1’;
step 5:Migrate redo logs to ASM.

SQL> select member,group# from v$logfile;
MEMBER                                                 GROUP#
-------------------------------------------------- ----------

/u01/oracle/oradata/PROD/redo03.log                     3

/u01/oracle/oradata/PROD/redo02.log                     2

/u01/oracle/oradata/PROD/redo01.log                     1

SQL> alter database add logfile group 4 size 5m;
Database altered.

SQL> alter database add logfile group 5 size 5m;
Database altered.

SQL> alter database add logfile group 6 size 5m;
Database altered.

SQL> select member,group# from v$logfile;

MEMBER                                                 GROUP#
-------------------------------------------------- ----------

/u01/oracle/oradata/PROD/redo03.log                     3

/u01/oracle/oradata/PROD/redo02.log                     2

/u01/oracle/oradata/PROD/redo01.log                     1

+DATA/PROD/onlinelog/group_4.264.705065691                  4

+DATA/PROD/onlinelog/group_5.265.705065703                  5

+DATA/PROD/onlinelog/group_6.266.705065719                  6

SQL> alter system switch logfile;
System altered.

SQL> alter database drop logfile group 2;
Database altered.

SQL> alter database drop logfile group 3;
Database altered.

SQL> alter database drop logfile group 4;
Database altered.

SQL> alter database drop logfile group 1;
Database altered.
Add additional control file.
If an additional control file is required for redundancy,
you can create it in ASM as you would on any other filesystem.
SQL> connect sys/sys@prod1 as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.

SQL> alter database backup controlfile to '+DATA/cf2.dbf';
Database altered.

SQL> alter system set control_files='+DATA/cf1.dbf '
  ,'+DATA/cf2.dbf' scope=spfile;
System altered.

SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

SQL> select name from v$controlfile;
NAME
---------------------------------------
+DATA/cf1.dbf
+DATA/cf2.dbf
step 6:Migrate spfile to ASM:

Create a copy of the SPFILE in the ASM disk group.
In this example, the SPFILE for the migrated database will be stored as +DISK/spfile.

If the database is using an SPFILE already, then run these commands:

run {
BACKUP AS BACKUPSET SPFILE;
RESTORE SPFILE TO "+DISK/spfile";
}

If you are not using an SPFILE, then use CREATE SPFILE
from SQL*Plus to create the new SPFILE in ASM.
For example, if your parameter file is called /u02/init.ora,
use the following command:

SQL> create spfile='+DISK/spfile' from pfile='/u02/init.ora'

Sunday, 24 April 2011

Hello Every one,

Now its my turn to blog about the Oracle stuff...

Thanks for visiting and contribution...

Thanks