Pinning on SQl statement in the library cache
HelloDo to pin frequently used SQL statement to the shared pool...
I know that dbms_shared_pool.keep does the job for PL/SQL, but on simple SQL statements.
Experts from the clues?
Thank you
King
See more of scripts:
-- Get address and hash_value of SQL statement
select address, hash_value from v$sql where sql_text like 'your query to keep';
------------------------------------------------------------------------------------------------
00000000858CA2B0 2239673969
exec dbms_shared_pool.keep('00000000858CA2B0, 2239673969','C');
I think you want to pin the SQL statement that is specific to the moment analysis of long abovid.
I see no reason to pin the SQL more.
Dion Cho
Tags: Database
Similar Questions
-
Is it possible to make the condition depending on the sql statements in the data models
Hi all
Is it possible to include the condition based on sql statements in the data models.
For example
Is something like this? Also, the good doc is available for ' how to take full advantage of the "data models" in BI Publisher?if (some parameter is not null) <sqlstatement name="STATEMENT_1"> ... </sqlstatement> else <sqlstatement name="STATEMENT_2"> ... </sqlstatement>
Thank you
-SookieHello Sookie,
I couldn't find the time to get a data model of demonstration of work for you, but I'll try to explain.First, write a PL/SQL package. Make sure that you set all the parameters of model of data such as a global variable in the default PL/SQL package.
CREATE OR REPLACE
package as employee
function BeforeReportTrigger return Boolean;
query_text varchar (2000);
number of p_DEPTNO;
END;
/CREATE OR REPLACE
package as body employee
function BeforeReportTrigger return Boolean IS
StartIF (p_DEPTNO = 10) THEN
query_text: = select col1, col2, col3 from HR.
elsif (p_DEPTNO = 20) THEN
query_text: = select col1, col2, col3 hr_history.
on the other
query_text: = select col1, col2, col3 hr_history1.
end if;
Returns true;
end;
/Use this package in the default package in your data model. Check the "defaultPackage ="employee"in the following data model header.
Sample data model
------------------------------
--
--
--
--
Before running the query SQL, data engine reads the "before the release of the report" and all the texte_requete argument based on the p_DeptNo value. When executing the Q1, engine sqlQuery analyze the query ' & quert_text and replace it with the actual value. For example if the p_deptno = 10, the query will be "select col1, col2, col3 from HR.
Try it...
-
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.
-
New installation of SQL Server, disable the write cache?
Hello, I'm under ESXi 5.1 and I need to configure a virtual machine Windows server 2012 for our first virtual SQL Server. My database guy tells me that I have to disable the cache write for SQL best practices. Is it always true when it is a virtual machine? If it is true where would I turn it off? To add a bit more info about our storage on a network SAN Dell EqualLogic and we will use SQL 2008 as SQL 2012 is not yet supported. Thanks for the help!
I think that your SQL guy assumes the ESXi host will be caching on its own transparent for the VM by default. This is incorrect, ESXi does nothing like that.
The only place where caching of write i/o can happen is on the side of physical storage outside ESXi, so in your case the SAN controllers (no reason not to have this license here too long as it is on battery/flash) or the discs themselves (ugh, it is never enabled by default for a good reason).
BTW: I'm pretty sure that SQL 2008 is not supported on Server 2012.
-
FDM generated SQL statement in the log file?
Hello everyone, hopefully a simple question:When you perform an import using FDM, I know that behind the scenes of a SQL SELECT statement statement composed and performed on the database server. My question: the actual SQL statement is retained in a newspaper somewhere (so that we can see it?) In our case, it's an Oracle DB server and we use the ERPI adapter; not sure if it's relevant. We would like to enter this SQL statement and use it as a starting point for other things.
Thanks in advance for anything you can offer.
The statement SQL is not written in the journal of the adapter. The only things that are registered are what show in the file card log if you enable loggin to the adapter source ERPi in action 'Get Data'.
-
SQL statement causes the database to hang
Guys,
a DBA told me that there is something wrong with this SQL statement and causes a blockage of database...
Please check.
SELECT field1 FROM table1 WHERE Field1 LIKE ' %% ' AND field2 = '123456' ORDER BY Field2 ASC
Tell me, what is the problem with statement above. The LIKE operator is?
Thanks for the help!Are not specifically related to your question, but having a clause such as ' where Field2 ='123456 "and then you place your order on Field2 is not really going to do much for you, all values will be identical!
Carl
-
SQL statement for the hierarchy of the Organization
Nice day
I was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10
Thank you
ElmerI was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10
Please see if (how to extract HR organization hierarchies in SQL? [REF 463359.1]) help.
Thank you
Hussein -
Hide results SQL - State of the button, see the
Hello
I use APEX 4.0 with Toad for Oracle 10.5. My problem is that I need to hide the delete button based on the results of the SQL statement. When the point: P43_DEPARTMENT_ID value is entered and there is for any field below, the data will appear along the line.
But when no data appears that there is still a blank line for the fields. That will make the hidden Delete button. I don't know how to remove this row of the grid with my results of the select statement above. The State still thinks there is a line and a value (s) appear statement.SELECT (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (division_id, 0, 5) FROM tbl_division)) AS DIVISION, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5) FROM tbl_grant)) AS GRANTS, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5) FROM tbl_allotment)) AS ALLOTMENT, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT department_id FROM tbl_department_temp)) AS DEPARTMENT_TEMP, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (division_id, 0, 5) FROM tbl_division_temp)) AS DIVISION_TEMP, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5) FROM tbl_grant_temp)) AS GRANT_TEMP, (SELECT distinct department_id FROM tbl_department WHERE department_id = :P43_DEPARTMENT_ID AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5) FROM tbl_allotment_temp)) AS ALLOTMENT_TEMP FROM DUAL
DIVISION OF | GRANTS | ALLOTMENT | DEPARTMENT_TEMP | DIVISION_TEMP | GRANT_TEMP | ALLOTMENT_TEMP
________|_______ |___________|__________________|_____________ |____________|_________________
Can someone help me with my select statement or provide me with advice on how to remove this blank line when there is no data? I can't create a view and then add a WHERE IS NOT NULL clause because of the variable binding: P43_DEPARTMENT_ID.Do not know if I just got it, but what about:
SELECT SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
OF tbl_division))
THE DIVISION,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_grant))
FORM OF GRANTS,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_allotment))
AS ASSIGNMENT,.
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT department_id
OF tbl_department_temp))
AS DEPARTMENT_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
OF tbl_division_temp))
AS DIVISION_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_grant_temp))
AS GRANT_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_allotment_temp))
AS ALLOTMENT_TEMP
OF THE DOUBLE
LESS
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL from doubleThis should ensure you don't receive a "no data found" when all the columns return null.
-
Hello. all.
I wonder how to find sql_id using a sql statement, including transport retrun and tab space multiple.
To be more precise,
My sql is:
Select
col_a,
col_b,
..
..
I usually use the following query to find the sql_id
Select sql_id in v$ sql where sql_text like 'MY SQL STATEMENT %.
When MY SQL STATEMENT includes carriage return and tab space multiple, how can I do?
Thanks in advance.
Best regards.Hello
Did you look at regular expressions? Use regexp_like instead of as.
http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10759/conditions018.htm
Kind regards
-
SQL statement for the materialized view?
Can someone please tell me what SQL statement creates a materialized view?Syntactically, Yes. Otherwise Yes too (as long as you don't mind the Cartesian join with State B).
Why not just try and see what happens?Concerning
Etbin
-
Logging has no SQL statements using the view system
Hello
We would like to improve our logging of errors of logging of sql statements failed.
in other words, when a user does something in our system that generates a sql error.
We want to connect to the corresponding sql statement.
to do this, we need a way to get this statement by using a sql query.
is there perhaps something like a point system with the sql statement failed where
I can just go get the last being?
would be very happy for some advice.Yes, you need to activate the first check. Checkout:
http://www.Oracle-base.com/articles/10G/Auditing_10gR2.php
http://www.tiplib.com/183/enable-auditing-Oracle-database -
Esscaping Charaters in the SQL statement in the ASP.
I have a SQL statement that inserts a line of text that contains ('), a single quotation mark. How to escape from this server so that it don't think it's the end of the string.
SQLStr = "UPDATE TABLE SET field = ' this is my string to insert." It does not work because of the apostrophe ' WHERE Id = 31 "
ASP/ACCESS
Thank you
JeremyPut two consecutive ' instead.
SQLStr = "UPDATE TABLE SET field = ' this is my string to insert." It "s not
work because of the apostrophe ' WHERE Id = 31 " -
How to execute the SQL statement in the Application Module
Hi people
I´d would like to know how I can execute a SQL statement like "remove user" in the Module to request... prepareSession method...
I m using Jdev 10 with ADF Faces
Thank youThis is possible, but you should think twice about it.
If this can be done with an EO/VO do in this way.
If you can't do it with an EO/VO you can yourself the DB operation (ApplicationModule.getDBTransaction ()) and use a call of createStatement (...) do what you want.Timo
-
insufficient privileges when using dynamic sql statements in the procedure
Hello
I use following script on oracle 10g. and get the error not enough privs. Please advice.
SQL > show user
The user is 'GRSADM '.
SQL > create or replace procedure grsadm.test_proc as
a varchar2 (2000);
Start
a: =' VIEW to CREATE or REPLACE
TEST_VIEW
IN SELECT
"FLAS" one
THE DOUBLE ';
immediately run one;
end;
Created procedure.
SQL > start
grsadm.test_proc;
end;
Start
grsadm.test_proc;
end;
Error on line 16
ORA-01031: insufficient privileges
ORA-06512: at "GRSADM. TEST_PROC', line 9
ORA-06512: at line 2
SQL > select * from session_privs
where the privilege as "VIEW %.
PRIVILEGE
----------------------------------------
CREATE A VIEW
REMOVE ANY VIEW
CREATE A MATERIALIZED VIEW
MODIFY A MATERIALIZED VIEW
REMOVE ANY MATERIALIZED VIEW
5 selected lines.
Published by: Rous Sharma on November 24, 2011 12:00GRSADM has a privilege ' CREATE (all) VIEW ' live?
And not via a role...SSM
Samir,
GRSADM is the owner of this procedure, it seems that the EXECUTE priv, that you suggested is already involved. -
How to execute the sql statement in the file beats?
I want to execute after the statement
C:\ > sqlplus/nolog
SQL > conn scott/tiger
SQL > select * from tab;
I know I can achieve it following test.bat and testdb.sql file
test.bat is:
sqlplus/nolog @testdb.sql
TestDB.SQL is:
Conn scott/tiger
Select * from tab;
Now I don't want to use the sql file, I want only use bat file, as follows:
test.bat is:
sqlplus/nolog
Conn scott/tiger
Select * from tab;
When I run test.bat, I find only one sqlplus /nolog execute statement, do not execute other statements.
(1) I want to know if there is a method to run the SQL file by fighting without a sql file? How to make it happen?
(2) if I call the sql file, how to hide the password of user? Because I don't want other people to know scott password, if I use conn scott/tiger in testdb.sql, other person can see testdb.sql and the password. Is there a good way to avoid?
Thank you!It works a bit different in Windows. Create a file is like this:
( echo conn scott/tiger@orcl echo spool c:\temp\list.txt echo select sysdate from dual; echo spool off echo exit ) | sqlplus -s -l /nolog
Maybe you are looking for
-
How can I connect my apple tv to my wifi using an ethernet cable?
So I can not find my apple tv remote, but I know that I can still use my iPhone as a remote control. Because I need to connect to a new wifi spot, I know that I can connect my ethernet cable to my apple tv and then use my phone as a remote control. I
-
Hello I have a problem with the scaling of a NI6229 device. Set the entry on 0.0V, then the return value of aiPolynomialScaler (.) -10.63V and if the 10V input, I get - 0.63V.
-
I have a deskjet 3056a j611 series and I can't install Windows 8
I have a laptop HP2000-bf69WM I want to install a HP deskjet printer that uses Windows 7.
-
What is the win 2 k SP4 and how to install the di?
I'm trying to upload videos to a CD, but the equipment that I use wonder upgrade for WIN 2 - K SERVICE PACK 4. What is this and how do I install it?
-
Discovery Network Vista problems
I have a PC running Windows Vista Home Premium 32 bit version. The specs are 400 GB hard drive, Intel 2160 1 .8GHz duo core CPU, 2 GB memory DDR2 Ram. I use Kaspersky Internet Security 2009. I've been running this program for a month without any prob