How to find the biggest and the larger tables in Oracle 10 g?
Hi people,Environment: 10g Rel 2
Can someone please suggest the view (s) data dictionary that I can query for a list of the longest (lines) and tables (columns) wide in any schema?
Thanks in advance
rogers42
Can someone please suggest the view (s) data dictionary that I can query for a list of the longest (lines) and tables (columns) wide in any schema?
1* SELECT OWNER, TABLE_NAME LONGEST FROM DBA_TABLES WHERE NUM_ROWS = (SELECT MAX(NUM_ROWS) FROM DBA_TABLES)
SQL> /
OWNER LONGEST
------------------------------ ------------------------------
SYS WRI$_OPTSTAT_HISTGRM_HISTORY
1* SELECT OWNER, TABLE_NAME WIDEST FROM DBA_TABLES WHERE AVG_ROW_LEN = (SELECT MAX(AVG_ROW_LEN) FROM DBA_TABLES)
SQL> /
OWNER WIDEST
------------------------------ ------------------------------
SYSMAN MGMT_PAF_TEXTUAL_DATA
Tags: Database
Similar Questions
-
How to cut the large table into pieces
I'm trying to derive some of generic logic that would be cut into pieces of defined size a large table. The goal is to perform the update into pieces and avoid questions too small restoration. The full table on the update scan is inevitable, given that the update target each row of the table.
The BIGTABLE has 63 million lines. The purpose of the bellow SQL to give ID all 2 million rows. So I use the rownum 'auto line numering field' and run a test to see I could. I expected the piece of fist to have 2 million rows, but in fact, it is not the case:
Here is the +(NOTE I had many problems with quotes, so some ROWID appears without their enclosing quotes or they disappear from current output here) code +:
Amzingly, this code works perfectly for small tables, but fails for large tables. Does anyone has an explanation and possibly a solution to this?select rn, mod, frow, rownum from ( select rowid rn , rownum frow, mod(rownum, 2000000) mod from bigtable order by rn) where mod = 0 / SQL> / RN MOD FROW ROWNUM ------------------ ---------- ---------- ---------- AAATCjAA0AAAKAVAAd 0 4000000 1 AAATCjAA0AAAPUEAAv 0 10000000 2 AAATCjAA0AAAbULAAx 0 6000000 3 AAATCjAA0AAAsIeAAC 0 14000000 4 AAATCjAA0AAAzhSAAp 0 8000000 5 AAATCjAA0AABOtGAAa 0 26000000 6 AAATCjAA0AABe24AAE 0 16000000 7 AAATCjAA0AABjVgAAQ 0 30000000 8 AAATCjAA0AABn4LAA3 0 32000000 9 AAATCjAA0AAB3pdAAh 0 20000000 10 AAATCjAA0AAB5dmAAT 0 22000000 11 AAATCjAA0AACrFuAAW 0 36000000 12 AAATCjAA6AAAXpOAAq 0 2000000 13 AAATCjAA6AAA8CZAAO 0 18000000 14 AAATCjAA6AABLAYAAj 0 12000000 15 AAATCjAA6AABlwbAAg 0 52000000 16 AAATCjAA6AACBEoAAM 0 38000000 17 AAATCjAA6AACCYGAA1 0 24000000 18 AAATCjAA6AACKfBABI 0 28000000 19 AAATCjAA6AACe0cAAS 0 34000000 20 AAATCjAA6AAFmytAAf 0 62000000 21 AAATCjAA6AAFp+bAA6 0 60000000 22 AAATCjAA6AAF6RAAAQ 0 44000000 23 AAATCjAA6AAHJjDAAV 0 40000000 24 AAATCjAA6AAIR+jAAL 0 42000000 25 AAATCjAA6AAKomNAAE 0 48000000 26 AAATCjAA6AALdcMAA3 0 46000000 27 AAATCjAA9AAACuuAAl 0 50000000 28 AAATCjAA9AABgD6AAD 0 54000000 29 AAATCjAA9AADiA2AAC 0 56000000 30 AAATCjAA9AAEQMPAAT 0 58000000 31 31 rows selected. SQL> select count(*) from BIGTABLE where rowid < AAATCjAA0AAAKAVAAd ; COUNT(*) ---------- 518712 <-- expected around 2 000 000 SQL> select count(*) from BIGTABLE where rowid < AAATCjAA0AAAPUEAAv ; COUNT(*) ---------- 1218270 <-- expected around 4 000 000 SQL> select count(*) from BIGTABLE where rowid < AAATCjAA0AAAbULAAx ; COUNT(*) ---------- 2685289 <-- expected around 6 000 000
Here's the complete SQL code that is suppposed to generate all the predicates, I need to add update statements in order to cut into pieces:
Nice but not accurate...select line from ( with v as (select rn, mod, rownum frank from ( select rowid rn , mod(rownum, 2000000) mod from BIGTABLE order by rn ) where mod = 0), v1 as ( select rn , frank, lag(rn) over (order by frank) lag_rn from v ), v0 as ( select count(*) cpt from v) select 1, case when frank = 1 then ' and rowid < ''' || rn || '''' when frank = cpt then ' and rowid >= ''' || lag_rn ||''' and rowid < ''' ||rn || '''' else ' and rowid >= ''' || lag_rn ||''' and rowid <'''||rn||'''' end line from v1, v0 union select 2, case when frank = cpt then ' and rowid >= ''' || rn || '''' end line from v1, v0 order by 1) / and rowid < AAATCjAA0AAAKAVAAd and rowid >= 'AAATCjAA0AAAKAVAAd' and rowid < 'AAATCjAA0AAAPUEAAv'' and rowid >= 'AAATCjAA0AAAPUEAAv' and rowid < 'AAATCjAA0AAAbULAAx'' and rowid >= 'AAATCjAA0AAAbULAAx' and rowid < 'AAATCjAA0AAAsIeAAC'' and rowid >= 'AAATCjAA0AAAsIeAAC' and rowid < 'AAATCjAA0AAAzhSAAp'' and rowid >= 'AAATCjAA0AAAzhSAAp' and rowid < 'AAATCjAA0AABOtGAAa'' and rowid >= 'AAATCjAA0AAB3pdAAh' and rowid < 'AAATCjAA0AAB5dmAAT'' and rowid >= 'AAATCjAA0AAB5dmAAT' and rowid < 'AAATCjAA0AACrFuAAW'' and rowid >= 'AAATCjAA0AABOtGAAa' and rowid < 'AAATCjAA0AABe24AAE'' and rowid >= 'AAATCjAA0AABe24AAE' and rowid < 'AAATCjAA0AABjVgAAQ'' and rowid >= 'AAATCjAA0AABjVgAAQ' and rowid < 'AAATCjAA0AABn4LAA3'' and rowid >= 'AAATCjAA0AABn4LAA3' and rowid < 'AAATCjAA0AAB3pdAAh'' and rowid >= 'AAATCjAA0AACrFuAAW' and rowid < 'AAATCjAA6AAAXpOAAq'' and rowid >= 'AAATCjAA6AAA8CZAAO' and rowid < 'AAATCjAA6AABLAYAAj'' and rowid >= 'AAATCjAA6AAAXpOAAq' and rowid < 'AAATCjAA6AAA8CZAAO'' and rowid >= 'AAATCjAA6AABLAYAAj' and rowid < 'AAATCjAA6AABlwbAAg'' and rowid >= 'AAATCjAA6AABlwbAAg' and rowid < 'AAATCjAA6AACBEoAAM'' and rowid >= 'AAATCjAA6AACBEoAAM' and rowid < 'AAATCjAA6AACCYGAA1'' and rowid >= 'AAATCjAA6AACCYGAA1' and rowid < 'AAATCjAA6AACKfBABI'' and rowid >= 'AAATCjAA6AACKfBABI' and rowid < 'AAATCjAA6AACe0cAAS'' and rowid >= 'AAATCjAA6AACe0cAAS' and rowid < 'AAATCjAA6AAFmytAAf'' and rowid >= 'AAATCjAA6AAF6RAAAQ' and rowid < 'AAATCjAA6AAHJjDAAV'' and rowid >= 'AAATCjAA6AAFmytAAf' and rowid < 'AAATCjAA6AAFp+bAA6'' and rowid >= 'AAATCjAA6AAFp+bAA6' and rowid < 'AAATCjAA6AAF6RAAAQ'' and rowid >= 'AAATCjAA6AAHJjDAAV' and rowid < 'AAATCjAA6AAIR+jAAL'' and rowid >= 'AAATCjAA6AAIR+jAAL' and rowid < 'AAATCjAA6AAKomNAAE'' and rowid >= 'AAATCjAA6AAKomNAAE' and rowid < 'AAATCjAA6AALdcMAA3'' and rowid >= 'AAATCjAA6AALdcMAA3' and rowid < 'AAATCjAA9AAACuuAAl'' and rowid >= 'AAATCjAA9AAACuuAAl' and rowid < 'AAATCjAA9AABgD6AAD'' and rowid >= 'AAATCjAA9AABgD6AAD' and rowid < 'AAATCjAA9AADiA2AAC'' and rowid >= 'AAATCjAA9AADiA2AAC' and rowid < 'AAATCjAA9AAEQMPAAT'' and rowid >= 'AAATCjAA9AAEQMPAAT'' 33 rows selected. SQL> select count(*) from BIGTABLE where 1=1 and rowid < AAATCjAA0AAAKAVAAd ; COUNT(*) ---------- 518712 SQL> select count(*) from BIGTABLE where 1=1 and rowid >= 'AAATCjAA9AAEQMPAAT'' ; COUNT(*) ---------- 1846369
The problem is that your query implies that ROWID, and ROWNUM are classified in the same way. For small tables it is very often the case, but not for the larger tables. Oracle does not guarantee return records in the order the rowid. However usually it works this way.
You could test ensuring that get you the rownum after you ordered. And see if it works then.
select rn, mod, frow, rownum from (select rn, rownum frow, mod(rownum, 2000000) mod from (select rowid rn from bigtable order by rn) order by rn ) where mod = 0 /
-
How to find the site to download oracle 10g
Hello
I need to find the site to download oracle 10g. Please, help me.
Respect of
Natalia10g is no longer available for download - you need to open an SR with Support and they will provide a download link, assuming you paid for extended support.
PL see the previous discussions on this topic
year https://forums.Oracle.com/forums/Search.jspa?threadID=&q=10g+and+Download&objid=C18&DateRange=This & userID = & numResults = 15
HTH
Srini -
Hello
y at - it (quesry) way to find the list of children tables for a given table.
tried to interview user_constraints and USER_CONS_COLUMNS, but not be able to find a way.
Thank youHello
You can use the query as follows - it will list the children tables and the FK name for table HR.JOBS:
Select
a.Owner, a.table_name, a.constraint_name
sys.all_constraints a.,
(select master, constraint_name from sys.all_constraints where owner = * 'HR' * and table_name = * "JOBS" * and constraint_type in ('P', 'U')) b
where
a.CONSTRAINT_TYPE = 'R' and a.r_constraint_name = b.constraint_name and a.r_owner = b.ownerIf you do not need name FK, then put separate:
Select
a.owner, separate a.table_name
sys.all_constraints a.,
(select master, constraint_name from sys.all_constraints where owner = 'HR' and table_name = 'JOBS' and constraint_type in ('P', 'U')) b
where
a.CONSTRAINT_TYPE = 'R' and a.r_constraint_name = b.constraint_name and a.r_owner = b.ownerPhilippe
-
How to find the partitioned tables and the number of sheets in each table
Hello friends,
I have a scheme called ICS_OWNER where I partitioned and tables not partitoined.
I want to list all the tables that are partitioned.
and also
I want to know what partitions exists in every partitioned table.
with respective schema specified
Thank you/KumarWhen you have questions like this, you don't ask here.
but you take your (or should I say 'your') keyboard
and type
Select *.
dict
where table_name like ' % PART %.
/All the dictionary views are listed in the DICT.
----------
Sybrand Bakker
Senior Oracle DBA -
How to find the SID for DB Oracle 11g
Someone installed a new database of Oracle 11 g on my machine. Now I'm opening "SQL Developer" and it asks username, password and sid. I don't know what is the SID for my case. How I know that?
2827706 wrote:
The guy is not available.
I checked the list of services in my machine. There is no service windows in my system named OracleService
You mention that you are using Windows, but if you are and that you have installed the oracle database software and NO service like OracleService
, then you do not have a database. But then, why the hell you you ask about this? If you do not want the database software, why don't you just go ahead and uninstall it? And how is it, someone can come and something on your server and have no idea about it? Aman...
-
How to find the value max and min for each column in a table 2d?
How to find the value max and min for each column in a table 2d?
For example, in the table max/min for the first three columns would be 45/23, 14/10, 80/67.
Thank you
Chuck,
With color on your bars, you should have enough experience to understand this.
You're a loop in the table already. Now you just need a function like table Max and min. loop. And you may need to transpose the table 2D.
-
How to find the right server to use windowsmail to send and receive e-mails?
How to find the right server to use windowsmail to send and receive e-mails?
Who is your current e-mail server? (Which is after the @ in your address).Windows Mail: Setting up an account of end-to-end
http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-mail-setting-up-an-account-from-start-to-finish -
How to find the book, THE, Op units, Org (All) names and ID?
How to find the book, THE, Op units, Org (All) names and ID?
With regard to:
Mr. Shahzad Saleem
Please run the following query
SELECT gl.NAME ledger_name, hou.NAME operating_unit_name,
xep.NAME legal_entity_name
Gl_ledgers gl, hr_operating_units hou, xle_entity_profiles xep
WHERE gl.ledger_id = hou.set_of_books_id
AND hou.default_legal_context_id = xep.legal_entity_id
-
How to find the first Sunday and the second Saturday of each month
Hi all
How to find the first Sunday and the second Saturday of each month
Thank you
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
994122 wrote:
Hello
I need to pass the months parameter how to do this? like Jan, Feb etc... (one of those)
Do you have a procedure?
Should you output only for the months you passed in the parameter?
The easiest way is to set the parameter as date. When you go such as p_date as DATE ' 2014-10-01', then you can
PROCEDURE two_dates)
p_date IN DATE
p_first_sunday DATE
p_second_saturday DATE
)
IS
BEGIN
p_first_sunday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-12', 'DAY'));
p_second_saturday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-11', 'DAY')) + 7;
END two_dates;
Or you describe what you need.
-
How to find the age of a child and snapshot number snapshot for a virtual machine.
Hi all
How to find the age of a snapshot for a virtual machine child count and snapshot.
This code snippet should help... Assuming that you have the following entries:
VM (VC:VirtualMachine)
snapshot (VC:VirtualMachineSnapshot)
System.log("====== Snapshot details for VM: "+snapshot.config.name+" ======"); var snapshotTrees = vm.snapshot.rootSnapshotList; System.log("Snapshot Tree Count: "+snapshotTrees.length); for each (snapshotTree in snapshotTrees){ showSnapshotInfo(snapshotTree, snapshot); } function showSnapshotInfo(snapshotTree, selectedSnapshot){ if(selectedSnapshot == snapshotTree.snapshot){ System.log("===================="); System.log("Name: "+snapshotTree.name); System.log("Id: "+snapshotTree.id); System.log("Description: "+snapshotTree.description); System.log("createTime: "+snapshotTree.createTime); System.log("quiesced: "+snapshotTree.quiesced); System.log("replaySupported: "+snapshotTree.replaySupported); System.log("backupManifest: "+snapshotTree.backupManifest); System.log("snapshot id: "+snapshotTree.snapshot.id); System.log("state: "+snapshotTree.state.value); var childSnapshotList = snapshotTree.childSnapshotList; if(childSnapshotList != null){ System.log("childSnapshotList length: "+snapshotTree.childSnapshotList.length); } System.log(""); } if(snapshotTree.childSnapshotList != null){ System.log("Children found: "+snapshotTree.childSnapshotList.length); for each (childSnapshotTree in snapshotTree.childSnapshotList){ showSnapshotInfo(childSnapshotTree, selectedSnapshot); } } }
During the passage of one of my virtual machines, here is an example of output I get:
[2014-06-12 15:19:21.493] [I] Snapshot Tree Count: 1 [2014-06-12 15:19:21.493] [I] ==================== [2014-06-12 15:19:21.494] [I] Name: before upgrade to 5.0.1 [2014-06-12 15:19:21.494] [I] Id: 31 [2014-06-12 15:19:21.494] [I] Description: [2014-06-12 15:19:21.495] [I] createTime: Mon Mar 19 2012 13:48:57 GMT-0400 (EDT) [2014-06-12 15:19:21.495] [I] quiesced: false [2014-06-12 15:19:21.495] [I] replaySupported: null [2014-06-12 15:19:21.495] [I] backupManifest: null [2014-06-12 15:19:21.496] [I] snapshot id: snapshot-83 [2014-06-12 15:19:21.496] [I] state: poweredOff [2014-06-12 15:19:21.496] [I] childSnapshotList length: 1 [2014-06-12 15:19:21.496] [I] [2014-06-12 15:19:21.497] [I] ==================== [2014-06-12 15:19:21.497] [I] Name: Before 5.1 upgrade [2014-06-12 15:19:21.497] [I] Id: 36 [2014-06-12 15:19:21.497] [I] Description: [2014-06-12 15:19:21.498] [I] createTime: Fri Sep 21 2012 21:59:58 GMT-0400 (EDT) [2014-06-12 15:19:21.498] [I] quiesced: false [2014-06-12 15:19:21.498] [I] replaySupported: null [2014-06-12 15:19:21.498] [I] backupManifest: null [2014-06-12 15:19:21.499] [I] snapshot id: snapshot-84 [2014-06-12 15:19:21.499] [I] state: poweredOff [2014-06-12 15:19:21.499] [I] childSnapshotList length: 1 [2014-06-12 15:19:21.499] [I] [2014-06-12 15:19:21.500] [I] ==================== [2014-06-12 15:19:21.500] [I] Name: Before Named Instance [2014-06-12 15:19:21.500] [I] Id: 37 [2014-06-12 15:19:21.501] [I] Description: [2014-06-12 15:19:21.501] [I] createTime: Mon Nov 11 2013 13:40:46 GMT-0500 (EST) [2014-06-12 15:19:21.501] [I] quiesced: false [2014-06-12 15:19:21.501] [I] replaySupported: null [2014-06-12 15:19:21.502] [I] backupManifest: null [2014-06-12 15:19:21.502] [I] snapshot id: snapshot-236 [2014-06-12 15:19:21.502] [I] state: poweredOff [2014-06-12 15:19:21.502] [I]
-
How to find the difference between standard edition and standard edition one
How to find the difference between oracle database standard edition and standard edition one 64 bit
(a) using sql
(b) using the configuration/installation filesHow to find the difference between oracle database standard edition and standard edition one 64 bit
(a) using sql
Select * the option of $ v;
(b) using the configuration/installation files
opatch lsinventory-details
-
How to find the path of reports to PDF and send them via JAVA?
Hi expert,
We have created many reports of OBIEE, how to find the way of reports to PDF and send them via JAVA?
Catalog/shared /..., but it is a binary file that is not sent to the customers.Hey kobe,.
You can try this:
http://satyaobieesolutions.blogspot.com/2012/07/setting-up-iBOT-to-save-report-to.html
-
How to find the OS ppid in v$ session and V$ process
Hello
Oracle 11gDB
I have this suspiscious process in my session of $ v which is always running and connected to a 'HR' scheme, even if the 'HR' application is also stopped and other HR related batch process.
And he also told me that it came from the UNIX sun-server1. My problem is that I can not locate the PPID OS for this process when I login to the operating system to the Sun-server1.
I tried to kill this session, but he maintains the connection. Even if I bounce the database, it come back.
How to find the source of this process to the Sun-server1?
I tried this script:
SELECT p.program, p.spid FROM v$session s, v$process p WHERE s.paddr = p.addr AND s.sid IN (39)
But if I have a ps - ef | grep 6404 there is no existing process OS. No matter what other script that can identify the process id of the operating system?Program Spid ============ ==== ORACLE.EXE (SHAD) 6404
Thank you very muchKinsaKaUy? wrote:
Thanks Sb, what is your new name :)Who do you think is the culprit?
root@sun-server1 # ps -ef|grep "May 16" v231sys 7065 7051 0 May 16 pts/1 11:16 /usr/jdk/jdk1.5.0_13/bin/sparcv9/java -server -Xms1024m -Xmx1024m -XX:MaxPermSi v231sys 7051 1 0 May 16 pts/1 0:00 /bin/sh startWebLogic.sh V231_ABDC root 13117 11928 0 12:56:30 pts/3 0:00 grep May 16 v231sys 7229 7065 0 May 16 pts/1 1:17 /opt/SPLcobAS51/bin/cobjrun64 -Dcom.microfocus.cobol.cobjvm=sun_150_64 -DSPLCJV v231sys 6257 8518 0 May 16 pts/1 0:00 bash v231sys 7211 7065 0 May 16 pts/1 1:17 /opt/SPLcobAS51/bin/cobjrun64 -Dcom.microfocus.cobol.cobjvm=sun_150_64 -DSPLCJV
When the process lasts more than 24 hours, you can get is no longer hours or minutes.
You can use the utility "netstat" to connect the source & destination?If this isn't the case, random randomly start put to death via kill - 9
until you success! -
How to find the session killed and computer name
Hello
At the time of the batch run killed .somebody this session without me knowing how to find the user particular db level or oslevel .de name which machine they killed how know at the OS level. but when I put the audit_trail = os only user SYSDBA activities are not checked the other activities of the user.
The server is AIX and db version 11i provide the query for conclusion or os level.
Thank you
DBC.
Published by: dbc001 on March 26, 2013 21:48check with who ever is privilleges to kill these perticluar session, if you have few users.
It is not possible to findout without verification or error info... etc.
Otherwise, restart these jobs perticluar and follow closely.
Maybe you are looking for
-
How to accept a new ssl certificate in Thunderbird?
7.15.15I can't get or send emails on my cell phone two days ago.- Neither the "Configuration Options for certificates" worked to bring in the certificate that I use that allows you to send and receive e-mail. Under the "Digital Signature" or "Encrypt
-
After 1 GB memory upgrade Qosmio G10 - 133 does not start
Try to pass 512 MB with memory Kingston KTT3311 / 1 G 1512 MB I put the new Kingston 1 GB in the top slot of spare. When I rebooted the machine, the fan has come and the indicator light on the front came. But it seemed no not no start-up process at a
-
Y50-70 - USB Reader and card reader no longer recognized
I have Lenovo Y50-70 (running Windows 10) and my WD My Passport Ultra external drives are more recognized (they worked fine until 3 days ago). My card reader CF is no longer recognized either. My Samsung Galaxy S5 works well. The WD My Passport drive
-
HP officejet pro 8000 will not grab the paper - paper jam flashing guard
ADVICE ON GLADE
-
New WUSB600N does not work after the end of the trial
Everything worked fine initially. After the trial period Basic is supposed to work. Now, says Win 7 64 bit it not only does not recognize the device, but it is bad and must be replaced. I went with Network Magic and it is said that he can not cont