|
|
|
|
|
|
|
|
Re: How to create tablespace from backup [message #280013 is a reply to message #279964] |
Mon, 12 November 2007 05:14 |
bbmonster
Messages: 47 Registered: June 2007 Location: UB
|
Member |
|
|
I still didn't solved the problem. I am posting test code here.
Please help
##### 1. create tablespace & insert some data to it.
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 12 19:14:50 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> CREATE SMALLFILE TABLESPACE "TS07" DATAFILE '/disk6/TS07_1' SIZE 100M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
Tablespace created.
SQL> create table tbl01_1 tablespace TS07 as SELECT * FROM uid02.tbl01 WHERE M105 = 3
2 ;
Table created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
##### 2. backup TS07 with RMAN
[oracle@localhost ~]$ /home/oracle/db/bin/rman target / nocatalog
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Nov 12 19:19:38 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: UCCS (DBID=1480994533)
using target database control file instead of recovery catalog
RMAN> run {
2> allocate channel c1 device type disk;
3> set command id to 'BBBackup';
4> configure backup optimization on;
5> sql "alter tablespace TS07 offline normal";
6> backup format '/disk6/backup/TS07_bak_%T_%U'
7> (tablespace TS07);
8> release channel c1;
9> sql "alter tablespace TS07 online";
10> }
allocated channel: c1
channel c1: sid=136 devtype=DISK
executing command: SET COMMAND ID
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
sql statement: alter tablespace TS07 offline normal
Starting backup at 12-NOV-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00052 name=/disk6/TS07_1
channel c1: starting piece 1 at 12-NOV-07
channel c1: finished piece 1 at 12-NOV-07
piece handle=/disk6/backup/TS07_bak_20071112_0uj0srn6_1_1 tag=TAG20071112T193502 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 12-NOV-07
Starting Control File and SPFILE Autobackup at 12-NOV-07
piece handle=/disk6/backup/controlfile/c-1480994533-20071112-05 comment=NONE
Finished Control File and SPFILE Autobackup at 12-NOV-07
released channel: c1
sql statement: alter tablespace TS07 online
RMAN> quit
Recovery Manager complete.
##### 3. drop tablespace including data files
[oracle@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 12 19:37:38 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> drop tablespace TS07 including contents and datafiles;
Tablespace dropped.
SQL> commit;
Commit complete.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
##### 4. restore deleted tablespace from backup
[oracle@localhost ~]$ /home/oracle/db/bin/rman nocatalog target /
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Nov 12 19:39:59 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: UCCS (DBID=1480994533)
using target database control file instead of recovery catalog
RMAN> run {
2> allocate channel c1 type disk format '/disk6/backup/TS07_bak_20071112_0uj0srn6_1_1';
3> restore tablespace TS07;
4> release channel c1;
5> }
allocated channel: c1
channel c1: sid=76 devtype=DISK
Starting restore at 12-NOV-07
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/12/2007 19:41:48
RMAN-20202: tablespace not found in the recovery catalog
RMAN-06019: could not translate tablespace name "TS07"
Regards BB
|
|
|
|
|
|
|
|
|
|
|