Separate LOB tablespace
Hello members,
I am currently doing maintenance work on a 10.2 application. This has quite a few xmltype columns, and I've noticed one thing;
all of these are created with no considerations given to physical properties. Meaning - among other things - that all are enable storage in row.
I am planning to do something about this, but first I was reading through the lob developers guide (Both 11.2 and 10.2 since we are in our final year of 10g)
Doing this, I came across this little sentence:
TABLESPACE and LOB Index
Best performance for LOBs can be achieved by specifying storage for LOBs in a tablespace different from the one used for the table that contains the LOB. If many different LOBs are accessed frequently, then it may also be useful to specify a separate tablespace for each LOB column or attribute in order to reduce device contention.
Which strikes me as kind of odd, playing the performance card here. It makes me wonder if this is the "Separate Index Table Space" revived?
Or is there more to it? - Is there any reason for separate lob tablespace, and if no performance reason, what then?
Any comments?
Regards
Peter
P.S: I may decide to enjoy my week-end, so I may not follow up right away ;)
Hi Peter,
I am reading this link :
http://asktom.oracle.com/pls/asktom/f?p=100:11:3400094338666934::::P11_QUESTION_ID:378418239571
And Sir Thomas's replies :
1.
lobs make sense in their own tablespace since they use a "versioning" scheme that is a little different from table data (they use space very differently)
2.
not just "another tablespace", for a tablespace is for ease of administration, not performance. You could have 100 tablespaces -- all on the same disk (leaving 50 other disks idle) for example.
It is about even IO distribution, not tablespaces.
3.
In general, tablespaces are NOT a performance thing, they are a "make my life as an admin easier" thing. They are a tool you can use to organize data.
A separate tablespace doesn't mean "separate IO system".
by default LOBS are not cached, depending on the size of your lobs - you might look at that detail. By default, when you insert a lob, you wait for the direct IO to the lob segment to complete. By default, when you read a lob, you wait for the direct IO to complete.
4.
A tablespace is a collection of one or more files in general. A tablespace is not a "tuning device" really (just because byte A and byte B are in different tablespaces does NOT mean that bytes A and B are on different devices at all)
So, i think here we get conflict of doc writing with Expert's (not only expert, but Oracle Legend) view.
Regards
Girish Sharma
Similar Messages
-
Reasons to use separate temp tablespace for user tablespace
Hi,
I know that guideline says is not use system tablespace for user tables. But need i create for user tablespace separate TEMP teblespace or i can use same TEMP tablespace for all tablespaces?Hi,
>>But need i create for user tablespace separate TEMP tablespace or i can use same TEMP tablespace for all tablespaces?
You can use one temp tablespace for a database , Temp tablespace usage are for sorting the data.
for more detail you can go with :Creating Tablespaces
HTH -
Hello everyone!!!
I'm using for testing an ORACLE XE on my own XP machine (which has a cluster of 4K), and I've created a tablespace for LOBs with those settings:
CREATE TABLESPACE lobs_tablespace
DATAFILE '.....lobs_datafile.dbf'
SIZE 20M
AUTOTEXTEND ON
NEXT 20M
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
BLOCKSIZE 16K;
so I created a test table with a LOB field:
CREATE TABLE test_table
ID NUMBER,
FIELD1 VARCHAR2(50)
FIELD2 BLOB,
CONSTRAINT......
LOB (FIELD2) STORE AS LOB_FIELD2 (
TABLESPACE lobs_tablespace
STORAGE (INITIAL 5M NEXT 5M PCTINCREASE 0 MAXEXTENTS 99)
CHUNK 16384
NOCACHE NOLOGGING
INDEX LOB_FIELD2_IDX (
TABLESPACE lobs_tablespace_idxs));
where lobs_tablespace_idxs is created with blocksize of 16K
so at this point, because i'm doing some tests on functions, I tried to insert in this table with a:
FOR i IN 1..10000 LOOP
fn_insert_into_table('description', 'filename');
END LOOP;
trying to insert a word file with dimension of almost 5Mb and I get the datafile lobs_datafile.dbf increased from start of 50M to almost 5Gb...
I have some parameters settled as:
db_16K_cache_size=1028576
db_block_checking = false
undo_management = auto
db_block_size = 8192
sga_target = 128M
sga_max_size = 256M
so the question is: doing some calculus 5Mb of a file * 10000 should be at max 60Mb...not 5Gb...so why the datafile increased so much as like it did? shall I have to check something else that I've missed?....
Thanks a lot to everyone! :-)Hi,
I'm guessing that you'll need to do a bit of a re-org in order to free up the space.
You may well be able to do that just at the LOB level, rather than rebuilding the entire table.
There's stuff about that in Chapter 3 of the 10G App Developers Guide: Large Objects.
Of course, it the table is now empty, then you might as well just drop it and recreate.
After that, you should be able to resize the datafile. -
Separate UNDO tablespace for each instance
Version: 10.2.0.4, 11.2.0.2
I've noticed that there is an UNDO tablespace for each instance in RAC. Since UNDO tablespace lies in the shared storage, isn't it better to have just one UNDO tablespace for all instances?Max wrote:
Version: 10.2.0.4, 11.2.0.2
I've noticed that there is an UNDO tablespace for each instance in RAC. Since UNDO tablespace lies in the shared storage, isn't it better to have just one UNDO tablespace for all instances?Each instance in the RAC system can only use one undo tablespace at a time. In other words, instances cannot share undo tablespaces. Each instance in the cluster, being an independent transaction-processing environment, maintains its own UNDO area for undo management.
Either automatic undo management or rollback segment undo can be used to manage undo space. If the automatic rollback method will be used, set the global parameter undo_management to auto in the server parameter file, and set the undo_tablespace parameter to assign the undo tablespace to the instance.
The RAC system allows the creation and use of several undo tablespaces. When the instance is started, it uses the first available undo tablespace. A second instance will use another undo tablespace. Thus, each instance in a RAC system will have exclusive access to a particular undo tablespace at a given time. The undo tablespace cannot be shared among the instances at the same time. Only once an undo tablespace is released by an instance, it can be assigned to another instance. However, all instances can read blocks from any or all undo tablespaces for the purpose of constructing read-consistency images.
source:http://www.dba-oracle.com/real_application_clusters_rac_grid/undo_management.htm -
The following is not a question and I am not requesting a response but rather posting this for informational purposes as was requested by the docs team.
A few weeks back as the result of a thread I can not currently locate, questions were raised with respect to Oracle's documentation about LOBs and I stated that I would pursue it getting the docs fixed.
I now have the response and, with names removed, am posting the thread for anyone interested in the topic.
From: Janis [email protected] <[email protected]>
Date: Tue, Jan 24, 2012 at 12:40 PM
Subject: Re: Oracle Docs Issue *** ADLOB forum issue: tablespace separate from table containing LOB
To: damorgan11g @ gmail.com
Cc: Eric ... <[email protected]>
Dan,
You have two somewhat related issues here and I have divided them up.
See inline notes
Best,
Janis
On 11/27/2011 10:54 PM, Daniel Morgan wrote:
Thanks Eric ... Hi Janis
Thank you for taking a look at this. The way modern SANs are configured, and so many of us using ASM it is my expectation that those "different" tablespaces
could be on the same disk whereas the two segments in the same tablespace might be miles of stripe away from each other. In short I can not conceive of
how it could matter.
I look forward to learning what you find out during your investigations.
Also, as you are rewriting the book, it would be great if you could bring together, in one place, the regular functions that now support LOBS
(for example LENGTH), the DBMS_LOB functionality, and far clearer explanations of CHUNK and NOCACHE and other bits of related functionality.
We don't so much need definitions as we need clarity as to when and how to use them.
Here's one example:
http://docs.oracle.com/cd/E11882_01/appdev.112/e10777/ch_dba.htm#IMURG11685
what, one might wonder, is the default if CHUNK is not specified?
Thank you.
Daniel A. Morgan
Oracle ACE Director
The Multimedia book will add a note to see the Packages guide, chapter on DBMS_LOB for specifics of various methods etc.
http://st-doc.us.oracle.com/11/112/appdev.112/e25788/d_lob.htm#autoId0
As far as CHUNK goes, it is a basic parameter defined (with default) in the SQL Reference Guide (SQLRF). In the context of the discussion,
it relates to create table.
The definition is found here:
http://st-doc.us.oracle.com/11/112/server.112/e26088/statements_7002.htm?term=Chunk#SQLRF54527
CHUNK integer Specify the number of bytes to be allocated for LOB manipulation. If integer is not a multiple of the database block size, then the
database rounds up in bytes to the next multiple. For example, if the database block size is 2048 and integer is 2050, then the database allocates
4096 bytes (2 blocks). The maximum value is 32768 (32K), which is the largest Oracle Database block size allowed. The default CHUNK size is one
Oracle Database block. The value of CHUNK must be less than or equal to the value of NEXT, either the default value or that specified in the
storage_clause. If CHUNK exceeds the value of NEXT, then the database returns an error. You cannot change the value of CHUNK once it is set.
As far as your suggestion for consolidation, yes, in some areas of the ADLOB book, this is true and I am working on it.
Continue below
On Sun, Nov 27, 2011 at 9:39 PM, Eric ... <[email protected]> wrote:
Hi Daniel,
Thanks for the detailed feedback.
Your timing is perfect. I've just assigned the LOBs book to Janis.
Janis: Can you please investigate and respond when you've got it sorted out.
Thanks,
-Eric
On 11/27/2011 8:34 PM, Daniel Morgan wrote:
The links in question are:
http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm
http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#i1006434
What is of specific concern is this statement on both pages.
Best performance for LOBs can be achieved by specifying storage for LOBs in a tablespace different from the one used for the table that contains the LOB.
I personally don't believe it and my limited testing over the weekend seems to confirm my suspicion. The comment has the distinct feeling of having been
written by the same misguided sole that thought best performance could be had by putting tables and indexes into separate tablespaces. Today we all
know that was pure mythology but for a decade everyone quoted the Oracle 7.x docs as supporting the idea.
In a world of virtualized storage, striping, and multi-user systems the statement does not ring true. Please have the author either remove it or justify it then
post a clarification to this thread.Re: Separate LOB tablespace
Daniel, I have the following response from the development team, please convey this to the forum for us:
Choice of tablespaces for different objects is a complex issue that is not amenable to summarization. Every rule/statement on the topic (including the one
in the docs) has scenarios where it is justified, and scenarios
where it is not.
If the concern is about the seeming categorical nature of the current statement, just remove it [removed: doc team]. There is no way to make that
statement less categorical and simultaneously useful and actionable.
Per the developer's request, I am removing the paragraph from the SecureFiles and Large Objects Guide.
Best,
JanisI am not kidding. I posted the link but I did not check if it were the same source. Really I do not have time to realize it.
I think you can get a fast answer in SQL & PL/SQL forum.
Good Luck!
Joel Pérez -
Hi,
I want to know two things
*1-* If I insert a lob value say blob through sql stament as shown below
insert into employee(id,name,picture) values('101','Peter',pic );
Now how value will insert into Oracle table i.e. lob pointer in original table and lob value in either other segment of same tablespace or in segment of different tablespace. I mean is there any internal mechanism which Oracle handles or developer/dba has to take care of it. Like I want to create a separate Lob segment for picture and want to insert original lob value in it. How can I achieve this.
*2-*If I'm using DBMS_LOB package for insertind data in ltable containg lob clolums. Then is it necessary to first initialize lob cloumn and then insert value in it.
Looking for guidence .
Regards,
AbbasiYou can NOT insert a BLOB like insert into employee(id,name,picture) values('101','Peter',pic );, You can try it yourself and check!.
If the column is of BFILE then atleast you need something like insert into employee(id,name,picture) values('101','Peter',BFILENAME('MY_DIR','pic.jpg' );To load/insert a BLOB you need DBMS_LOB. One example may be....
SQL> CREATE TABLE myblob (id NUMBER(2), my_xls BLOB);
Table created.
SQL> CREATE OR REPLACE DIRECTORY TEST_DIR as 'C:\';
Directory created.
SQL> DECLARE
2 v_src_loc BFILE := BFILENAME('TEST_DIR', 'saubhik.xls');
3 v_amount INTEGER;
4 v_b BLOB;
5 BEGIN
6 DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY);
7 v_amount := DBMS_LOB.GETLENGTH(v_src_loc);
8 INSERT INTO myblob VALUES (1, EMPTY_BLOB()) RETURNING my_xls INTO v_b;
9 DBMS_LOB.LOADFROMFILE(v_b, v_src_loc, v_amount);
10 DBMS_LOB.CLOSE(v_src_loc);
11 END;
12 /
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete. -
ORA-12815 while reorg/compression of tables without LONG and LOB with 11g
Hello fellows,
I am in the luxury situation that I got a copy of our production R/3 environment that was left over from a project and is no more required by any of our developers.
As we are still on oracle 9.2.0.7 I upgraded this copy to 11.2 in a two step process (from 9i to 10g to 11g).
I got myself the SAP dbatools 7.20(3) and the Note 1431296 - LOB conversion and table compression with BRSPACE 7.20.
I started with some small tablespaces but after a while I thought I'd like to try to reorg/compress the worst of all tablespaces...PSAPPOOLD with ~15.000 tables.
I first converted tables with LONG fields online that can be compressed, than the onse that can not be compressed, than I reorged the tables that contain old LOB fields online. With these different executions of the brspace commands that are also mentioned in the above note I managed to move ~ 3.000 tables without any issues.
But now I started with the biggest bunch of tables, the compression of tables without LONG and LOB fields online.
This is the command I used:
brspace -u / -p reorgEXCL.tab -f tbreorg -a reorg -o sapr3 -s PSAPPOOLD -t allsel -n psapreorg -i psapreorgi -c ctab -SCT
...after a few checks that are performed by brspace, I end up in the screen
Options for reorganization of tables (which is still nothing I wouldn't have expected)
1 * Reorganization action (action) ............ [reorg]
2 - Reorganization mode (mode) ................ [online]
3 - Create DDL statements (ddl) ............... [yes]
4 ~ New destination tablespace (newts) ........ [PSAPREORG]
5 ~ Separate index tablespace (indts) ......... [PSAPREORGI]
6 - Parallel threads (parallel) ............... [1]
7 ~ Table/index parallel degree (degree) ...... []
8 ~ Category of initial extent size (initial) . []
9 ~ Sort by fields of index (sortind) ......... []
10 # Index for IOT conversion (iotind) ......... [FIRST]
11 - Compression action (compress) ............. [none]
12 # LOB compression degree (lobcompr) ......... [medium]
13 # Index compression method (indcompr) ....... [ora_proc]
But independent of what I enter in point 6 and 7, I always end up with below erros during the reorg/compression of the outstanding tables:
Just one sample, but the issue is always the same.
BR0301E SQL error -12815 in thread 2 at location tab_onl_reorg-26, SQL statement:
'CREATE UNIQUE INDEX "SAPR3"."RTXTF_____0#$" ON "SAPR3"."RTXTF#$" ("MANDT", "APPLCLASS", "TEXT_NAME", "TEXT_TYPE", "FROM_LINE",
"FROM_POS")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 1662976 NEXT 655360 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "PSAPREORGI" PARALLEL ( INSTANCES 0) '
ORA-12815: value for INSTANCES must be greater than 0
Just in case, here it the OBJECT DDL:
CREATE UNIQUE INDEX "SAPR3"."RTXTF_____0"
ON "SAPR3"."RTXTF" ("MANDT", "APPLCLASS", "TEXT_NAME",
"TEXT_TYPE", "FROM_LINE", "FROM_POS")
TABLESPACE "PSAPPOOLI" PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE ( INITIAL 1624K NEXT 640K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
LOGGING
Perhaps someone already gained some experience on the compression with brspace and can give me a hint.
Many thanks
FlorianHello Florian,
> Perhaps someone already gained some experience on the compression with brspace and can give me a hint.
I have not performed any compression operations on Oracle 11g R2 with brspace until yet .. but this error seems to be very obvious.
It seems like SAP is still not using the procedure DBMS_REDEFINITION.COPY_TABLE_DEPENDENT to create the indexes (and NOT NULL constraints) on Oracle 11g R2. No idea why, i can only think of one case (create a DDL file before reorganisation to change the DDL parameters through the reorganisation in some kind of ways).
So in your case it seems like SAP is creating a wrong SQL for creating the index on the interim table.
You can try to create the DDL file first and correct the parameters and after that you can try to run the reorganisation again.
Please check sapnote #646681 (Remark 5) for more information about the procedure for "creating the DDL first .. and then do the reorg with edited parameters).
Regards
Stefan -
Staging area and base are in different schema/tablespace
Please can someone give me some advantages and disadvantages to keep staging tables and base tables in same schema. For eg we have staging area where we daily truncate staging table, load in the stg table and do transformation process. Once done we will move the staging table data to base tables. Base tables sizes are huge volume like 6 to 8 million rows as there is no purging done.
I want to suggest to my team that we should keep them in separate schemas as I understand it will be good from I/O point.
Is there any other reason to keep staging and base tables in separate schema/tablespace.Hi,
Definitely I agree with previous answers. You wrote that staging area, transformation etc.. So I think it's a datawarehouse. Staging and base tables should be stored in different data files also in different harddrives. During the ETL task there can be high load on the Disk subsystem. Storing them in different schemas is another subject which is not related with the disk performance.
When it comes to blocksize of the datafile, there is a approach like this:
If the database is used for OLTP systems, it would be good idea to setup smaller size blocks. But when we're talking about a datawarehouse, it's highly recommended to use larger block sizes like 16KB or 32KB. This setting has an advantage related to reading, accessing data blocks.
Regards,
Cuneyt -
How to change the storage destination of Lob objects
Hi All
I've an existing table with a Lob entry.
I'd like to redirect all Lob segments in a precific tablespace. I'd like to do this without reconstruct the table. Is it possible ?
Thanks in advance,
A.G.I think this should work:
alter table <table_name> move lob (XML_DATA.XMLDATA) store as <lob> (tablespace <new_tablespace>); -
System tablespace 92% full
Oracle 9.2.0.1
Linux 7.3
I am on a test machine.
The system tablespace is 92%full.Is it an appropriate value?
What should be the size of the system tablespace?
I checked in DBA_USERS,all users have users tablespace ,few system users have system tablespace as there default tablespace.There is a separate temp tablespace for temporary segments.few system users have system tablespace as there default tablespacei think the OP mentioned users are the one that are created during the creation of database
Once the user has been assigned a tablesapce ..whatever he creates after that by default will be created under the default tablesapce unless it is redirected to use a different tbs provided he has the privilge on that -
System Tablespace unexpected usage
Hi
this is my Oracle version:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production.
The problem I'm having is that my System tablespace fills up quicker than expected (for example 500mb in less than a week and it is not a very 'buisy' server either) and it does not reduce in size.
No other user objects use the system table-space.
I have a separate Temp tablespace.
I am aware of the Autoextend parameter.
Can anyone please explain why this happens and what can be a solution.
Thank you.Thanks Virag for ur suggestions.
I have tried to do this:
SQL> VARIABLE total_blocks NUMBER
SQL> VARIABLE total_bytes NUMBER
SQL> VARIABLE unused_blocks NUMBER
SQL> VARIABLE unused_bytes NUMBER
SQL> VARIABLE lastextf NUMBER
SQL> VARIABLE last_extb NUMBER
SQL> VARIABLE lastusedblock NUMBER
SQL> exec DBMS_SPACE.UNUSED_SPACE('SCOTT', 'EMP', 'TABLE', :total_blocks, -
:total_bytes,:unused_blocks, :unused_bytes, :lastextf, -
:last_extb, :lastusedblock);and got a result.
But how do I do the same for the SYSTEM tablespace.
And, is there any other way to monitor the SYSTEM tablespace growth?
Thank You. -
RDBMS version:11.2, 10.2
We usually create only one temporary tablespace (TEMP) for a database. But, our application team is asking us to create two more dedicated Temporary tablespaces for 2 of its DB schemas which have high activity and assign it as the default temporary tablespaces for it.
Are there any advantages in creating separate TEMP tablespaces for highly active schemas ? Can't I just have one tablespace and increase the size of this TEMP tablespace instead ?SM_308 wrote:
RDBMS version:11.2, 10.2
We usually create only one temporary tablespace (TEMP) for a database. But, our application team is asking us to create two more dedicated Temporary tablespaces for 2 of its DB schemas which have high activity and assign it as the default temporary tablespaces for it.
Are there any advantages in creating separate TEMP tablespaces for highly active schemas ? Can't I just have one tablespace and increase the size of this TEMP tablespace instead ?I would recommend single larger TEMP tablespace -
HI if anyone had some tips for tuning 10g, so that my OLAP (AW in particular) performance is at its peak.
THe server specs are as follows:
Server1.
Windows 2000 Server
2GB RAM
Server2.
Windows XP Pro SP1
1GB RAM
I find that when I import old Express 6.3.4 databases into 10g, after import, the initial Update/commit, takes the same time as the import command. Is this because it has to write data from temporary space to permament.
I am basically looking for comparable parameters to that which would have been set in Express Instance Manager.
At this stage I have only looked to tweak :
shared_pool_size
sga_target
db_cache_size
From my reading I understand it is best to leave olap_page_pool_size as 0.
Can any one assist. I am finding that performace using default parameters in 10g, is worse than that of Express 6.3.4.
Regards,
Imran Shah
Ioppolo & Associates
[email protected]Here are some guidelines for improving the OLAP performance in Oracle Database 10g Release 1.
A. Turn off LOGGING (REDO) during builds to improve data insertion performance.
Disable Logging during build to improve overall load performance. Once load is complete turn it on.
If you choose to set NOLOGGING for the LOB segment (of the AW$ table containing your Analytic Workspace) check out MetaLink 1058851.6 for information pertaining to event 10359 which can reduce I/O for frequently updated NOLOGGING LOBs.
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1058851.6
* Turn Logging off prior to commencing build.
ALTER TABLE GLOBAL.AW$GLOBAL MODIFY LOB (awlob) (CACHE READS NOLOGGING);
* Turn Logging on after build completes.
ALTER TABLE GLOBAL.AW$GLOBAL MODIFY LOB (awlob) (CACHE READS LOGGING);
B. Increase REDO Log size and log_buffer parameter to reduce log switch waits and improve overall time.
Ask the DBA to increase this to somewhere between 100M and 500M from the default of 10M. Use ADDM to determine the ideal size.
C. Build Analytic Workspaces (LOBs) in separate preallocated Tablespaces to improve overall data load performance.
This can reduce device contention while preallocating space avoids allocation during inserts and updates.
D. Move TEMP, UNDO and REDO Logs to fastest disks to improve overall build performance.
Ask the DBA to place TEMP, UNDO and REDO Logs on fastest disks. No RAID5. Use RAW whenever possible and consider RAID10 or 0+1. RAID 5 can severely affect performance on highly updated databases.
E. Specify better OLAP DML for SQL IMPORT or SQL INSERT DIRECT to improve analytic workspace load performance.
SQL INSERT DIRECT is up to 53x faster than SQL INSERT.
NOTE: Source tables should be ordered by the inverse of the target object's dimensionality when loading data from relational sources into an analytic workspace.
SQL IMPORT is up to 7x faster than SQL FETCH.
F. Use AW TRUNCATE instead of AW DELETE if you wish to keep the analytic workspace name. Performs better with less overhead.
EXEC DBMS_AW.EXECUTE('AW TRUNCATE SCOTT.EMPAW');
[Edited by: awaite on Apr 20, 2005 11:20 AM] -
BRSPACE Log being created under incorrect location
I have written a shell script to re-org couple of tables. following is the script:
#!/usr/bin/ksh
# BW Tables re-org and index compression
ORACLE_SID=TST; export ORACLE_SID
ORACLE_HOME=/oracle/TST/112_64; export ORACLE_HOME
PATH=/usr/sbin:/oracle/TST/admin/bin:/oracle/TST/112_64/bin:.:/oracle/TST:/usr/sap/TST/SYS/exe/run:/usr/bin:.:/usr/ccs/bin:/usr/ucb
LD_LIBRARY_PATH=/usr/sap/TST/SYS/exe/run:/oracle/TST/112_64/lib; export LD_LIBRARY_PATH
CURDATE=`date +"%Y-%m-%d-%H:%M"`
LOGFILE=/oracle/$ORACLE_SID/admin/log/tables_reorg.log; export LOGFILE
EMAIL_FILE=/oracle/$ORACLE_SID/admin/log/tables_reorg_email.txt; export EMAIL_FILE
echo "Table Reorg Start Time:`date +"%Y-%m-%d-%H:%M"` " > $EMAIL_FILE
echo " " >> $EMAIL_FILE
brspace -c force -u / -f tbreorg -t BALHDR,RSBATCHDATA > $LOGFILE
echo "Table Reorg End Time: `date +"%Y-%m-%d-%H:%M"`" >> $EMAIL_FILE
echo " " >> $EMAIL_FILE
echo "############ SUCCESS ############" >> $EMAIL_FILE
grep "reorganized successfully" /oracle/$ORACLE_SID/admin/log/tables_reorg.log >> $EMAIL_FILE
echo " " >> $EMAIL_FILE
echo "############ SKIPPED ############" >> $EMAIL_FILE
grep "will be skipped" /oracle/$ORACLE_SID/admin/log/tables_reorg.log >> $EMAIL_FILE
echo " " >> $EMAIL_FILE
echo "############ OVERALL ERRORS ############" >> $EMAIL_FILE
grep "error" /oracle/$ORACLE_SID/admin/log/tables_reorg.log >> $EMAIL_FILE
echo " " >> $EMAIL_FILE
cat $EMAIL_FILE | /usr/bin/mailx -s "$ORACLE_SID Table Re-organisation Report " [email protected]
exit
We are required to login to the server using our personal ID and then "sudo su - oratst" to connect to oratst. When I login like this and execute the above script it works fine. Below is the output:
BR1001I BRSPACE 7.20 (38)
BR1002I Start of BRSPACE processing: seortudn.tbr 2014-09-07 15.35.15
BR0484I BRSPACE log file: /oracle/TST/sapreorg/seortudn.tbr
BR0280I BRSPACE time stamp: 2014-09-07 15.35.16
BR1009I Name of database instance: TST
BR1010I BRSPACE action ID: seortudn
BR1011I BRSPACE function ID: tbr
BR1012I BRSPACE function: tbreorg
BR0134I Unattended mode with 'force' active - no operator confirmation allowed
BR0280I BRSPACE time stamp: 2014-09-07 15.35.18
BR1039I Selecting information about tables and indexes...
BR0285I This action can take several seconds/minutes - be patient...
BR0280I BRSPACE time stamp: 2014-09-07 15.35.33
BR0814I Number of tables/partitions in schema of owner SAPR3: 33913/7699
BR0836I Number of tables treated as info cubes for owner SAPR3: 168
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR0815I Number of indexes/partitions in schema of owner SAPR3: 62579/64258
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR0660I List display 352 # no selection possible
List of tables for reorganization
Pos. Owner Table Pt. DgPk. Rows Used[KB] Data[KB:%]
1 - SAPR3 BALHDR NO 1 752120 228272 193906:85
2 - SAPR3 RSBATCHDATA NO 1 295 136 122:90
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR0134I Unattended mode with 'force' active - continuing processing with default reply 'cont'
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR0657I Input menu 353 # please enter/check input values
Options for reorganization of tables: SAPR3.BALHDR,... (2 tables)
1 * Reorganization action (action) ............ [reorg]
2 - Reorganization mode (mode) ................ [online]
3 - Create DDL statements (ddl) ............... [yes]
4 ~ New destination tablespace (newts) ........ []
5 ~ Separate index tablespace (indts) ......... []
6 - Parallel threads (parallel) ............... [1]
7 ~ Table/index parallel degree (degree) ...... []
8 ~ Category of initial extent size (initial) . []
9 ~ Sort by fields of index (sortind) ......... []
10 # Index for IOT conversion (iotind) ......... [FIRST]
11 - Compression action (compress) ............. [none]
12 # LOB compression degree (lobcompr) ......... [medium]
13 # Index compression method (indcompr) ....... [ora_proc]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR0134I Unattended mode with 'force' active - continuing processing with default reply 'cont'
BR0280I BRSPACE time stamp: 2014-09-07 15.35.58
BR1108I Checking tables for reorganization...
BR0280I BRSPACE time stamp: 2014-09-07 15.35.59
BR1112I Number of tables selected/skipped for reorganization: 2/0
BR0370I Directory /oracle/TST/sapreorg/seortudn created
BR0280I BRSPACE time stamp: 2014-09-07 15.35.59
BR1101I Starting 'online' table reorganization...
BR0280I BRSPACE time stamp: 2014-09-07 15.35.59
BR1124I Starting 'online' reorganization of table SAPR3.BALHDR ...
BR0280I BRSPACE time stamp: 2014-09-07 15.36.53
BR1105I Table SAPR3.BALHDR reorganized successfully
BR0280I BRSPACE time stamp: 2014-09-07 15.36.53
BR1141I 1 of 2 tables processed - 752120 of 752415 rows done
BR0204I Percentage done: 98.67%, estimated end time: 15:36
BR0001I *************************************************_
BR0280I BRSPACE time stamp: 2014-09-07 15.36.53
BR1124I Starting 'online' reorganization of table SAPR3.RSBATCHDATA ...
BR0280I BRSPACE time stamp: 2014-09-07 15.37.05
BR1105I Table SAPR3.RSBATCHDATA reorganized successfully
BR0280I BRSPACE time stamp: 2014-09-07 15.37.05
BR1141I 2 of 2 tables processed - 752415 of 752415 rows done
BR0204I Percentage done: 100.00%, estimated end time: 15:37
BR0001I **************************************************
BR0280I BRSPACE time stamp: 2014-09-07 15.37.05
BR1102I Number of tables reorganized successfully: 2
BR0280I BRSPACE time stamp: 2014-09-07 15.37.05
BR1022I Number of tables processed: 2
BR1003I BRSPACE function 'tbreorg' completed
BR1008I End of BRSPACE processing: seortudn.tbr 2014-09-07 15.37.05
BR0280I BRSPACE time stamp: 2014-09-07 15.37.06
BR1005I BRSPACE completed successfully
When I schedule it in the crontab of oratst directly it is trying to create the logfile under $ORACLE_HOME/sapreorg and fails since that folder does not exist. Please see below
BR1001I BRSPACE 7.20 (38)
BR0252E Function fopen() failed for '/oracle/TST/112_64/sapreorg/seortuxs.tbr' at location main-5
BR0253E errno 2: No such file or directory
BR0121E Processing of log file /oracle/TST/112_64/sapreorg/seortuxs.tbr failed
BR0700E Fatal errors occurred - terminating processing...
BR1008I End of BRSPACE processing: seortuxs.tbr 2014-09-07 15.44.00
BR0280I BRSPACE time stamp: 2014-09-07 15.44.00
BR1007I BRSPACE terminated with errors
My question is, why is trying to create log under $ORACLE_HOME/reorg? Where is is picking up this location from?
Any advice from experts?
Thanks in advance.Hello Reagan,
Below is the env of oratst:
HOME=/oracle/TST
LOGNAME=oratst
PATH=/usr/bin:
SHELL=/usr/bin/sh
TZ=US/Eastern
When I sudo su - oratst and do env, this is what I see:
HOME=/oracle/TST
PATH=/usr/sbin:/usr/local/bin:/oracle/TST/112_64:/oracle/TST/112_64/OPatch:/oracle/TST/112_64/admin/bin:/oracle/TST/112_64/bin:/usr/sbin:/usr/local/bin:/oracle/TST/112_64:/oracle/TST/112_64/OPatch:/oracle/TST/112_64/admin/bin:/oracle/TST:/usr/sap/TST/SYS/exe/run:/usr/bin:.:/tools/ca/3.1/services/bin:/tools/ca/3.1/services/tools:/tools/ca/3.1/agents/bin:/opt/EMCpower/bin:/etc/emc/bin:/etc:/usr/ccs/bin:/usr/ucb
LOGNAME=oraTST
HZ=
TERM=xterm
SHELL=/usr/bin/csh
MAIL=/var/mail/oraTST
TZ=US/Eastern
PWD=/tmp
USER=oraTST
AGENTWORKS_DIR=/tools/ca/3.1
CASHCOMP=/opt/CA/SharedComponents
CALIB=/opt/CA/SharedComponents/lib
LD_LIBRARY_PATH=/opt/CA/SharedComponents/lib:/etc/emc/rsa/cst/lib:/usr/sap/TST/SYS/exe/run
LIC_ECHO=echo
SAPSYSTEMNAME=TST
DIR_LIBRARY=/usr/sap/TST/SYS/exe/run
THREAD=NOPS
dbms_type=ORA
dbs_ora_tsname=TST
ORACLE_BASE=/oracle
ORACLE_PSRV=TST
ORACLE_SID=TST
ORACLE_HOME=/oracle/TST/112_64
ORA_NLS10=/oracle/TST/112_64/nls/data
NLS_LANG=AMERICAN_AMERICA.WE8DEC
SAPDATA_HOME=/oracle/TST
EDITOR=vi -
Trying to use brspace to do a reorg
I am trying to reorg ALL the tables in one tablespace at once:
brspace -f tbreorg -a reorg -i psapfact2i -m offline -n psapfact2d -s psapfactd -t "*"
I get this back:
BR1001I BRSPACE 7.00 (33)
BR1002I Start of BRSPACE processing: sdxtkjdu.tbr 2008-04-22 11.57.42
BR0484I BRSPACE log file: /oracle/BQA/sapreorg/sdxtkjdu.tbr
BR0280I BRSPACE time stamp: 2008-04-22 11.57.45
BR1009I Name of database instance: BQA
BR1010I BRSPACE action ID: sdxtkjdu
BR1011I BRSPACE function ID: tbr
BR1012I BRSPACE function: tbreorg
BR0280I BRSPACE time stamp: 2008-04-22 11.57.47
BR1039I Selecting information about tables and indexes...
BR0285I This function can take several seconds/minutes - be patient...
BR0280I BRSPACE time stamp: 2008-04-22 11.57.49
BR0814I Number of tables/partitions in schema of owner SAPR3: 15948/1024
BR0280I BRSPACE time stamp: 2008-04-22 11.57.56
BR0815I Number of indexes/partitions in schema of owner SAPR3: 21106/6021
BR0280I BRSPACE time stamp: 2008-04-22 11.57.56
BR0660I List display 352 - no selection possible
List of tables for reorganization
Pos. Owner Table Pt. DgPk. Rows Space[KB] Data[KB:%]
1 - SAPR3 /BI0/E0BWTC_C02 NO 1 0 72 0:0
2 - SAPR3 /BI0/E0BWTC_C03 NO 1 0 72 0:0
3 - SAPR3 /BI0/E0BWTC_C04 NO 1 0 72 0:0
4 - SAPR3 /BI0/E0BWTC_C05 NO 1 0 72 0:0
5 - SAPR3 /BI0/E0BWTC_C06 NO 1 0 72 0:0
6 - SAPR3 /BI0/E0BWTC_C07 NO 1 0 72 0:0
7 - SAPR3 /BI0/E0BWTC_C09 NO 1 0 72 0:0
8 - SAPR3 /BI0/E0BWTC_C11 NO 1 0 72 0:0
9 - SAPR3 /BI0/E0PCA_C01 YES 1 0 584 0:0
10 - SAPR3 /BI0/E0PCA_C02 NO 1 0 72 0:0
11 - SAPR3 /BI0/F0BWTC_C02 YES 1 5405 1040 713:69
12 - SAPR3 /BI0/F0BWTC_C03 YES 1 0 72 0:0
13 - SAPR3 /BI0/F0BWTC_C04 YES 1 0 72 0:0
14 - SAPR3 /BI0/F0BWTC_C05 YES 1 128 144 6:4
15 - SAPR3 /BI0/F0BWTC_C06 YES 1 0 72 0:0
16 - SAPR3 /BI0/F0BWTC_C07 YES 1 0 72 0:0
17 - SAPR3 /BI0/F0BWTC_C09 YES 1 0 72 0:0
18 - SAPR3 /BI0/F0BWTC_C11 YES 1 0 72 0:0
19 - SAPR3 /BI0/F0PCA_C01 YES 1 9985560 715472 565588:79
20 - SAPR3 /BI0/F0PCA_C02 YES 1 3964200 144840 100654:69
Press <Rtn> - scroll, 'c' - cont, 'h' - header, 's' - stop ...
21 - SAPR3 /BIC/E100000 NO 1 289140 18440 13836:75
22 - SAPR3 /BIC/E100001 NO 1 147720 9224 7069:77
23 - SAPR3 /BIC/E100002 NO 1 587930 50184 40191:80
24 - SAPR3 /BIC/EMMPUR_C01 NO 1 0 72 0:0
25 - SAPR3 /BIC/EZCO_C50 NO 1 0 72 0:0
26 - SAPR3 /BIC/EZCO_C51 NO 1 0 72 0:0
27 - SAPR3 /BIC/EZECCS_C04 NO 1 0 72 0:0
28 - SAPR3 /BIC/EZMMPURC01 NO 1 0 72 0:0
29 - SAPR3 /BIC/EZPCA_C03 YES 1 0 488 0:0
30 - SAPR3 /BIC/EZPURC001 YES 1 0 2664 0:0
31 - SAPR3 /BIC/EZPURC002 YES 1 0 296 0:0
32 - SAPR3 /BIC/EZQM_C50 YES 1 0 16488 0:0
33 - SAPR3 /BIC/EZRC_C50 NO 1 0 72 0:0
34 - SAPR3 /BIC/EZRC_C51 YES 1 0 488 0:0
35 - SAPR3 /BIC/F100000 YES 1 0 72 0:0
36 - SAPR3 /BIC/F100001 YES 1 0 72 0:0
37 - SAPR3 /BIC/F100002 YES 1 0 72 0:0
38 - SAPR3 /BIC/FMMPUR_C01 YES 1 590150 53328 42648:80
39 - SAPR3 /BIC/FZCO_C50 YES 1 478120 55552 41555:75
40 - SAPR3 /BIC/FZCO_C51 YES 1 32610 4176 2898:69
Press <Rtn> - scroll, 'c' - cont, 'h' - header, 's' - stop ...
41 - SAPR3 /BIC/FZECCS_C04 YES 1 744980 34696 25463:73
42 - SAPR3 /BIC/FZMMPURC01 YES 1 9719 976 655:67
43 - SAPR3 /BIC/FZPCA_C03 YES 1 11251680 741872 593350:80
44 - SAPR3 /BIC/FZPURC001 YES 1 0 72 0:0
45 - SAPR3 /BIC/FZPURC002 YES 1 0 8 0:0
46 - SAPR3 /BIC/FZQM_C50 YES 1 0 72 0:0
47 - SAPR3 /BIC/FZRC_C50 YES 1 62090 4576 1819:40
48 - SAPR3 /BIC/FZRC_C51 YES 1 0 8 0:0
49 - SAPR3 RSDMFACTAB NO 1 0 72 0:0
50 - SAPR3 RSMDMCNVTAB NO 1 0 72 0:0
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2008-04-22 11.58.02
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2008-04-22 11.58.02
BR0657I Input menu 353 - please enter/check input values
Options for reorganization of tables: SAPR3./BI0/E0BWTC_C02,... (50 tables)
1 ~ New destination tablespace (newts) ........ [PSAPFACT2D]
2 ~ Separate index tablespace (indts) ......... [PSAPFACT2I]
3 - Parallel threads (parallel) ............... [1]
4 ~ Table/index parallel degree (degree) ...... []
5 # Create DDL statements (ddl) ............... [yes]
6 ~ Category of initial extent size (initial) . []
7 # Sort by fields of index (sortind) ......... []
8 - Table reorganization mode (mode) .......... [offline]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your choice:
Why is it only doing 50 of the 353 tables?From DB02 then saved to an excel file:
Owner Object Type Tablespace KBytes Blocks Extents MaxExtents Next (K)
1 SAPR3 /BIC/EZQM_C50200509 TABLE PART PSAPFACTD 64 8 1 -1 0
2 SAPR3 /BIC/EZQM_C50200508 TABLE PART PSAPFACTD 64 8 1 -1 0
3 SAPR3 /BIC/EZQM_C50200507 TABLE PART PSAPFACTD 64 8 1 -1 0
4 SAPR3 /BIC/EZQM_C50200506 TABLE PART PSAPFACTD 64 8 1 -1 0
595 SAPR3 /BIC/EZRC_C5192003003 TABLE PART PSAPFACTD 64 8 1 -1 0
596 SAPR3 /BIC/EZRC_C5192003002 TABLE PART PSAPFACTD 64 8 1 -1 0
597 SAPR3 /BIC/EZRC_C5192003001 TABLE PART PSAPFACTD 64 8 1 -1 0
Maybe you are looking for
-
If I go to a website that requires a login & password, and I have it set up to automatically log me in, I get automatically logged in (it remembers by userid & password for that site), but the prompt from the Software Security Device for my master pa
-
when i open Itunes its telling me i need the current version of Quicktime, but i installed it when i upgraded to the new version i also checked which version of quicktime im running (which is the one it says i need) i tried upgrading quicktime and i
-
I seem to have corrupted the DBMS_SPACE package. How can I rebuild it? Thanks
-
I used to be able to burn a CD a few pictures at a time till it was full. I have tried CD-R AND CD-RW and now it says "This Disc Does Not allow any more burns, please put in a blank CD" what happened? I used a CD-RW disc, and it still doesn't allow m
-
SPAM : timeout error in DISASSEMBLE phase
I am getting a timeout error while i was updating ST-ICO component my solution manager 7.0 system to level 11 from ST-ICO 150_700 level 10. I have increased the value of parameter "rdisp/max_wprun_time" to 2000 but still the error occurs. Current SP