how to find memory utilisation of a table? [closed] - oracle

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I would like to find the memory utilised by a particular table in Oracle DB. Could anyone provide me the DB query for the same?
Thanks in advance!

Following what #Alex said,
You can check the table size on disk by querying dba_segments
select segment_name , segment_type , byte/1024/1024 mb
from dba_segments
where owner = 'X'
and segment_name= 'Y';
If you want to see which or how many blocks from the table are currently stored in the cache you can query v$cache. read about it here

Related

How do you remove duplicate rows in Access? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I want to remove duplicate rows within my database.
I only want them removed if each field within that row matches another within the same table.
I've researched how to use the Query wizard to find duplicate fields, but I haven't found a way to match the entire row.
Are you able to perform queries?
DELETE FROM table_name
LEFT OUTER JOIN (
SELECT
MIN(RowId) as RowId,
column_name1,
column_name2,
column_name3
FROM
table_name
GROUP BY
column_name1,
column_name2,
column_name3
) as nonDuplicates ON
table_name.RowId = nonDuplicates.RowId
WHERE
nonDuplicates.RowId IS NULL

Which tables do not have indexes in Oracle? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
On Oracle, how can I list ALL tables and ALL materialized views without indexes using a SELECT command ?
Well, normally I wouldn't do this, but here you go:
SELECT t.TABLE_NAME
FROM USER_TABLES t
LEFT OUTER JOIN (SELECT DISTINCT TABLE_NAME
FROM USER_INDEXES) i
ON i.TABLE_NAME = t.TABLE_NAME
WHERE i.TABLE_NAME IS NULL;
Perhaps your question should be "Why did someone just do my homework for me?".
Best of luck.

Convert Row into columns [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
how can I convert rows of my table as column value
for eg I have a table a
emp id
1
2
3
4
and I want my output as
1 2 3 4
i am also using pivot in oracle and crosstab in postgres but not able to get desired solution as shown above.
Check the listagg function. Note you need at least Oracle 11 for this.
Use this script and change it to your values to get desired results
SELECT * FROM (SELECT emp_id, emp_points
FROM emp_data)
PIVOT (
SUM(emp_points) AS sum_emp_points
FOR (emp_id) IN (1 AS [1], 2 AS [2],3 AS [3],4 AS [4])
);
select * from (select empno from t7) pivot(min(empno) for empno in (1,2,3,4));

How can I take substring in Oracle [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a row string in oracle table.
Some text № 3694452 from 31.08.2013, stilltext 02.09.2013 18:16:27
How can I take "02.09.2013 18:16:27" (from the end of row and after stilltext)
for converting it to date.
Assuming that the date string always positioned at the end of text,
you can use regular expression like this:
select
to_date(
regexp_substr(your_column_name, '\d{2}.\d{2}.\d{4} \d{2}:\d{2}:\d{2}$'),
'dd.mm.yyyy hh24:mi:ss')
from you_table_name;
This assumes that the date is always at the end of the string and is fixed in format.
with dummy as
(select '3694452 from 31.08.2013, stilltext 02.09.2013 18:16:27' data
from dual)
select to_date(substr(data,length(data)-19), 'MM.DD.YYYY HH24:MI:SS')
from dummy
There are more elegant ways to do this with regular expressions, but I am assuming this will suffice.
SQL Fiddle demo here

Issue while creating index in Oracle [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm trying to create an index in Oracle on table QueueData and on field XYZ which is one of the nodes of XMLTYPE column TEXT.
My query is:
CREATE INDEX IX_QUEUE_XYZ ON QUEUEDATA (extractValue(TEXT, '//XYZ')) TABLESPACE "PSAPD"
But it is giving me following error:
ORA-19025: EXTRACTVALUE returns value of only one node
I can't understand what is wrong here. Can anyone explain?
The second argument of the extractValue points to more then one node, it should return only one node, so if you have multiple tags "XYZ" it will return all of them if you use XYZ[1] only the first will be returned.
See:
http://www.w3schools.com/xpath/xpath_syntax.asp

Resources