List of tables count and Views count in schema wise
Hi All,
I want to get all tables count and views count in Schema wise, What is the query for that?
Thanks in Advance.
SELECT COUNT(*) FROM sys.tables t join sys.schemas s
on s.schema_id=t.schema_id
SELECT COUNT(*) FROM sys.views t join sys.schemas s
on s.schema_id=t.schema_id
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence
Similar Messages
-
Get Target table name and its count
Hi Experts,
I have created a Procedure where I want to get the Target table name and its count of the previous Interface in a Package and insert these values into the Audit table.
I am able to get the number of Inserts in previous step using getPrevStepLog() API, but I also want the Target table name and its total count of the previous Interface. Is there any generic way or code to bring these Information without hardcoding the table name. Kindly help to sort this issue.Thanks!
Warm Regards,
VBVHi VBV,
Please follow the below steps to audit ur execution.
Please note i coded in such a way that u can use ur existing procedure to capture the table name no need to query ur repository as its not advisable to query the repository as Oracle may change the structure in future which i personally feel right.
I created a Audit table with the below structure.
CREATE TABLE AUDIT_TABLE
INSERT_COUNT VARCHAR2(100 BYTE),
TABLE_NAME VARCHAR2(4000 BYTE)
Step 1 :
This step needs to be added in ur existing IKM after Commit step where i am using API to capture the target table name.
Step Name: Get Table Name
Command On Source
Technology: Oracle
Schema: Any Oracle related Schema
Command:
SELECT '<%=odiRef.getTargetTable("RES_NAME")%>' AS TGT_NAME FROM DUAL
Command On Target
Technology: Jython
Command:
TargetTable='#TGT_NAME'
Step 2:
In ur existing procedure add the below or add a new procedure.
Step Name: Audit Log
Command on Source
Technology : Oracle
Schema: Whichever schema holds the audit table
Command on Target
Technology : Jython
Command:
import java.sql as sql
import java.lang as lang
myCon =odiRef.getJDBCConnection("SRC")
MyStmt=myCon.createStatement()
myRs = MyStmt.executeQuery("INSERT INTO ODITGT.AUDIT_TABLE (INSERT_COUNT,TABLE_NAME) VALUES (<%=odiRef.getPrevStepLog("INSERT_COUNT")%>,'"+TargetTable+"')")
Thats it.
OTN doesnt allow me to put + sign in front of any word ( its assume its a Italic) so please add + (plus) sign before and after TargetTable in the above script.
This way u can capture the table name, insert count in to ur audit table.
Please note u need to call this Procedure after the successful completion of the interface in a package and make sure u selected the right IKM which capture the table name as in Step 1.
I tested in my local and its working fine. Let me know if u find any difficulties in implementation.
Thanks,
Guru -
How to dynamically set Min count and Max Count values in Adobe Print Form?
How to set the Min Count and Max Count values dynamically in a Print Form?
The values when set should over ride the values set in Binding Tab.
This is all needed to print multiple Material Number labels on a single page - and the number of labels to be printed needs to be under user control - something like an Avery Address labels
Please advise.
Thanks,Here is a work around that works for me and may not be an intelligent solution .
I kept the Min Count to 1 on the subform binding properties.
Per the number of labels required, I appended the same item to the internal table so many times and passed it to the label.
it works fine for my requirement.
However - leaving out the post for a while to see if this can be done at the form level via scripting.
Thanks, -
Hello,
I have an ALV Report.Could any one tell me the code for Count and Sub Count.
Example is belwo.
Number Name Type
1 af A
2 werg A
3 weg A
Subcount =3
4 t2423 B
5 24t2 B
Subcount =2
6 24t2 C
7 2442422 C
8 fdghs C
9 sghs C
Subcount =4
10 rghqwegtwq D
Subcount =1
Total = 10
- Varun
Basic questions are not allowed. Please put some effort from your side, before turning to the forums for help. Use the existing tools (F1 Help, ABAPDOCU, Google, SAP Help, etc) first to resolve your issue. Thread locked
Edited by: kishan P on Aug 24, 2010 9:43 AMHello,
I have an ALV Report.Could any one tell me the code for Count and Sub Count.
Example is belwo.
Number Name Type
1 af A
2 werg A
3 weg A
Subcount =3
4 t2423 B
5 24t2 B
Subcount =2
6 24t2 C
7 2442422 C
8 fdghs C
9 sghs C
Subcount =4
10 rghqwegtwq D
Subcount =1
Total = 10
- Varun
Basic questions are not allowed. Please put some effort from your side, before turning to the forums for help. Use the existing tools (F1 Help, ABAPDOCU, Google, SAP Help, etc) first to resolve your issue. Thread locked
Edited by: kishan P on Aug 24, 2010 9:43 AM -
How to find the max session count and process count for a database
Hi All,
How to find the maximum session count and process count reached for a database over a period of 15 days?
DB version:11.2.0.2
OS:AIXThanks for the link.
The output of the below query that is given in the link shows the results for the last 10 or 12 days.. Is there a query which gives a result for the last 30 days?
col metric_unit for a30
set pagesize 100
Select trunc(end_time),max(maxval) as Maximum_Value,metric_unit
from dba_hist_sysmetric_summary
where metric_id in ( 2118,2119) group by trunc(end_time),metric_unit order by 1; -
SCOM-Difference between Problem Count and Event Count in Application Failure Analysis Report
Dear All,
Could someone explain me clearly , the difference between Problem Count and
Event Count in Application Failure Analysis Report. Please help me in understanding What is meant be problem and event in the report .
Thanks in Advance.
Regards,
Rajesh Kumar CHello Rajesh,
The "problem" is the logically grouped set of the exception events which have the identical hash calculated over several fields as "Stack", "Source", "Failed Function" and so on... So, even if exceptions are different
in the other properties but hash matches over the considered properties - then all those exceptions go into the same "problem group".
So, event is an instance of the problem. One event contributes to one problem but one problem might have a huge event count if you have a repeating issue.
The logic is similar for the performance analysis report, only fields that go into the "problem" hash are different. e.g. "Stack" is not used in hash for perf events...
Dmitry Matveev -
Is there a list of table name and object name? (oCompany.GetBusinessObject)
Hi,
How do I find the objects regarding the tables in SBO?
Example Item Master, I use following statement:
SAPbobsCOM.Items oItem;
oItem = ( SAPbobsCOM.Items ) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
I like to find the object for SPP1.
Is there a list of table name and object name?
Thank you,
RuneThank you, Owen,
Yes, I found the table name and method name in SDK Help Center:
On your P/C, click START. Select All programs , SAP Business One > SDK > SDK Help Center. Then select DI API, then DI API Reference. If you scroll down this window you will find all existing classes. You will then find the SpecialPrices and the SpecialPricesDataAreas. All the information required to code is in there. -
How to know the the list of tables with no rows inside a schema?
with reference to
http://www.ss64.com/orad/USER_TABLES.html
How to know the the list of tables with no rows inside a schema?
I try this select table_name from user_tables where num_rows=0;
I can found one table that is empty.
So what's the query to return list of tables in a schema which has no rows?
thanksYou can do that only if your have collected the stats properly. Otherwise its going to show you wrong information.
Check this out...
SQL> drop table t
2 /
Table dropped.
SQL> create table t
2 as
3 select level no from dual connect by level <=100
4 /
Table created.
SQL> select table_name,num_rows from user_tables where table_name = 'T'
2 /
TABLE_NAME NUM_ROWS
T
SQL> begin
2 dbms_stats.gather_table_stats(user,'T');
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> select table_name,num_rows from user_tables where table_name = 'T'
2 /
TABLE_NAME NUM_ROWS
T 100
SQL>Thanks,
Karthick. -
Table to store the list of BSP Applications and View Names
Hi,
Please let me know the tables used to store the list of BSP Application and the corresponding View Names.
Thanks and Regards,
PavithraTable name is O2PAGDIR.
~Salil -
Inventory count and re-count data
hi friends,
need some info ..
Is it possible to view changes of inventory documents e.g. if a count was changed for an item on the inventory document. Used MI12 to display changes but did not get a result.
Any transaction / table to view this info.
regards,
chaitanyaHi
Kindly check the tables
cdpos and cdhdr
Note:
The system only creates change documents when:
o the creation of change documents is allowed for all plants in
Customizing for Inventory Management in the step Define Default
Values for Physical Inventory Document
o a user changes a physical inventory document (MI02)
o a user changes a physical inventory count (MI05)
REgards
Damu -
How to reduce logical count and scan count for a select query
hi,
I have two tables one is master and other is history. i need to combine this two tables into one temporary table.
I am using the below query to create temp table.
Select * into temporders
from
(select * from orders
union
select * from ordershistory) b
where updateon= (select max(updateon)from (select updateon,name,units,subunits from orders
union
select updateon,name,units,subunits from ordershistory) a
where updateon <='11/08/2008 11:18 AM' and a.name=b.name and a.units=b.units and a.subunits=b.subunits group by name,units,subunits)
order by report,subunitsorder
the statistics for this query:
SQL Server parse and compile time:
CPU time = 47 ms, elapsed time = 62 ms.
Table 'Worktable'. Scan count 556, logical reads 1569, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'ORDERSHISTORY'. Scan count 116, logical reads 339, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'ORDERS'. Scan count 116, logical reads 285, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 32 ms, elapsed time = 63 ms.
(115 row(s) affected)
you see logical reads and scan count for worktable(temporary) is quite high.
So anyone can give a solution for reduce the scan count and logical reads.
NOTE: name,units, subunits,updateon columns have primarykeySQL ServerAm i reading it properly? :(
This is Oracle Forum And not the SQL Server.
Regards.
Satyaki De. -
Xlate count and connection count
Can a firewall show more XLATE created than CONNECTIONS?
Is that theoretically possible to have more XLATEs than the total number of connections?. the reason I am asking, that assuming a Cisco 5510 has have maximum 130,000 total connections, however xlate limit on an ASA is considered as UNLIMITED.
I am designing a large network having multiple CIsco ASAs deployed as multi context mode to cater various networks inside the organization. I want to create proper resources per class. So far Xlate count vs. connection count is not very clear.. I tried putting a very large value for xlate and the firewall accepted it, and still showed the total percentage as 0%
Xlates default all CA unlimited
123 2 C 2147483647 4294967294 0.00%
All Contexts: 3 4294967294 0.00%
Whereas connection count is shown as
Conns default all CA unlimited
123 2 C 65000 130000 100.00%
All Contexts: 3 130000 100.00%
Any help is highly appreciated.
Thank you,
FNKHi
as far as i remember xlate is nat (regardless if it is static or not)
and on the IOS systems it is the same, static entries are in the table.
connections are actual session in the packetfilter/firewall sessions this is a differnet operation.
Patrick -
Getting Sum, Count and Distinct Count of a file
Hi all this is a UNIX question.
I have a large flat file with millions of records.
col1|col2|col3
1|a|b
2|c|d
3|e|f
3|g|h
footer****
I am supposed to calculate the sum of col1 =9, count of col1 =4, and distinct count of col1 =c3
I would like it if you avoid external commands like AWK. Also, can we do the same by creating a function?
Please bear in mind that the file is huge
Thanks in advanceThis sounds like homework for a shell class, but here goes. Save into a file, maybe "doit". Run it like this:
$ ./doit < data
<snip>
#!/bin/sh
got0=0
got1=0
got2=0
got3=0
got4=0
got5=0
got6=0
got7=0
got8=0
got9=0
sum=0
cnt=0
IFS='|'
while read c1 c2 c3 junk; do
# Sum and count
echo "c1=${c1}"
case "${c1}" in
[0-9] )
sum=$(expr ${sum} + ${c1})
cnt=$(expr ${cnt} + 1)
esac
# Distinct
case "${c1}" in
0 ) got0=1;;
1 ) got1=1;;
2 ) got2=1;;
3 ) got3=1;;
4 ) got4=1;;
5 ) got5=1;;
6 ) got6=1;;
7 ) got7=1;;
8 ) got8=1;;
9 ) got9=1;;
esac
done
echo "cnt=${cnt}"
echo "sum=${sum}"
echo "distinct="$(expr $got0 + $got1 + $got2 + $got3 + $got4 + $got5 + $got6 + $got7 + $got8 + $got9)
<snip> -
Maximum record counts and property counts
Hello,
I am looking for the document/link that mentions maximum record counts and maximum property counts for each record.
let say there are 1.5million records and each record has 2000 properties. Not sure if it can be handled nicely.
Mdex version is 6.2.1 at this point. but can upgrade if higher version can handle more.
Thanks,Jeremy is pretty much correct. There are no limitations except by performance.
Start with the Performance Tuning Guide - here is a link to the 6.4.1 document:
http://docs.oracle.com/cd/E41223_01/Mdex.641/pdf/PerfTuningGuide.pdf
For your questions, start with Chapter 5 and read how properties/dimensions affect performance and this will help drive how you architect your queries and pipeline configuration/index setup to be most efficient. -
Word counts and character counts
Hi,
I'm using Pages '06. I would like to be able to count the number of words and characters in a paragraph in Pages. I know that if i go to the Document Inspector and click info, it gives me word and character counts for the entire document. Is there a way to do this for individual paragraphs?
Many thanks.
Joe.After you install WordService (see link in Dennis' post), you can access several new services in the Pages menu. You may have to restart Pages &/or your Mac.
WordService & CalcService add their functions to any OS X program that has been programed to utilize Services. I've been using them since shortly after I got iWork '05.
Maybe you are looking for
-
How do I transfer photos from computer to ipad
How to transfer photos etc from computer to ipad,
-
How to declare top of page in alv grid disply
Hi Can any ine let me know how to declare the top -of -page?? Arun Joseph
-
Signature in PKCS1 v1.5: RSAPKCS1SignatureFormatter vs RSACryptoServiceProvider
I need to sign a Hash value of data and get a digital signature in PKCS1 v1.5 format. My understanding is that RSAPKCS1SignatureFormatter.CreateSignature(HashValue) does exactly that. In other words, I calculate a Hash value, don't do anything to it
-
Limit PO created in SRM changes to Service PO in ECC
Hi, I've created a limit PO in SRM, but when I viewed it the item category was 'D' (Service) instead of 'B' (Limit). Can anyone advise? Regards, John
-
How to make system call to execute command line in JAVA?
Hi, I am new in JAVA. How to make system call to execute the following command line in JAVA in LINUX environment. rpm -qa jdkIn C programming, use as such: system ("rpm -qa jdk"); How about JAVA? Thanks.