SAP Note 11515 - Shrinking/deleting rollback tablespaces.
Symptom
Important: - This note applies only to ORACLE7 and Oracle8!!!
- The storage parameter OPTIMAL is NOT exported.
You have to activate it manually afterwards
sqldba lmode=y
connect internal
alter rollback segment storage (optimal xxM);
1. Determine the datafiles that belong to tablespace PSAPROLL
sqlplus sapr3/sap
SQL> select file_name from dba_data_files
where tablespace_name = 'PSAPROLL';
2. Structure export of the complete database (no table contents!!)
using ORACLE tool exp:
exp system/manager
The user is then prompted, and can use the default settings for
all questions except for the following three:
(1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > 1
Export table data (yes/no): yes > no
Compress extents (yes/no): yes > no
CAUTION: If statistics were already created for tables, these must
either be deleted beforehand or the export must be called
in a command procedure.
Otherwise the time estimate will not be correct!!
exp system/manager file=expges.dmp full=y compress=n
statistics=none buffer=1000 rows=n
3. sqldba lmode=y (connect internal)
SQLDBA> create rollback segment dummy storage (initial 32K);
4. SQLDBA> alter rollback segment dummy online;
5. SQLDBA> alter rollback segment prs_ offline; (x stands for 1,2,3,...,n). All rollback segments
must be set offline. Active rollback segments in the DB
can be listed under the init.ora parameter
rollback_segments.
6. SQLDBA> drop rollback segment prs_ ; (x stands for 1,2,3,...,10) - all rollback segments must
be dropped (see step 5)
7. SQLDBA> drop tablespace psaproll including contents;
8. Once step 7 has been performed successfully, the data files
determined in step 1 can be deleted at UNIX level .
9. You must now redefine tablespace PSAPROLL:
Example:
sqldba lmode=y (connect internal)
SQLDBA> create tablespace psaproll
datafile '/usr/ora/C11/sapdata0/roll_1/roll.data1'
size 200M;
10. Structure import of the database exported in step 2, using
ORACLE tool imp:
imp system/manager
The user is prompted again and can use the default responses to
all questions with the exception of the following:
Import table data (yes/no): yes > no
Time required: 5-10 minutes
In this way you can avoid creating the individual rollback segments
manually. All the other structures of the export file already
exist and are no longer imported.
11. Shut down / restart the database.
12. sqldba lmode=y (connect internal)
SQLDBA> drop rollback segment dummy;
Key word: PSAPROLL
The customer wants to shrink tablespace PSAPROLL, as it was defined too large.
Tablespace PSAPROLL defined too large.
Important: - This note applies only to ORACLE7 and Oracle8!!!
- The storage parameter OPTIMAL is NOT exported.
You have to activate it manually afterwards
sqldba lmode=y
connect internal
alter rollback segment
1. Determine the datafiles that belong to tablespace PSAPROLL
sqlplus sapr3/sap
SQL> select file_name from dba_data_files
where tablespace_name = 'PSAPROLL';
2. Structure export of the complete database (no table contents!!)
using ORACLE tool exp:
exp system/manager
The user is then prompted, and can use the default settings for
all questions except for the following three:
(1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > 1
Export table data (yes/no): yes > no
Compress extents (yes/no): yes > no
CAUTION: If statistics were already created for tables, these must
either be deleted beforehand or the export must be called
in a command procedure.
Otherwise the time estimate will not be correct!!
exp system/manager file=expges.dmp full=y compress=n
statistics=none buffer=1000 rows=n
3. sqldba lmode=y (connect internal)
SQLDBA> create rollback segment dummy storage (initial 32K);
4. SQLDBA> alter rollback segment dummy online;
5. SQLDBA> alter rollback segment prs_
must be set offline. Active rollback segments in the DB
can be listed under the init
rollback_segments.
6. SQLDBA> drop rollback segment prs_
be dropped (see step 5)
7. SQLDBA> drop tablespace psaproll including contents;
8. Once step 7 has been performed successfully, the data files
determined in step 1 can be deleted at UNIX level .
9. You must now redefine tablespace PSAPROLL:
Example:
sqldba lmode=y (connect internal)
SQLDBA> create tablespace psaproll
datafile '/usr/ora/C11/sapdata0/roll_1/roll.data1'
size 200M;
10. Structure import of the database exported in step 2, using
ORACLE tool imp:
imp system/manager
The user is prompted again and can use the default responses to
all questions with the exception of the following:
Import table data (yes/no): yes > no
Time required: 5-10 minutes
In this way you can avoid creating the individual rollback segments
manually. All the other structures of the export file already
exist and are no longer imported.
11. Shut down / restart the database.
12. sqldba lmode=y (connect internal)
SQLDBA> drop rollback segment dummy;
Key word: PSAPROLL
Comments
Post a Comment