Oracle Express Edition (XE) 11g (11.2.0.1) Avaliable

Oracle Database Express Edition 11g Release 2

Free to develop, deploy, and distribute

Oracle Database Express Edition 11g Release 2 (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 11g Release 2 code base.  It’s free to develop, deploy, and distribute; fast to download; and simple to administer.

Oracle Database XE can be installed on any size host machine with any number of CPUs (one database per machine), but XE will store up to 11GB of user data, use up to 1GB of memory, and use one CPU on the host machine.

Download

Avaliable only to Windows x32 and Linux x64

Download Link: http://www.oracle.com/technetwork/database/express-edition/downloads/index.html

Feature Availability

  • Options and Major Features Not Included
  • Application Development, Language, and Database Features
  • Availability/Backup and Recovery Features
  • Security Features
  • Manageability Features
  • Data Movement/Integration Features
  • Networking Features

Options and Major Features Not Included

The following options and major features are not included with Oracle Database XE:

  • Development Platform
    • Oracle Precompilers (Pro*C/C++, Pro*Cobol)
    • SQLJ
  • High Availability:
    • Automatic Block Repair
    • Block change tracking for fast incremental backup
    • Block-level media recovery
    • Duplexed backup sets
    • Fast-start fault recovery
    • Flashback Database
    • Flashback Data Archive
    • Flashback Table
    • Flashback Transaction
    • Lost Write Protection
    • Online index rebuild
    • Online index-organized table organization
    • Online table redefinition
    • Oracle Active Data Guard
    • Oracle Data Guard-Redo Apply
    • Oracle Data Guard-Snapshot Standby
    • Oracle Data Guard-SQL Apply
    • Oracle Fail Safe
    • Oracle RAC One Node
    • Parallel backup and recovery
    • Rolling Upgrades-Patch Set, Database, and Operating System
    • Tablespace point-in-time recovery
    • Trial recovery
    • Unused block compression in backups
    • Oracle Total Recall
  • Scalability
    • Automatic Workload Management
    • Oracle Real Application Clusters
  • Security
    • Advanced Security Option
    • Fine-grained auditing
    • Oracle Database Vault
    • Oracle Label Security
    • Oracle Virtual Private Database
    • Secure External Password Store
    • SecureFiles Encryption
  • Performance
    • Client Side Query Cache
    • Database Smart Flash Cache
    • In-Memory Database Cache
    • PL/SQL Function Result Cache
    • Query Results Cache
    • Server Flash Cache
    • Support for Oracle Exadata Storage Server Software
    • Xstream
  • Manageability
    • Database Resource Manager
    • Deferred segment creation
    • Instance Caging
    • Oracle Change Management Pack
    • Oracle Configuration Management Pack
    • Oracle Diagnostic Pack
    • Oracle Real Application Testing
    • Oracle Provisioning and Patch Automation Pack
    • Oracle Tuning Pack
    • SQL Plan Management
  • VLDB, Data Warehousing, Business Intelligence
    • Asynchronous Change Data Capture
    • Basic Table Compression
    • Bitmapped index, bitmapped join index, and bitmap plan conversions
    • Deferred Segment Creation
    • In-memory Parallel Execution
    • Oracle Advanced Compression
    • Oracle Data Mining
    • Oracle Data Profiling and Quality
    • Oracle Data Watch and Repair Connector
    • Oracle OLAP
    • Oracle Partitioning
    • Parallel Data Pump Export/Import
    • Parallel index build/scans
    • Parallel query/DML
    • Parallel Statement Queuing
    • Parallel statistics gathering
    • Summary management-Materialized View Query Rewrite
    • Transportable tablespaces, including cross-platform
  • Integration
    • Advanced Replication
    • Database Gateways
    • Messaging Gateway
    • Oracle Streams
  • Content Management
    • Oracle Multimedia
    • Semantic Technologies (RDF/OWL)
  • Spatial and Location Data
    • Multimaster replication of SDO_GEOMETRY objects
    • Oracle Spatial
    • Parallel spatial index builds
    • Partitioned spatial indexes
  • Networking
    • Infiniband Support
    • Oracle Connection Manager

Application Development, Language, and Database Features 

Feature Availability
SQL*Plus Yes
Integrated Web Application Development Environment Yes (Oracle Application Express, no Application Express application authentication using Oracle Application Server Single Sign-On)
Database Web services No
PL/SQL stored procedures and triggers Yes
PL/SQL server pages Yes
PL/SQL native compilation Yes
JDBC drivers Yes (client-side JDBC only)
Java support in the database No
Java Server Pages No
Java native compilation No
SQLJ No
XML support in the database Yes (no JNDI, or Servlet support)
Native .NET data provider support Yes (Windows only)
ASP.NET Providers Yes (Windows only)
OLE DB support Yes (Windows only)
ODBC support Yes (Windows and UNIX)
.NET Stored Procedures Yes (Windows only)
Microsoft Distributed Transaction Coordinator support Yes (Windows only)
COM Automation No (Windows only)
Oracle Objects for OLE (OO4O) No (Windows only)
Windows VLM Support, 4GB RAM Tuning No (Windows only)
Large Page memory support Yes (Windows only)
Active Directory integration Yes (Windows only; no storing of tnsnsames.ora file in Active Directory)
DML triggers Yes
Database event triggers Yes
Instead-of triggers Yes
Index-organized tables Yes
Temporary table Yes
Data Compression No
Objects and Extensibility Yes
LOB (large object) support Yes
Oracle Text Yes (English/French Knowledge Bases not supplied, nor are the following features: RULE_CLASSIFIER, SVM_CLASSIFIER, and KMEAN_CLUSTERING)
Oracle Locator Yes
Function-based index Yes
Bitmapped index, bitmapped join index No
Regular Expressions Yes
Sample Scan Yes
SQL Model Yes
SQL Analytic functions Yes
Summary Management No
Materialized View Query Rewrite No
Star query transformation Yes (B-tree indexes only)
Parallel query/DML No
Parallel statistics gathering No
Parallel index build/scans No
Parallel export/import No
Globalization support Yes (limited character sets and language translations; seeOracle Database Express Edition Installation Guide)
Multiple block size support Yes

Availability/Backup and Recovery Features

Feature Availability
Drop column Yes
Rename column, constraint Yes
Online schema reorganization/redefinition No
Flashback Query Yes
Flashback Table No
Flashback Database No
Flashback Transaction Query No
Server-managed backup and recovery No
Online Backup Yes
Backup Unused Block Compression No
Backup Encryption No
Incremental backup and recovery Yes (no change tracking file or optimized incremental backup capability)
Duplexed backup sets No
Fast-Start Selectable Recovery Time No
Block-level media recovery No
Parallel backup and recovery No
Point-in-time tablespace recovery No
Trial recovery No
Rolling Upgrade Support – Patch Set, Database and O/S No
Oracle Logminer Yes

Security Features

Feature Availability
Encryption toolkit Yes
Virtual Private Database No
Fine grained auditing No

Manageability Features

Feature Availability
Automatic Storage Management No
Automatic Datafile Management Yes
Automatic Memory Management Yes
Automatic Undo Management Yes
Automatic Optimizer Statistics Management Yes
Server-generated Alerts Yes
Database Resource Manager No

Data Movement/Integration Features

Feature Availability
Direct Path Load API Yes
External tables Yes
External procedures Yes
Synchronous Change Data Capture No
Asynchronous Change Data Capture No
Transportable tablespaces, including cross-platform No
Advanced Queuing Yes
Basic Replication Yes (read-only and updateable materialized view site only)
Advanced Replication No
Distributed queries Yes
Distributed transactions Yes
Transparent Gateways No
Generic connectivity Yes

Networking Features

Feature Availability
Directory connectivity No

For more details: http://download.oracle.com/docs/cd/E17781_01/license.112/e18068/toc.htm

Database Express Edition Documentation 11g Release 2 (11.2)

http://download.oracle.com/docs/cd/E17781_01/index.htm

Enjoy

Advertisements

How Migrate All Files on ASM to Non-ASM (Unix/Linux)

In this post I’ll show a way to migrate the database stored in ASM to Filesystem.
I’ll use PL/SQL scripts and RMAN commands to accomplish this.

I don’t like to use Oracle Managed File (OMF) for filesystem because I prefer readable names when we use non-ASM filesystem.
We have some others options which is litte bit easier, for example, migrating using OMF (filesystem) and RMAN, this way will be covered on this post.

I ask you if modify the PL/SQL code used in this post, leaving more efficiently, please send it back so I can make available to others by updating this post. (thank you)

Env Info:

DATABASE NAME : DROP
ORACLE DATAFILES/CONTROLFILE/TEMPFILE = /u01/app/oracle/oradata/drop
ORACLE FLASH RECOVERY AREA= /u01/app/oracle/flash_recovery_area/

Migration  steps:

  1. Controlfile
  2. Datafile and Tempfile
  3. Online Logs (redo)
  4. Archived Online logs (archivelogs) and BackupSet in FRA
  5. Server Parameter File (SPFILE)

1.  Controlfiles

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DG_DATA/drop/controlfile/current.275.761683397
+DG_FRA/drop/controlfile/current.281.761683397

 

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

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1119043584 bytes
Fixed Size                  2218888 bytes
Variable Size             855639160 bytes
Database Buffers          251658240 bytes
Redo Buffers                9527296 bytes

SQL> alter system set
control_files='/u01/app/oracle/oradata/drop/control01.ctl',
'/u01/app/oracle/flash_recovery_area/drop/control02.ctl'
SCOPE=SPFILE SID='*';

System altered.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.

$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Mon Sep 12 18:36:53 2011

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

connected to target database (not started)

RMAN> startup nomount

Oracle instance started

Total System Global Area    1119043584 bytes

Fixed Size                     2218888 bytes
Variable Size                855639160 bytes
Database Buffers             251658240 bytes
Redo Buffers                   9527296 bytes

RMAN> restore controlfile from '+DG_DATA/drop/controlfile/current.275.761683397';

Starting restore at 12-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=/u01/app/oracle/oradata/drop/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/drop/control02.ctl
Finished restore at 12-SEP-11

RMAN> startup mount

database is already started
database mounted
released channel: ORA_DISK_1

RMAN> exit

Recovery Manager complete.

 

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 12 18:53:19 2011

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

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/drop/control01.ctl
/u01/app/oracle/flash_recovery_area/drop/control02.ctl

2.  Datafiles and Tempfiles

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

     FILE# NAME
---------- --------------------------------------------------
         1 +DG_DATA/drop/datafile/system.292.761712355
         2 +DG_DATA/drop/datafile/sysaux.291.761712395
         3 +DG_DATA/drop/datafile/undotbs1.290.761712439
         4 +DG_DATA/drop/datafile/users.289.761712455
         5 +DG_DATA/drop/datafile/users.288.761712457
         6 +DG_DATA/drop/datafile/users.287.761712457
         7 +DG_DATA/drop/datafile/users.277.761712459
         8 +DG_DATA/drop/datafile/users.278.761712461
         9 +DG_DATA/drop/datafile/users.279.761712461
        10 +DG_DATA/drop/datafile/users.276.761712463

10 rows selected.

SQL> select file#, name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         2 +DG_DATA/drop/tempfile/temp.286.761687721
         1 +DG_DATA/drop/tempfile/temp.293.761712609

Using this PL/SQL is enough to generate RMAN command to migrate all datafiles and tempfiles at same time.

SET serveroutput ON;
DECLARE
  vcount  NUMBER:=0;
  vfname VARCHAR2(1024);
  CURSOR df
  IS
    SELECT file#,
      rtrim(REPLACE(name,'+DG_DATA/drop/datafile/','/u01/app/oracle/oradata/drop/'),'.0123456789') AS name
    FROM v$datafile;
  CURSOR tp
  IS
    SELECT file#,
      rtrim(REPLACE(name,'+DG_DATA/drop/tempfile/','/u01/app/oracle/oradata/drop/'),'.0123456789') AS name
    FROM v$tempfile;
BEGIN
  dbms_output.put_line('CONFIGURE CONTROLFILE AUTOBACKUP ON;');
  FOR dfrec IN df
  LOOP
    IF dfrec.name  != vfname THEN
      vcount      :=1;
      vfname     := dfrec.name;
    ELSE
      vcount := vcount+1;
      vfname:= dfrec.name;
    END IF;
    dbms_output.put_line('backup as copy datafile ' || dfrec.file# ||' format  "'||dfrec.name ||vcount||'.dbf";');
  END LOOP;
  dbms_output.put_line('run');
  dbms_output.put_line('{');
  FOR dfrec IN df
  LOOP
    IF dfrec.name  != vfname THEN
      vcount      :=1;
      vfname     := dfrec.name;
    ELSE
      vcount := vcount+1;
      vfname:= dfrec.name;
    END IF;
    dbms_output.put_line('set newname for datafile ' || dfrec.file# ||'  to  '''||dfrec.name ||vcount||'.dbf'' ;');
  END LOOP;
  FOR tprec IN tp
  LOOP
    IF tprec.name  !=  vfname THEN
      vcount      :=1;
      vfname     := tprec.name;
    ELSE
      vcount := vcount+1;
      vfname:= tprec.name;
    END IF;
    dbms_output.put_line('set newname for tempfile ' || tprec.file# ||'  to  '''||tprec.name ||vcount||'.dbf'' ;');
    END LOOP;
    dbms_output.put_line('switch tempfile all;');
    dbms_output.put_line('switch datafile all;');
    dbms_output.put_line('restore database;');
    dbms_output.put_line('recover database;');
    dbms_output.put_line('}');
    dbms_output.put_line('alter database open;');
    dbms_output.put_line('exit');
END;
/

Database must be Mounted


SQL> SET serveroutput ON;
SQL> DECLARE
.
.
.
 57      dbms_output.put_line('exit');
 58  END;
 59  /

CONFIGURE CONTROLFILE AUTOBACKUP ON;
backup as copy datafile 1 format  "/u01/app/oracle/oradata/drop/system1.dbf";
backup as copy datafile 2 format  "/u01/app/oracle/oradata/drop/sysaux1.dbf";
backup as copy datafile 3 format  "/u01/app/oracle/oradata/drop/undotbs1.dbf";
backup as copy datafile 4 format  "/u01/app/oracle/oradata/drop/users1.dbf";
backup as copy datafile 5 format  "/u01/app/oracle/oradata/drop/users2.dbf";
backup as copy datafile 6 format  "/u01/app/oracle/oradata/drop/users3.dbf";
backup as copy datafile 7 format  "/u01/app/oracle/oradata/drop/users4.dbf";
backup as copy datafile 8 format  "/u01/app/oracle/oradata/drop/users5.dbf";
backup as copy datafile 9 format  "/u01/app/oracle/oradata/drop/users6.dbf";
backup as copy datafile 10 format  "/u01/app/oracle/oradata/drop/users7.dbf";
run
{
set newname for datafile 1  to  '/u01/app/oracle/oradata/drop/system1.dbf' ;
set newname for datafile 2  to  '/u01/app/oracle/oradata/drop/sysaux1.dbf' ;
set newname for datafile 3  to  '/u01/app/oracle/oradata/drop/undotbs1.dbf' ;
set newname for datafile 4  to  '/u01/app/oracle/oradata/drop/users1.dbf' ;
set newname for datafile 5  to  '/u01/app/oracle/oradata/drop/users2.dbf' ;
set newname for datafile 6  to  '/u01/app/oracle/oradata/drop/users3.dbf' ;
set newname for datafile 7  to  '/u01/app/oracle/oradata/drop/users4.dbf' ;
set newname for datafile 8  to  '/u01/app/oracle/oradata/drop/users5.dbf' ;
set newname for datafile 9  to  '/u01/app/oracle/oradata/drop/users6.dbf' ;
set newname for datafile 10  to  '/u01/app/oracle/oradata/drop/users7.dbf' ;
set newname for tempfile 1  to  '/u01/app/oracle/oradata/drop/temp1.dbf' ;
set newname for tempfile 2  to  '/u01/app/oracle/oradata/drop/temp2.dbf' ;
switch tempfile all;
switch datafile all;
restore database;
recover database;
}
alter database open;
exit

Important: Setting AUTOBACKUP ON is mandatory (Backup Fails ORA-27038 Creating Automatic Controlfile Backup [ID 382989.1])

Create a RMAN script file “migrate_db.rcv” and paste command generate by PL/SQL.

nohup rman target / cmdfile migrate_db.rcv log migrate_db.log &

cat migrate_db.log

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Starting backup at 13-SEP-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=137 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DG_DATA/drop/datafile/system.292.761712355
output file name=/u01/app/oracle/oradata/drop/system1.dbf tag=TAG20110913T025233 RECID=68 STAMP=761712766
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvxlw3_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DG_DATA/drop/datafile/sysaux.291.761712395
output file name=/u01/app/oracle/oradata/drop/sysaux1.dbf tag=TAG20110913T025253 RECID=69 STAMP=761712784
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvy5h5_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DG_DATA/drop/datafile/undotbs1.290.761712439
output file name=/u01/app/oracle/oradata/drop/undotbs1.dbf tag=TAG20110913T025312 RECID=70 STAMP=761712796
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvyjkb_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DG_DATA/drop/datafile/users.289.761712455
output file name=/u01/app/oracle/oradata/drop/users1.dbf tag=TAG20110913T025321 RECID=71 STAMP=761712802
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvymrv_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DG_DATA/drop/datafile/users.288.761712457
output file name=/u01/app/oracle/oradata/drop/users2.dbf tag=TAG20110913T025326 RECID=72 STAMP=761712807
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvys74_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DG_DATA/drop/datafile/users.287.761712457
output file name=/u01/app/oracle/oradata/drop/users3.dbf tag=TAG20110913T025332 RECID=73 STAMP=761712812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvyydl_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=+DG_DATA/drop/datafile/users.277.761712459
output file name=/u01/app/oracle/oradata/drop/users4.dbf tag=TAG20110913T025335 RECID=74 STAMP=761712816
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvz1qq_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=+DG_DATA/drop/datafile/users.278.761712461
output file name=/u01/app/oracle/oradata/drop/users5.dbf tag=TAG20110913T025338 RECID=75 STAMP=761712819
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvz4xm_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00009 name=+DG_DATA/drop/datafile/users.279.761712461
output file name=/u01/app/oracle/oradata/drop/users6.dbf tag=TAG20110913T025342 RECID=76 STAMP=761712822
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvz878_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

Starting backup at 13-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00010 name=+DG_DATA/drop/datafile/users.276.761712463
output file name=/u01/app/oracle/oradata/drop/users7.dbf tag=TAG20110913T025345 RECID=77 STAMP=761712825
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-SEP-11

Starting Control File and SPFILE Autobackup at 13-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_13/o1_mf_s_761712652_76xvzcjb_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-11

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/drop/temp1.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/drop/temp2.dbf in control file

datafile 1 switched to datafile copy
input datafile copy RECID=68 STAMP=761712766 file name=/u01/app/oracle/oradata/drop/system1.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=69 STAMP=761712784 file name=/u01/app/oracle/oradata/drop/sysaux1.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=70 STAMP=761712796 file name=/u01/app/oracle/oradata/drop/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=71 STAMP=761712802 file name=/u01/app/oracle/oradata/drop/users1.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=72 STAMP=761712807 file name=/u01/app/oracle/oradata/drop/users2.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=73 STAMP=761712812 file name=/u01/app/oracle/oradata/drop/users3.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=74 STAMP=761712816 file name=/u01/app/oracle/oradata/drop/users4.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=75 STAMP=761712819 file name=/u01/app/oracle/oradata/drop/users5.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=76 STAMP=761712822 file name=/u01/app/oracle/oradata/drop/users6.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=77 STAMP=761712825 file name=/u01/app/oracle/oradata/drop/users7.dbf

Starting restore at 13-SEP-11
using channel ORA_DISK_1

skipping datafile 1; already restored to file /u01/app/oracle/oradata/drop/system1.dbf
skipping datafile 2; already restored to file /u01/app/oracle/oradata/drop/sysaux1.dbf
skipping datafile 3; already restored to file /u01/app/oracle/oradata/drop/undotbs1.dbf
skipping datafile 4; already restored to file /u01/app/oracle/oradata/drop/users1.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/drop/users2.dbf
skipping datafile 6; already restored to file /u01/app/oracle/oradata/drop/users3.dbf
skipping datafile 7; already restored to file /u01/app/oracle/oradata/drop/users4.dbf
skipping datafile 8; already restored to file /u01/app/oracle/oradata/drop/users5.dbf
skipping datafile 9; already restored to file /u01/app/oracle/oradata/drop/users6.dbf
skipping datafile 10; already restored to file /u01/app/oracle/oradata/drop/users7.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 13-SEP-11

Starting recover at 13-SEP-11
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:02

Finished recover at 13-SEP-11

database opened

Recovery Manager complete.
SQL> select file#, name from v$datafile;

     FILE# NAME
---------- --------------------------------------------------
         1 /u01/app/oracle/oradata/drop/system1.dbf
         2 /u01/app/oracle/oradata/drop/sysaux1.dbf
         3 /u01/app/oracle/oradata/drop/undotbs1.dbf
         4 /u01/app/oracle/oradata/drop/users1.dbf
         5 /u01/app/oracle/oradata/drop/users2.dbf
         6 /u01/app/oracle/oradata/drop/users3.dbf
         7 /u01/app/oracle/oradata/drop/users4.dbf
         8 /u01/app/oracle/oradata/drop/users5.dbf
         9 /u01/app/oracle/oradata/drop/users6.dbf
        10 /u01/app/oracle/oradata/drop/users7.dbf

10 rows selected.

SQL> select file#, name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         2 /u01/app/oracle/oradata/drop/temp2.dbf
         1 /u01/app/oracle/oradata/drop/temp1.dbf

SQL>

3.  Online Logs (Redo)

Database must be Open

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

    GROUP# MEMBER
---------- ------------------------------------------------------------------------------------------
         1 +DG_DATA/drop/onlinelog/group_1.285.761755579
         2 +DG_DATA/drop/onlinelog/group_2.284.761755615
         3 +DG_DATA/drop/onlinelog/group_3.278.761755651
         4 +DG_DATA/drop/onlinelog/group_4.283.761754951
         5 +DG_DATA/drop/onlinelog/group_5.276.761754957
         6 +DG_DATA/drop/onlinelog/group_6.282.761754963
         7 +DG_DATA/drop/onlinelog/group_7.279.761754967

SQL> SELECT group# grp,
      thread# thr,
      bytes/1024 bytes_k,
      'NO' srl,
      status
    FROM v$log
  UNION
  SELECT group# grp,
    thread# thr,
    bytes/1024 bytes_k,
    'YES' srl,
    status
  FROM v$standby_log
  ORDER BY 1;

       GRP        THR    BYTES_K SRL STATUS
---------- ---------- ---------- --- ----------------
         1          1     102400 NO  INACTIVE
         2          1     102400 NO  CURRENT
         3          1     102400 NO  UNUSED
         4          1     102400 YES UNASSIGNED
         5          1     102400 YES UNASSIGNED
         6          1     102400 YES UNASSIGNED
         7          1     102400 YES UNASSIGNED

Another PL/SQL, will work only if database have more than 2 Logfile Group

DECLARE
  vgroup NUMBER;
  CURSOR rlc
  IS
    SELECT group# grp,
      thread# thr,
      bytes/1024 bytes_k,
      'NO' srl,
      status
    FROM v$log
  UNION
  SELECT group# grp,
    thread# thr,
    bytes/1024 bytes_k,
    'YES' srl,
    status
  FROM v$standby_log
  ORDER BY status DESC;
  stmt    VARCHAR2(2048);
  swtstmt VARCHAR2(1024) := 'alter system switch logfile';
  ckpstmt VARCHAR2(1024) := 'alter system checkpoint global';
BEGIN
  FOR rlcRec IN rlc
  LOOP
    IF (rlcRec.srl = 'YES') THEN
      BEGIN
        SELECT group#
        INTO vgroup
        FROM v$standby_log
        WHERE group# = rlcRec.grp
        AND thread#  = rlcRec.thr
        AND (status  ='CURRENT'
        OR status    = 'ACTIVE');
        stmt        := 'alter database drop standby logfile group ' || rlcRec.grp;
        EXECUTE IMMEDIATE swtstmt;
        EXECUTE IMMEDIATE ckpstmt;
        EXECUTE immediate stmt;
        stmt := 'alter database add standby logfile thread ' || rlcRec.thr ||' group '||rlcRec.grp||' ''/u01/app/oracle/oradata/drop/redo_stby'||rlcRec.grp||'_'||rlcRec.thr||'_a.log'' size ' || rlcRec.bytes_k || 'K';
        EXECUTE immediate stmt;
      EXCEPTION
      WHEN NO_DATA_FOUND THEN
        BEGIN
          EXECUTE immediate ckpstmt;
          stmt := 'alter database drop standby logfile group ' || rlcRec.grp;
          EXECUTE immediate stmt;
          stmt := 'alter database add standby logfile thread ' || rlcRec.thr ||' group '||rlcRec.grp||' ''/u01/app/oracle/oradata/drop/redo_stby'||rlcRec.grp||'_'||rlcRec.thr||'_a.log'' size ' || rlcRec.bytes_k || 'K';
          EXECUTE immediate stmt;
        END;
      END;
    ELSE
      BEGIN
        SELECT group#
        INTO vgroup
        FROM v$log
        WHERE group# = rlcRec.grp
        AND thread#  = rlcRec.thr
        AND (status  ='CURRENT'
        OR status    = 'ACTIVE');
        stmt        := 'alter database drop logfile group ' || rlcRec.grp;
        EXECUTE IMMEDIATE swtstmt;
        EXECUTE IMMEDIATE ckpstmt;
        EXECUTE immediate stmt;
        stmt := 'alter database add logfile thread ' || rlcRec.thr || ' group '||rlcRec.grp||'  ''/u01/app/oracle/oradata/drop/redo_'||rlcRec.grp||'_'||rlcRec.thr||'_a.log'' size ' || rlcRec.bytes_k || 'K';
        EXECUTE immediate stmt;
      EXCEPTION
      WHEN NO_DATA_FOUND THEN
        BEGIN
          EXECUTE immediate ckpstmt;
          stmt := 'alter database drop logfile group ' || rlcRec.grp;
          EXECUTE immediate stmt;
          stmt := 'alter database add logfile thread ' || rlcRec.thr || ' group '||rlcRec.grp||'  ''/u01/app/oracle/oradata/drop/redo_'||rlcRec.grp||'_'||rlcRec.thr||'_a.log'' size ' || rlcRec.bytes_k || 'K';
          EXECUTE immediate stmt;
        END;
      END;
    END IF;
  END LOOP;
END;
/
SQL> select group#,member from v$logfile order by 1;

    GROUP# MEMBER
---------- ------------------------------------------------------------------------------------------
         1 /u01/app/oracle/oradata/drop/redo_1_1_a.log
         2 /u01/app/oracle/oradata/drop/redo_2_1_a.log
         3 /u01/app/oracle/oradata/drop/redo_3_1_a.log
         4 /u01/app/oracle/oradata/drop/redo_stby4_1_a.log
         5 /u01/app/oracle/oradata/drop/redo_stby5_1_a.log
         6 /u01/app/oracle/oradata/drop/redo_stby6_1_a.log
         7 /u01/app/oracle/oradata/drop/redo_stby7_1_a.log

7 rows selected.

SQL> SELECT group# grp,
      thread# thr,
      bytes/1024 bytes_k,
      'NO' srl,
      status
    FROM v$log
  UNION
  SELECT group# grp,
    thread# thr,
    bytes/1024 bytes_k,
    'YES' srl,
    status
  FROM v$standby_log
  ORDER BY 1;  2    3    4    5    6    7    8    9   10   11   12   13   14

       GRP        THR    BYTES_K SRL STATUS
---------- ---------- ---------- --- ----------------
         1          1     102400 NO  CURRENT
         2          1     102400 NO  UNUSED
         3          1     102400 NO  UNUSED
         4          1     102400 YES UNASSIGNED
         5          1     102400 YES UNASSIGNED
         6          1     102400 YES UNASSIGNED
         7          1     102400 YES UNASSIGNED

4.  Archived Online logs (archivelogs) and BackupSet stored in FRA

Migrating BackupSet and Archivelogs from FRA (Flash Recovery Area) on ASM to FRA on NON-ASM

The first step is set new FRA.

SQL> show parameter db_recovery_file
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +DG_FRA
db_recovery_file_dest_size           big integer 100G

SQL> alter system set db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' scope=both;

SQL> show parameter db_recovery_file
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size           big integer 100G

Migrating Archivelog

RMAN> list archivelog all;

using target database control file instead of recovery catalog
List of Archived Log Copies for database with db_unique_name DROP
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
80      1    57      A 16-SEP-11
        Name: +DG_FRA/drop/archivelog/2011_09_16/thread_1_seq_57.343.762030975

81      1    58      A 16-SEP-11
        Name: +DG_FRA/drop/archivelog/2011_09_16/thread_1_seq_58.333.762030975
.
.
.
89      1    66      A 16-SEP-11
        Name: +DG_FRA/drop/archivelog/2011_09_16/thread_1_seq_66.340.762030987

90      1    67      A 16-SEP-11
        Name: +DG_FRA/drop/archivelog/2011_09_16/thread_1_seq_67.341.762030989

$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Sep 16 19:20:01 2011

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

connected to target database: DROP (DBID=3027542406)

RMAN>  BACKUP AS COPY ARCHIVELOG ALL DELETE INPUT;

Starting backup at 16-SEP-11
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=57 RECID=92 STAMP=762031143
output file name=/u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_57_777lwyyp_.arc RECID=105 STAMP=762031215
.
.
.
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_69_777lww4t_.arc RECID=104 STAMP=762031212
Finished backup at 16-SEP-11

Starting Control File and SPFILE Autobackup at 16-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_16/o1_mf_s_762031234_777lxlx5_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 16-SEP-11

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name DROP
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
105     1    57      A 16-SEP-11
        Name: /u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_57_777lwyyp_.arc

106     1    58      A 16-SEP-11
        Name: /u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_58_777lx0dh_.arc

.
.
.
116     1    68      A 16-SEP-11
        Name: /u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_68_777lxhfl_.arc

117     1    69      A 16-SEP-11
        Name: /u01/app/oracle/flash_recovery_area/DROP/archivelog/2011_09_16/o1_mf_1_69_777lxjwv_.arc
 

Migrating Backupset

 list backupset summary;

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
49      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190201
50      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190208
51      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190235
52      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190237
53      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190919
54      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190921
55      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190937
56      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190939

RMAN> LIST BACKUPPIECE TAG TAG20110916T190201;

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
49      49      1   1   AVAILABLE   DISK        +DG_FRA/drop/backupset/2011_09_16/annnf0_tag20110916t190201_0.332.762030121

RMAN> BACKUP DEVICE TYPE DISK BACKUPSET ALL DELETE INPUT;

Starting backup at 16-SEP-11
using channel ORA_DISK_1
channel ORA_DISK_1: input backup set: count=107, stamp=762030121, piece=1
channel ORA_DISK_1: starting piece 1 at 16-SEP-11
channel ORA_DISK_1: backup piece +DG_FRA/drop/backupset/2011_09_16/annnf0_tag20110916t190201_0.332.762030121
piece handle=/u01/app/oracle/flash_recovery_area/DROP/backupset/2011_09_16/o1_mf_annnn_TAG20110916T190201_777ly4p4_.bkp comment=NONE
.
.
.
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:00
channel ORA_DISK_1: input backup set: count=153, stamp=762031234, piece=1
channel ORA_DISK_1: starting piece 1 at 16-SEP-11
skipping backup piece handle /u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_16/o1_mf_s_762031234_777lxlx5_.bkp; already exists
channel ORA_DISK_1: finished piece 1 at 16-SEP-11
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:00
Finished backup at 16-SEP-11

Starting Control File and SPFILE Autobackup at 16-SEP-11
piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_16/o1_mf_s_762031278_777lyz23_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 16-SEP-11

RMAN> LIST BACKUPSET SUMMARY;

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
49      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190201
50      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190208
51      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190235
52      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190237
53      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190919
54      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190921
55      B  A  A DISK        16-SEP-11       1       1       NO         TAG20110916T190937
56      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T190939
57      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T191630
58      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T191920
59      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T192034
60      B  F  A DISK        16-SEP-11       1       1       NO         TAG20110916T192118

RMAN> LIST BACKUPPIECE TAG TAG20110916T190201;

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
60      49      1   2   AVAILABLE   DISK        /u01/app/oracle/flash_recovery_area/DROP/backupset/2011_09_16/o1_mf_annnn_TAG20110916T190201_777ly4p4_.bkp

5.  Server Parameter File (SPFILE)

SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DG_DATA/drop/spfiledrop.ora

srvctl config database -d drop |grep Spfile
Spfile: +DG_DATA/drop/spfiledrop.ora

rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Sep 16 19:56:33 2011

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

connected to target database: DROP (DBID=3027542406)

RMAN> restore spfile to '$ORACLE_HOME/dbs/spfiledrop.ora';

Starting restore at 16-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=136 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: restoring SPFILE
output file name=$ORACLE_HOME/dbs/spfiledrop.ora
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_16/o1_mf_s_762031278_777lyz23_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/DROP/autobackup/2011_09_16/o1_mf_s_762031278_777lyz23_.bkp tag=TAG20110916T192118
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 16-SEP-11

# edit initdrop.ora on $ORACLE_HOME/dbs
vi initdrop
spfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledrop.ora'

# If you are using Oracle Restart you must change configuration with srvct.
$ srvctl modify database -d drop -p $ORACLE_HOME/dbs/spfiledrop.ora
$ srvctl config database -d drop |grep Spfile
Spfile: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledrop.ora

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

Total System Global Area 1119043584 bytes
Fixed Size                  2218888 bytes
Variable Size             855639160 bytes
Database Buffers          251658240 bytes
Redo Buffers                9527296 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledrop.ora

You can comment … I accept hints ….

Rodrigo Murillo G (Quote)

I did a little change in the PL/SQL script which generates rman commands for backup and restore. The change allows numbers on the datafile names (i.e. datafiles for table partitions tablespaces by years, quarters, etc). Also, the restore database and switch commands were changed in their order (originally: first switch then restore), and the order that worked for me was first restore then switch.

SET serveroutput ON;
DECLARE
vcount NUMBER:=0;
vfname VARCHAR2(1024);
CURSOR df
IS
SELECT file#,
replace (substr ( name, 1, instr( name, '.', 1 , 1 ) -1) || '_', '+DATA', '/data_oracle' ) AS name
FROM v$datafile
order by name;
CURSOR tp
IS
SELECT file#,
rtrim(REPLACE(name,'+DATA/ictxcyc/tempfile/','/data_oracle/ictxcyc/datafile/'),'.0123456789′) AS name
FROM v$tempfile;
BEGIN
dbms_output.put_line('CONFIGURE CONTROLFILE AUTOBACKUP ON;');
FOR dfrec IN df
LOOP
IF dfrec.name != vfname THEN
vcount :=1;
vfname := dfrec.name;
ELSE
vcount := vcount+1;
vfname:= dfrec.name;
END IF;
dbms_output.put_line('backup as copy datafile ' || dfrec.file# ||' format "'||dfrec.name ||vcount||'.dbf";');
END LOOP;
dbms_output.put_line('run');
dbms_output.put_line('{');
FOR dfrec IN df
LOOP
IF dfrec.name != vfname THEN
vcount :=1;
vfname := dfrec.name;
ELSE
vcount := vcount+1;
vfname:= dfrec.name;
END IF;
dbms_output.put_line('set newname for datafile ' || dfrec.file# ||' to "'||dfrec.name ||vcount||'.dbf" ;' );
END LOOP;
FOR tprec IN tp
LOOP
IF tprec.name != vfname THEN
vcount :=1;
vfname := tprec.name;
ELSE
vcount := vcount+1;
vfname:= tprec.name;
END IF;
dbms_output.put_line('set newname for tempfile ' || tprec.file# ||' to "'||tprec.name ||vcount||'.dbf" ;');
END LOOP;
dbms_output.put_line('restore database;');
dbms_output.put_line('switch tempfile all;');
dbms_output.put_line('switch datafile all;');
dbms_output.put_line('recover database;');
dbms_output.put_line('}');
dbms_output.put_line('alter database open;');
dbms_output.put_line('exit');
END;
/

Enjoy…


Oracle ACFS Filesystem managed by OHAS on Oracle Restart

Bad news from Oracle 11.2.0.2:

Oracle ACFS and Oracle Restart


Oracle Restart does not support root-based Oracle ACFS resources for this release. Consequently, the following operations are not automatically performed:

Loading Oracle ACFS drivers
Mounting Oracle ACFS file systems listed in the Oracle ACFS mount registry
Mounting resource-based Oracle ACFS database home file systems
The Oracle ACFS resources associated with these actions are not created for Oracle Restart configurations.

While Oracle ACFS resource management is fully supported for Oracle Grid Infrastructure configurations, the Oracle ACFS resource-based management actions must be replaced with alternative, sometimes manual, operations in Oracle Restart configurations.

http://download.oracle.com/docs/cd/E11882_01/server.112/e16102/asmfs_extra.htm#CACBDGCC

Big Question!
Why use ACFS (i.e Cluster Filesystem) on Single Node Installation? It makes no sense!!!
Using O.S filesystem I have all resources of ACFS (Performance, Manageability and Availability).
And using ACFS on Single Node (Oracle Restart) is very poor many task must be performed manually (like load drivers, mountfilesystem,etc) .
Particularly I do not use ACFS on Single Nodes, I see no need for that.

I created this post just for fun and to help those  wich use ACFS on Oracle Restart.

BUT…
ACFS has a feature that does not have on S.O filesystem.

ACFS Snapshots

ACFS provides snapshotting capability for the respective filesystem. This snapshot uses the First Copy-on-Write (FCOW) methodology to enable a consistent, version-based, online view of the source filesystem.
Snapshots are immutable views of the source file system as it appeared at a specific point in time.
Snapshots are initially a sparse filesystem, as the source filesystem files change, the before-image extent of that file is copied into the snapshot directory.
Accessing the snapshot will always provide a point-in-time view of a file, thus ACFS snapshots can be very useful for file-based recovery or for filesystem backups. If file level recovery is needed (for the base filesystem), it can be performed using standard file copy or replace commands.
A possible use case scenario for snapshots can be to create a consistent recovery point set between the database ORACLE_HOME and the database.
This is useful, for example, when a recovery point needs to be established before applying a database patchset.

Important: Be very careful using Oracle ACFS filesystem to ORACLE_HOME. When you create a database using this ORACLE_HOME this database is automatically registred on OHAS (Oracle Restart). If you restart Server OHAS will try start this database automatically, but the filesystem (ACFS) of ORACLE_HOME is not mounted automatically must be done manually , therefore all databases of this ORACLE_HOME must be started manually too.

I’ll show you how to automate the process of load and drivers of ACFS and mounting/umounting filesystem using OHAS.

LINUX PLATAFORM

Create a ACFS Filesystem.

I will create a ACFS Filesystem on DISKGROUP “DG_ORAHOME11GR2_1”

Create ACFS for Database Home

Configure Oracle Home location, Size (GB), user and group.

Creating ACFS…

ASMCA does not support root-based Oracle ACFS resources, so must be done manually.

Oracle automatically generate a script to mount this filesystem.

Volume created…and ENABLED

ACFS MOUNTED…..

If you restart your Server, the ASCS drivers will be not loaded automatically, therefore te TAB (Volumes and ASM Cluster File Systems) of ASMCA will be inactive.

Loading ACFS Drivers Automatically

To configure Autostart of ACFS drivers during node reboot on Linux

Add an acfsload start command in /etc/rc.local.so they are automatically loaded during node bootup

cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/sbin/modprobe hangcheck-timer
/u01/app/grid/product/11.2.0/grid/bin/acfsload start –s
devlabel restart

Setting up  AUTO MOUNT/AUTO UMOUNT of Filesystem on OHAS. 

We can use OHAS to start, stop, monitor and restart applications. Using feature RESOURCE of OHAS.

Let’s create a script to mount/umount ACFS Filesystem.

Using Oracle user (oracle)

cd /u01/app/grid/product/11.2.0/grid/crs/script

vi acfs_ORAHOME11GR2.sh
#!/bin/sh
case $1 in
'start')
# Check if Volume is Enabled if not enable volume

if [ ! -f /dev/asm/db112_dbh1-220 ]; then
ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
ORACLE_SID=+ASM
$ORACLE_HOME/bin/asmcmd <<EOF
volenable -G DG_ORAHOME11GR2_1 db112_dbh1
EOF
fi
# Mount filesystem

/usr/bin/sudo /bin/mount -t acfs /dev/asm/db112_dbh1-220 /u01/app/oracle/product/11.2.0/dbhome_1

# Change permission of Filesystem
 if [ $? = "0" ]; then
 /usr/bin/sudo  /bin/chown oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1
 /usr/bin/sudo  /bin/chmod 775 /u01/app/oracle/product/11.2.0/dbhome_1
  exit 0
 fi
 RET=$?
;;

# Stop Filesystem
'stop')
/usr/bin/sudo /bin/umount -t acfs /dev/asm/db112_dbh1-220
 RET=$?
;;
'clean')
/usr/bin/sudo  /bin/umount -t acfs /dev/asm/db112_dbh1-220
  RET=$?
    ;;
# Check if Filesystem is Mounted
'check')
  OUTCMD=`/bin/mount |grep '/dev/asm/db112_dbh1-220' |wc -l`
  if [ $OUTCMD = 1 ]; then
  RET=0
  else
  RET=1
  fi
;;
esac
# 0: success; 1 : error
if [ $RET -eq 0 ]; then
exit 0
else
exit 1
fi

I used the “sudo” to perform root-tasks. So you must allow user oracle perform root actions without password.

Using root privileges (or root user)  type “visudo” to edit sudoers file.

# visudo

Comment the line "Defaults    requiretty"
# Defaults    requiretty

Add user Oracle above this:
# %wheel        ALL=(ALL)       NOPASSWD: ALL
oracle          ALL=(ALL)       NOPASSWD: /bin/chown, /bin/chmod, /bin/mount, /bin/umount

Registering Resource in OHAS

Register Resource “acfs.orahome11gR2_1.fs” on OHAS creating dependency of DISKGROUP “DG_ORAHOME11GR2_1”

START_DEPENDENCIES: Specifies a set of relationships that OHAS considers when starting a resource.
You can specify a space-separated list of dependencies on several resources and resource types on which a particular resource can depend.
hard: Specify a hard start dependency for a resource when you want the resource to start only when a particular resource or resource of a particular type starts.
Oracle recommends that resources with hard start dependencies also have pullup start dependencies.
pullup: When you specify the pullup start dependency for a resource, then this resource starts as a result of named resources starting.

So, We must specify the START_DEPENDENCIES referencing to DISKGROUP DG_ORAHOME11GR2_1 where are ORACLE_HOME filesystem, that’s means when you try start the resource “acfs.orahome11gR2_1.fs” the DISKGROUP DG_ORAHOME11GR2_1 must be started, if DISKGROUP DG_ORAHOME11GR2_1 is not started “pullup” will try start DISKGROUP DG_ORAHOME11GR2_1 before try start resource “acfs.orahome11gR2_1.fs”.

STOP_DEPENDENCIES: Specifies a set of relationships that OHAS considers when stopping a resource.
hard: Specify a hard stop dependency for a resource that you want to stop when named resources or resources of a particular resource type stop.

So, if we try to stop (using OHAS) DISKGROUP DG_ORAHOME11GR2_1 when ACFS (ORACLE_HOME) remain mounted (ONLINE) OHAS must raise CRS-2529

CRS-2529: Unable to act on  because that would require stopping or relocating ,
but the force option was not specified

 

crsctl add resource acfs.orahome11gR2_1.fs \
-type local_resource \
-attr "\
ACTION_SCRIPT=/u01/app/grid/product/11.2.0/grid/crs/script/acfs_ORAHOME11GR2.sh,\
AUTO_START=always,\
START_TIMEOUT=100,\
STOP_TIMEOUT=100,\
CHECK_INTERVAL=10,\
START_DEPENDENCIES=hard(ora.DG_ORAHOME11GR2_1.dg)pullup(ora.DG_ORAHOME11GR2_1.dg),\
STOP_DEPENDENCIES='hard(ora.DG_ORAHOME11GR2_1.dg)'"

More info about attributes used here you can found here:
http://download.oracle.com/docs/cd/E11882_01/rac.112/e16794/resatt.htm

$ crsctl status resource acfs.orahome11gR2_1.fs
NAME=acfs.orahome11gR2_1.fs
TYPE=local_resource
TARGET=OFFLINE
STATE=OFFLINE

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       54G  9.0G   42G  18% /
/dev/sda1              99M   31M   64M  33% /boot
tmpfs                 2.5G  176M  2.3G   8% /dev/shm

# Mounting Filesystem with OHAS:
$ crsctl start resource acfs.orahome11gR2_1.fs
CRS-2672: Attempting to start 'acfs.orahome11gR2_1.fs' on 'macedonia'
CRS-2676: Start of 'acfs.orahome11gR2_1.fs' on 'macedonia' succeeded

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       54G  9.0G   42G  18% /
/dev/sda1              99M   31M   64M  33% /boot
tmpfs                 2.5G  176M  2.3G   8% /dev/shm
/dev/asm/db112_dbh1-220
                       15G  10M   15G  1% /u01/app/oracle/product/11.2.0/dbhome_1

$ crsctl status resource acfs.orahome11gR2_1.fs
NAME=acfs.orahome11gR2_1.fs
TYPE=local_resource
TARGET=ONLINE
STATE=ONLINE on macedonia

Trying stop DISKGROUP without umount filesystem

$ srvctl stop diskgroup -g DG_ORAHOME11GR2_1
PRCR-1065 : Failed to stop resource ora.DG_ORAHOME11GR2_1.dg
CRS-2529: Unable to act on 'ora.DG_ORAHOME11GR2_1.dg' because that would require stopping or relocating 'acfs.orahome11gR2_1.fs', but the force option was not specified

Now you can restart your server and make sure wich the filesystem will be mounted at startup of OHAS.
If everything is ok you can install Oracle Software on ACFS.

I created a Database (db11g) using ORACLE_HOME on ACFS.

When DBCA create a Database (Oracle Restart) he doesn’t create dependencies between ACFS Mount and Database.

So, when OHAS start a Database (db11g)  he will try start only DISKGROUPs where database files are and just it. As ORACLE_HOME is not mounted Database will not start automatically.

We must create a dependencie between ACFS Mount and Database (like oracle does with Diskgroup).

Using Resource name of Database (ora.db11g.db) let’s create dependencies.

To Start Database (db11g) the ACFS Filesystem must be mounted. And to Stop ACFS Filesystem Database must be OFFLINE. If we try start Database without ACFS Filesystem mounted  OHAS will try start ACFS Filesystem before start Database.

$ crsctl modify resource ora.db11g.db -attr "\
START_DEPENDENCIES='hard(acfs.orahome11gR2_1.fs)pullup(acfs.orahome11gR2_1.fs)',\
STOP_DEPENDENCIES='hard(acfs.orahome11gR2_1.fs)'"

Creating this dependencies does not affect config of Database in OHAS.

$ srvctl config database -d db11g -a
Database unique name: db11g
Database name: db11g
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DG_DATA/db11g/spfiledb11g.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DG_DATA,DG_FRA
Services:
Database is enabled

Testing:

All Online:

crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
acfs.orahome11gR2_1.fs
               ONLINE  ONLINE       macedonia
ora.DG_DATA.dg
               ONLINE  ONLINE       macedonia
ora.DG_FRA.dg
               ONLINE  ONLINE       macedonia
ora.DG_ORAHOME11GR2_1.dg
               ONLINE  ONLINE       macedonia
ora.LISTENER.lsnr
               ONLINE  ONLINE       macedonia
ora.asm
               ONLINE  ONLINE       macedonia                Started
ora.ons
               OFFLINE OFFLINE      macedonia
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       macedonia
ora.db11g.db
      1        ONLINE  ONLINE       macedonia                Open
ora.diskmon
      1        ONLINE  ONLINE       macedonia
ora.evmd
      1        ONLINE  ONLINE       macedonia

Stopping Diskgroup DG_ORAHOME11GR2_1

$ srvctl stop database -d db11g
$ crsctl stop resource acfs.orahome11gR2_1.fs
CRS-2673: Attempting to stop 'acfs.orahome11gR2_1.fs' on 'macedonia'
CRS-2677: Stop of 'acfs.orahome11gR2_1.fs' on 'macedonia' succeeded
$ srvctl stop diskgroup -g DG_ORAHOME11GR2_1

### Database, Filesystem and Diskgroup is Offline
$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
acfs.orahome11gR2_1.fs
               OFFLINE OFFLINE      macedonia
ora.DG_DATA.dg
               ONLINE  ONLINE       macedonia
ora.DG_FRA.dg
               ONLINE  ONLINE       macedonia
ora.DG_ORAHOME11GR2_1.dg
               OFFLINE OFFLINE      macedonia
ora.LISTENER.lsnr
               ONLINE  ONLINE       macedonia
ora.asm
               ONLINE  ONLINE       macedonia                Started
ora.ons
               OFFLINE OFFLINE      macedonia
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       macedonia
ora.db11g.db
      1        OFFLINE OFFLINE                               Instance Shutdown
ora.diskmon
      1        ONLINE  ONLINE       macedonia
ora.evmd
      1        ONLINE  ONLINE       macedonia

Starting only database, all resources dependents must be UP automatically.


$ srvctl start database -d db11g

$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
acfs.orahome11gR2_1.fs
               ONLINE  ONLINE       macedonia
ora.DG_DATA.dg
               ONLINE  ONLINE       macedonia
ora.DG_FRA.dg
               ONLINE  ONLINE       macedonia
ora.DG_ORAHOME11GR2_1.dg
               ONLINE  ONLINE       macedonia
ora.LISTENER.lsnr
               ONLINE  ONLINE       macedonia
ora.asm
               ONLINE  ONLINE       macedonia                Started
ora.ons
               OFFLINE OFFLINE      macedonia
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       macedonia
ora.db11g.db
      1        ONLINE  ONLINE       macedonia                Open
ora.diskmon
      1        ONLINE  ONLINE       macedonia
ora.evmd
      1        ONLINE  ONLINE       macedonia

Everthing is fine.

This solution is not supported by Oracle this is a Workaround to start ACFS Filesystem at boot of Server

Enjoy…


Cluster Health Monitor (CHM)

Oracle is strongly encouraging the admins of Clusterware / RAC using the CHM (Cluster Health Monitor).
This tool (formerly known as Instantaneous Problem Detector for Clusters or IPD/OS) is designed to detect and analyze operating system (OS) and cluster resource related degradation and failures in order to bring more explanatory power to many issues that occur in clusters where Oracle Clusterware and Oracle RAC are running such as node eviction. It tracks the OS resource consumption at each node, process, and device level continuously. It collects and analyzes the cluster-wide data. In real time mode, when thresholds are hit, an alert is shown to the operator. For root cause analysis, historical data can be replayed to understand what was happening at the time of failure.

See this presentation on this issue on link below

Introduction
– What is? Why use? Where to get?
Cluster Health Monitor (CHM)
• Installation
– Of the Tool
– Of the GUI
• CHM in Action
• Administration
• FAQ & More Information
– OTN Migration

Everything_you_ever_wanted_to_know_about_CHM

Enjoy…


EMC CLARiiON: Oracle Database 10g/11g/11gR2 with Storage Replication Consistency

Introduction

This white paper is intended of database and system administrators interested in implementing backup and remote disaster protection plan on Linux and Windows Plataform for Oracle databases using the consistenty features of EMC CLARiiON SnapView nad MirrorView/S. The reader should be familiar with Oracle Database software and ASM and EMC CLARiion SnapView and MirrorView replication  technologies.

Click link below…

h2104-emc-clariion-db-stor-sol-oracle-10g-oracle-11g-clariion-stor-repltn-wp

Enjoy


Deploying Oracle Database 11g Release 2 on EMC Unified Storage

Introduction

This white paper is intended to help users of Oracle udersand the deployment gidlines and considerations of Oracle Database 11g Release 2 on x86_64 and x86-based Linux servers in envornments with EMC unified storage. Based on enginnering testing done at EMC Labs, this paper covers the important deployment not intended to cover every feature of Oracle Database Release 2. For Specific features not cover in this white paper please refer to the appropriate Oracle Database 11g Release 2 documentation.

See link below..

h8150-deploying-oracle-unified-wp

Enjoy

 


Best Practices for Running Oracle RAC Database with ASM on IBM DS4800 Storage Subsystems

Owning state-of-the-art storage subsystems is not enough to excel in today’s competitive business climate.

Even with the best storage subsystems, the continuous demands upon the IT environment can create challenges:

• Unused capacity on expensive equipment becomes a financial waste.

• Continuous hardware and software sprawl create an ever-changing environment that constantly must be re-tuned to adjust to new conditions.

• New equipment is hot-added when possible, often resulting in a convoluted configuration that makes tuning for high performance complex and difficult to manage.

The purpose of this document is to detail optimum performance settings for IBM® DS4800  storage subsystems with the Oracle® Database application.

This document identifies parameters for optimizing a high-performance storage subsystem. For each parameter, this document explains how to monitor, evaluate, adjust, and confirm that the adjustment was appropriate and positive.

The process of keeping the parameters tuned involves the following tasks:• Identify the relevant parameters. • Take a baseline to determine the benchmark value for each relevant parameter.

• Continuously monitor each parameter on an ongoing basis. Only continuous monitoring can isolate the triggers that impact performance. Also, continue monitoring after any adjustment so that the effectiveness of the adjustment can be evaluated.

• Adjust parameters while the system remains in production.

• Watch how adjustments in one parameter are affecting other parameters.

Click link below..

best_practices_runing_rac_asm_DS4800_storage

Enjoy