$sqlplus / as sysdba
SQL> alter system set control_files='+DATA' scope=spfile;
SQL> alter system set db_create_file_dest='+DATA' scope=spfile;
SQL> alter system set db_recovery_file_dest='+DATA' scope=spfile;
[oracle@database ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 18 00:06:29 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/oradata/orcl/control01.ctl';
Starting restore at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/orcl/controlfile/current.256.764813197
Finished restore at 18-OCT-11
RMAN> exit
Recovery Manager complete.
[oracle@database ~]$ sqlplus / as sysdba
SQL> alter database mount;
Database altered.
[oracle@database ~]$ rman target /
RMAN> backup as copy database format '+DATA';
Starting backup at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
output file name=+DATA/orcl/datafile/system.257.764813279 tag=TAG20111018T000759 RECID=1 STAMP=764813326
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
output file name=+DATA/orcl/datafile/sysaux.258.764813335 tag=TAG20111018T000759 RECID=2 STAMP=764813375
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
output file name=+DATA/orcl/datafile/undotbs1.259.764813381 tag=TAG20111018T000759 RECID=3 STAMP=764813399
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/orcl/controlfile/backup.260.764813405 tag=TAG20111018T000759 RECID=4 STAMP=764813406
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
output file name=+DATA/orcl/datafile/users.261.764813409 tag=TAG20111018T000759 RECID=5 STAMP=764813408
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-OCT-11
channel ORA_DISK_1: finished piece 1 at 18-OCT-11
piece handle=+DATA/orcl/backupset/2011_10_18/nnsnf0_tag20111018t000759_0.262.764813409 tag=TAG20111018T000759 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-11
RMAN> switch database to copy;
using target database control file instead of recovery catalog
datafile 1 switched to datafile copy "+DATA/orcl/datafile/system.257.764813279"
datafile 2 switched to datafile copy "+DATA/orcl/datafile/sysaux.258.764813335"
datafile 3 switched to datafile copy "+DATA/orcl/datafile/undotbs1.259.764813381"
datafile 4 switched to datafile copy "+DATA/orcl/datafile/users.261.764813409"
SQL> select NAME from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/orcl/datafile/system.257.764813279
+DATA/orcl/datafile/sysaux.258.764813335
+DATA/orcl/datafile/undotbs1.259.764813381
+DATA/orcl/datafile/users.261.764813409
RMAN> recover database;
Starting recover at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-OCT-11
[oracle@database ~]$ sqlplus / as sysdba
SQL> alter database open;
Database altered.
Redo Logs:
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
SQL> select group#,status,sequence#,bytes from v$log;
GROUP# STATUS SEQUENCE# BYTES
---------- ---------------- ---------- ----------
1 CURRENT 28 52428800
2 INACTIVE 26 52428800
3 UNUSED 0 52428800
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 size 50m;
Database altered.
SQL> select group#,status,sequence#,bytes from v$log;
GROUP# STATUS SEQUENCE# BYTES
---------- ---------------- ---------- ----------
1 CURRENT 28 52428800
2 UNUSED 0 52428800
3 UNUSED 0 52428800
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE +DATA/orcl/onlinelog/group_2.265.764814191
2 ONLINE +DATA/orcl/onlinelog/group_2.266.764814191
-- TEMP FILES
SQL> select tablespace_name,file_name from dba_temp_files;
TABLESPACE_NAME FILE_NAME
------------------------------ ----------------------------------------
TEMP /u01/app/oracle/oradata/orcl/temp01.dbf
SQL> alter database tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' drop including datafiles;
Database altered.
SQL> alter tablespace temp add tempfile size 100m autoextend on next 10m maxsize 2000m;
Tablespace altered.
SQL> select tablespace_name,file_name from dba_temp_files;
TABLESPACE_NAME FILE_NAME
------------------------------ ----------------------------------------
TEMP +DATA/orcl/tempfile/temp.267.764814889
SQL> alter system set control_files='+DATA' scope=spfile;
SQL> alter system set db_create_file_dest='+DATA' scope=spfile;
SQL> alter system set db_recovery_file_dest='+DATA' scope=spfile;
[oracle@database ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 18 00:06:29 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/oradata/orcl/control01.ctl';
Starting restore at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/orcl/controlfile/current.256.764813197
Finished restore at 18-OCT-11
RMAN> exit
Recovery Manager complete.
[oracle@database ~]$ sqlplus / as sysdba
SQL> alter database mount;
Database altered.
[oracle@database ~]$ rman target /
RMAN> backup as copy database format '+DATA';
Starting backup at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
output file name=+DATA/orcl/datafile/system.257.764813279 tag=TAG20111018T000759 RECID=1 STAMP=764813326
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
output file name=+DATA/orcl/datafile/sysaux.258.764813335 tag=TAG20111018T000759 RECID=2 STAMP=764813375
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
output file name=+DATA/orcl/datafile/undotbs1.259.764813381 tag=TAG20111018T000759 RECID=3 STAMP=764813399
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/orcl/controlfile/backup.260.764813405 tag=TAG20111018T000759 RECID=4 STAMP=764813406
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
output file name=+DATA/orcl/datafile/users.261.764813409 tag=TAG20111018T000759 RECID=5 STAMP=764813408
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-OCT-11
channel ORA_DISK_1: finished piece 1 at 18-OCT-11
piece handle=+DATA/orcl/backupset/2011_10_18/nnsnf0_tag20111018t000759_0.262.764813409 tag=TAG20111018T000759 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-11
RMAN> switch database to copy;
using target database control file instead of recovery catalog
datafile 1 switched to datafile copy "+DATA/orcl/datafile/system.257.764813279"
datafile 2 switched to datafile copy "+DATA/orcl/datafile/sysaux.258.764813335"
datafile 3 switched to datafile copy "+DATA/orcl/datafile/undotbs1.259.764813381"
datafile 4 switched to datafile copy "+DATA/orcl/datafile/users.261.764813409"
SQL> select NAME from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/orcl/datafile/system.257.764813279
+DATA/orcl/datafile/sysaux.258.764813335
+DATA/orcl/datafile/undotbs1.259.764813381
+DATA/orcl/datafile/users.261.764813409
RMAN> recover database;
Starting recover at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-OCT-11
[oracle@database ~]$ sqlplus / as sysdba
SQL> alter database open;
Database altered.
Redo Logs:
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
SQL> select group#,status,sequence#,bytes from v$log;
GROUP# STATUS SEQUENCE# BYTES
---------- ---------------- ---------- ----------
1 CURRENT 28 52428800
2 INACTIVE 26 52428800
3 UNUSED 0 52428800
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 size 50m;
Database altered.
SQL> select group#,status,sequence#,bytes from v$log;
GROUP# STATUS SEQUENCE# BYTES
---------- ---------------- ---------- ----------
1 CURRENT 28 52428800
2 UNUSED 0 52428800
3 UNUSED 0 52428800
SQL> select group#,status,type,member from v$logfile where group# =2;
GROUP# STATUS TYPE MEMBER
---------- ------- ------- ---------------------------------------------
2 ONLINE +DATA/orcl/onlinelog/group_2.265.764814191
2 ONLINE +DATA/orcl/onlinelog/group_2.266.764814191
-- TEMP FILES
SQL> select tablespace_name,file_name from dba_temp_files;
TABLESPACE_NAME FILE_NAME
------------------------------ ----------------------------------------
TEMP /u01/app/oracle/oradata/orcl/temp01.dbf
SQL> alter database tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' drop including datafiles;
Database altered.
SQL> alter tablespace temp add tempfile size 100m autoextend on next 10m maxsize 2000m;
Tablespace altered.
SQL> select tablespace_name,file_name from dba_temp_files;
TABLESPACE_NAME FILE_NAME
------------------------------ ----------------------------------------
TEMP +DATA/orcl/tempfile/temp.267.764814889
Comentários
Postar um comentário