$export ORACLE_SID=SID
$sqlplus / as sysdba
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/app/oracle/oradata/SID/control1/control01.ctl
/app/oracle/oradata/SID/control2/control02.ctl
SQL> alter system set control_files='+DATA','+DATA' scope=spfile;
SQL> alter system set db_create_file_dest='+DATA' scope=spfile;
SQL> shutdown immediate;
SQL> startup nomount;
SQL> exit
$rman target /
RMAN> restore controlfile from '/app/oracle/oradata/SID/control1/control01.ctl';
RMAN> alter database mount;
RMAN> backup as copy database format '+DATA';
RMAN> switch database to copy;
RMAN> recover database;
RMAN> exit
$export ORACLE_SID=SID
$sqlplus / as sysdba
SQL> alter database open;
SQL> CREATE TEMPORARY TABLESPACE "TEMP1" TEMPFILE SIZE 61865984 AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE "TEMP1";
SQL> shutdown immediate;
SQL> startup;
SQL> DROP TABLESPACE TEMP;
SQL> CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE SIZE 61865984 AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE "TEMP";
SQL> shutdown immediate;
SQL> startup
SQL> DROP TABLESPACE TEMP1;
Или просто добавить временный файл в существующее табличное пространство:
SQL> ALTER TABLESPACE "TEMP" ADD TEMPFILE SIZE 500M AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
Tablespace altered.
SQL>
SQL>SQL> alter system set db_create_online_log_dest_1='+REDO' scope=spfile;
SQL> shutdown immediate;
SQL> startup;
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/app/oracle/oradata/SID/redoa/redo06a.log
/app/oracle/oradata/SID/redoa/redo05a.log
/app/oracle/oradata/SID/redoa/redo04a.log
/app/oracle/oradata/SID/redoa/redo03a.log
/app/oracle/oradata/SID/redoa/redo02a.log
/app/oracle/oradata/SID/redoa/redo01a.log
6 rows selected.
SQL> alter database drop logfile group 1;
SQL> alter database add logfile group 1 size 52428800;
SQL> alter database drop logfile group 2;
SQL> alter database add logfile group 2 size 52428800;
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance SID (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: '/app/oracle/oradata/SID/redoa/redo03a.log'
SQL> alter database drop logfile group 4;
SQL> alter database add logfile group 4 size 52428800;
SQL> alter database drop logfile group 5;
SQL> alter database add logfile group 5 size 52428800;
SQL> alter database drop logfile group 6;
SQL> alter database add logfile group 6 size 52428800;
SQL> alter system switch logfile;
SQL> alter system checkpoint;
SQL> alter database drop logfile group 3;
SQL> alter database add logfile group 3 size 52428800;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/datafile/system.270.789045335
+DATA/SID/datafile/undotbs1.269.789045319
+DATA/SID/datafile/sysaux.268.789045295
+DATA/SID/datafile/users.271.789045349
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/tempfile/temp.275.789045723
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/controlfile/current.266.789045265
+DATA/SID/controlfile/current.267.789045265
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+REDO/SID/onlinelog/group_1.274.789046953
+REDO/SID/onlinelog/group_2.276.789046981
+REDO/SID/onlinelog/group_4.277.789047043
+REDO/SID/onlinelog/group_5.278.789047061
+REDO/SID/onlinelog/group_3.279.789047111
+REDO/SID/onlinelog/group_6.280.789047303
6 rows selected.
SQL>
$sqlplus / as sysdba
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/app/oracle/oradata/SID/control1/control01.ctl
/app/oracle/oradata/SID/control2/control02.ctl
SQL> alter system set control_files='+DATA','+DATA' scope=spfile;
SQL> alter system set db_create_file_dest='+DATA' scope=spfile;
SQL> shutdown immediate;
SQL> startup nomount;
SQL> exit
$rman target /
RMAN> restore controlfile from '/app/oracle/oradata/SID/control1/control01.ctl';
RMAN> alter database mount;
RMAN> backup as copy database format '+DATA';
RMAN> switch database to copy;
RMAN> recover database;
RMAN> exit
$export ORACLE_SID=SID
$sqlplus / as sysdba
SQL> CREATE TEMPORARY TABLESPACE "TEMP1" TEMPFILE SIZE 61865984 AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE "TEMP1";
SQL> shutdown immediate;
SQL> startup;
SQL> DROP TABLESPACE TEMP;
SQL> CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE SIZE 61865984 AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE "TEMP";
SQL> shutdown immediate;
SQL> startup
SQL> DROP TABLESPACE TEMP1;
Tablespace altered.
SQL>
SQL> shutdown immediate;
SQL> startup;
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/app/oracle/oradata/SID/redoa/redo06a.log
/app/oracle/oradata/SID/redoa/redo05a.log
/app/oracle/oradata/SID/redoa/redo04a.log
/app/oracle/oradata/SID/redoa/redo03a.log
/app/oracle/oradata/SID/redoa/redo02a.log
/app/oracle/oradata/SID/redoa/redo01a.log
6 rows selected.
SQL> alter database drop logfile group 1;
SQL> alter database add logfile group 1 size 52428800;
SQL> alter database drop logfile group 2;
SQL> alter database add logfile group 2 size 52428800;
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance SID (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: '/app/oracle/oradata/SID/redoa/redo03a.log'
SQL> alter database drop logfile group 4;
SQL> alter database add logfile group 4 size 52428800;
SQL> alter database drop logfile group 5;
SQL> alter database add logfile group 5 size 52428800;
SQL> alter database drop logfile group 6;
SQL> alter database add logfile group 6 size 52428800;
SQL> alter system switch logfile;
SQL> alter system checkpoint;
SQL> alter database drop logfile group 3;
SQL> alter database add logfile group 3 size 52428800;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/datafile/system.270.789045335
+DATA/SID/datafile/undotbs1.269.789045319
+DATA/SID/datafile/sysaux.268.789045295
+DATA/SID/datafile/users.271.789045349
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/tempfile/temp.275.789045723
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA/SID/controlfile/current.266.789045265
+DATA/SID/controlfile/current.267.789045265
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+REDO/SID/onlinelog/group_1.274.789046953
+REDO/SID/onlinelog/group_2.276.789046981
+REDO/SID/onlinelog/group_4.277.789047043
+REDO/SID/onlinelog/group_5.278.789047061
+REDO/SID/onlinelog/group_3.279.789047111
+REDO/SID/onlinelog/group_6.280.789047303
6 rows selected.
SQL>
Комментариев нет:
Отправить комментарий