Tuesday, August 27, 2013

patch during patch


How to Apply an 11i Patch When adpatch is Already Running

1.  Using the adctrl utility, shutdown the workers.
    a. adctrl
    b. Select option 3 "Tell worker to shutdown/quit"

2.  Backup the FND_INSTALL_PROCESSES table which is owned by the APPLSYS schema
    a. sqlplus applsys/<password>
    b. create table fnd_Install_processes_back
       as select * from fnd_Install_processes;
    c. The 2 tables should have the same number of records.
       select count(*) from fnd_Install_processes_back;
       select count(*) from fnd_Install_processes;

3.  Backup the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. create table AD_DEFERRED_JOBS_back
       as select * from AD_DEFERRED_JOBS;
    c. The 2 tables should have the same number of records.
       select count(*) from AD_DEFERRED_JOBS_back;
       select count(*) from AD_DEFERRED_JOBS;

4.  Backup the .rf9 files located in $APPL_TOP/admin/<SID>/restart directory.
    At this point, the adpatch session should have ended and the cursor should 
    be back at the Unix prompt.
    a. cd $APPL_TOP/admin/<SID>
    b. mv restart restart_back
    c. mkdir restart

5.  Drop the FND_INSTALL_PROCESSES table and the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. drop table FND_INSTALL_PROCESSES;
    c. drop table AD_DEFERRED_JOBS;

6.  Apply the new patch.

7.  Restore the .rf9 files located in $APPL_TOP/admin/<SID>/restart_back
    directory.
    a. cd $APPL_TOP/admin/<SID>
    b. mv restart restart_<patchnumber>
    c. mv restart_back restart 

8. Restore the FND_INSTALL_PROCESSES table which is owned by the APPLSYS
    schema.
    a. sqlplus applsys/<password>
    b. create table fnd_Install_processes
       as select * from fnd_Install_processes_back;
    c. The 2 tables should have the same number of records.
       select count(*) from fnd_Install_processes;
       select count(*) from fnd_Install_processes_back;

9. Restore the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. create table AD_DEFERRED_JOBS
       as select * from AD_DEFERRED_JOBS_back;
    c. The 2 tables should have the same number of records.
       select count(*) from AD_DEFERRED_JOBS_back;
       select count(*) from AD_DEFERRED_JOBS;

10. Re-create synonyms
    a. sqlplus apps/apps
    b. create synonym AD_DEFERRED_JOBS for APPLSYS.AD_DEFERRED_JOBS;
    c. create synonym FND_INSTALL_PROCESSES FOR APPLSYS.FND_INSTALL_PROCESSES;

11. Start adpatch, it will resume where it stopped previously.

Rapid Clone R12.1.3 Basic steps

Rapid Clone R12.1.3 Basic steps

Cloning Oracle Applications Release 12 with Rapid Clone [ID 406982.1]


PRECLONE PART





1) DB Tier preparation for Cloning




login in as Oracle user

Run the following commands:

RDBMS HOME = $ORACLE_HOME

$ cd $ORACLE_HOME/appsutil/scripts/<context_name>
$ perl adpreclone.pl dbTier




2) Apps Tier preparation for Cloning




login in as applmgr user 


Run Pre-Clone on all the nodes that contains an APPL_TOP.

$cd $INST_TOP/admin/scripts
$perl adpreclone.pl appsTier



COPY PART








3) Application copy





Copy or Tar ball or sftp source system application tier file system to the target system.

Note: You need not to shutdown your source system application node for this step.

File System which need to be Tar ball or sftp to target system from Source System 
includes:

APPL_TOP

COMMON_TOP

ORACLEAS_10.1.2_ORACLE_HOME

ORACLEAS_10.1.3_ORACLE_HOME





4) Database copy



below is the method for cold copy :

copy or TAR ball or sftp source system database tier file system to the target system.

a) This step require you bring down your source sytem (i.e database node) as user oracle. 
b) Shutdown normal the source system database
c) copy the database (.dbf) files from the source to the target system
d) copy or TAR ball or sftp the source database ORACLE_HOME to the target system.


you can go for hot backup by RMAN of source database, moving the backup pieces to the target node and doing recovery. By this method you don't have to bring down Source database





Activities on target






5) DBTier Configuration and then start the Target System database Server



login in as Oracle user


RDBMS_HOME = $ORACLE_HOME

$ cd $ORACLE_HOME/appsutil/clone/bin

$ perl adcfgclone.pl dbTier



You will be prompted wfor the values specific to the target system like SID,port etc.






6)  Apps Tier configuration on Target system application Server nodes




$ cd $INST_TOP/admin/scripts
$ adautocfg.sh

Oracle APPS R12.1.3 Rapid Clone Application and Database

Pre clone Activity

Database Tier
$ su – <dbuser>
$ cd <db script home> (ex:/u01/orcln/crp/db/tech_st/11.1.0/appsutil/scripts/)
$ sh adautocfg.sh
Pwd: apps

$ perl adpreclonr.pl dbTier
Prompt Pwd: apps

$ exit

Application Tier

$ su– <application user>testcrp
$ cd <application script home> (ex: /u01/orcln/crp/apps/inst/apps/TEST10_vis/admin/scripts)
$ sh adautocfg.sh
Pwd: apps

$ perl adpreclone.pl appsTier
$ exit

Stop Instance
and ensure all process are stop

Login as root
copy all folder(apps,db,inst) to destination
$ cp –R <source>(/u01/orcln/crp/*) <destination>( /b01/UAT/)

After completion of copy change permission and ownership:-
$ chown – R orauat:dba db
$ chown – R appluat:dba apps
$ chown – R appluat:dba inst

$ chmod –R 777 db

$chmod –R 777 apps
$chmod –R 777 inst
Post Clone Activity database
$ su – <new db user> orauat
$ cd <clone/bin> (ex:/b01/UAT/db/tech_st/11.1.0/appsutil/clone/bin)
$ perl adcfgclone.pl dbTier
Prompt Pwd: apps

Target system host name : <host name> (test)
RAC(Y/N): N
Target system Database SID: <SID> (UAT)
Target system: /b01/UAT/db/tech_st/11.1.0
Target system utl_file_dir Directody list : /usr/tmp
DATA_TOP: 1
DATA_TOP_Directory: /b01/UAT/db/apps_st/data
ORACLE_HOME Directory: /b01/UAT/db/tech_st/11.1.0
Do you want to preserve display : y
Target system port pool : 6
$ exit

Checking for database connection (database up or not)

Post Clone Activity Application
$ su – <new application user>(appluat)
$ cd /b01/UAT/apps/apps_st/comn/clone/bin
$ perl adcfgclone.pl appsTier
Prompt Pwd: apps
Host name : test
SID : <sid> (UAT)
Database server node : vis
System database domain name : kross.com
System base directory : - /b01/UAT/apps/apps_st/appl
System tool oracle_home: - /b01/UAT/apps/tech_st/10.1.2
System web oracle_home :- /b01/UAT/apps/tech_st/10.1.3
System appl_top:- /b01/UAT/apps/apps_st/appl
System common_top:- /b01/UAT/apps/apps_st/comn
System instance home:- /b01/UAT/apps/inst
<accept other default value by pressing enter>

Preserve display: y
Port pool : 6
Appltmp : - 1( /usr/tmp)
Do you want to startup application services: y

Stop and start new instance

Run Autoconfig on Database
Run Autoconfig on Application

Stop and start New instance

Step by step Oracle Apps R12.1.3 Rapid Cloning

Step by step Oracle Apps R12.1.3 Rapid Cloning

Prerequisite Steps
1. If your target server holds at least one Oracle Apps R12.1.3 instance, you can skip for any OS patch or software requirement section. As the server is running a Oracle Apps instance, we can assume the server has all the

mandatory OS patch and required software. Else look into the metalink for platform specific requirements.
2. Apply Latest AD patch
Check whether AD patch version is atleast R12.AD.B.3. You can check that using following query.
SELECT patch_level FROM fnd_product_installations WHERE patch_level LIKE 'R12.AD%'
If it is below that level apply patch 9239089.
3. Apply the latest AutoConfig template patch
Update the Oracle Applications file system with the AutoConfig files by applying the latest AutoConfig Template patch (Patch 9386653 for 12.0.X customers and Patch 8919489 for 12.1.X customers) to all application tier nodes in the Applications instance. You can check whether this patch is already there or not in your system by the following sql.
SELECT * FROM ad_applied_patches WHERE patch_name = '8919489'
4. Apply the latest Rapid Clone patches
For Release 12.1 apply following patches.
9171651:R12.OAM.B 12.1 RAPIDCLONE CONSOLIDATED FIXES JUL/2010
9833058:R12.OAM.B HOT CLONE FAILS WITH ORA-00201 DURING RECOVERY MANAGER 
12404574:R12.OAM.B ORACLE_HOME REGISTRATION DOES NOT HAPPEN WITH CENTRAL INVENTORY ON LOZ 
12598630:R12.OAM.B R12.1 ONE-OFF FOR S_DB_LISTENER BUG 12362010
5. Run AutoConfig on the application tiers
Follow the steps under section " Run AutoConfig on the Application Tiers " in My Oracle Support Knowledge Document 387859.1 to run AutoConfig on all application tier nodes.
6. Synchronize appsutil on the database tier nodes
Follow the steps under section "Copy AutoConfig to the RDBMS ORACLE_HOME" in My Oracle Support Knowledge Document 387859.1 to copy AutoConfig and Rapid Clone files to each database node via the admkappsutil.pl utility.
7. Run AutoConfig on the database tier
Follow the steps under section "Run AutoConfig on the Database Tier" in My Oracle Support Knowledge Document 387859.1 to run AutoConfig on the database tier nodes.
8. Maintain Snapshot Information
Log in to each application tier node as the APPLMGR user, and run "Maintain Snapshot Information" in AD Administration. To update the snapshot, please select the following options "Update Current View Snapshot" and "Update Complete APPL_TOP".
Cloning Steps
9. Prepare the source system
Execute the following commands to prepare the source system for cloning.
Prepare the source system database tier for cloning
Log on to the source system as the ORACLE user, and run the following commands.
$ cd [RDBMS ORACLE_HOME]/appsutil/scripts/[CONTEXT_NAME]
$ perl adpreclone.pl dbTier b.

Prepare the source system application tier for cloning
Log on to the source system as the APPLMGR user, and run the following commands on each node that contains an APPL_TOP:
$ cd [INST_TOP]/admin/scripts
$ perl adpreclone.pl appsTier
10. Shutdown the source system. Copy full directory "apps" and "db" from source system to target system. Use the following command for copy.
$ cp -RH
11. Configure the target system
Run the following commands to configure the target system. You will be prompted for specific target system values such as SID, paths, and ports.
a.Configure the target system database server
Log on to the target system as the ORACLE user and enter the following commands.
$ cd [RDBMS ORACLE_HOME]/appsutil/clone/bin
$ perl adcfgclone.pl dbTier b.Configure the target system application tier server nodes
Log on to the target system as the APPLMGR user and enter the following commands:
$ cd [COMMON_TOP]/clone/bin
$ perl adcfgclone.pl appsTier

Oracle EBS from R12.1.1 to 12.1.3

Objective:
To describe the procedure I have followed in upgrading our Oracle EBS Release 12.1.1 to 12.1.3. While the procedure mentioned in this blog are the exact steps I have followed (including the commands issued) the best document to read about the upgrade is Oracle support note 1080973.1.
Our Oracle Server current configuration:-
a. Hardware and host environment:-
> Base server:  Windows 7 Professional 64-bit, CPU = Intel Core i7-2600 @3.40GHz, RAM = 16.0 GB
> VMware platform on top of Windows 7:- VMware Server 2.0.2
> Virtual machine specifications:-
  Operating system type = Red Hat Enterprise Linux 4 (32-bit)
  HDD space allocated = 400GB
  RAM allocated = 8.0 GB
b. Oracle EBS server (current) – Vision instance
 hostname = ls1.skysys.com.au  (alias “ls1″)
 Installation home = /home/oracle/VIS
 Oracle Database version = 11.1.0.7
  Applications Release name/version = 12.1.1
Upgrade procedure followed:-
1. I have downloaded following patches and extracted into /home/oracle/R12-Patches directory.
9239089
9239090
9817770
9966055
9239095
2. Stopped all application tier services.
$ /home/oracle/VIS/inst/apps/VIS_ls1/admin/scripts/adstpall.sh apps/******
I kept the Oracle Enterprise Manage DB console service running as it helped me monitor the database performance, tablespaces health, etc.
3. Switched the instance into maintenance mode.
$cd /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$adadmin defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=adadmin.log menu_option=ENABLE_MAINT_MODE workers=4
4. Run adgrants.sql as a pre-requisite for the first patch 9239089
- “adgrants.sql” is a file extracted out of 9239089 patch. Copied this sql script into $ORACLE_HOME/appsutil/admin directory.
$ cd /home/oracle/VIS/db/tech_st/11.1.0/appsutil/admin
$ sqlplus /nolog
SQL> @adgrants.sql apps
—- adgrants.sql executed and database changes committed.
SQL> exit
5. Applied the first patch 9239089.
$ cd /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$ . APPSVIS_ls1.env
$adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=u9239089.log patchtop=/home/oracle/VIS/R12-Patches/9239089 driver=u9239089.drv workers=8
6. Applied the second patch 9239090.
$ cd /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$ . APPSVIS_ls1.env
$adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=u9239090.log patchtop=/home/oracle/VIS/R12-Patches/9239090 driver=u9239090.drv workers=8
The 9239090 patch ran for nearly 12 hours. There was an incident when one of the workers has failed and I have to skip the job (worker) by using “adctl” utility.
7. Applied the next patch 9239095.
$ /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$ . APPSVIS_ls1.env
$ adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=u9239095.log patchtop=/home/oracle/VIS/R12-Patches/9239095 driver=u9239095.drv workers=8
Now moved on to the post update steps:-
8. Applied the mandatory post-install patch 981770.
$ cd /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$ . APPSVIS_ls1.env
$ adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=u9817770.log patchtop=/home/oracle/VIS/R12-Patches/9817770 driver=u9817770.drv workers=8
9. Applied the second mandatory post-install patch 9966055.
$ cd /home/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$ . APPSVIS_ls1.env
$ adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=u9966055.log patchtop=/home/oracle/VIS/R12-Patches/9966055 driver=u9966055.drv workers=8
10. Updated the DB tier with the EBS 12.1.3 code level
$ cd $APPL_TOP
$ . APPSVIS_ls1.env
> Executed the admkappsutil.pl utility to create the appsutil.zip
$ cd $AD_TOP/bin
$ admkappsutil.pl
> As the outcome of the above script the appsutil.zip got created into the $INST_TOP/admin/out directory.
> Copied appsutil.zip (created in previous step) to $ORACLE_HOME
$ cp $INST_TOP/admin/out/appsutil.zip $ORACLE_HOME
> Unzipped the appsutil.zip at $ORACLE_HOME
$ cd $ORACLE_HOME
$ unzip -o appsutil.zip
> Executed the autoconfig utilities on Database tier:
$ perl $ORCLE_HOME/appsutil/bin/adbldxml.pl
$ cd $ORACLE_HOME/appsutil/bin
$ sh adconfig.sh
11. Executed the adpreclone.pl on database tier and then on the applications tier.
$ cd $ORACLE_HOME
$ . VIS_ls1.env        — sourced database environment
$perl appsutil/bin/adpreclone.pl dbTier
$ cd $APPL_TOP/appl/scripts
$ . /VIS_ls1.env        — sourced application environment
$ perl $INST_TOP/appl/appsutil/bin/adpreclone.pl dbTier
12. Got the environment back to normal from maintenance mode.
$adadmin defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=adadmin.log menu_option=DISABLE_MODE workers=4
13. Inquired the Oracle EBS code level to see the upgrade is all well.
$ cd $ORALE_HOME
$ . VIS_ls1.env
$ sqlplus apps/*****
SQL> select release_name from fnd_product_groups;
RELEASE_NAME
———————————————-
12.1.3
13. Restarted the application services.
$ cd $ADMIN_SCRIPTS_HOME
$ sh adstrtal.sh apps/*****
We have got our Oracle EBS 12.1.3 ready to play (learn I mean).
Thank you for visiting our blog. Have a great day.

upgrade Oracle EBS R12.1.1 to 12.1.3

How to upgrade Oracle EBS R12.1.1 to 12.1.3

Here are the complete guidelines to upgrade Oracle Ebusiness Suite to 12.1.3 from 12.1.1. Before upgrade our database version was 11.1.0.7.
Although we have followed the doc Oracle E-Business Suite Release 12.1.3
Readme [ID 1080973.1], we have done some changes in the steps for successful upgrade.

Oracle Apps 12.1.3 upgrade is only possible if your system is in 12.1.1 or upper version. If you have not upgraded your EBS to 12.1.1 version you can follow the following article to do so.




Prerequisite Steps

Step 1

At first make some changes in the database parameters for upgrade. You need to set the following parameters using initialization file.

recyclebin=false
_pga_max_size=104857600
_disable_fast_validate = TRUE

Use the following kind of comand to changes the mentioned three parameters.
alter system set "_disable_fast_validate"=FALSE SCOPE=BOTH;

[If you don't change the _pga_max_size to greater than 104857600. You may get the following error during upgrade.
ORA-04030: out of process memory when trying to allocate 822904 bytes
(pga heap,kco buffer)
ORA-07445: exception encountered: core dump [dbgtfdFileWrite()+48]
[SIGSEGV] [ADDR:0xFFFFFFFF7FFC1C88] [PC:0x1063BD2D0] [Address not mapped
to object] []]

For additional information check the Document 761570.1





Step 2

Apply the specific database patches as applicable for your database by following Database Preparation Guidelines for an E-Business Suite Release 12.1.1 Upgrade [ID 761570.1] .

[Our oracle inventory was corrupted, so, I have created a local inventory for opatch application and applied the patches. For opatch issues you can check the following articles.
Additionally you can apply the opatch with no_inventory option in this situation.
opatch apply no_inventory]



Step 3

If you are already upgraded to 12.1.1 version, you have already upgraded form tier and web tier. So, no action is required for form and web tier upgrade. But, you can always check the latest doc for form and web tier latest patches.



Main Upgrade Patch Application

Step 4

Download the following two patches from metalink 9239089, 9239090.
Using autopatch utility first apply R12.AD.B.DELTA.3 Patch 9239089. Then apply the main upgrade patch 9239090.
The main patch application has taken more than three days to complete in our environment. Our system is 8 CPU solaris box with 16 GB RAM. The main patch failed two times with error. We have fixed the errors using adctrl utility and resumed the patch application.



Post upgrade steps

Step 5

Apply the following two patches immediately after upgrade 9817770, 9966055.




Step 6

Source the application env file. Then run autoconfig in apps tier.
$ $ADMIN_SCRIPTS_HOME/adautocfg.sh

Now generate the appsutil.zip file.
$ perl /bin/admkappsutil.pl

Copy appsutil.zip file in DB_HOME. Unzip the appsutil.zip file.

After sourcing the database env file run autoconfig in database tier.



Step 7

Now run preclone in db tier first, then in apps tier.

perl adpreclone.pl dbTier
perl adpreclone.pl appsTier




Step 8

Apply the language patch of the main patch 9239090 if applicable in your environment. In our case French was the additional language that is installed in our system. So, we have applied the french version of 9239090 in this step.



Step 9

Do the step 6 and step 7 again after applying language pack. Then, restrat the whole apps tier and database tier.

This step is not mentioned in the upgrade doc. But, if you don't do it your application login page will not open.



Step 10

Login to the Oracle EBS and check the version. Now, start testing individual product.









Reference document
Oracle E-Business Suite Release 12.1.3 Readme [ID 1080973.1]
Database Preparation Guidelines for an E-Business Suite Release 12.1.1 Upgrade [ID 761570.1]
Database Initialization Parameters for Oracle Applications Release 12 [ID 396009.1]
Oracle® E-Business Suite Upgrade Guide




-----------------------------------
Issue faced 1
ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column

Check the following url for solution.
http://forums.oracle.com/forums/thread.jspa?threadID=415560&tstart=15

Thursday, August 22, 2013

Upgrading Oracle 10g to Oracle 11g

Step by Step Upgrading Oracle 10g to Oracle 11g

Pre-Requisite:

You should have the Oracle database 10g, which you want to migerate.
Also here we are upgrading to Oracle Database 11g – Beta 6 (11.1.0.6)

Step 1) Installing Oracle 11g Home

We cannot upgrade the existing Oracle Home, since 11g is not a patchset. We have to install 11g oracle home as a seperate ORACLE_HOME in parallel to 10g Oracle Home.

Example my 10g Oracle Home is : /u01/app/oracle/oracle/product/10.2.0

then my 11g Oracel Home is : /u01/app/oracle/oracle/product/11.1.0

Just a parallel 11.1.0 directory can be created and we can install oracle home in this location.

Start the installation using the below command

./runInstaller -invPtrLoc /u01/app/oracle/oracle/product/11.1.0/oraInst

Screen 10 – Summary
Click on “Install”

At the end of installation, installer will ask to run root.sh script. Do not press OK button.
Run root.sh as a root user and once done, press OK button. This will complete the software installation for Oracle Database 11g.

Step 2) Pre-Upgrade Utility

In 11g Home you installed, go to $ORACLE_HOME/rdbms/admin and copy the file utlu111i.sql to some temp location.

[oracle]$ cd $ORACLE_HOME
[oracle]$ cd rdbms/admin/
[oracle]$ pwd
/u01/app/oracle/oracle/product/product/11.1.0/db_1/rdbms/admin
[oracle]$ cp utlu111i.sql /tmp


Step 3) Executing the recommended steps


SQL> select * from v$timezone_file;

FILENAME VERSION
———— ———-
timezlrg.dat 2

SQL> SELECT CASE COUNT(DISTINCT(tzname))

VERSION
———-
2

If the Version of the existing timezone is less than 4, then apply the patch for Version 4 timezone files.

Check the database version

SQL> select banner from v$version;

Once you identify the correct patchset(5632264 for 10.2.X), download the same and unzip it.
[oracle]$ unzip p5632264_10202_LINUX.zip
[oracle]$ ls
etc files README.txt
[oracle]$ cd files/oracore/zoneinfo
[oracle]$ ls
readme.txt timezlrg.dat timezone.dat

Backup $ORACLE_HOME/oracore/zoneinfo directory

[oracle]$ cp -R $ORACLE_HOME/oracore/zoneinfo $ORACLE_HOME/oracore/zoneinfo_backup

Copy the .dat files

[oracle]$ cp timezone.dat timezlrg.dat $ORACLE_HOME/oracore/zoneinfo

Bounce the database and check the TIMEZONE version again

SQL> select * from v$timezone_file;

FILENAME VERSION
———— ———-
timezlrg.dat 4

SQL> SELECT CASE COUNT(DISTINCT(tzname))

Gather Dictionary stats:

Connect as sys user and gather statistics
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYS’);

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYSMAN’);

PL/SQL procedure successfully completed.

Step 4) Run Pre-Upgrade Utility again

After executing the recommended steps, run the pre-upgrade utility once again to make sure, you don’t get any critical warnings.

Run the pre-upgrade utility script on 10g database while connecting from 10g oracle home.

If every thing looks fine, Shut down the database from 10g Oracle Home

This time make sure you dont have the critical warnings like the one with TIMEZONE version.

Step 5) Starting Upgrade

Source the following variables for 11g Oracle Home

[oracle]$ export ORACLE_HOME=/u01/app/oracle/oracle/product/product/11.1.0/db_1
[oracle]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle]$ export ORACLE_SID=orcl
[oracle]$ export TNS_ADMIN=$ORACLE_HOME/network/admin

connected to the database sys as sysdba

sqlplus “/ as sysdba” –> will be connected to idle instance

SQL> startup upgrade

SQL> SPOOL upgrade.log
SQL> @catupgrd.sql

Once the upgrades finishes. It will shut down the database automatically.
Login again as sysdba and startup in normal mode.

Check the dba_registry for the components and its status

Step 6) Post-Upgrade Steps

Once the upgrade completes, restart the instance to reinitialize the system parameters for normal operation.

SQL> STARTUP

Run utlu111s.sql to display the results of the upgrade:

SQL> @?/rdbms/admin/utlu111s.sql


Run catuppst.sql, located in the ORACLE_HOME/rdbms/admin directory, to perform upgrade actions that do not require the database to be in UPGRADE mode:

SQL> @?/rdbms/admin/catuppst.sql

Run utlrp.sql to recompile

SQL> select count(*) from dba_objects
2 where status = ‘INVALID’;

COUNT(*)
———-
1576

SQL> @?/rdbms/admin/utlrp.sql

SQL> select count(*) from dba_objects
2 where status = ‘INVALID’;

COUNT(*)
———-
0

This completes the upgrade.

Upgrade from 10.2.0.1 to 10.2.0.4

Before database upgrade it is recommanded to backup the PRODUCTION database.

1. Stop all services of oracle

emctl stop dbconsole

sqlplus “/as sysdba”

SQL> shutdown immediate

2. Install the Database Patch Set

   export DISPLAY=10.13.5.95:0.0
   /u01/stage/patch/Disk1/runInstaller

3. Upgrade Database

   sqlplus “/as sysdba”

SQL> STARTUP UPGRADE

SQL> SPOOL /u01/stage/patch/Disk1/upgrade_info.log

SQL> @?/rdbms/admin/utlu102i.sql

SQL> SPOOL OFF;

SQL> SPOOL /u01/stage/patch/Disk1/patch.log

SQL> @?/rdbms/admin/catupgrd.sql

SQL> SPOOL OFF

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP

To compile invalid objects

SQL> @?/rdbms/admin/utlrp.sql

SQL> select comp_name, version, status from sys.dba_registry;

Clone a Database Using a Hot Backup RMAN

Clone a Database Using a Hot Backup

    A) Take a hot backup of the SOURCE Instance

    To quickly take a hot backup , Refer to : Script-to-create-Script-to-take-Hot-Backup-of-Database

    B) Prepare the TARGET

    SHUTDOWN the target DATABASE and LISTENER
    Take backup and Remove the TARGET ORACLE_HOME and database

    C) Use tar to copy the ORACLE_HOME and the database (from the hot backup) to the TARGET system to replace the target system.

    On the Source : Create the tar files

    tar -cvf /tmp/ohome.tar <ORACLE_HOME location>
    tar -cvf /tmp/dbbkp.tar <Database Hot backup location>


    Copy or scp the tar files

    scp /tmp/ohome.tar oracle@192.168.2.131:/tmp/ohome.tar
    scp /tmp/dbbkp.tar oracle@192.168.2.131:/tmp/dbbkp.tar


    On the Target Intance :

    create the directories for the ORACLE_HOME and datafiles if it does not exist
    Extract the tar files

    cd <ORACLE_HOME location>
    tar -xvf /tmp/ohome.tar

    cd <datafile location>
    tar -xvf /tmp/dbbkp.tar



ON the TARGET

1 Login as target user user and Verify .profile and *.env file under $ORACLE_HOME
Make sure that the environment is set for the Target System.

cd $ORACLE_HOME
pwd

2 Check all oracle related file systems for user and group ownership

cd <TARGET file systems>
ls -l

Check user and group ownership : It should be proper


3 Modify the entries in the tnsnames.ora and listener.ora to have the Listner for the target instance

eg : My listener.ora - where target is dev
==================================

dev =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL= IPC)(KEY= EXTPROCdev))
(ADDRESS= (PROTOCOL= TCP)(Host= dbalounge)(Port= 1525))
)

SID_LIST_dev =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /u03/oracle/devdb/10.2.0)
(SID_NAME = dev)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u03/oracle/devdb/10.2.0)
(PROGRAM = extproc)
)
)

STARTUP_WAIT_TIME_dev = 0
CONNECT_TIMEOUT_dev = 10
TRACE_LEVEL_dev = OFF

LOG_DIRECTORY_dev = /u03/oracle/devdb/10.2.0/network/admin
LOG_FILE_dev = dev
TRACE_DIRECTORY_dev = /u03/oracle/devdb/10.2.0/network/admin
TRACE_FILE_dev = dev
ADMIN_RESTRICTIONS_dev = OFF


eg : My TNS entry - where target is dev
==================================

dev=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=DBALOUNGE.com)(PORT=1 525))
(CONNECT_DATA=
(SERVICE_NAME=dev)
(INSTANCE_NAME=dev)
)
)


4 In config.c, make sure the entries are pointing to target .

cd $ORACLE_HOME/rdbms/lib
ls -ltr config*
vi config.c
Take care of Group. It should be the group the target user belongs to :
#define SS_DBA_GRP "dbTARGET"
#define SS_OPER_GRP "dbTARGET"



5 Move config.o

cd $ORACLE_HOME/rdbms/lib
mv config.o config.o.old_18jul10


6 If this is RAC to NON-RAC Refresh, relink Oracle with rac_off

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk rac_off

If this step did not fail with fatal errors, proceed with :
make -f ins_rdbms.mk ioracle


7 Relink all the executables.

cd $ORACLE_HOME/bin
./relink all

8 Verify the Timestamp
ls -l $ORACLE_HOME/bin/oracle



9 Verify that you can run sqlplus “/ as sysdba” without prompting for any password.

sqlplus "/ as sysdba"
connected to idle instance


10 Set the init.ora paramters and create the destination directory location
To see the directories to be created and corresponding parameters to be modified, Refer to :
Create-a-Database-Manually-using-Create-Database-Script

11 Prepare the Control file script from the trace bacup taken on production.

vi TARGET_control.sql

a) ? Consider the resetlog portion of this script . Delete the noresetlogs section of the script.

b)? Old Entry - CREATE CONTROLFILE REUSE DATABASE "SOURCE" NORESETLOGS ARCHIVELOG FORCE LOGGING

? New Entry - CREATE CONTROLFILE REUSE SET DATABASE "SOURCE" RESETLOGS ARCHIVELOG

c) Change the location of Datafiles to point to the Target,
Replace all occurances of : SOURCE replaced by TARGET
Replace all occurances of : SOURCE replaced by TARGET

d) Remove the TEMP file entries ( keep a safe copy, for later use).
Keep a safe backup of Temporary creation part and redo logfile creation statements.
After this , you can remove all lines after characterset and semicolon.

e) Inspect the control file script
The number of Datafiles should match that in the source.
select count(*) from v$datafile at the source.

Similarily, number of copied Datafiles at the Target should match the definition in the script.

Example – of what you will be left with in TARGET_control.sql
STARTUP NOMOUNT;
CREATE CONTROLFILE REUSE SET DATABASE "TARGET" RESETLOGS ARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 5
MAXDATAFILES 1024
MAXINSTANCES 8
MAXLOGHISTORY 1361
LOGFILE
GROUP 1 (
'/TARGET/..../log01a.dbf',
'/TARGET/..../log01b.dbf'
) SIZE 200M,
GROUP 2 (
'/TARGET/..../log02a.dbf',
'/TARGET/..../log02b.dbf'
) SIZE 200M,
GROUP 3 (
'/TARGET/..../log03a.dbf',
'/TARGET/..../log03b.dbf'
) SIZE 200M,
….
DATAFILE
'/TARGET/..../system01.dbf',
'/TARGET/..../system02.dbf',
……….
……….. (representing other datafiles)

CHARACTER SET UTF8
;


12 Create the Controlfile

$sqlplus "/ as sysdba"
@TARGET_control.sql

13 See archive log mode

SQL>ARCHIVE LOG LIST
Should show automatic archiving “Enabled” and “Archivelog” Mode

14 Recover the database

SQL> recover database using backup controlfile until cancel;

Enter the archive file location, when prompted.

Use the following query on SOURCE to get the list of archives needed to be recovered -
select THREAD#, SEQUENCE# from v$log_history where &1 between FIRST_CHANGE# and NEXT_CHANGE#;

Here – For the value for $1 to be given will come from the sequence returned by the command – “recover database using backup controlfile until cancel;” which you have given on TARGET


15 Open the DB with resetlogs
SQL> alter database open resetlogs;

When the DB opens, check for any missing files or files needed for recovery

SQL> select * from v$recover_file;
SQL> select * from v$datafile where name like '%MISS%';
Should not return any rows for these queries.

16 Shutdown the Database

17 Check for the Default Temporary file –

select * from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';

Confirm that this TEMP.
If the default is not TEMP,
SQL>alter database default temporary tablespace TEMP

18. Create the Temp datafiles , using the commands taken from the control file.

ALTER TABLESPACE TEMP ADD TEMPFILE __________

Example - The commands will be similar to below
ALTER TABLESPACE TEMP ADD TEMPFILE '/TARGET/..../temp20.dbf'
SIZE 134217728 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 1800M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/TARGET/..../temp19.dbf'
SIZE 134217728 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 1800M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/TARGET/..../temp18.dbf'
SIZE 134217728 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 1800M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/TARGET/..../temp17.dbf'
SIZE 134217728 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 1800M;

Verify dba_temp_files, for all the temp file entries added to TEMP

SQL> select file_name from dba_temp_files;

19 Update global_name

select * from global_name;
update global_name set global_name='TARGET.ORACLEOUTSOURCING.COM';
commit;

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
TARGET


Different Approach As Per Oracle Documentation.

    Assumptions:

    Hot backups of the production server are there, including binary backup of controlfiles.

    Production Database Name: orcl
    Cloned Database Name: pub

    --Create pfile from the production servers spfile.

    SQL> create pfile='/u01/initpub.ora' from spfile;

    -- Make appropriate folder structures.

    [oracle@canada ~]$ mkdir -p /u01/app/oracle/admin/pub/adump
    [oracle@canada ~]$ mkdir -p /u01/app/oracle/oradata/pub
    [oracle@canada ~]$ mkdir -p /u01/app/oracle/flash_recovery_area/pub
    [oracle@canada ~]$ mkdir -p /u01/app/oracle/flash_recovery_area/PUB/archivelog


    -- Edit the initpub.ora file and change the location of all the files for
    -- the "pub" database.

    Also add the following parameters to the pfile:

    DB_UNIQUE_NAME=pub

    -- above parameter is necessary if database is created on the same machine.

    DB_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/orcl/,/u01/app/oracle/oradata/pub/)

    -- above parameter is necessary if database is created on the same machine,
    -- or if the directory structure is different.

    LOG_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/orcl/,/u01/app/oracle/oradata/pub/)

    -- above parameter is mandatory.

    LOG_ARCHIVE_DEST_1 = 'LOCATION=/u01/app/oracle/flash_recovery_area/PUB/archivelog/'

    Sample Pfile


    pub.__db_cache_size=62914560
    pub.__java_pool_size=4194304
    pub.__large_pool_size=4194304
    pub.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    pub.__pga_aggregate_target=113246208
    pub.__sga_target=150994944
    pub.__shared_io_pool_size=0
    pub.__shared_pool_size=75497472
    pub.__streams_pool_size=0
    *.audit_file_dest='/u01/app/oracle/admin/pub/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.0.0'
    *.control_files='/u01/app/oracle/oradata/pub/control01.ctl',
    '/u01/app/oracle/flash_recovery_area/pub/control02.ctl'
    *.db_block_size=8192
    *.db_domain=''
    *.db_name='orcl'
    *.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
    *.db_recovery_file_dest_size=4039114752
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=pubXDB)'
    *.log_archive_format='%t_%s_%r.dbf'
    *.memory_target=262144000
    *.open_cursors=300
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.undo_tablespace='UNDOTBS1'
    DB_UNIQUE_NAME=pub
    DB_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/orcl/,/u01/app/oracle/oradata/pub/)
    LOG_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/orcl/,/u01/app/oracle/oradata/pub/)
    LOG_ARCHIVE_DEST_1 = 'LOCATION=/u01/app/oracle/flash_recovery_area/PUB/archivelog/'

    --Copy the backup datafiles, archived log files, and control files to folders created
    --earlier.


    [oracle@canada ~]$ export ORACLE_SID=pub
    [oracle@canada ~]$ sqlplus

    SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 16 19:02:27 2012

    Copyright (c) 1982, 2009, Oracle. All rights reserved.

    Enter user-name: / as sysdba
    Connected to an idle instance.

    SQL> startup nomount pfile='/u01/initpub.ora';
    ORACLE instance started.

    Total System Global Area 263639040 bytes
    Fixed Size 1335892 bytes
    Variable Size 197135788 bytes
    Database Buffers 62914560 bytes
    Redo Buffers 2252800 bytes

    SQL> alter database mount clone database;

    Database altered.

    SQL> set pagesize 100
    SQL> set linesize 130
    SQL> select name,file#,status from v$datafile;

    NAME FILE# STATUS
    ------------------------------ ---------- -------
    /u01/app/oracle/oradata/pub/sy 1 SYSOFF
    stem01.dbf

    /u01/app/oracle/oradata/pub/sy 2 OFFLINE
    saux01.dbf

    /u01/app/oracle/oradata/pub/un 3 OFFLINE
    dotbs01.dbf

    /u01/app/oracle/oradata/pub/us 4 OFFLINE
    ers01.dbf


    SQL> alter database datafile 1 online;

    Database altered.

    SQL> alter database datafile 2 online;

    Database altered.

    SQL> alter database datafile 3 online;

    Database altered.

    SQL> alter database datafile 4 online;

    Database altered.


    SQL> select name,file#,status from v$datafile;

    NAME FILE# STATUS
    -------------------------------------------------- ---------- -------
    /u01/app/oracle/oradata/pub/system01.dbf 1 SYSTEM
    /u01/app/oracle/oradata/pub/sysaux01.dbf 2 ONLINE
    /u01/app/oracle/oradata/pub/undotbs01.dbf 3 ONLINE
    /u01/app/oracle/oradata/pub/users01.dbf 4 ONLINE


    SQL>recover database until cancel using backup controlfile;

    --manually apply all the suggested archived log files and finish
    --the incomplete recovery.

    SQL>alter database open resetlogs;

Recovery Senarios ...............

One of live recovery scenario faced by our DBA
ONE OF THE DATABASE PROD (DB NAME
CHANGED) WHICH HAS 12 DATAFILES MISSING. We came to know about these 12 datafiles from
the Alert logfile and from the v$datafile view (status='RECOVER').
We had this power outage on Sunday, for all the three databases we had a successful
RMAN tape hot backup on Saturday (Evident from the RMAN logfiles).
To check if the backup is physically available in the backup silo (We have about 800
Production databases and all the backups go to the one silo) we gave the below command
but it was hanging and never returned output.
RMAN> list backup;
Then we gave the below command to find the availability of backupset of datafile '4' ('4'
is the file_id of one of the missing datafile of PROD database) that is missing.
RMAN> LIST BACKUPSET OF DATAFILE 4;
The above command showed the datafile id '4' is available in the backup. Then we gave
the below command to restore and recover the datafile 4; Then it failed with the below
error saying that its didn't have archivelog file with sequence 185233 to restore.
RMAN> Connect target / ;
RMAN> Connect catalog rman/rman@PROD
RMAN> startup mount;
RMAN>run {
allocate channel t1 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
sql 'alter database datafile 4 offline';
restore datafile 4;
recover datafile 4;
sql 'alter database datafile 4 online';
release channel t1;
}
allocated channel: t1
channel t1: sid=25 devtype=SBT_TAPE
channel t1: XXX v4.2.0.0
Starting restore at 27-APR-09
released channel: t1
RMAN-00571:===================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =====
RMAN-00571:===================================================
RMAN-03002: failure of restore command at 04/27/2009 12:43:00
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of log thread 1 seq 185233 scn 6111805242226 found to
restore
RMAN> EXIT;
Then we checked the RMAN logfiles, they showed that all the archivelogs have been
backed up successfully. We then listed the archivelog file that was missing and it showed
as expired.
RMAN> LIST BACKUPSET OF archivelog sequence 185233;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
39383086 269M SBT_TAPE 00:00:41 26-APR-09
BP Key: 39383088 Status: EXPIRED Tag: TAG20090426T005740
Piece Name: offsite_arch_PROD_S187166_685155460
List of Archived Logs in backup set 39383086
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 185233 6111805242226 25-APR-09 6111807600250 26-APR-09
Then we contacted the storage group about the missing archivelog file and they
confirmed that they see the backupset 39383086 as available in the silo, So we went with
the "CROSS CHECK" command as below. Now the RMAN has realized that the
archivelog is available in the silo it changed its status to "AVAILABLE"
RMAN>ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE 'sbt_tape'
parms 'ENV=(XXX_SERVER=xxhaxx)';
RMAN>CROSSCHECK BACKUPSET 39383086;
RMAN> LIST BACKUPSET OF archivelog sequence 185233;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
39383086 269M SBT_TAPE 00:00:41 26-APR-09
BP Key: 39383088 Status: AVAILABLE Tag: TAG20090426T005740
Piece Name: offsite_arch_PROD_S187166_685155460
List of Archived Logs in backup set 39383086
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 185233 6111805242226 25-APR-09 6111807600250 26-APR-09
We followed the same method for making all the archivelog files that couldn't be
restored. Then we gave the restore and recovery command for datafile '4' and this time it
was successful. It restored the datafile '4' and all the archivelogfiles that are recovered for
the recovery.
RMAN> Connect target / ;
RMAN> Connect catalog rman/rman@PROD
RMAN>run {
allocate channel t1 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
sql 'alter database datafile 4 offline';
restore datafile 4;
recover datafile 4;
sql 'alter database datafile 4 online';
release channel t1;
}
RMAN> Exit;
Now we are sure that everything is working fine and went for the recovery of the
remaining 11 datafiles as below. This time RMAN restored only the datafiles but not the
archivelogfiles as all the archivelogfiles required for the recovery were already restored.
We used multiple channels to improve the performance of restore and recovery. The
restore and recovery of 11 datafiles finished in about 2 Hr's.
RMAN> Connect target / ;
RMAN> Connect catalog rman/rman@PROD
RMAN>run {
allocate channel t1 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
allocate channel t3 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
allocate channel t4 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
allocate channel t5 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
allocate channel t6 type 'sbt_tape' parms 'ENV=(XXX_SERVER=xxhaxx)';
sql 'alter database datafile 16 offline';
sql 'alter database datafile 9 offline';
sql 'alter database datafile 18 offline';
sql 'alter database datafile 19 offline';
sql 'alter database datafile 23 offline';
sql 'alter database datafile 24 offline';
sql 'alter database datafile 46 offline';
sql 'alter database datafile 47 offline';
sql 'alter database datafile 66 offline';
sql 'alter database datafile 67 offline';
sql 'alter database datafile 79 offline';
restore datafile 16,9,18,19,23,24,46,47,66,67,79;
recover datafile 16,9,18,19,23,24,46,47,66,67,79;
sql 'alter database datafile 16 online';
sql 'alter database datafile 9 online';
sql 'alter database datafile 18 online';
sql 'alter database datafile 19 online';
sql 'alter database datafile 23 online';
sql 'alter database datafile 24 online';
sql 'alter database datafile 46 online';
sql 'alter database datafile 47 online';
sql 'alter database datafile 66 online';
sql 'alter database datafile 67 online';
sql 'alter database datafile 79 online';
release channel t1;
release channel t2;
release channel t3;
release channel t4;
release channel t5;
release channel t6;
}
RMAN>sql 'alter database open';
RMAN>EXIT;




Author – A.Kishore
http://appsdba.info
How to Recover lost online redo logs ?
If you lose the current online redo log, then you will not be able to recover the
information in that online redo log. This is one reason why redo logs should be
multiplexed. If it is multiplexed, you will have a copy of the online redo log. Let's assume
that your online redo log group #1 has two members, redo01a.log and redo01b.log. If
redo01a.log is missing, simply shutdown the database and copy redo01b.log and rename
it to redo01a.log. You should be able to start the database.
If you have not multiplexed your online redo logs, then you are only left with incomplete
recovery. Your steps are as follows:
1. SHUTDOWN ABORT
2. STARTUP MOUNT
3. RECOVER DATABASE UNTIL CANCEL;
4. When you have applied any archived redo logs, then reply CANCEL to stop the
recovery process.
5. ALTER DATABASE OPEN RESETLOGS;
The last step will recreate your missing log files. Any transactions in those missing log
files that were not written to disk are now lost. Any time you open with RESETLOGS,
make sure you shutdown the database and take a good backup.
If it is multiplexed then replace the lost one with the available one else restore it from
backup. Here I am using RMAN
Note : RMAN will never take the backup of RMAN logs
RMAN SID = RECO
TARGET SID = TEST5
Check that our target system is running on archive log
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
Author – A.Kishore
http://appsdba.info
RMAN Setup and Configuration
----------------------------
Configure the Database for RMAN Operations
Set Up the Database User in the target database - on the TEST database
create user backup_admin identified by backup_admin default tablespace users;
grant sysdba to backup_admin;
Creating the Recovery Catalog User - on RECO database
create user rcat_user identified by rcat_user default tablespace users;
grant connect,resource,recovery_catalog_owner to rcat_user;
Creating the Recovery Catalog Schema Objects
Step 1. Connect to the recover catalog with RMAN:
rman catalog=rcat_user/rcat_user@reco
Step 2. Issue the create catalog command from the RMAN prompt:
create catalog;
Register your database in the recovery catalog
Step 1: Using RMAN, sign into the database and the recover catalog at the same time
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test5
Step 2: Register the database with the recovery catalog
RMAN> register database
RMAN> show all;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> backup database plus archivelog;
Author – A.Kishore
http://appsdba.info
run
{
backup database plus archivelog;
backup current controlfile;
}
-- Add some records
SQL> insert into test values(3);
1 row created.
SQL> commit;
Commit complete.
C:\>sqlplus scott/tiger@test5
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 22 15:00:02 2009
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> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
With the Partitioning, OLAP and Data Mining options
C:\>sqlplus "sys/oracle@test5 as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 22 15:00:05 2009
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
Author – A.Kishore
http://appsdba.info
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247876 bytes
Variable Size 79693180 bytes
Database Buffers 79691776 bytes
Redo Buffers 7139328 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\REDO01.LOG'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
SQL>
C:\>rman catalog=rcat_user/rcat_user@RECO
target=backup_admin/backup_admin@test5
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Apr 22 13:41:02 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST5 (not mounted)
connected to recovery catalog database
RMAN> restore controlfile;
Starting restore at 22-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: reading from backup piece
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\AUTOBACKUP
\2009_04_22\O1_MF_S_684
859432_4YZ3WTC8_.BKP
Author – A.Kishore
http://appsdba.info
channel ORA_DISK_1: restored backup piece 1
piece
handle=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\AUTOB
ACKUP\2009_04_22\O1_MF_S_684859432_4YZ3WTC8_.BKP tag=TAG20090
422T144352
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL01.CTL
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL02.CTL
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL03.CTL
Finished restore at 22-APR-09
RMAN> restore database;
Starting restore at 22-APR-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\SYSTEM01.DBF
restoring datafile 00002 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\UNDOTBS01.DBF
restoring datafile 00003 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\SYSAUX01.DBF
restoring datafile 00004 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\USERS01.DBF
restoring datafile 00005 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\BACKUPSET\2
009_04_22\O1_MF_NNNDF_
TAG20090422T144216_4YZ3SSFN_.BKP
channel ORA_DISK_1: restored backup piece 1
piece
handle=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\BACKU
PSET\2009_04_22\O1_MF_NNNDF_TAG20090422T144216_4YZ3SSFN_.BKP
tag=TAG20090422T144216
channel ORA_DISK_1: restore complete, elapsed time: 00:01:06
Finished restore at 22-APR-09
Author – A.Kishore
http://appsdba.info
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> recover database until logseq 5;
Starting recover at 22-APR-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:06
Finished recover at 22-APR-09
RMAN> alter database open resetlogs;
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
SQL> connect scott/tiger@test5
Connected.
SQL> select * from test;
T
----------
1
2
The data stored in the redo log file is lost, that is reason we should always multiplex the
redo logfile









Author – A.Kishore
http://appsdba.info
How to Recover the lost current control file, or the current control file is
inconsistent with files that you need to recover??
If it is multiplexed then replace the lost one with the available one else restore it from
backup. Here I am using RMAN
RMAN SID = RECO
TARGET SID = TEST5
Check that our target system is running on archive log
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
RMAN Setup and Configuration
----------------------------
Configure the Database for RMAN Operations
Set Up the Database User in the target database - on the TEST database
create user backup_admin identified by backup_admin default tablespace users;
grant sysdba to backup_admin;
Creating the Recovery Catalog User - on RECO database
create user rcat_user identified by rcat_user default tablespace users;
grant connect,resource,recovery_catalog_owner to rcat_user;
Creating the Recovery Catalog Schema Objects
Step 1. Connect to the recover catalog with RMAN:
rman catalog=rcat_user/rcat_user@reco
Author – A.Kishore
http://appsdba.info
Step 2. Issue the create catalog command from the RMAN prompt:
create catalog;
Register your database in the recovery catalog
Step 1: Using RMAN, sign into the database and the recover catalog at the same time
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test5
Step 2: Register the database with the recovery catalog
RMAN> register database
RMAN> show all;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> backup database plus archivelog;
run
{
backup database plus archivelog;
backup current controlfile;
}
-- Add some records
SQL> connect scott/tiger@test5
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL> create table test(t number);
Table created.
SQL> insert into test values(1);
1 row created.
Author – A.Kishore
http://appsdba.info
SQL> commit;
Commit complete.
SQL> shutdown abort
remove all the controlfiles
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247876 bytes
Variable Size 79693180 bytes
Database Buffers 79691776 bytes
Redo Buffers 7139328 bytes
ORA-00205: error in identifying control file, check alert log for more info
C:\>rman catalog=rcat_user/rcat_user@RECO
target=backup_admin/backup_admin@test5
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Apr 22 13:41:02 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST5 (not mounted)
connected to recovery catalog database
RMAN> restore controlfile;
Starting restore at 22-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: reading from backup piece
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\AUTOBACKUP
\2009_04_22\O1_MF_S_684
855297_4YYZVMN3_.BKP
Author – A.Kishore
http://appsdba.info
channel ORA_DISK_1: restored backup piece 1
piece
handle=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST5\AUTOB
ACKUP\2009_04_22\O1_MF_S_684855297_4YYZVMN3_.BKP tag=TAG20090
422T133457
channel ORA_DISK_1: restore complete, elapsed time: 00:00:05
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL01.CTL
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL02.CTL
output
filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST5\CONTROL03.CTL
Finished restore at 22-APR-09
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> alter database open;
RMAN> alter database open resetlogs;
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
C:\>sqlplus scott/tiger@test5
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 22 13:57:52 2009
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
Author – A.Kishore
http://appsdba.info
SQL> select tname from tab;
TNAME
------------------------------
DEPT
EMP
BONUS
SALGRADE
TEST
SQL> select * from test;
T
----------
1
2
http://www.orafaq.com/wiki/index.php?title=Control_file_recovery&action=edit&section
=2




Author – A.Kishore
http://appsdba.info
Insanity: doing the same thing over and over again and expecting different results. – Nice
Proverb
No back up was taken after reset logs. How to recover the database?
Solution – It’s possible, I have tried with Oracle 10g. Before Oracle 10g we may have to
reset the incarnation, then we should be able to recover the database.
RMAN SID = RECO
TARGET SID = TEST
Check that our target system is running on archive log
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
RMAN Setup and Configuration
----------------------------
Configure the Database for RMAN Operations
Set Up the Database User in the target database - on the TEST database
create user backup_admin identified by backup_admin default tablespace users;
Spongebob - Today I am going to
teach restoration of database
Patrick – Show me how! Show
me how!
Author – A.Kishore
http://appsdba.info
grant sysdba to backup_admin;
Creating the Recovery Catalog User - on RECO database
create user rcat_user identified by rcat_user default tablespace users;
grant connect,resource,recovery_catalog_owner to rcat_user;
Creating the Recovery Catalog Schema Objects
Step 1. Connect to the recover catalog with RMAN:
rman catalog=rcat_user/rcat_user@reco
Step 2. Issue the create catalog command from the RMAN prompt:
create catalog;
Register your database in the recovery catalog
Step 1: Using RMAN, sign into the database and the recover catalog at the same time
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test
Step 2: Register the database with the recovery catalog
RMAN> register database
Take the backup
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test
RMAN> backup database plus archivelog;
Author – A.Kishore
http://appsdba.info
SQL> create table test( t number);
Table created.
SQL> set time on
09:47:27 SQL>
09:47:28 SQL> insert into test values(1);
1 row created.
09:47:42 SQL> commit;
Commit complete.
09:47:45 SQL>
09:47:46 SQL>
09:47:46 SQL>
09:47:46 SQL> create table test1(t number);
Table created.
09:47:56 SQL> insert into test1 values(2);
1 row created.
09:48:05 SQL> commit;
Commit complete.
09:49:04 SQL> drop table test;
Table dropped.
09:49:29 SQL> drop table test1;
Table dropped.
Let’s recover our database – 9:48:20
Author – A.Kishore
http://appsdba.info
n Check the current incarnation of the database
C:\>rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Apr 17 09:59:21 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST (DBID=1982397231)
connected to recovery catalog database
RMAN> list incarnation of database;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 8 TEST 1982397231 PARENT 1 30-AUG-05
1 2 TEST 1982397231 CURRENT 534907 15-APR-09
Steps – TEST DB
Shutdown the database
Start the database in mount stage
09:59:30 SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
10:00:20 SQL> startup nomount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247876 bytes
Variable Size 75498876 bytes
Database Buffers 83886080 bytes
Redo Buffers 7139328 bytes
Steps – RMAN
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test
restore controlfile from autobackup;
restore database;
recover database until time "to_date('04/17/09 9:48:20','MM/DD/YY HH24:MI:SS')";
alter database open resetlogs
C:\>rman catalog=rcat_user/rcat_user@RECO
target=backup_admin/backup_admin@test
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Apr 17 10:04:14 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Author – A.Kishore
http://appsdba.info
connected to target database: TEST (not mounted)
connected to recovery catalog database
RMAN> restore controlfile from autobackup;
Starting restore at 17-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
recovery area destination: C:\oracle\product\10.2.0/flash_recovery_area
database name (or database unique name) used for search: TEST
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found:
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\AUTOBACKUP\
2009_04_17\O1_MF_S_684409406_4Y
KDFJFL_.BKP
channel ORA_DISK_1: control file restore from autobackup complete
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL01.CTL
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL02.CTL
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL03.CTL
Finished restore at 17-APR-09
RMAN> restore database;
Starting restore at 17-APR-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF
restoring datafile 00002 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOTBS01.DBF
restoring datafile 00003 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAUX01.DBF
restoring datafile 00004 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS01.DBF
restoring datafile 00005 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\EXAMPLE01.DBF
restoring datafile 00006 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\MYTEST01.DBF
Author – A.Kishore
http://appsdba.info
channel ORA_DISK_1: reading from backup piece
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\BACKUPSET\20
09_04_17\O1_MF_NNNDF_T
AG20090417T094124_4YKD9P5Q_.BKP
channel ORA_DISK_1: restored backup piece 1
piece
handle=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\BACKUP
SET\2009_04_17\O1_MF_NNNDF_TAG20090417T094124_4YKD9P5Q_.BKP t
ag=TAG20090417T094124
channel ORA_DISK_1: restore complete, elapsed time: 00:01:36
Finished restore at 17-APR-09
RMAN> recover database until time "to_date('04/17/09 9:48:20','MM/DD/YY
HH24:MI:SS')";
Starting recover at 17-APR-09
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of recover command at 04/17/2009 10:13:09
ORA-01507: database not mounted
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> recover database until time "to_date('04/17/09 9:48:20','MM/DD/YY
HH24:MI:SS')";
Starting recover at 17-APR-09
Starting implicit crosscheck backup at 17-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 17-APR-09
Starting implicit crosscheck copy at 17-APR-09
using channel ORA_DISK_1
Finished implicit crosscheck copy at 17-APR-09
Author – A.Kishore
http://appsdba.info
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name:
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\AUTOBACKUP\
2009_04_17\O1_MF_S_684409406_4YKDFJFL_.BKP
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 19 is already on disk as file
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2
009_04_1
7\O1_MF_1_19_4YKDF9H0_.ARC
archive log thread 1 sequence 20 is already on disk as file
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG
archive log
filename=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHI
VELOG\2009_04_17\O1_MF_1_19_4YKDF9H0_.ARC thread=1 seq
uence=19
archive log filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG
thread=1 sequence=20
media recovery complete, elapsed time: 00:00:07
Finished recover at 17-APR-09
RMAN> alter database open resetlogs;
RMAN> list incarnation of database;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 8 TEST 1982397231 PARENT 1 30-AUG-05
1 2 TEST 1982397231 PARENT 534907 15-APR-09
1 1478 TEST 1982397231 CURRENT 647072 17-APR-09
Author – A.Kishore
http://appsdba.info
Recovery completed:
10:17:08 SQL> connect scott/tiger@test
Connected.
10:17:20 SQL> select * from test;
T
----------
1
2
10:17:24 SQL> select * from test1;
no rows selected
NOTE:
The resetlogs option used to open the database in the above example, will create a new
incarnation of the database. It is critical to take a complete backup of the database after
performing a resetlogs.
Spongebob as usual forgot to take the backup after resetlogs
10:17:28 SQL> create table test2(t number);
Table created.
10:30:19 SQL> insert into test2 values(1);
1 row created.
Patrick, see I have
restored the
database. Hi He He
Author – A.Kishore
http://appsdba.info
10:30:26 SQL> commit;
Commit complete.
10:30:29 SQL>
10:30:29 SQL>
10:30:30 SQL>
10:30:30 SQL>
10:30:55 SQL> drop table test2;
Table dropped.
Lets try to restore the database till 10:30:30
09:59:30 SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
10:00:20 SQL> startup nomount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247876 bytes
Variable Size 75498876 bytes
Database Buffers 83886080 bytes
Redo Buffers 7139328 bytes
Steps – RMAN
rman catalog=rcat_user/rcat_user@RECO target=backup_admin/backup_admin@test
restore controlfile from autobackup;
restore database;
alter database mount;
recover database until time "to_date('04/17/09 10:30:30','MM/DD/YY HH24:MI:SS')";
alter database open resetlogs
C:\>rman catalog=rcat_user/rcat_user@RECO
target=backup_admin/backup_admin@test
Patric .. I will restore
without taking the
backups after the reset
Author – A.Kishore
http://appsdba.info
SQL> connect scott/tiger@test
Connected.
SQL> select tname from tab;
TNAME
------------------------------
DEPT
EMP
BONUS
SALGRADE
TEST
TEST1
TEST2
7 rows selected.
SQL> select * from test2;
T
----------
1
C:\>
C:\>
C:\>rman catalog=rcat_user/rcat_user@RECO
target=backup_admin/backup_admin@test
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Apr 17 14:37:08 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST (not mounted)
connected to recovery catalog database
RMAN> restore controlfile from autobackup;
Starting restore at 17-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
recovery area destination: C:\oracle\product\10.2.0/flash_recovery_area
database name (or database unique name) used for search: TEST
channel ORA_DISK_1: autobackup found in the recovery area
Author – A.Kishore
http://appsdba.info
channel ORA_DISK_1: autobackup found:
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\AUTOBACKUP\
2009_04_17\O1_MF_N_684411334_4Y
KG9ROR_.BKP
channel ORA_DISK_1: control file restore from autobackup complete
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL01.CTL
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL02.CTL
output filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\CONTROL03.CTL
Finished restore at 17-APR-09
RMAN> restore database;
Starting restore at 17-APR-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF
restoring datafile 00002 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOTBS01.DBF
restoring datafile 00003 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAUX01.DBF
restoring datafile 00004 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS01.DBF
restoring datafile 00005 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\EXAMPLE01.DBF
restoring datafile 00006 to
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\MYTEST01.DBF
channel ORA_DISK_1: reading from backup piece
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\BACKUPSET\20
09_04_17\O1_MF_NNNDF_T
AG20090417T094124_4YKD9P5Q_.BKP
channel ORA_DISK_1: restored backup piece 1
piece
handle=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\BACKUP
SET\2009_04_17\O1_MF_NNNDF_TAG20090417T094124_4YKD9P5Q_.BKP t
ag=TAG20090417T094124
channel ORA_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 17-APR-09
RMAN> recover database until time "to_date('04/17/09 10:30:30','MM/DD/YY
HH24:MI:SS')";
Author – A.Kishore
http://appsdba.info
Starting recover at 17-APR-09
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of recover command at 04/17/2009 14:39:38
ORA-01507: database not mounted
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> recover database until time "to_date('04/17/09 10:30:30','MM/DD/YY
HH24:MI:SS')";
Starting recover at 17-APR-09
Starting implicit crosscheck backup at 17-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 17-APR-09
Starting implicit crosscheck copy at 17-APR-09
using channel ORA_DISK_1
Finished implicit crosscheck copy at 17-APR-09
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name:
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\AUTOBACKUP\
2009_04_17\O1_MF_N_684411334_4YKG9ROR_.BKP
using channel ORA_DISK_1
starting media recovery
Author – A.Kishore
http://appsdba.info
archive log thread 1 sequence 19 is already on disk as file
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2
009_04_1
7\O1_MF_1_19_4YKG8MKT_.ARC
archive log thread 1 sequence 20 is already on disk as file
C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2
009_04_1
7\O1_MF_1_20_4YKG8FJV_.ARC
archive log thread 1 sequence 1 is already on disk as file
C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG
archive log
filename=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHI
VELOG\2009_04_17\O1_MF_1_19_4YKG8MKT_.ARC thread=1 seq
uence=19
archive log
filename=C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHI
VELOG\2009_04_17\O1_MF_1_20_4YKG8FJV_.ARC thread=1 seq
uence=20
archive log filename=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG
thread=1 sequence=1
media recovery complete, elapsed time: 00:00:10
Finished recover at 17-APR-09
RMAN> alter database open resetlogs
2> /
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01006: error signalled during parse
RMAN-02001: unrecognized punctuation symbol "/"
RMAN> alter database open resetlogs;
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
Author – A.Kishore
http://appsdba.info
SQL> select * from test2;
T
----------
1
http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+12399
85178932+28353475&threadId=653460
Before Oracle 10g
Now I configured a recovery catalog on a different system and backup/recovery is succuss.
I could do same recovery multiple times using rman/dp.
To redo the recovery after reset logs,
From RMAN>list incarnation of database;
RMAN>reset database to incarnation <number>;
Then SQL>shutdown immediate;
SQL>startup nomount;
Restored control files only DP GUI.
Restored and recovered from DP/GUI all the items (recover until option).
I could do this multiple times.
So, Maintaining a Recovery catalog look like easy and recommended method.
Thanks for every one again.
I have done it
again …