Command to show table indexes
It's driving me nuts that I can't find it. I know it's probably really simple. I'm using SQL Plus and SQLDeveloper.
Thanks!!
An alternative to the (USER|ALL|DBA)_INDEXES views is the DBMS_METADATA package; specifically the GET_DEPENDENT_DDL(object type, parent object name, parent object schema) function.
SQL> SET LONG 2000000
SQL> SET LONGCHUNKSIZE 120
SQL> SELECT DBMS_METADATA.GET_DEPENDENT_DDL('INDEX', 'SPECLOG', 'TEST999') FROM DUAL;
DBMS_METADATA.GET_DEPENDENT_DD
CREATE INDEX "TEST999"."SPECLOG_LINKED_ALIQDRV_IX" ON "TEST999"."SPECLOG" ("LINKED", "ALIQDRV")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TEST999"
CREATE INDEX "TEST999"."SPECLOG_PARUSPECID_IX" ON "TEST999"."SPECLOG" ("PARUSPECID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TEST999"
CREATE UNIQUE INDEX "TEST999"."SPECLOG_PK" ON "TEST999"."SPECLOG" ("USPECID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TEST999"And if that you can't cope with that much data, you can ask for less.
SQL> EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM, 'STORAGE', false);
PL/SQL procedure successfully completed.
SQL> EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM, 'SEGMENT_ATTRIBUTES', false);
PL/SQL procedure successfully completed.
SQL> SELECT DBMS_METADATA.GET_DEPENDENT_DDL('INDEX', 'SPECLOG', 'TEST999') FROM DUAL;
DBMS_METADATA.GET_DEPENDENT_DD
CREATE INDEX "TEST999"."SPECLOG_LINKED_ALIQDRV_IX" ON "TEST999"."SPECLOG" ("LINKED", "ALIQDRV")
CREATE INDEX "TEST999"."SPECLOG_PARUSPECID_IX" ON "TEST999"."SPECLOG" ("PARUSPECID")
CREATE UNIQUE INDEX "TEST999"."SPECLOG_PK" ON "TEST999"."SPECLOG" ("USPECID")
Similar Messages
-
Is there in PL/SQL a command which shows database objects?
In psql (the postgresql' sqlplus-type application) there is a command \d which acts this way; \dt - show tables \du - show users \df - show functions, trigger etc.
thank you.All will be SQL operations.
SQL> select object_name, object_type from user_objects where object_type = 'TABLE' ;
SQL> select * from all_users ;
SQL> select object_name, object_type from user_objects where object_type = 'FUNCTION' ; -
OMB command to modify Table Index
Hi All,
I am trying to add a new columnname to index of the table by using omb command but failing out .. Can anybody help me ?
OMBALTER TABLE 'TABLENAME' \
MODIFY INDEX 'INDEXNAME' \
ADD INDEX_COLUMN 'COL1'
Thanks,
Samurai.I got it thanks.
OMBALTER TABLE 'TABLENAME'\
ADD INDEX_COLUMN 'COLUMNNAME' OF INDEX 'INDEXNAME'
Thanks,
Samurai. -
Oracle - Show tables - Short result
Hi,
Thank you for reading my post.
Here is my question:
When I execute the following command:
SQLPLUS>> select * from tab;
I get 4201 rows.
The database I am using is "demobld.sql".
This database contains - among the above huge number of tables -
the following tables:
- EMP,
- DEPT,
- BONUS,
- SALGRADE,
- DUMMY.
I am looking for a command (like "SHOW TABLES" in MySQL) which
would show me these tables only.
Can you tell me how to do that?
Thanks and all the best,
Lmhelp
[Oracle Database 11g Enterprise Edition Release 11.1.0.6.0]
P.S. At the end of the following webpage:
http://www.orafaq.com/wiki/SQL*Plus_FAQ
the result of the command "select * from tab;"
is only three lines long.
It looks like it is an excerpt of the command output...
but this is the kind of result I wish I could get.Hi,
Thank you for your answer.
Would you mind giving me the exact query?
I am not sure about what you mean about "comparing one DB features to another".
Are you thinking about my writing about MySQL?
If so, I think you are wrong :) : why?
1) because it is normal for someone to try to use one's previous knowledge in the
database field, not doing so would be silly and waste ;
2) and moreover, I DO think it is interesting to compare one DB features to another.
I wish I had found a good comparison between MySQL and Oracle.
It would have helped me a lot.
You know... some kind of tutorial for Oracle beginners who are used to MySQL...
I can admit I didn't compare the right things but I am trying to.
I am not judging Oracle. I don't care about that. I only want to understand as
quickly as I can :).
What I want to do with Oracle, I already know how to do it with MySQL.
So I am trying to do "exactly" the same.
I know Oracle is powerful, I am not questioning that.
I also know some MySQL drawbacks.
I am not the inventor of these RDMS, so I wont defend any of them...
I am sorry if you misunderstood me.
Best regards,
Lmhelp -
New tables & indexes created do not show up in dba_segments view
Dear all,
I have created 3 tables and some indexes, but these objects do not show up in dba_segments view. Is this a normal behaviour? Previously, with dictionary managed tablespace, I can specify the minimum extent to create, when the table/index is created. But I'm not sure how the locally managed tablespace work. Please do advice. Thank you very much in advance.
I'm using Oracle 11g R2 (11.2.0.1.0) for Microsoft Windows (x64), running on Windows 7.
For the purpose of reproducing this issue, I have created the tablespaces as follow:
CREATE TABLESPACE CUST_DATA
DATAFILE 'd:\app\asus\oradata\orcl11gr2\CUST_DATA01.DBF' SIZE 512K
AUTOEXTEND ON NEXT 256K MAXSIZE 2000K
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE CUST_INDX
DATAFILE 'd:\app\asus\oradata\orcl11gr2\CUST_INDX.DBF' SIZE 256K
AUTOEXTEND ON NEXT 128K MAXSIZE 2000K
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K
SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLE CUSTOMER_MASTER (CUST_ID VARCHAR2 (10),
CUST_NAME VARCHAR2 (30),
EMAIL VARCHAR2 (30),
DOB DATE,
ADD_TYPE CHAR (2) CONSTRAINT CK_ADD_TYPE CHECK (ADD_TYPE IN ('B1','B2','H1','H2')),
CRE_USER VARCHAR2 (5) DEFAULT USER,
CRE_TIME TIMESTAMP (3) DEFAULT SYSTIMESTAMP,
MOD_USER VARCHAR2 (5),
MOD_TIME TIMESTAMP (3),
CONSTRAINT PK_CUSTOMER_MASTER PRIMARY KEY (CUST_ID) USING INDEX TABLESPACE CUST_INDX)
TABLESPACE CUST_DATA;
SQL> SELECT TABLE_NAME, TABLESPACE_NAME
2 FROM USER_TABLES
3 WHERE TABLE_NAME LIKE 'CUST%';
TABLE_NAME TABLESPACE_NAME
CUSTOMER_MASTER CUST_DATA
SQL> SELECT INDEX_NAME, TABLESPACE_NAME
2 FROM USER_INDEXES
3 WHERE TABLE_NAME LIKE '%CUST%';
INDEX_NAME TABLESPACE_NAME
PK_CUSTOMER_MASTER CUST_INDX
SQL> SELECT SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME, BYTES
2 FROM USER_SEGMENTS;
no rows selectedPrior to 11g, when you created a table or whatever, you automatically allocated one extent.
This is now no longer true and depends on a parameter I don't remember.
dba_segments is a summary of dba_extents.
Obviously, if there is no extent allocated, the table (view is defined with inner join) will not show up.
You could qualify this is as a bug and submit a SR to Oracle. But then the performance impact may be huge.
Sybrand Bakker
Senior Oracle DBA -
DB02old showing Missing in R/3 DDIC Tables & Indexes in BI 7.0 system
Hi,
Db02old showing missing in R/3 DDIC Tables & Indexes ,Details given below.
Tables Indexes
Total number 63,413 88,532
Total size/kb 1,208,272,704 227,436,608
More than 1 extent 16,499 6,629
Missing in database 0 0
Missing in R/3 DDIC 5 1
Space-critical objects 0 0
Unknown indexes in ABAP Dictionary
DB indexes 1
/BIC/E101128~900
Unknown objects in ABAP Dictionary
DB tables 5
/BI0/1ASSET
/BI0/1ASSET_CLAS
/BIC/E100219
/BIC/F101145
/BIC/F101153
Why it is showing ? Please advise.
Thnks&Rgds,
Ganga.Hi Bhaskar,
I have done the below process
In T-code DB02 Menu "Go TO" -> Table and Indices -> DB <-> ABAP Dic<->Display
It is showing the below details
Other checks
Tables 1
SCI_TEMPT Should not be created in DB
I have select the SCI_TEMPT table and clicked on create in DB.
After that again I have checked the db02 t-code again it is showing the same.
Please let me know how can fix this issue.
Regards,
Reddy V. -
Tables & Index not showing any data
Hi All,
I have done the db2 upgradtion from 9.1 to 9.7 with fix pack 4.I am unable to see table size after upgrade. I have checked all the sap collector job running fine.
db02>history>tables& index not showing any data
Regrads,
MnaiPlease make sure RSCOL00 running or execute it manually.
Did you try to run the stats in DB13 ? -
Need to find total no fo tables/index/m.views in my database
Hello Everyone ;
How can i find total no fo tables/index/m.views in my database ?
when i google i have seen following command ;
SQL> Select count(1) from user_tables where table_name not like '%$%' /
COUNT(1)
but i dont understand what '%$%' indicates ?
Thanks all ;Hello Everyone ;
How can i find total no fo tables/index/m.views in my database ?
when i google i have seen following command ;
SQL> Select count(1) from user_tables where table_name not like '%$%' /
COUNT(1)
but i dont understand what '%$%' indicates ?
Thanks all ;
consider to simply Read The Fine Manual YOURSELF!
Oracle Database Search Results: like -
Hi
Can anybody tell me how the BWA decides when a fact table index gets split into multiple parts? We have a number of very large cubes that are indexed and some have a fact table index that consists of one logical index which is made up of multiple physical indexes but other, similar sized cubes, just have one very large physical index for the fact table.
With the one very large physical index we seem to get an overload problem but when they are split into multiple parts we don't.
Thanks
MartinHi Martin,
this depends on the reorg config and the attribute of the index. You can manually trigger a splitting of an index via command 'ROUNDROBIN x', x stand for the number of parts which the index will be split to. Therefore you have to go into trexadmin standalone tool -> landscape right click on index -> split/merge index...
If you want an automatically split, you have to setup your reorg settings. Goto trexadmin standalone tool -> tab reorg -> options -> here you can choose the type of algorithm. Have a look into note 1313260 and 1163149.
Do you have a scheduled reorg job?
Regards,
Jens
PS: Every black box can be understood... -
Hello.
I'm in the process of putting some indexes on tables for performance improvement of queries run.
eg the foll query -
SELECT MPH_ENTITY_ID, MPH_PRICE_DT, MPH_STCK_EXCHNG_ID, BPT_BP_SHRT_NM, MPH_SEC_ID, SEC_SEC_NM, NMS_SEC_NUM, MPH_PRICE_TYP, MPH_MKT_PRC, MPH_VENDOR, MPH_PRICE_TIME, MPH_EXCHNG_RATE, MPH_DENOM_UNIT, MPH_LOCL_CNC_EQVU, MPH_INDCTV_PRC_IND, MPH_VLM_TRDD, MPH_MRKT_CPTL, MPH_MKT_PRICE_HSTRY_VER, BPT_BSNS_PRTNR_VER, SEC_SEC_MASTER_VER FROM MPH_MKT_PRICE_HSTRY left outer join NMS_NUM_SCHEME on NMS_SEC_ID=MPH_SEC_ID AND NMS_NUM_SCHM='CUSIP',BPT_BSNS_PRTNR,SEC_SEC_MASTER WHERE MPH_ENTITY_ID=BPT_ENTITY_ID AND MPH_STCK_EXCHNG_ID=BPT_BP_ID AND MPH_SEC_ID=SEC_SEC_ID ORDER BY MPH_SEC_ID DESC
The Explain plan in PL/SQL developer shows "Table Access Full" scan for 2 tables - BPT_BSNS_PRTNR AND MPH_MKT_PRICE_HSTRY.
I created the foll 2 indexes and now the explain plan shows "index fast full" scan on these tables -
1) create index mph_3 on mph_mkt_price_hstry(MPH_ENTITY_ID, MPH_PRICE_DT, MPH_STCK_EXCHNG_ID, MPH_SEC_ID, MPH_PRICE_TYP, MPH_MKT_PRC, MPH_VENDOR, MPH_PRICE_TIME, MPH_EXCHNG_RATE, MPH_DENOM_UNIT, MPH_LOCL_CNC_EQVU, MPH_INDCTV_PRC_IND, MPH_VLM_TRDD, MPH_MRKT_CPTL, MPH_MKT_PRICE_HSTRY_VER);
2) create index BPT_8 on bpt_bsns_prtnr(BPT_BP_SHRT_NM,BPT_BSNS_PRTNR_VER,BPT_ENTITY_ID,BPT_BP_ID);
My question here is that I have included columns in the select clause also in the indexes and the scan type has improved from table access full to index fast full scan. Is this correct ? Should select columns be also a part of indexes ? My take was that indexes contain columns in "where" clause or columns where joins are implemented and not select columns.
Please suggest.An Index that includes all the columns of the SELECT clause with those of the WHERE clause is a "skinny table".
Using such an Index avoids accesses to the table entirely.
There are situations where the DBA or Designer may choose to create such an Index.
Downsides ?*
If there are too many columns in the Index, the Index itself may become too large. When the index is too large for Oracle to be able to cache blocks, Oracle may have to undertake multiple single block read calls to the OS if accessing many rows. This can make the index counter-productive.
Index maintenance overheads increase -- the probability that the index also has to be updated with every UPDATE statement on the table increases. Also, every INSERT and DELETE makes that much more effort updating the Index Leaf Blocks (ie the size of the update to the Index is larger, the Index Key being larger).
Some queries might be executed using Skip Scan Search of the index when, properly, it might have made more sense to put those query columns in a seperate index. -
TIPS(29) : TABLE에 걸려 있는 INDEX 찾아 보기
제품 : SQL*PLUS
작성날짜 : 1996-12-27
TIPS(29) : TABLE에 걸려 있는 INDEX 찾아 보기
===========================================
/* show_index.sql USAGE: Show the indexes on a table */
/* This script prompts the user for the table owner and name then gets */
/* the indexed columns for any indexes on the table */
column index_name format A20
column column_name format A25
column column_position format 999 heading 'Pos'
column uniq format a5
set verify off
break on index_name skip 1
select C.index_name,substr(I.uniqueness,1,1) uniq, C.column_name,
C.column_position
from all_ind_columns C
,all_indexes I
where C.table_owner = upper('&table_owner')
and C.table_name = upper('&table_name')
and C.index_owner = I.owner
and C.index_name = I.index_name
order by 2 desc,1,4
/ -
Table index size in DB02 smaller after upgrade
SAP ERP 6.0, DB2 9.5, AIX 5.3. After we upgraded to SPS 15 / EHP4 / Netweaver EHP1 SPS02 using the downtime minimized method (shadow instance created) the index sizes for the tables are showing reduced sizes. When looking in DB02 under History -> "tables and indexes" all the tables show a drop in index sizes. I have compared the indexes to a pre upgrade copy of the system and all the indexes are still defined and active in the upgrades system. Can somebody please explain why the size drop? Is this a reporting error or what?
Hi Eddie,
DB2 V8.2 did not allow to retrieve table/index size information from DB2 directly. Therefore the SAP DB2 database interface and the CCMS code tried to do some size estimation based on cardinality and table/index width. DB2 V9.1+ provides table function ADMIN_GET_TAB_INFO to retrieve size information directly from DB2. Since this size information is much more accurate the SAP DB2 database interface and the CCMS code have been changed to use this table function.
So the phantom-"shrink" you observed may be related to the switch from size estimation to the size retrieved from ADMIN_GET_TAB_INFO . This may have happened directly after the V9.5 upgrade ( size retrieved differently in SAP DB2 database interface ) or after the SAP release upgrade ( change in CCMS ABAP coding ).
Regards
Frank -
Hello,
when I call from a java program a plsql procedure with 1
parameter type table index, it works fine. But, when I use 2
parameters type table index, it throws the exception with this
message:
ORA-01036: illegal variable name/number
Thanks,
Andres.Hi Simi,
now, it is working well in the JDeveloper 9i, but when I deploy
the files in the iAS server (1.0.2.2.1), it shows an exception:
ORA-00932: inconsistent datatypes
Just because of the table index parameter.
I have changed the classes12 file in the home/lib directory in
the OC4J without success with:
classes12.jar original from lib directory.
classes12.zip original from iAS's client BD.
classes12.zip original from Oracle client BD 8.1.7. (C:\orant8
\jdbc\lib)
classes12.zip original from Oracle client BD 9i. (C:\orant9
\jdbc\lib)
classes12.jar original from Oracle client BD 9i. (C:\orant9
\jdbc\lib)
classes12.zip original from JDeveloper 9i. (C:jdev9i\lib)
My java program is:
connection.prepareCall("{call user.package.proc
ocs.setString(1, cod);
ocs.registerOutParameter(2, OracleTypes.VARCHAR);
ocs.registerOutParameter(3, OracleTypes.VARCHAR);
ocs.registerOutParameter(4, OracleTypes.VARCHAR);
ocs.registerOutParameter(5, OracleTypes.VARCHAR);
ocs.registerOutParameter(6, OracleTypes.VARCHAR);
ocs.registerIndexTableOutParameter(7, 50,
OracleTypes.VARCHAR, 100);
ocs.registerOutParameter(8, OracleTypes.VARCHAR);
ocs.registerOutParameter(9, OracleTypes.VARCHAR);
ocs.registerOutParameter(10, OracleTypes.INTEGER);
ocs.registerOutParameter(11, OracleTypes.VARCHAR);
ocs.execute();
My plsql header is:
TYPE StringTabTyp IS TABLE OF table.column%TYPE
INDEX BY BINARY_INTEGER;
PROCEDURE proc
( ps1 IN VARCHAR2,
ps2 OUT VARCHAR2,
ps3 OUT VARCHAR2,
ps4 OUT VARCHAR2,
ps5 OUT VARCHAR2,
ps6 OUT VARCHAR2,
ps7 OUT StringTabTyp,
ps8 OUT VARCHAR2,
ps9 OUT VARCHAR2,
pnRet OUT NUMBER,
psRet OUT VARCHAR2
If the parameter ps7 is of type VARCHAR2, it works. But if it is
of type StringTabTyp (Table Index), this message is generated:
ORA-00932: inconsistent datatypes
Any idea will be useful.
Thank you very much.
Andres. -
How to import tables, indexes, tablespace, etc from a DMP.
Hello,
I like to know how to import tables, indexes, tablespace, etc from an DMP export of a Oracle 10.2.0.1 to be apply on a Oracle 11.2.0. When I import the DMP file all the data is going to one single Tablespace, for example, Users tablespace.
On the original database we have various tablespace's each separated with different content (tables, indexes) and I like to know if it posible to import the same schema,tables, indexes, tablespace all made with one single DMP Export. I can't use DBUA because the software of the database on the 10.2 is missing, I have only a DMP file (24GB) of DMP!.
Thanks for the reply,
Sorry for my english :).
Regards.thanks for that but is not what Im looking for.
Look, on my ORCL directory of the oracle 10.2 I have for example this:
CONTROL01.CTL
EXAMPLE01.DBF
REDO01-1.LOG
REDO01.LOG
REDO02-2.LOG
REDO02.LOG
REDO03-3.LOG
REDO03.LOG
RMAN.DBF
SYSAUX01.DBF
SYSTEM01.DBF
TEMP01.DBF
UNDOTBS01.DBF
USERS01.DBF
TABLESPACE1.ORA
TABLESPACE2.ORA
TABLESPACE3.ORA
TABLESPACE4.ORA
TABLESPACE5.ORA
I make a full export to a DMP. Then in my 11.2 version first I created the user then when import the DMP file none of the tablespace (TABLESPACE1, TABLESPACE2, ETC...) is created, all is going to the USERS tablespace, SO, im looking a way to tell imp command that generates the exactly tablespace structure that i was have on the 10.2.
Hope this can explain more my problem.
Thanks again!. -
How to obtain the table index in word use LabVIEW Report Generation Toolkit for Microsoft Office
I created a word templete and it had several tables. When I use the "Word Edit Cell" function in LabVIEW Report Generation Toolkit for Microsoft Office, the function need "table index", and I didn't find any function to get or set the table index in word document. How can I achieve my attention to write value to specified table cell using the "Word Edit Cell" function?
Thanks for reply!
YangAfreetHi yangafreet
You do not need to get the table index for the word edit cell.vi from anywhere. LabVIEW will automatically index all the tables in the document. See the attatched vi for an example.
Rich
Attachments:
Table Edit.vi 23 KB
Maybe you are looking for
-
How to know who Deleted Item or Business Partner
Hi all! In SAP B1, we have change log to track who updated information for Item master or Business Partner In case, one Item is deleted by user. How to know and control this. Thanks!
-
Scroll bar problem...please help !
I have 2 blocks. The first is master with a SCROLLING BAR, and the other one is detail. I wanna do some validations when the scroll bar of the master is scrolled...and i tried the forms trigger, KEY-SCRDOWN, but in version 4.5 of forms is doesn't fir
-
Sent mail not shown in Hub or sent folder
Hi All. Having problems with my Z10. When I send an email from the hand set the message disappears once sent its not shown in either the Hub or sent folder so end up with no record of the message sent. Any help would be appreciated.
-
Flex mobile paged list troubles with destructionPolicy
Hello, i have set a list with data paging in a flex mobile view with destructionPolicy=never, when coming back to this view i get some errors when the paging mechanism is triggered (there is no errors when all of the items were previously fetched). T
-
TCODE-TABLE relationship(only insert/modify/update/delete)
Hi, I would like to know whether a particular transaction(tcode) is updating/modifying which underlying tables. Is it possible? Here i would be intesrested only in those tables which are getting insert/modify/update/delete states. I have found one ta