Tiny DB to SQL statements
HelloWe need to all small DB or tool where we can run some statements SQL base with joins.
It took at the end of training. All Oracle DB installation looks huge for that.
All of the suggestions that I should install.
Thank you...
user8941550 wrote:
HelloWe need to all small DB or tool where we can run some statements SQL base with joins.
It took at the end of training. All Oracle DB installation looks huge for that.
All of the suggestions that I should install.Thank you...
So what stops you to create a?
It is difficult to make specific suggestions without knowing your complete and available - requirement or acquirable - assets.
For personal use, you could install XE on your own desktop.
Or you could install VirtualBox with a vm pre-configured containing an Oracle database. Both available free of charge from www.oracle.com
Use of the team, we need to know more...
Published by: EdStevens on December 14, 2012 07:36
Tags: Database
Similar Questions
-
I have this PreExpression at a stage of SQL statement:
Locals.SQL_LatestResult = "SELECT UUT_RESULT.ID, UUT_RESULT. UUT_SERIAL_NUMBER, UUT_RESULT. START_DATE_TIME UUT_RESULT WHERE (((UUT_RESULT. UUT_SERIAL_NUMBER) =------"' + Locals.serial + ' \ ') AND ((UUT_RESULT." START_DATE_TIME) = (SELECT MAX (UUT_RESULT2. START_DATE_TIME) OF UUT_RESULT AS UUT_RESULT2 WHERE UUT_RESULT. UUT_SERIAL_NUMBER = UUT_RESULT2. UUT_SERIAL_NUMBER))); »
Locals.SQL_LatestResult has this value after the PreExpression:
SELECT UUT_RESULT.ID, UUT_RESULT. UUT_SERIAL_NUMBER, UUT_RESULT. START_DATE_TIME UUT_RESULT WHERE (((UUT_RESULT. UUT_SERIAL_NUMBER) = "15514011") AND ((UUT_RESULT. START_DATE_TIME) = (SELECT MAX (UUT_RESULT2. START_DATE_TIME) OF UUT_RESULT AS UUT_RESULT2 WHERE UUT_RESULT. UUT_SERIAL_NUMBER = UUT_RESULT2. UUT_SERIAL_NUMBER)));
I get the number of records = 0, if I run the sequence.
If I copy the exact same SQL query in access I get what I want to know a record.
If I remove that part of the query:
((UUT_RESULT. UUT_SERIAL_NUMBER) =------"" + Locals.serial + "\") "
I get 388 records which is correct and it run directly in access.
What's not here?
I was too fast for this post... it's my fault, the database link was wrong, so data were there...
Statements are very good!
-
With the help of a number variable in a SQL statement
Hello
I am trying to use a variable in a sql statement, and I ran into problems when the variable is a number. The following line of code works if the variable is a string, but not if it is a number.
"SELECT PAGE 1 UUT_STATUS OF UNIT_UUT_RESULT WHERE UnitID = '" + Locals.LocalUnitID + "' ORDER BY DESC START_DATE_TIME.
Is there a difference in the use of single and double quotes and the sign for numbers variables +?
Thank you
Stuart
Jervin is almost correct in the post above.
While it is correct that numbers in SQL are not enclosed in single quotes ('), we still need the entire expression to a string. If Locals.LocalUnitID is stored as a number to TestStand, you will need to cast to a string so that the string concatination works properly.
I believe that the correct form is as follows:
"SELECT PAGE 1 UUT_STATUS OF UNIT_UUT_RESULT WHERE UnitID ="+ Str (Locals.LocalUnitID) + 'ORDER BY DESC START_DATE_TIME'
-
Game of demand does not pick up the good period open to active fixed from the SQL statement
Hello
We have a demand that could kick off the simultaneous application of the value: Ixr: list of asset by period and Ixr: reserve book report.
ON overall demand, we set the parameter: default period based on a SQL = select period_name from FA_DEPRN_PERIODS where book_type_code = 'PER2011' and period_close_date is null
The query runs with the good period, until we open the new period, the game application will still come closed period.
When I run this script on the database, it gives the correct name of the open period.
Why all the demand does not pick up the open period?
Rock
Hello
When planning, the parameter values that you gave when planning will not change.
For the test, for a simultaneous program, I create a parameter and has given the value 100 tank and default type sql statement and the value as below.
Select to_char (sysdate, 'dd-mon-yyyy hh24:mi:ss') of double
If, at the time of the program, it shows a default value such as the date and time with seconds. Then I planned it for every minute.
When you check in for each race it is seen the first time only, it does not.
so in your case, you must plan its new after change of period.
Hope this will help you...
-
What are these SQL statements?
Hello!
We are our applications running on Windows Server 2003 where it works fine, using Oracle via OCI 12.1.
Now, we have the application installed on Windows Server 2012 and it works very slowly.
When comparing these two environments trace files came a surprise: Oracle generates a lot of SQL statements when run on Windows Server 2012! By operating on Windows2003 it only executes the SQL from the applicaton instructions. These additional SQL statements must be the reason for the slowness, but why Oracle it generates them and how could we get arrested?
An example:
PARSING IN CURSOR #46985062096816 len = 210 dep = 2 uid = 0 oct = cover 3 = 0 tim = hv 1439277877325893 = ad 864012087 = "4db599f28" sqlid = "96g93hntrzjtr."
Select / * + rule * / bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp #, sample_size, minimum, maximum, distcnt, lowval, hival, density, col #, spare1, spare2, hist_head avgcln $ where obj #=: 1 and intcol #=: 2
END OF STMT
ANALYSIS #46985062096816:c = 1000, e = 456, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 2, og = 3, plh = 0, tim = 1439277877325890
EXEC #46985062096816:c = 0, e = 498, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326455
FETCH #46985062096816:c = 0, e = 56, p = 0, cr = 3, cu = 0, set = 0, r = 1, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326533
STAT #46985062096816 id = 1 cnt = 1 pid = 0 obj = op 411 = pos = 1 "TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr = 3 pr = 0 pw = time 0 = 55 US)"
"STAT #46985062096816 id = 2 cnt = 1 pid = 1 pos = 1 obj = op 413 ='INDEX RANGE SCAN I_HH_OBJ #_INTCOL # (cr = 2 pr = 0 pw = time 0 = 32 US)"
OUTCOME #46985062096816:c = 0, e = 37, dep = 2, type = 3, tim = 1439277877326601
EXEC #46985062096816:c = 0, e = 23, p = 0, cr = 0, cu = 0, set = 0, r = 0, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326702
FETCH #46985062096816:c = 0, e = 18, p = 0, cr = 3, cu = 0, set = 0, r = 1, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326738
OUTCOME #46985062096816:c = 0, e = 8, dep = 2, type = 3, tim = 1439277877326765
EXEC #46985062096816:c = 0, e = 19, p = 0, cr = 0, cu = 0, set = 0, r = 0, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326837
FETCH #46985062096816:c = 0, e = 21, p = 0, cr = 3, cu = 0, set = 0, r = 1, dep = 2, og = 3, plh = 2239883476, tim = 1439277877326923
OUTCOME #46985062096816:c = 0, e = 10, dep = 2, type = 3, tim = 1439277877326954
Thank you very much in advance!
Best regards
Jaakko Terhonen
Thank you all for the reply! This time, the reason was a problem in network traffic (TCP protocol): a lot of retransmissions for a still unknown reason. If it had nothing to do with Oracle after all.
I cried for help here because as a common application programmer, I wasn't familiar with the Interior details of SQL analysis and after seeing it in the trace, I assumed that these strange SQL statements - which, for some reason, is appeared only in W2012-trace - were the reason for the slowness.
Thank you, I'm a little wiser now - and I hope that many others find this thread before asking the same question!
Best regards
Jaakko Terhonen
-
How can I pass a condition of the table in the sql statement?
For example, in the table in the COND Varchar2 column (200) there is the value ' VAR > 10'.
| COND |
|' VAR > 10' |
where VAR is the name of the table column. I would like to make statement CASE WHEN VAR > 10 AND 0... I tried with as subquery
WHEN BOX (SELECT COND FROM TABLE WHERE...) THEN 0, but it does not work.
Hello
You can do this by using dynamic SQL.
that is to say:
declare v_stm varchar2(4000); v_cond varchar2(100); v_result integer; begin select cond into v_cond from yourtable where a=1; v_stm := 'select case when '||v_cond||' then 0 ...'; -- dynamic sql execute immediate v_stm into v_result; end; /
Remember that, in general, dynamic SQL has a performance degradation that SQL static and should be avoided when possible.
Storage condition or the SQL statements in the tables is not a good practice.
Kind regards.
Alberto
-
Identify the SQL statements that are executed frequently
I would like to identify SQL statements that are executed may times (e.g., > 1000 times) during an interval AWR.
I am aware of coloring a SQL_ID with exec ('...') dbms_workload_repository.add_colored_sql; but then the SQL ID must be known.
Is it also possible to do the same for the (not yet known) SQL statements that are executed > 1000 times? I think that the SQL statements that run very quickly (for example 1 s <) won't be captured automatically in a CWA even if those statements are frequently performed.
Version 11.2.0.4 on SLES11
Try this...
fixed lines 155
execs from collar to 999 999 999
Col min_etime to 999,999.99
Col max_etime to 999,999.99
Col avg_etime to 999,999.999
Col avg_lio to 999,999,999.9
Col norm_stddev to 999,999.9999
Col begin_interval_time to a30
node of col to 99999
break on plan_hash_value on startup_time skip 1
Select * from)
Select sql_id, sum (execs), min (avg_etime) min_etime, max (avg_etime) max_etime stddev_etime/min (avg_etime) norm_stddev
de)
Select sql_id, execs, plan_hash_value, avg_etime,
StdDev (avg_etime) on stddev_etime (sql_id partition)
de)
Select sql_id, plan_hash_value,.
Sum (NVL(executions_delta,0)) execs,
(sum (elapsed_time_delta) /decode (sum (nvl(executions_delta,0)), 0.1, sum (executions_delta)) / 1000000) avg_etime
-sum ((buffer_gets_delta/decode (nvl(buffer_gets_delta,0), 0.1, executions_delta))) avg_lio
DBA_HIST_SQLSTAT s, DBA_HIST_SNAPSHOT SS
where ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
Group of sql_id, plan_hash_value
)
)
Group of sql_id, stddev_etime
)
where norm_stddev > nvl (to_number('&min_stddev'), 2)
and max_etime > nvl (to_number('&min_etime'),.1)
order of norm_stddev
/
-
Get the SQL statement error programmatically
Hello
error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?
I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?
Thanks and regards,
Sascha
Sascha,
You should be able to use the: SYSTEM. System LAST_QUERY variable forms.
Craig...
-
Several SQL statements with zero executions in the region of SQL
Hello
one of my databases has a large number of statements in the SQL box with zero executions. Some of them analyzed several times without a single run. Why the database stores these statements and how to avoid or reduce them?
My problem is that the only time or zero time sql statements take the largest part of the area of sql:
-sql statement and only once and without executing sql statements
Select
Count (1) num_sql_total,.
sum (decode (executions, 1, 1, 0)) num_one_use_sql,.
sum (decode (executions, 0, 1, 0)) num_no_use_sql,.
Sum (RUNTIME_MEM) / 1024/1024 mb_used,.
sum (decode (executions, sharable_mem, 1, 0)) / 1024/1024 mb_for_one_use_sql,.
sum (decode (executions, 0, sharable_mem, 0)) / 1024/1024 mb_for_no_use_sql
Of
GV$ sqlarea
where
RUNTIME_MEM > 0;
NUM_SQL_TOTAL NUM_ONE_USE_SQL NUM_NO_USE_SQL MB_USED MB_FOR_ONE_USE_SQL MB_FOR_NO_USE_SQL 23318
8739
8027
1420,95619106293
381,41183757782
530,999855041504
Concerning
Thomas
This is not unusual. Another app could analyze for example hard the most often used SQLs in upstairs app - making benefit of further processing (in theory) of sweet analysis when you use these SQLs.
In fact, I remember reading something to this effect as a performance for some factor or another Oracle document or note?
So unless you have serious questions of shared pool, why bother with these sliders? What would be the problem?
-
Order of execution of SQL statements
Hello
I have two SQL statements where the first statement executes on a table with more than 40 million lines, the second statement is running on a table more 6 million lines. When they are running their own each take about 0.15 seconds to run, but when combined they take 20 minutes to run, (the second SQL statement is inserted in the WHERE clause of the statement of first). It would seem that after combining these statements, the first statement goes through all 40 million lines before it performs the SELECT in the WHERE clause. I think that what is necessary is to ensure the SELECT in the WHERE clause is executed first... or something like that! Anyone has any ideas on how to combine these statements but not suffer from the performance impact?
The first statement is:
Select csi.instance_id,
OEL.ordered_item
of apps.csi_item_instances csi,.
Apps.oe_order_lines_all oel
where csi.instance_id in
(1718000,3698000,48740202)
and csi.last_oe_order_line_id = oel.line_id;
The second statement is:
Select / * + INDEX (IEA (attribute_id)) * /.
IEA.instance_id
apps.csi_iea_values do
where iea.attribute_id = 10004
and iea.attribute_value is not null;
The joint return is:
Select csi.instance_id,
OEL.ordered_item
of apps.csi_item_instances csi,.
Apps.oe_order_lines_all oel
where csi.instance_id in
(select / * + INDEX (IEA (attribute_id)) * /)
IEA.instance_id
apps.csi_iea_values do
where iea.attribute_id = 10004
and iea.attribute_value is not null)
and csi.last_oe_order_line_id = oel.line_id;
Thanks for any help,
Mike
Your subquery returns probably just two values that you did originally as constants - but the optimizer thinks that you're going to get 564 K lines. This is why the indicator for the simple query has a beneficial effect, it forces the Oracle to use an index when it would otherwise make a search.
When the subquery is incorporated, however, the optimizer uses its cardinality expected to decide whether to use a nested loop join or the hash join to CSI_ITEM_INSTANCES, since the large enough estimate, he uses the hash with a join analysis complete. That's why I pointed out that the fact to tell the optimizer to how many lines outside the subquery should make a difference.
Have you tried the "common table expression" approach, rather than approach no_merge, but it would not help because it does not change the optimizer for cardinality estimate. If you want to repeat the method CTE adding boards / * + materialize cardinality (2) * / to the query in the WITH clause, you should get the desired result.
Concerning
Jonathan Lewis
-
Copy SQL statement to another database with the same SQL_ID
Is there a reliable way to copy a sql statement in a database to another preserving the formatting so it ends with the same SQL_ID.
I want to copy a statement of the shared pool to a test database to develop a plan to import sql database in production.
In the past, I just did ' select sql_fulltext from v$ sql "in SQL Developer and pasted the result into a spreadsheet SQL Developer and run it. The statement is now in the pool shared with the correct sql_id.
This does not work for instruction, I am currently in train. It ends with a different id of sql.
I know it's probably a problem of formatting, but the statement is 1000 characters and a manual check will take forever.
You could put in a SQL Tuning Set and transfer it.
-
error in pseudo-column "DECODE" can be used within an SQL statement
Hi gurus,
Your help is grealty appreciated. Please help me.
I'm trying to see if I can use the function decode as below and get the error, here below vPlatformfrom value would be QA or MTS
vDataBase1 :='@'|| Decode (vPlatformfrom, 'STD', 'STD', 'QA', 'QA')
Before we check function NVL to a single platform, but now we need the database based on the platform is here.-vDataBase1 :='@'|| NVL (vPlatformto, 'MTS');
Error:
PLS-00204: pseudo-column "DECODE" or function may be used within an SQL statement
> So, here, instead of the decode function, I can use this case as below:
Well... you can, but why? In your CASE, you simply return the same value as the variable.
You might as well use: vDataBase1: = vPlatformfrom; It would reach exactly the same thing.
If vPlatformfrom can be a null value, you will need to decide what database to use or an exception. I think you're original code (NVL) were probably more correct, but I can't decide which.
(and don't bother selecting double, it is an unnecessary sql statement which must be analysed, etc..)
-
Vo SQL statement will not use aliases
Hello!
When I tried to enter the following code in the SQL statement in my definition of VO, it gave me an error in column ambiguously defined:
SELECT a.PERSON_ID,
a.EFFECTIVE_START_DATE,
a.EFFECTIVE_END_DATE,
a.EFFECTIVE_START_DATE,
a.EFFECTIVE_END_DATE,
a.EMPLOYEE_NUMBER,
a.FULL_NAME
OF PER_ALL_PEOPLE_F one
I need to put an alias because I need to refer to one of its columns inside the place where the condition. What is supposed to be the right way to set it?
Thank you.
whatever the dynamic where clause you add with setwhereclause, it is added on top of the query you mentioned in the original Version, so your alias doesn't work
Now if you look at the care of error fully you can see you are querying VO got closed in support () and another alias has been given by the framework (OAF) so all adding the whereclause by setwherelcause dynamically delete pls the 'a'., of the Sub statement
setWhereClause ("a.employee_number =: 1 and a.effective_end_date = (select max (effective_end_date) in the per_all_people_f where employee_number = a.employee_number) '");
ratther write like
setWhereClause ("employee_number =: 1 and effective_end_date = (select max (effective_end_date) in the per_all_people_f b where b.employee_number =: 2)" ");
setWhereClauseParams (null); Always reset
setWhereClauseParam (0, EmpNumber);
setWhereClauseParam (1, EmpNumber);
I hope that is clear, if not please let me know.
Kind regards
Hemant
-
Need an example of loop with sql statement in shell script values
Hello
I have to present a simultaneous program to each line of the table through script shell (only).
The table has all the parameters required to pass to the concurrent program.
I have trouble in a loop with the lines of sql statement results.
Could someone give me an example of a shell script with a loop with the sql statement values.
appreciate your time and your help.
Thank you
Ganesh
Hello
Here is a guide using 3 parameters:
{
sqlplus-s $OA_USR / $OA_PWD<>
SET THE OFF POSITION;
SET FEEDBACK OFF;
SET LINESIZE 300;
SELECT param1, param2, param3
Of your_param_table;
ENDOFSQL
} | while reading line
do
If ['$line'] # line non-NULL
then
set $line
param1 = "$1."
param2 = "$2."
param3 = "$3."
# Pass parameters to a script, sql more
sqlplus-s $apps_usr / $apps_pwd @SUBMIT_CONC_PROG.sql $param1 $param2 $param3
FI
fact
}
In your SQL * more script you run 3 parameters into variables:
declare
VARCHAR2 (10) param1: = ' & &1';
VARCHAR2 (10) param2: = ' & &2';
param3 varchar2 (10): = ' & &3';
.....
-
Try to run a SQL statement through the window of OEM 12 c run SQL. Statement fails
All,
I have a 11g database. When it is initially installed, I installed it in $ORACLE_BASE = / orabin/app/oracle/product and $ORACLE_HOME = $ORACLE_BASE/11gDB_R2. This is the version 11.2.0.1 to give birth to 11.2.0.3.
Recently, I installed 11.2.0.4 in $ORACLE_BASE/11.2.0.4. Then, I upgraded my database at 11.2.0.4. Everything works fine.
All my scripts on the linux host logon changed to point my environment at $ORACLE_BASE/11.2.0.4 House and my $PATH when I connect to the linux host is: /orabin/app/oracle/product/11.2.0.4/bin:/orabin/app/oracle/product/11.2.0.4/OPatch:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
On my OEM Console, the database appears as 11.2.0.4 and me can manage very well.
However, when I try to use the window of the OEM Console to execute SQL to execute any type of SQL statement, it fails.
The failure error is:
Could not launch/orabin/app/oracle/product/11gDB_R2/bin/sqlplus-s/nolog: no such file or directory
It would be a mistake since the 11gDB_R2 directory tree (the 11.2.0.3 software) has been removed from the host, now that the database is set to level and working as 11.2.0.4.
I wonder if somewhere in the OEM software, there is always a pointer to the old ORACLE_HOME? I can't find anything in the .bashrc or other shell scripts that are executed when a Shell session on the host computer which were still the reference to the old directory of 11gDB_R2 so I'm a bit puzzled.
I have 8 guests, and all have been improved in the same way at 11.2.0.4. For some databases, the OEM window run SQL is executing the SQL code.
Someone has some ideas on this?
Go to the Configuration of the analysis of the database (when you set the password) and update of the Oracle home. Also do this for all targets listener on this host as well.
Maybe you are looking for
-
How to remove a toolbar that I don't like
People, I stupidly installed "downloadfalshplayer community toolbar. It is not good. But I don't know how to uninstall it. Please, anyone?
-
C670-12 x satellite doesn't recognize any HARD drive
Hi all My Satellite phone (C670 12 x) does not recognize the hard drives (the bios boot). I tried with several hard drives. I was wondering if a Bios update would be useful? Y at - it an update of the Bios Flash boot CD? I already tried to convert th
-
Hi all I'm a student using MultiSim 12. I have a need to generate 1 and 2 Hz clock timer circuits using the MultiSim student edition. I am not having success finding designs that can use pre-existing components of MultSim. Can anyone offer/provide i
-
object limitation Clip Sport 2000
There will be a future firmware version that goes beyond the limit of object 2000 catalog?
-
the resume session logon screen does not appear
This happened after I installed windows essentials. Less, it's the only thing that has changed on my computer. Since then, my screensaver snaps but the logon screen does not light when I touch the mouse or keyboard. Everything is there for anyone to