Table reorganisation
Hi,
I wanted to know how is it possible to do a table reorganisation.
I ask this question because i have read a lot of subject where the brtools is use for this operation but like my DB is MS SQL 2005 SP3 ....i haven't this tool...
Does the reorg have to be done by an MS SQL tool with the MS SQL manager? or in the Tx DB02 maybe?
Other question :
When is it possible to say " this table has to be reorganise" (What is the main paramèter : zise grow ?)
Thanks in advance.
Regards.
Hi BABY Fabrice,
We do 2005 MSSQL reorgs fairly frequently for one of our clients, here is how we go about it during our weekly maintenance window.
1. Before the window we take an online backup of the DB and Transaction logs.
2. We are on a cluster so we make sure that all resources are on the primary, then pause (or outright shutdown) the second node.
3. SAP is stopped.
4. Go into Enterprise Manager
5. Select the database, right-click, choose Properties
6. We switch to simple mode so we don't overwhelm the t-log during the reorg
7. Restart the DB for the change to take effect
8. On the Enterprise Manger expand the DB, then Management and click on Jobs
9. Create a job and under the Steps tab change the type to Transact-SQL Script (TSQL), and the Database field to your database. In the command field the query we use is as follows:
EXEC sp_help TABLE_NAME <---your table
dbcc dbreindex ('TABLE_NAME', ") with no_infomsgs
GO
dbcc updateusage ('SID','TABLE_NAME') <----SID is your instance SID
GO
10. The job will be added to your list in the jobs section mentioned in step 8
11. Right-click on the job and choose Properties, and then edit Step 1, under "On success action" Quit the job reporting success and change the "Output file" to somewhere where the log can write the log to.
12. Right-click on your job and choose Start Job
13. We've experienced various run times, but it's highly dependent on your hardware. On the production system which is relatively new and powerful I've seen 20GB to 60GB an hour. Typically on our hardware if it was a 200GB table, I'd estimate then entire downtime (6 hours) and ask for a two or three more hours.
14. Be aware that if you are tight on space, you have to be mindful of the size of the table you are reorging...you need equivilent disk space while it rebuilds, meaning that if your table is 20GB, you need another 20GB free while performing the reorg. You can reclaim it from the SAN (if applicable) afterwards.
15. Once done and reporting success, after watching Enterprise Manager and the log (the log doesn't update very frequently at all), be sure that before you bring everything back online that you change the Recovery Model back to Full.
I hope this helps you out and good luck.
Regards
Similar Messages
-
Hi Experts,
Pls tell us the what are the scenerios table reorganisation nedds to be done.
Thanks
SaravanaPlease go through
Note 541538 - FAQ: Reorganization
and get back if you have specific questions.
Markus -
I have a problem with TableSorter. I am pretty much using the version supplied on the Sun site.
When I click the headers, the table reorganises itself fine on the screen.
However when I double click on them using a method within the JTable the row which appears is the one at that position before the tables were sorted. I am sure it is something to do with the TableModel but I can't figure out what. Anyone had a problem similar to this in the past?
Any feedback welcome.
Thanks,
PaulI have a problem with TableSorter. I am pretty much using the version supplied on the Sun site.
When I click the headers, the table reorganises itself fine on the screen.
However when I double click on them using a method within the JTable the row which appears is the one at that position before the tables were sorted. I am sure it is something to do with the TableModel but I can't figure out what. Anyone had a problem similar to this in the past?
Any feedback welcome.
Thanks,
Paul -
Increasing size of SAPREORG Directory
Hi,
We do DB backup for our quality system once in two days. Though we get it done successfully, we get some warnings. Its saying that "the /oracle/sid/sapreorg has not enough space. it says it should have atleast 3GB.
i want to know what type of data is stored in this sapreorg directory. Is there any possiblity to increase the filesystem manually. We are using IBM AIX operating system.
Will there be any problem in the database if we delete some of the files in sapreorg directory.
Please anyone guide me in this regard.
Regards,
Sailesh KHi Sailesh,
The SAPREORG directory is used to hold log files for brspace and is also used as the standard "dump" directory where the files and scripts are placed during a table reorganisation.
This directory is normally a seperate filesystem and this can be enlarged by your AIX people. This can even be done while your system is running, as long as brspace is not doing any actions.
This means you have to check your crontab and/or DB13 to make sure there are no brspace actions scheduled.
Of course you could also ignore the warning, but that can be dangerous bacuase then you always expect the backup to end with warnings and miss another warning that is potentially more severe.
As to the question about removing files, please checkout chapter 1.5 in the <a href="https://service.sap.com/~sapidb/011000358700001789182002E">BRCONNECT</a> manual.
I hope this information is enough to get you started.
Kind regards,
Alexander Webster -
Options to avoid error ORA-01653
Hi all,
Error - ORA 01653,01654
Since this error message is related to tablespace overflow. So using what all options can we avoid this error, apart from table reorganisation ?
Regards,
Sanjeev KumarHello Sanjeev,
This error as you know oocurs when there are no free contigous data block to be allocated in the data file.
There are two solutions for this.
1. Extend the table space i.e you add new data files in the table space.
2. Resize the datafile size.
Also if you are using Locally managed tablespaces, you can set the autoextend option on for a reasonable size if you can afford diskspace.
All this can be done using BR*TOOLs (which i am sure you are already aware of :-).
Hope this helps.
Regards,
Prashant -
Hi, in Oracle segment advisor you will find suggestions like "shrink space" or "Reorganise" to reorganise a table. I understand the different commands behind these options, but can you explain the criteria Oracle uses to choose between these two options ?
Kind Regards
AlexanderThe docs are at http://tahiti.oracle.com.
Read the relevant information under concepts and if you have specific questions ask them along with the link to the doc that is confusing. -
Steps for table level reorganisation
Dear Friends.
We are going for Archiving on big tables like EDI40 table.
So I have decided to regain space after archiving by using table level reorg is it ok??
can you please suggest necessary steps and prerequisites.
Thanks in advance.
Regards
JIggiDear All,
I have done following steps:--
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Documents and Settings\wiqadm.WSECCQA>brtools
BR0651I BRTOOLS 7.00 (24)
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.21
BR0656I Choice menu 1 - please make a selection
BR*Tools main menu
1 = Instance management
2 - Space management
3 - Segment management
4 - Backup and database copy
5 - Restore and recovery
6 - Check and verification
7 - Database statistics
8 - Additional functions
9 - Exit program
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
3
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.25
BR0663I Your choice: '3'
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.25
BR0656I Choice menu 7 - please make a selection
Database segment management
1 = Reorganize tables
2 - Rebuild indexes
3 - Export tables
4 - Import tables
5 - Alter tables
6 - Alter indexes
7 - Additional segment functions
8 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
1
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.28
BR0663I Your choice: '1'
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.28
BR0657I Input menu 91 - please check/enter input values
BRSPACE options for reorganization of tables
1 - BRSPACE profile (profile) ...... [initWIQ.sap]
2 - Database user/password (user) .. [/]
3 ~ Reorganization action (action) . []
4 ~ Tablespace names (tablespace) .. []
5 ~ Table owner (owner) ............ []
6 ~ Table names (table) ............ []
7 - Confirmation mode (confirm) .... [yes]
8 - Extended output (output) ....... [no]
9 - Scrolling line count (scroll) .. [20]
10 - Message language (language) .... [E]
11 - BRSPACE command line (command) . [-p initWIQ.sap -s 20 -l E -f tbreorg]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
6
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.38
BR0663I Your choice: '6'
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.38
BR0681I Enter string value for "table" []:
BDCP
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.41
BR0683I New value for "table": 'BDCP'
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.41
BR0657I Input menu 91 - please check/enter input values
BRSPACE options for reorganization of tables
1 - BRSPACE profile (profile) ...... [initWIQ.sap]
2 - Database user/password (user) .. [/]
3 ~ Reorganization action (action) . []
4 ~ Tablespace names (tablespace) .. []
5 ~ Table owner (owner) ............ []
6 ~ Table names (table) ............ [BDCP]
7 - Confirmation mode (confirm) .... [yes]
8 - Extended output (output) ....... [no]
9 - Scrolling line count (scroll) .. [20]
10 - Message language (language) .... [E]
11 - BRSPACE command line (command) . [-p initWIQ.sap -s 20 -l E -f tbreorg -t "
BDCP"]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.45
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0291I BRSPACE will be started with options '-p initWIQ.sap -s 20 -l E -f tbreo
rg -t "BDCP"'
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.45
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2009-04-01 15.14.46
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...
BR1001I BRSPACE 7.00 (24)
BR1002I Start of BRSPACE processing: seagjxpe.tbr 2009-04-01 15.14.46
BR0484I BRSPACE log file: F:\oracle\WIQ\sapreorg\seagjxpe.tbr
BR0280I BRSPACE time stamp: 2009-04-01 15.14.48
BR1009I Name of database instance: WIQ
BR1010I BRSPACE action ID: seagjxpe
BR1011I BRSPACE function ID: tbr
BR1012I BRSPACE function: tbreorg
BR0280I BRSPACE time stamp: 2009-04-01 15.14.52
BR0657I Input menu 353 - please check/enter input values
Options for reorganization of tables: SAPSR3.BDCP (degree 1)
1 ~ New destination tablespace (newts) ..... []
2 ~ Separate index tablespace (indts) ...... []
3 - Parallel threads (parallel) ............ [1]
4 ~ Table/index parallel degree (degree) ... []
5 - Create DDL statements (ddl) ............ [yes]
6 ~ Initial extent size category (initial) . []
7 ~ Sort by fields of index (sortind) ...... []
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2009-04-01 15.14.55
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2009-04-01 15.14.55
BR1108I Checking tables for reorganization...
BR0280I BRSPACE time stamp: 2009-04-01 15.14.56
BR1112I Number of tables selected/skipped for reorganization: 1/0
BR0280I BRSPACE time stamp: 2009-04-01 15.14.56
BR0370I Directory F:\oracle\WIQ\sapreorg\seagjxpe created
BR0280I BRSPACE time stamp: 2009-04-01 15.14.56
BR1101I Starting online table reorganization...
BR0280I BRSPACE time stamp: 2009-04-01 15.14.56
BR1124I Starting reorganization of table SAPSR3.BDCP ...
BR0280I BRSPACE time stamp: 2009-04-01 15.17.24
BR1105I Table SAPSR3.BDCP reorganized successfully
BR0280I BRSPACE time stamp: 2009-04-01 15.17.24
BR1141I 1 of 1 table reorganized - 2152767 of 2152767 rows processed
BR0204I Percentage done: 100.00%, estimated end time: 15:17
BR0001I **************************************************
BR0280I BRSPACE time stamp: 2009-04-01 15.17.24
BR1102I Number of tables reorganized successfully: 1
BR0280I BRSPACE time stamp: 2009-04-01 15.17.24
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRSPACE time stamp: 2009-04-01 15.18.05
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2009-04-01 15.18.05
BR1022I Number of tables processed: 1
BR1003I BRSPACE function 'tbreorg' completed
BR1008I End of BRSPACE processing: seagjxpe.tbr 2009-04-01 15.18.05
BR0280I BRSPACE time stamp: 2009-04-01 15.18.05
BR1005I BRSPACE completed successfully
BR0292I Execution of BRSPACE finished with return code 0
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.05
BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRTOOLS:
c
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.10
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.10
BR0656I Choice menu 7 - please make a selection
Database segment management
1 + Reorganize tables
2 - Rebuild indexes
3 - Export tables
4 - Import tables
5 - Alter tables
6 - Alter indexes
7 - Additional segment functions
8 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
b
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.13
BR0663I Your choice: 'b'
BR0673I Going back to the previous menu...
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.13
BR0656I Choice menu 1 - please make a selection
BR*Tools main menu
1 = Instance management
2 - Space management
3 + Segment management
4 - Backup and database copy
5 - Restore and recovery
6 - Check and verification
7 - Database statistics
8 - Additional functions
9 - Exit program
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
9
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.15
BR0663I Your choice: '9'
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.15
BR0680I Do you really want to exit BRTOOLS? Enter y[es]/n[o]:
y
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.17
BR0257I Your reply: 'y'
BR0280I BRTOOLS time stamp: 2009-04-01 15.18.17
BR0652I BRTOOLS completed successfully
And I compared space before reorg and after reorg.
I got 5 Gb space back .
I hv done the whole procedure on BDCP table on WIQ.
Shall i do the same procedure on production server.
Thanks in advance.
JIggi -
Hi Gurus,
I have to delete the clients and then perform DB-Reorg.
Through SCC5, I am deleting the clients.
1) Is it possible to select all the clients and delte altogether, as there are 12 clients to be deleted.
For Reorg, I went through the below notes :
620803
646681
541538
647697
706625
214995
As I am deleting all clients except 3 (000, 001 and development client), do I need to re-organize the entire database ? How to reorganise the entire database at one go ?
Some of the tables are around 90-98 GB.
Is there any way to check from SAP level (other than SQL query) if the Tablespace is DMTS or LMTS and if it is ASSM ?
Incase of DMTS, do you have any document how to convert to LMTS as I am a bit confused.
Does there any dependency on SAP Kernel Level, is it ok to reorg on Kernel 46D.
Thanks and Regards,
AmitYou can't delete all clients in one go... you need to logon into each and schedule the deletion via SCC5.
A reorg of this scale will be very time consuming.. I think it will be much quicker to do a Homogeneous system copy via Export/Import.
Also, if this is your development system make sure you check the client independent requests that might have been release from those clients and also the version management of developments.
Thats my 2cents.
Regards
Juan -
TIPS(18) : CREATING SCRIPTS TO RECREATE A TABLE STRUCTURE
제품 : SQL*PLUS
작성날짜 : 1996-11-12
TIPS(18) : Creating Scripts to Recreate a Table Structure
=========================================================
The script creates scripts that can be used to recreate a table structure.
For example, this script can be used when a table has become fragmented or to
get a defintion that can be run on another database.
CREATES SCRIPT TO RECREATE A TABLE-STRUCTURE
INCL. STORAGE, CONSTRAINTS, TRIGGERS ETC.
This script creates scripts to recreate a table structure.
Use the script to reorganise a table that has become fragmented,
to get a definition that can be run on another database/schema or
as a basis for altering the table structure (eg. drop a column!).
IMPORTANT: Running the script is safe as it only creates two new scripts and
does not do anything to your database! To get anything done you have to run the
scripts created.
The created scripts does the following:
1. save the content of the table
2. drop any foreign key constraints referencing the table
3. drop the table
4. creates the table with an Initial storage parameter that
will accomodate the entire content of the table. The Next
parameter is 25% of the initial.
The storage parameters are picked from the following list:
64K, 128K, 256K, 512K, multiples of 1M.
5. create table and column comments
6. fill the table with the original content
7. create all the indexes incl storage parameters as above.
8. add primary, unique key and check constraints.
9. add foreign key constraints for the table and for referencing
tables.
10.Create the table's triggers.
11.Compile any depending objects (cascading).
12.Grant table and column privileges.
13.Create synonyms.
This script must be run as the owner of the table.
If your table contains a LONG-column, use the COPY
command in SQL*Plus to store/restore the data.
USAGE
from SQL*Plus:
start reorgtb
This will create the scripts REORGS1.SQL and REORGS2.SQL
REORGS1.SQL contains code to save the current content of the table.
REORGS2.SQL contains code to rebuild the table structure.
undef tab;
set echo off
column a1 new_val stor
column b1 new_val nxt
select
decode(sign(1024-sum(bytes)/1024),-1,to_char((round(sum(bytes)/(1024*1
024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
decode(sign(512-sum(bytes)/1024), -1,'1M',
decode(sign(256-sum(bytes)/1024), -1,'512K',
decode(sign(128-sum(bytes)/1024), -1,'256K',
decode(sign(64-sum(bytes)/1024) , -1,'128K',
'64K'
a1,
decode(sign(1024-sum(bytes)/4096),-1,to_char((round(sum(bytes)/(4096*1
024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
decode(sign(512-sum(bytes)/4096), -1,'1M',
decode(sign(256-sum(bytes)/4096), -1,'512K',
decode(sign(128-sum(bytes)/4096), -1,'256K',
decode(sign(64-sum(bytes)/4096) , -1,'128K',
'64K'
b1
from user_extents
where segment_name=upper('&1');
set pages 0 feed off verify off lines 150
col c1 format a80
spool reorgs1.sql
PROMPT drop table bk_&1
prompt /
PROMPT create table bk_&1 storage (initial &stor) as select * from &1
prompt /
spool off
spool reorgs2.sql
PROMPT spool reorgs2
select 'alter table '||table_name||' drop constraint
'||constraint_name||';'
from user_constraints where r_constraint_name
in (select constraint_name from user_constraints where
table_name=upper('&1')
and constraint_type in ('P','U'));
PROMPT drop table &1
prompt /
prompt create table &1
select decode(column_id,1,'(',',')
||rpad(column_name,40)
||decode(data_type,'DATE' ,'DATE '
,'LONG' ,'LONG '
,'LONG RAW','LONG RAW '
,'RAW' ,'RAW '
,'CHAR' ,'CHAR '
,'VARCHAR' ,'VARCHAR '
,'VARCHAR2','VARCHAR2 '
,'NUMBER' ,'NUMBER '
,'unknown')
||rpad(
decode(data_type,'DATE' ,null
,'LONG' ,null
,'LONG RAW',null
,'RAW' ,decode(data_length,null,null
,'('||data_length||')')
,'CHAR' ,decode(data_length,null,null
,'('||data_length||')')
,'VARCHAR' ,decode(data_length,null,null
,'('||data_length||')')
,'VARCHAR2',decode(data_length,null,null
,'('||data_length||')')
,'NUMBER' ,decode(data_precision,null,' '
,'('||data_precision||
decode(data_scale,null,null
,','||data_scale)||')')
,'unknown'),8,' ')
||decode(nullable,'Y','NULL','NOT NULL') c1
from user_tab_columns
where table_name = upper('&1')
order by column_id
prompt )
select 'pctfree '||t.pct_free c1
,'pctused '||t.pct_used c1
,'initrans '||t.ini_trans c1
,'maxtrans '||t.max_trans c1
,'tablespace '||s.tablespace_name c1
,'storage (initial '||'&stor' c1
,' next '||'&stor' c1
,' minextents '||t.min_extents c1
,' maxextents '||t.max_extents c1
,' pctincrease '||t.pct_increase||')' c1
from user_Segments s, user_tables t
where s.segment_name = upper('&1') and
t.table_name = upper('&1')
and s.segment_type = 'TABLE'
prompt /
select 'comment on table &1 is '''||comments||''';' c1 from
user_tab_comments
where table_name=upper('&1');
select 'comment on column &1..'||column_name||
' is '''||comments||''';' c1 from user_col_comments
where table_name=upper('&1');
prompt insert into &1 select * from bk_&1
prompt /
set serveroutput on
declare
cursor c1 is select index_name,decode(uniqueness,'UNIQUE','UNIQUE')
unq
from user_indexes where
table_name = upper('&1');
indname varchar2(50);
cursor c2 is select
decode(column_position,1,'(',',')||rpad(column_name,40) cl
from user_ind_columns where table_name = upper('&1') and
index_name = indname
order by column_position;
l1 varchar2(100);
l2 varchar2(100);
l3 varchar2(100);
l4 varchar2(100);
l5 varchar2(100);
l6 varchar2(100);
l7 varchar2(100);
l8 varchar2(100);
l9 varchar2(100);
begin
dbms_output.enable(100000);
for c in c1 loop
dbms_output.put_line('create '||c.unq||' index '||c.index_name||' on
&1');
indname := c.index_name;
for q in c2 loop
dbms_output.put_line(q.cl);
end loop;
dbms_output.put_line(')');
select 'pctfree '||i.pct_free ,
'initrans '||i.ini_trans ,
'maxtrans '||i.max_trans ,
'tablespace '||i.tablespace_name ,
'storage (initial '||
decode(sign(1024-sum(e.bytes)/1024),-1,
to_char((round(sum(e.bytes)/(1024*1024))+1))||'M',
decode(sign(512-sum(e.bytes)/1024), -1,'1M',
decode(sign(256-sum(e.bytes)/1024), -1,'512K',
decode(sign(128-sum(e.bytes)/1024), -1,'256K',
decode(sign(64-sum(e.bytes)/1024) , -1,'128K',
'64K'))))) ,
' next '||
decode(sign(1024-sum(e.bytes)/4096),-1,
to_char((round(sum(e.bytes)/(4096*1024))+1))||'M',
decode(sign(512-sum(e.bytes)/4096), -1,'1M',
decode(sign(256-sum(e.bytes)/4096), -1,'512K',
decode(sign(128-sum(e.bytes)/4096), -1,'256K',
decode(sign(64-sum(e.bytes)/4096) , -1,'128K',
'64K'))))) ,
' minextents '||s.min_extents ,
' maxextents '||s.max_extents ,
' pctincrease '||s.pct_increase||')'
into l1,l2,l3,l4,l5,l6,l7,l8,l9
from user_extents e,user_segments s, user_indexes i
where s.segment_name = c.index_name
and s.segment_type = 'INDEX'
and i.index_name = c.index_name
and e.segment_name=s.segment_name
group by s.min_extents,s.max_extents,s.pct_increase,
i.pct_free,i.ini_trans,i.max_trans,i.tablespace_name ;
dbms_output.put_line(l1);
dbms_output.put_line(l2);
dbms_output.put_line(l3);
dbms_output.put_line(l4);
dbms_output.put_line(l5);
dbms_output.put_line(l6);
dbms_output.put_line(l7);
dbms_output.put_line(l8);
dbms_output.put_line(l9);
dbms_output.put_line('/');
end loop;
end;
declare
cursor c1 is
select constraint_name, decode(constraint_type,'U',' UNIQUE',' PRIMARY
KEY') typ,
decode(status,'DISABLED','DISABLE',' ') status from user_constraints
where table_name = upper('&1')
and constraint_type in ('U','P');
cname varchar2(100);
cursor c2 is
select decode(position,1,'(',',')||rpad(column_name,40) coln
from user_cons_columns
where table_name = upper('&1')
and constraint_name = cname
order by position;
begin
for q1 in c1 loop
cname := q1.constraint_name;
dbms_output.put_line('alter table &1');
dbms_output.put_line('add constraint '||cname||q1.typ);
for q2 in c2 loop
dbms_output.put_line(q2.coln);
end loop;
dbms_output.put_line(')' ||q1.status);
dbms_output.put_line('/');
end loop;
end;
declare
cursor c1 is
select c.constraint_name,c.r_constraint_name cname2,
c.table_name table1, r.table_name table2,
decode(c.status,'DISABLED','DISABLE',' ') status,
decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
delete_rule
from user_constraints c,
user_constraints r
where c.constraint_type='R' and
c.r_constraint_name = r.constraint_name and
c.table_name = upper('&1')
union
select c.constraint_name,c.r_constraint_name cname2,
c.table_name table1, r.table_name table2,
decode(c.status,'DISABLED','DISABLE',' ') status,
decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
delete_rule
from user_constraints c,
user_constraints r
where c.constraint_type='R' and
c.r_constraint_name = r.constraint_name and
r.table_name = upper('&1');
cname varchar2(50);
cname2 varchar2(50);
cursor c2 is
select decode(position,1,'(',',')||rpad(column_name,40) colname
from user_cons_columns
where constraint_name = cname
order by position;
cursor c3 is
select decode(position,1,'(',',')||rpad(column_name,40) refcol
from user_cons_columns
where constraint_name = cname2
order by position;
begin
dbms_output.enable(100000);
for q1 in c1 loop
cname := q1.constraint_name;
cname2 := q1.cname2;
dbms_output.put_line('alter table '||q1.table1||' add constraint ');
dbms_output.put_line(cname||' foreign key');
for q2 in c2 loop
dbms_output.put_line(q2.colname);
end loop;
dbms_output.put_line(') references '||q1.table2);
for q3 in c3 loop
dbms_output.put_line(q3.refcol);
end loop;
dbms_output.put_line(') '||q1.delete_rule||q1.status);
dbms_output.put_line('/');
end loop;
end;
col c1 format a79 word_wrap
set long 32000
set arraysize 1
select 'create or replace trigger ' c1,
description c1,
'WHEN ('||when_clause||')' c1,
trigger_body ,
'/' c1
from user_triggers
where table_name = upper('&1') and when_clause is not null
select 'create or replace trigger ' c1,
description c1,
trigger_body ,
'/' c1
from user_triggers
where table_name = upper('&1') and when_clause is null
select 'alter trigger '||trigger_name||decode(status,'DISABLED','
DISABLE',' ENABLE')
from user_Triggers where table_name='&1';
set serveroutput on
declare
cursor c1 is
select 'alter table
'||'&1'||decode(substr(constraint_name,1,4),'SYS_',' ',
' add constraint ') a1,
decode(substr(constraint_name,1,4),'SYS_','
',constraint_name)||' check (' a2,
search_condition a3,
') '||decode(status,'DISABLED','DISABLE','') a4,
'/' a5
from user_constraints
where table_name = upper('&1') and
constraint_type='C';
b1 varchar2(100);
b2 varchar2(100);
b3 varchar2(32000);
b4 varchar2(100);
b5 varchar2(100);
fl number;
begin
open c1;
loop
fetch c1 into b1,b2,b3,b4,b5;
exit when c1%NOTFOUND;
select count(*) into fl from user_tab_columns where table_name =
upper('&1') and
upper(column_name)||' IS NOT NULL' = upper(b3);
if fl = 0 then
dbms_output.put_line(b1);
dbms_output.put_line(b2);
dbms_output.put_line(b3);
dbms_output.put_line(b4);
dbms_output.put_line(b5);
end if;
end loop;
end;
create or replace procedure dumzxcvreorg_dep(nam varchar2,typ
varchar2) as
cursor cur is
select type,decode(type,'PACKAGE BODY','PACKAGE',type) type1,
name from user_dependencies
where referenced_name=upper(nam) and referenced_type=upper(typ);
begin
dbms_output.enable(500000);
for c in cur loop
dbms_output.put_line('alter '||c.type1||' '||c.name||' compile;');
dumzxcvreorg_dep(c.name,c.type);
end loop;
end;
exec dumzxcvreorg_dep('&1','TABLE');
drop procedure dumzxcvreorg_Dep;
select 'grant '||privilege||' on '||table_name||' to '||grantee||
decode(grantable,'YES',' with grant option;',';') from
user_tab_privs where table_name = upper('&1');
select 'grant '||privilege||' ('||column_name||') on &1 to
'||grantee||
decode(grantable,'YES',' with grant option;',';')
from user_col_privs where grantor=user and
table_name=upper('&1')
order by grantee, privilege;
select 'create synonym '||synonym_name||' for
'||table_owner||'.'||table_name||';'
from user_synonyms where table_name=upper('&1');
PROMPT REM
PROMPT REM YOU MAY HAVE TO LOG ON AS SYSTEM TO BE
PROMPT REM ABLE TO CREATE ANY OF THE PUBLIC SYNONYMS!
PROMPT REM
select 'create public synonym '||synonym_name||' for
'||table_owner||'.'||table_name||';'
from all_synonyms where owner='PUBLIC' and table_name=upper('&1') and
table_owner=user;
prompt spool off
spool off
set echo on feed on verify on
The scripts REORGS1.SQL and REORGS2.SQL have been
created. Alter these script as necesarry.
To recreate the table-structure, first run REORGS1.SQL.
This script saves the content of your table in a table
called bk_.
If this script runs successfully run REORGS2.SQL.
The result is spooled to REORGTB.LST.
Check this file before dropping the bk_ table.
*/Please do NOT cross-postings: create a deep structure for dynamic internal table
Regards
Uwe -
I am a teacher setting up a tracking system using Numbers for the first time. I have set up a summary sheet with puil information, some of which is "looked up" from other tables within the document. It is working brilliantly until we regrouped the pupils.
When i reorganise the students on the summary page I want the same order to follow on all subsequent tables.
However the pupil lists on all subsequent pages stay in the original order!
Hope this makes some kind of sense as I am about to throw macbook out of the window!
DAvedavidmilce wrote:
I want all of the tick boxes in each row to move with the pupil name when they are reorganised (ie the unique data in each row stays with the pupi no matter where they go when sorted.
Thanks again
Dave
Dave,
I might use Match, Offset and Column in my expressions. There are many approaches to this
Match will tell you which row your person's data is in, and OFFSET will then take you to the row indicated by Match and the column indicated by COLUMN().
Let's say you want to access the data for Pupil A. Further assume that the string "Pupil A" is the content of Column A, essentially the title of the record.
MATCH(A, AF1 :: Table 1 :: A) will return the number of the Row in the source table where Pupil A is found.
INDEX(Main, MATCH($A, Main :: $A), COLUMN()) will get the content, in your case the checkbox status.
You are done if you are happy with displaying "TRUE" or "FALSE"
But if you want, you can substitute graphics, like this:
=IF(INDEX(Main, MATCH($A, Main :: $A), COLUMN()), "☑", "☐")
Regards,
Jerry -
Finding known Field name in R3 tables
Hi,
How can one find the R3 table which holds a field name of which the name is known? In casu, I'm looking for the table which holds 'REMES' value (reorganisation value).
Many thankshi,
what's the datasource name ?
get the datasource name that hold it,
then try help.sap.com, click 'search documentation',
option 'netweaver' and type in the datasource, and go, after the result come out, click 'datasource' in right side, and click the datasource name in left side,
if no luck, follow the steps in Roberto's excellent weblog
/people/sap.user72/blog/2005/09/05/sap-bw-and-business-content-datasources-in-pursuit-of-the-origins
hope this helps. -
How can I know the size of DB Table
Hi, Guys,
1. How can I know the size of the DB Table in terms of kb
2. If I delete some records from the Table, does the actual size of the Table remains same or will it be reduced.
3. If size remains same after deletion, how to reduce the size ( i.e. occupied space).
thanks
MaheshHi
1. How can I know the size of the DB Table in terms of kb
There is no precise method/tcode/program to know the Table size of a tables.
Just based on the record size of a table(say for example 2kb), and if 200 records are there then, we roughly assume that it occupied 400 kb.
All the tables are stored in Table spaces.
2. If I delete some records from the Table, does the actual size of the Table remains same or will it be reduced.
Time being it remains same. it won't get reduced immediately
during some next DB reorganisation it gets reorganised by reducing it.
3. If size remains same after deletion, how to reduce the size ( i.e. occupied space).
during next DB reorganisation it gets reorganised by reducing it.
Reward points if useful
Regards
Anji -
Tablespace Reorganisation in Oracle 10g Database
Dear All,
I'm planning of doing a carrying out a Tablespace Reorganisation of the schema tablespace on the production server. I need your views regarding the process to be taken and tuning that is required before carrying out such an activity. For your information, the size of the tablespace is around 3TB. Also, since it is the production server, we can't have an outage for more than 24hrs. Hence, I would like some help from all of you in order to carry out this activity successfully in the time frame.
Regarding the process :
I have some ideas about how to do the tablespace reorganisation in oracle 10g. But, if I carry out the activity my way, its going it to take atleast 3-4 days to complete (which won't be acceptable).
Areas of concern :
1) Steps to perform the tablespace reorganisation in Oracle 10g DB.
2) Size of the temporary tablespace before starting the Reorg.
3) Any further suggestions / recomendations regarding tuning up of Oracle Parameters for enhancement of speed and acuracy of the activity.
System Specifications :
SAP - BI 7.0 (SAP NetWeaver 2004s)
DB - Oracle 10.2.0.2.0, DBSL Patch Level - 158
OS - AIX 5.3
Looking forward to some good and prompt suggestions from all of you !!
Please provide your valuable inputs.
NOTE :: We have successfully performed the reorganization in the rest of the landscape on the same schema tablespace without any issues.
Thanks and Regards,
Deoraj Alok.It is quite an old thread, but let me put in my view points, which could help others.
1. The Size of PSAPTEMP and PSAPUNDO tablespace should be 1.5*largest Table Size.
2. Another Important thing is , if the time is in an issue, what you can do is to reorg. only top 50 largest tables where maximum space is being wasted. Folowing is the query to determine the TOP 50 tables which has the highest WASTED size.
SELECT * FROM
(SELECT
SUBSTR(TABLE_NAME, 1, 21) TABLE_NAME,
NUM_ROWS,
AVG_ROW_LEN ROWLEN,
BLOCKS,
+ROUND((AVG_ROW_LEN + 1) * NUM_ROWS / 1000000, 0) NET_MB,+
+ROUND(BLOCKS * (8000 - 23 * INI_TRANS) *+
(1 - PCT_FREE / 100) / 1000000, 0) GROSS_MB,
ROUND((BLOCKS * (8000 - 23 * INI_TRANS) * (1 - PCT_FREE / 100) -
+(AVG_ROW_LEN + 1) * NUM_ROWS) / 1000000) "WASTED_MB",+
Tablespace_Name
FROM DBA_TABLES
WHERE
NUM_ROWS IS NOT NULL AND
OWNER LIKE 'SAP%' AND
PARTITIONED = 'NO' AND
(IOT_TYPE != 'IOT' OR IOT_TYPE IS NULL)
ORDER BY 7 DESC)
WHERE ROWNUM <=50;
I am sure that, only these 50 tables will reduce the maximum space and you can ignore rest of the tables.
3. Even you can find out all the Tables which are having LONG and LONG RAW fields by using this query
Select Distinct TABLE_NAME From dba_tab_cols Where Owner='SAPYSP' and (DATA_TYPE='LONG' OR DATA_TYPE='LONG RAW');
Now, from the results of this query you can see how many Tables are present in the Top 50 Tables. There will be a few only and you can export/import these few tables in offline mode.
4. After reorg, fi you want to claim the free disk space also, it would not be that easy because of the high water mark present in datafiles but you can try with
Alter datafile <datafile id> resize <Size>M
5. If free disk space is the first priority the you need to create another Table space (which should have size as big as it can have all the tables) and you re-organize in this new tablespace. After Reorg, drop the old tablespace and rename the new Table space with the old one (Rename Tablespace Command will work only in Oracle 10g).
I hope this information helps all those who are going to do reorg in their respective projects. However, You can further put your question if in doubt and I will try to answer them. -
Unable to release space from table
Hi all,
We are unable to release space from a table called TST03 even after deletion of records.
Followings are the information.
Database : 9.2
Table Name : TST03
Tablespace : LOCALY MANAGED.
Previously there were lots of rows.
At Present only 9 No of Rows.
Space allocated : 41 GB
PCT_INCREASE : Null
One of the column is of LONG RAW type.
Since the table is in LMTS, we were expecting that the space allocated will be released automaticaly after deletion of records.
Now, what are the option left with us to release 41GB of space ?
A. Is there any effect of "Drop storage" option of 'Truncate table' command ?
B. If yes , can i copy all the 9 rows to a new table, then use "Truncate table TST03 drop storage", check if space is released and then copy back all the 9 rows to this table.
C. Do you have any other easy solution apart from export/import ?
D. Checked all the relevant Note(646681,48400,10551), could not find an easy solution. I want to avoid offline export/import option.
Thanks .
Naba J Neog> Hi all,
Hi !
> We are unable to release space from a table called
> TST03 even after deletion of records.
>
> Followings are the information.
> Database : 9.2
> Table Name : TST03
> Tablespace : LOCALY MANAGED.
> Previously there were lots of rows.
> At Present only 9 No of Rows.
> Space allocated : 41 GB
> PCT_INCREASE : Null
> One of the column is of LONG RAW type.
>
> Since the table is in LMTS, we were expecting that
> the space allocated will be released automaticaly
> after deletion of records.
Sorry, but that is not what LMTS is for. Wrong assumption.
MaxDB e.g. returns space immediately - Oracle does not.
> Now, what are the option left with us to release 41GB
> of space ?
> A. Is there any effect of "Drop storage" option of
> 'Truncate table' command ?
Yes, the effect is, that after the truncate the table is empty and only one extent is allocated - the rest is returned to freespace. That's the DEFAULT behaviour of TRUNCATE TABLE.
> B. If yes , can i copy all the 9 rows to a new table,
> then use "Truncate table TST03 drop storage", check
> if space is released and then copy back all the 9
> rows to this table.
Nope - you would have to copy the LONG RAW columns as well and this cannot be done easily from sqlplus.
> C. Do you have any other easy solution apart from
> export/import ?
Nope again - you'd have to use this offline reorganisation as long as you're not on Oracle 10g and the long raw fields got converted into LOBs. With 10g you might also use the SHRINK table command. But with Oracle 9i - sorry: exp and imp (will be pretty fast for 9 rows...)
> D. Checked all the relevant Note(646681,48400,10551),
> could not find an easy solution. I want to avoid
> offline export/import option.
Sorry - no way to avoid it and still get the free space back.
Anyhow you might want to take actions to prevent this situtation from reoccuring.
These kinds of questions are covered in the notes
<a href="http://service.sap.com/sap/support/notes/48400">#48400</a>
<a href="http://service.sap.com/sap/support/notes/66290">#66290</a>
>
> Thanks .
> Naba J Neog
You're welcome.
Lars -
How to reorganise a RDA application without getting error RSSTATMAN042?
Hallo RDA experts,
according to this [presentation|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40784126-7503-2b10-b586-f6d5acd41f60] SAP wants us to reorganise a RDA application frequently (see slide 37): "Data has to be deleted frequently from u201EReal-Time Data Acquisitionu201C DataStore Object to avoid
redundant data". Another reason for reorganisation would be the lousy performance of DSO objects...
Here we go again: after having transfered the RDA data to the cube and deleted them from the RDA-DSO the next daemon run will cause this error message:
Real-time upload not possible; request xyz must first be passed
Message no. RSSTATMAN042
where xyz is the ID of the last processed RDA PSA request. Also after an additional deletion of the PSA table this error is appearing (with xyz = 0).
I think it's not the right approach to reorganise manually at regular intervals - what is your solution for this task? Did you also experience this error message? We have BI 7.0, SP 18.
Many regards
Martin Lehmann
Edited by: Martin Lehmann on Sep 24, 2009 9:32 AM
Meanwhile I posted this problem to the OSS for further analysis and I am still waiting for responce...Hello there, ALGroves.
Great job so far in troubleshooting your issue. If you haven't already, feel free to review the information in this Knowledge Base article that goes over your particular error message:
Resolve issues between iTunes and security software
http://support.apple.com/kb/TS3125
If the issue persists, you can try the information in this article as another option for restoring your device:
What to do before selling or giving away your iPhone, iPad, or iPod touch
http://support.apple.com/kb/ht5661
Particularly:
Before you sell or give away your iOS device, make sure that you've removed all of your personal information. Follow these steps to protect your data and get your device to its factory default state for the new owner:
Back up your device.
Go to Settings > General > Reset, then tap Erase All Content and Settings.
This will completely erase your device and turn off iCloud, iMessage, FaceTime, Game Center, and other services.
If you're using iOS 7 and have Find My iPhone turned on, your Apple ID and password will be required. After you provide your password, the device will be erased and removed from your account so that the next owner can activate it.
Contact your carrier for guidance on transferring service to the new owner.
When the device is turned on for the first time by the new owner, Setup Assistant will guide them through the setup process.
Important: Do not manually delete contacts, calendars, reminders, documents, photo streams, or any other iCloud data while signed in to your iCloud account, or the content will also be deleted from the iCloud servers and all of your iCloud devices.
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro
Maybe you are looking for
-
We are running MRP with 3 different MRP types: V1, PD, ND on the Material Master. Since our schedule lines only allow u201CCNu201D category, I updated the combinations for sales item document, MRP type and Schedule Line on transaction VOV5: TAN V
-
Mail - How can I set up a mailbox on an external drive?
I am using a 13 inch MacBook Pro for work, running OS X Yosemite (ver. 10.10.3). I have a 4TB external drive attached, a portion of which I use for Time Machine and the rest is available for storage. I use the mail application to handle all of my e
-
Adding mobileme gallery content in iWeb with a personal domain
I've been building gorgeous looking pages in iWeb this year which I have attached to a personal domain. I'm having trouble adding a movie that I have published on my mobileme gallery as widget is telling me there is nothing available. Could this be b
-
I picked one up on friday past there and to be honest I am quite impressed with it. I didnt think I would be into it much, but it is getting used a fair bit. I doubt it will replace my trusty laptop, but it is great to pick up for a real quick browse
-
New vpn conncetion using Cisco Anyconnect Secure Mobility Client
(Not sure if I'm in the right forum.) I'd like to connect via VPN to complete work tasks while not on the network. My Windows 8 laptop came with Cisco Anyconnect Secure Mobility. How do I or where do I go to add the new settings for this new vpn lo