Introduction: Here we will see how to migrate a Non-ASM Tablespace to ASM Tablespace.
SQL> create tablespace test1
datafile
'/home2/oracle/ora10g/datafile/test1a.dbf'
size 20m autoextend on next 10m maxsize 100m,
'/home2/oracle/ora10g/datafile/test1b.dbf'
size 20m autoextend on next 10m maxsize 100m
extent management local;
Tablespace created.
SQL> select name from v$datafile where ts# in
2 (select ts# from v$tablespace where name='TEST1');
NAME
--------------------------------------------------------------------------------
/home2/oracle/ora10g/datafile/test1a.dbf
/home2/oracle/ora10g/datafile/test1b.dbf
SQL>
SQL> create user test1 identified by test1 default tablespace test1;
User created.
SQL> grant connect,resource to test1;
Grant succeeded.
SQL> connect test1/test1
Connected.
SQL> create table t1 as select * from all_tables;
Table created.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
T1 TABLE
SQL>
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/odb/datafile/system.256.617411373
+DATA/odb/datafile/undotbs1.258.617411379
+DATA/odb/datafile/sysaux.257.617411377
+DATA/odb/datafile/users.259.617411381
+DG1/odb/datafile/t1.256.617493211
/home2/oracle/ora10g/datafile/test1a.dbf
/home2/oracle/ora10g/datafile/test1b.dbf
7 rows selected.
SQL>
-bash-2.05b$ rman nocatalog target /
RMAN> sql "alter tablespace test1 offline";
sql statement: alter tablespace test1 offline
RMAN> backup as copy tablespace test1 format '+DG1';
Starting backup at 20-MAR-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=148 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=/home2/oracle/ora10g/datafile/test1a.dbf
output filename=+DG1/odb/datafile/test1.261.617749583 tag=TAG20070320T210622 recid=1 stamp=617749585
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile fno=00007 name=/home2/oracle/ora10g/datafile/test1b.dbf
output filename=+DG1/odb/datafile/test1.262.617749589 tag=TAG20070320T210622 recid=2 stamp=617749592
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 20-MAR-07
RMAN> switch tablespace test1 to copy;
datafile 6 switched to datafile copy "+DG1/odb/datafile/test1.261.617749583"
datafile 7 switched to datafile copy "+DG1/odb/datafile/test1.262.617749589"
RMAN> sql "alter tablespace test1 online";
sql statement: alter tablespace test1 online
RMAN> exit
Recovery Manager complete.
-bash-2.05b$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 20 21:07:32 2007
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/odb/datafile/system.256.617411373
+DATA/odb/datafile/undotbs1.258.617411379
+DATA/odb/datafile/sysaux.257.617411377
+DATA/odb/datafile/users.259.617411381
+DG1/odb/datafile/t1.256.617493211
+DG1/odb/datafile/test1.261.617749583
+DG1/odb/datafile/test1.262.617749589
7 rows selected.
SQL> connect test1/test1
Connected.
SQL> select count(*) from t1;
COUNT(*)
----------
91
SQL>
Summary :
Non-ASM based Tablespace is taken offline.
Using RMAN BACKUP AS COPY Command an Image Copy of Tablespace TEST1 is created
Using SWITCH Command the Datafiles are Renamed.
ASM Tablespace is taken online
Note : SWITCH Command does not deletes the datafile from Operating System.
RMAN SWITCH Command is equivalent to "ALTER DATABASE RENAME FILE"
# - Posted by Senthil Rajendran - 3/20/07; 8:59:21 PM - Comment [0]
ASM : SPFILE Information and Maintenance
ASM Instance
SQL> show parameter instance_name
NAME TYPE VALUE
---------------- ----------- ---------------------------------------
instance_name string +ASM
SQL> show parameter spfile;
NAME TYPE VALUE
---------------- ----------- ----------------------------------------
spfile string /home2/oracle/ora10g/dbs/spfile+ASM.ora
SQL>
ASM Enabled Instance
SQL> show parameter instance_name;
NAME TYPE VALUE
---------------- ----------- ----------------------------------------
instance_name string ODB
SQL> show parameter spfile;
NAME TYPE VALUE
---------------- --------- ------------------------------------------
spfile string +DATA/odb/spfileodb.ora
SQL>
Making Change to an SPFILE of the ASM Enabled Instance
Step 1: Create PFILE from SPFILE;
Step 2: Make the Change to the PFILE
Step 3: Shutdown the Database
Step 4: Create SPFILE from PFILE;
Lab:
SQL> show parameter instance_name;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string ODB
SQL> create pfile='/tmp/change.ora' from spfile;
File created.
SQL>
>> PFILE '/tmp/change.ora' - Modified
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> create spfile='+DATA/odb/spfileodb.ora' from pfile='/tmp/change.ora';
File created.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 71305460 bytes
Database Buffers 92274688 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL>
Note : The SPFILE for an ASM instance cannot be stored in ASM disks groups.
The voice in my head may not be real , but they have some good ideas !!!
Fail Fast, Fail Forward, Fail Often, Fail Better , Standup Every Time
Every problem has at least one solution. Only some solutions are harder to find.
Friday, June 22, 2007
Popular Posts
-
FS_CLONE Phase It is a stand-alone command used for file system cloning. Standard cloning (using adcfgclone.pl) cannot be used to synch...
-
[oracle@testebsop3app01 ~]$ perl /u01/install/APPS/fs1/EBSapps/comn/clone/bin/adcfgclone.pl appltop /u01/install/APPS/fs1/inst/apps/SATURN_...
-
Abort Phase If for some reason either the prepare or apply phase failed or gave problems, you can abort the patching cycle. After runnin...
-
As a green field expert in data science, you would be responsible for designing and implementing data science projects from scratch. This i...
-
PRVG-2031 : Owner of file "/u01/app/oracle/diag/crs/rac01/crs/lck" did not match the expected value on node "HOST1". [Ex...
-
Suddenly all production reports in BI Publisher failed with message " ORA-01017: invalid username/password; logon denied" The da...
-
If you are an EBS administrator the first thing some asks you to do a health check of an environment , you return to him with a Request ID o...
-
EBS 12.2 ADOP Cycle Errors During Validation Cannot open XML file for load ADOP cycle will have validation errors in some cases. *****...
-
ADOP patching on a downtime mode with [ERROR] Patch service is not exist or running Please note , if you get ADOP issues on PROD ple...
-
Let me start telling a story , "Once upon a time there lived a great ♚EBS 12.2 instance , it was very kind to the DBAs and one fine day...