Get All sql history in oracle 10g

How to get all select and insert statement from the beginning in the oracle? I tried, "select * from v$sqlarea;" but it's giving only today results, but i need all select and insert statement from the beginning where oracle installed or before particular month. Thanks in advance.

Thanks Sir for sharing this pause feature with query output
col stmtid 
heading 'Stmt Id'          
format
9999999999
col dr     
heading 'PIO blks'         
format   999,999,999
col bg     
heading 'LIOs'             
format   999,999,999
col sr     
heading 'Sorts'            
format  
999,999
col exe    
heading 'Runs'             
format   999,999,999
col rp     
heading 'Rows'             
format 9,999,999,999
col rpr    
heading 'LIOs|per Row'     
format   999,999,999
col rpe    
heading 'LIOs|per Run'     
format   999,999,999
col sqltxt    heading 'SQL Statement'  
format A25 word_wrapped
set pause
on
set pagesize  30
set pause
'More: '
set linesize  120
select  s.hash_value stmtid
,t.sql_text sqltxt
,sum(s.disk_reads) dr
,sum(s.buffer_gets) bg
,sum(s.rows_processed) rp
,sum(s.buffer_gets)/greatest(sum(s.rows_processed),1) rpr
,sum(s.executions) exe
,sum(s.buffer_gets)/greatest(sum(s.executions),1) rpe
from v$sql s, v$sqltext t
where s.command_type in ( 2,3,6,7 )
  and s.hash_value = t.hash_value
group by s.hash_value, t.sql_text
order by 5 desc

Similar Messages

  • SQL*Plus with Oracle 10g Express Edition

    How Can I do to log in using SQL*Plus into Oracle 10g?
    My Schema is: Banco.Global
    My Password is: 111111
    I need to write SET SERVEROUTPUT ON to get answer?
    I opened the Prompt, but i don't know to log in.
    Thanks and my english is not as well as you.

    If i write:
    SQL>connect "Banco.Global"/111111
    a error message is raised: Invalid username/password; logon denied
    but if I log in into Home Page with the same Username and Password, I get to log in.
    There is difference to connect SQL*Plus and the connect with Home Page the Oracle?
    I need to connect with SQL*Plus, because i need to make a test.

  • Is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader

    Hi
    Can anyone tell me whether is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader?
    I am upgrading the 9i db to 10g and wanted to run the 9i SQL Loader control files on upgraded 10g db. So please let me know is there any difference which I need to consider any modifications in the control files..
    Thank you in advance
    Adi

    answered

  • Migration from MS SQL Server to Oracle 10g

    Hi,
    In our application, we are planning to refresh data every one hour from MS SQL Server to Oracle 10g. Can anyone tell me what approach can be followed?
    Thanks & Regards,
    Faizal MK

    Hello,
    migrations can be done with the Migration Workbench that is included in the SQL Developer: http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    But your question sounds more like a replication of data than a migration. Please read as a starter the following note in My Oracle Support (former Metalink):
    Note 283700.1: How to replicate Data between Oracle and a Foreign Datasource
    That note describes ways for the replication in both directions. Please let me know whether this is helpful for you.
    Best regards
    Wolfgang Kobarg-Sachsse

  • Linking to SQL Server from Oracle 10g on 64bit Linux

    I have this working, so I thought I would post my steps.
    In versions 8 to 10 of Oracle, the software for making these connections was known as Heterogeneous Services. It was 32bit only software and the actual binary file that was executed when querying a non oracle database was $ORACLE_HOME/bin/hsodbc. When a query was made to the linked database, a process was started on the machine with the name of hsodbcXXX (where XXX is the name of the DSN).
    In version 11g of Oracle this software is now referred to as Database Gateways and there is a 64bit version as well as a 32bit version. The binary file that is executed in this case is $ORACLE_HOME/bin/dg4odbc.
    Fortunately the 64bit Database Gateway software can also be used with Oracle 10g databases as long as it is up to version 10.2.03 and has the odbc compatibility patch installed. (5965763).
    To make use of this, we need to install the 11g ODBC Gateway into a separate ORACLE_HOME and start a listener from that environment. We can then make use of that listener from the 10g environment.
    So here is what I did to get this working: (Note: DSN = MyDSN)
    1.     Download and install 64bit ODBC driver with support for 64-bit ULEN from Easysoft. The file is named odbc-sqlserver-1.1.4-linux-x86-64-ul64.tar. You'll need to email Easysoft support for the URL. Create the DSN entry as part of the install. At the end of the process it can test the DSN. The query should come back with info about the SQL Server. Test the connection using isql from the /opt/easysoft/unixODBC/bin directory to verify that it works as well (/opt/easysoft/unixODBC/bin/isql –v MyDSN). Note, I installed easysoft driver under /opt rather than the /usr/local which is the default. /usr/local/easysoft is a symlink to /opt/easysoft.
    2.     Install ODBC gateway via the 11g Gateways installer. You can do a custom install and deselect all but the ODBC Gateway component. (http://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_gateways.zip)
    3.     Create a /home/oracle/11g_environment.sh script that sets 11g ORACLE_HOME, PATH, and LD_LIBRARY_PATH variables. It should look something like this:
    #set ORACLE ENV vars for 11g
    ORACLE_HOME=/u01/app/oracle/product/11.1.0/tg_1 # (assuming that is where ODBC Gateway was installed)
    PATH=/bin:/usr/bin:/u01/app/oracle/product/11.1.0/tg_1/bin:/opt/easysoft/bin:/opt/easysoft/unixODBC/bin
    LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/tg_1/lib
    export ORACLE_HOME
    export PATH
    export LD_LIBRARY_PATH
    4.     Create $ORACLE_HOME/hs/admin/initMyDSN.ora, $ORACLE_HOME/network/admin/listener.ora, and $ORACLE_HOME/network/admin/tnsnames.ora under 11g structure. They are as follows:
    initMyDSN.ora:
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an ODBC Agent.
    # HS init parameters
    HS_FDS_CONNECT_INFO=MyDSN
    HS_FDS_TRACE_LEVEL=0
    HS_FDS_TRACE_FILE_NAME=MyDSN.trc
    HS_FDS_SHAREABLE_NAME=/opt/easysoft/unixODBC/lib/libodbc.so
    HS_FDS_SUPPORT_STATISTICS=FALSE
    # ODBC specific environment variables
    #set ODBCINI=/etc/odbc.ini
    #set ODBCINSTINI=/etc/odbcinst.ini
    #set LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/lib
    #set PATH=$PATH:/opt/easysoft/unixODBC/bin:/opt/easysoft/bin/
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>
    listener.ora
    MyDSN =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
    SID_LIST_MyDSN =
    (SID_LIST =
    (SID_DESC=
    (SID_NAME=MyDSN)
    (ORACLE_HOME = /u01/app/oracle/product/11.1.0/tg_1)
    (PROGRAM=dg4odbc)
    (ENVS=LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/tg_1/lib)
    tnsnames.ora
    # tnsnames.ora Network Configuration File:
    # Generated by Oracle configuration tools.
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    MyDSN =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MyDSN))
    (HS=OK)
    5.     Add another entry for MyDSN in /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora so tnsping works in 10g environment as well.
    MyDSN =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MyDSN))
    (HS=OK)
    *** Notice that the MyDSN listener runs on a different port (1522) as it is a separate listener.
    6.     Login to machine as user oracle and source the 11g environment script. “source ~/11g_environment.sh”. Now start the listener. “cd $ORACLE_HOME/bin”. “./lsnrctl start MyDSN”.
    7.     Login to a new shell as user oracle with a 10g environment.
    8.     Run sqlplus and create the database link. “CREATE PUBLIC DATABASE LINK SQLSERVER connect to “<someuser>” IDENTIFIED BY “<somepass>” USING ‘MyDSN’;”
    9.     test the link. “select * from information_schema.tables@SQLSERVER;”
    If it is successfull, you should see a system process named "dg4odbcMyDSN".

    So what have you found out for yourself so far (considering the solution to this is easily found on the web)?
    Have you looked up Heterogeneous Services?

  • Migration from SQL 2000 to Oracle 10g

    Hi every one,
    This is the first i am posting to this forum.
    I have a problem in migration of Sql Server database to Oracle 10g.
    We use Microsoft Navision Axapta 3.0 SP4 as front end.
    and Sql Server 2000.
    All table and indexes are created in sql server by Navison only.
    My Database size is 300 GB and now we face thousands of Problem with SQL server so we decided to make a intelligent move to oracle 10g.
    As we have 1200+ users.
    The problem i am facing when i tranfer all the table to my Oracle Database it gives a error out of buffer.
    some time it gives me error about the index as few of our developer have create two indexex on one field.
    So oracle identifies that there are two indexes on one field.
    So pls help how can i solve this problem.
    I have 1234 tables.
    from
    Mohd Sufian

    Can you post the exact Oracle error you are getting? The ORA-xxxxx part is the most important for us to identify what particular problem(s) you're having.
    Is your front-end certified to use an Oracle database? Particularly if the front end is creating database objects, it needs to know how to work with whatever database it is connecting to.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Unable to use PL/SQL Developer on Oracle 10g express edition

    Hello,
    i have installed oracle 10g XE and PL/SQL developer 8.
    The contents of .ora files are as follows
    tnsnames.ora file:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = pravindasari)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    listener.ora
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
    (PROGRAM = extproc)
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (ADDRESS = (PROTOCOL = TCP)(HOST = pravindasari)(PORT = 1521))
    DEFAULT_SERVICE_LISTENER = (XE)
    sqlnet.ora
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    i am able to login thru database home page.
    When connecting to oracle through PL/SQL developer, m using the following details
    username: system
    pwd: system
    database: XE
    connect as: Normal
    But i get the error as follows:
    ORA-12154: TNS: could not resolve the connect identifier specified
    Its working completely fine on my desktop which has windows XP, bt having problem while logging on laptop which has windows 7 home edition.
    Please help me how to login thru developer.....
    Edited by: user9243989 on Jun 13, 2010 12:36 AM

    Set the environment variable ORACLE_HOME to point to the XE database.

  • Loading data by sql loader in oracle 10g on linux

    I am trying to load data in Oracle 10g on linux by using sql loader, but getting error
    Problem in log showing that field length of SURNAME field is more than table field size.
    Following is the error in log file of sql loader
    Record 21: Rejected - Error on table TABLE1, column
    SURNAME.
    ORA-12899: value too large for column SURNAME (actual: 65, maximum: 64)
    and it is evident from following controlfile that i am using trim to discard any space then why it is giving an error.
    LOAD DATA
    TRUNCATE
    INTO TABLE TABLE1
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    ID INTEGER EXTERNAL,
    OPTION1 CHAR,
    REF1 CHAR,
    OTHER_REF CHAR,
    TITLE "TRIM(:TITLE)",
    FORENAME "TRIM(:FORENAME)",
    SURNAME "TRIM(:SURNAME)",
    JOINT_TITLE "TRIM(:JOINT_TITLE)",
    JOINT_FORENAME "TRIM(:JOINT_FORENAME)",
    JOINT_SURNAME "TRIM(:JOINT_SURNAME)",
    I checked the bad file and count number of characters, they are 64 characters.
    When i am inserting individual record from bad file by sql loader, it is loading

    Probably your database character set is multi-byte. That is %UTF8 or AL16UTF16%
    Post your NLS Database Parameters value
    select * from nls_database_parameters;
    In General varchar2(65) by default means 65 BYTES unless
    you have changed your Defalut NLS_LENGTH_SEMANTICS parameter from BYTE to CHAR.
    With best regards
    Shan

  • SQL performance slow -- oracle 10g to oracle 11g

    Hi,
    We are have two development server, here we can call server10 and server11.
    Server’s having same hardware and OS, but different oracle version, server 10 and server 11 having oracle 10g and oracle 11g respectively.
    Problem, when you run sql query in oracle 11g it’s very slow compare to oracle 10g server.
    Here I have checked
    1)     sga size – comparatively 11g size is big
    2)     no full table scan
    OS – SUN
    DB: 11.1.0.7.0, 10.2.0.4.0

    mmee wrote:
    Hi,
    We are have two development server, here we can call server10 and server11.
    Server’s having same hardware and OS, but different oracle version, server 10 and server 11 having oracle 10g and oracle 11g respectively.
    Problem, when you run sql query in oracle 11g it’s very slow compare to oracle 10g server.
    Here I have checked
    1)     sga size – comparatively 11g size is big
    2)     no full table scan
    OS – SUN
    DB: 11.1.0.7.0, 10.2.0.4.0If the query is running slow, the sga size should not be the first thing to check. PLease post the execution plans of the queries from both the servers. Please try to post the tkprof output of the trace of both. The reason for this that explain plan may lie to us about what has happened but trace would be the real picture only.
    HTH
    Aman....
    PS: Don't forget to use the code tag and using the Preview tab to see how the code looks. A better formatted post would most likely get better attention and response.

  • From SQL Server to Oracle 10g

    Hi!!
    My IT staff have been using SQL Server for quite a time and we have set up all our procedures under this platform, for example, our initial concern in this phase of the migration is: Under SQL Server we use templates that we use to import data into our tables in SQL Server DB, after uploading that data, we run some stored procedures and finally a view.
    Is there any thing similar to a template under Oracle 10g?
    I have been reading about the tools that 10g offers for data upload/download, but what about data files that doesn't have any field separator? All my fields have the same number of characters, that's why I use templates to import data on SQL Server.
    Any ideas?
    Best Regards,
    M Guirao

    sybase to oracle migration questions(I have read the documentation)

  • "Error In Writing to directory ..."  getting the error while installing oracle 10g in laptop

    Hi
    I thought I'd make my first post a hijack of a vaguely related thread,
    then some kind moderator could separate it out and branch it off to a post of its own.
    I'm not even sure this is in the proper forum.
    But anyhow ...
    i am getting problem while installing oracle 10g in laptop its showing error as "Error in Writing to Directory C:\Users\Accent.Muthu\Appdata\Local\temp\OraInstall2011-03-03-10-51-53 AM.
    Please ensure that the directory is writable and has atleast of 45 MB of disk space.Installation can not continue.
    so please tell me the solution as soon as possible
    thanks,
    arshad ayub

    Try the few resolutions mentioned here -
    forms 10g installation  error in writing to directory
    Specially -
    do not try to install from directory which has a space in its path
    TMP and TEMP environment variables are set correctly, preferably to C:/tempRegards,
    Anuj

  • Reading milliseconds from Sql server into oracle 10g

    Hi,
    We have a very time sensitive pressing requirements to be addressed immediately.
    We need to read the date time column from sql server 2008 into oracle 10g.
    We have a dblink established between the two servers and have tried to use sql server and sql native client 10 driver to read the dates from sql into oracle.This we are able to do very successfully.
    The issue is in reading milliseconds stored in sql server.The millisecond part comes in as 00000 from sqlserver to oracle.These milliseconds are needed to identlfy the unique records.
    For instance
    SQL SERVER Oracle
    source_id source id
    01/01/2012 6:30:35:456 01/01/2012 6:30:35:000000.
    Im issuing my query through Toad via Oracle to remote sql server using a dblink which connects using HS ODBC connection to sql server 2008(remote).
    We have no control over sql server Db as this is remote third party DB.We just have select access to their tables to bring into our own oracle DB.
    Any insight or help will be much appreciated.

    Hi,
    Could you please send the following information -
    - what version of HSODBC are you using ? Is it a 10.2 version ?
    - what is the SQL*Server datatype of the column you are reading ?
    - from Oracle could you issue -
    describe sql_server_table@hsodbc
    - what is the Oracle datatype shown for the column ?
    Could you also run your tests using SQLPLUS instead of TOAD ? We don't support TOAD and need to know if the problem also happens when using SQLPLUS, to avoid it being a TOAD problem.
    Also, 10.2 HSODBC is now desupported and you should be using the 11g Database Gateway for ODBC (DG4ODBC) which is a direct replacement for HSODBC. To use DG4ODBC your RDBMS needs to be at 10.2.0.4 or higher and DG4ODBC should be installed in a completely separate ORACLE_HOME from the existing 10.2 install.
    Regards,
    Mike

  • No suitable driver when connect MS SQL server from Oracle 10g using JTDS

    Hi,
    I have developed a java servlet application connection to MS SQL using jtds-1.2.jar. I have try to deploy this application to Oracle 9ias and it works fine.
    However, when I deploy the same application to Oracle 10g (10.1.2.0.2), I encounter this error - java.sql.SQLException: No suitable driver.
    I have copy the jtds-1.2.jar to Ora10g/jdbc/lib, Ora10g/j2ee/home/lib and also the Ora10g/j233/OC$J_GENERAL/applications/sampleApp/sampleApp/WEB-INF/lib folder, and also setup the data source via the EM interface. The data-source.xml entry is as follows:
    <data-source location="jdbc/ess" class="com.evermind.sql.DriverManagerDataSource" xa-location="jdbc/xa/essS" ejb-location="jdbc/ess" connection-driver="net.sourceforge.jtds.jdbc.Driver" username="scott" url="jdbc:jtds:sqlserver://202.xx.xx.xx:1433/sampleDB" inactivity-timeout="30" name="ess"/>
    </data-sources>
    Is there any configuration that I've forgotten to set?

    >
    I have developed a java servlet application
    connection to MS SQL using jtds-1.2.jar. I have try
    to deploy this application to Oracle 9ias and it
    works fine.
    However, when I deploy the same application to Oracle
    10g (10.1.2.0.2), I encounter this error -
    java.sql.SQLException: No suitable driver.
    I have copy the jtds-1.2.jar to Ora10g/jdbc/lib,
    Ora10g/j2ee/home/lib and also the
    Ora10g/j233/OC$J_GENERAL/applications/sampleApp/sample
    App/WEB-INF/lib folder, and also setup the data
    source via the EM interface.
    Is there any configuration that I've forgotten to set?The JAR file needs to be in a place the container can locate it correctly. This is the applib directory for your OC4J instance.
    Which I believe from what you have entered is:
    Ora10g/j2ee/OC4J_GENERAL/applib
    There's a general JDBC 3rd party driver set of documentation here:
    http://download.oracle.com/docs/cd/B14099_11/web.1012/b14012/datasrc.htm#sthref592
    This is not using jtds-1.2.jar but it shows how another set of 3rd party jdbc libs are used with the server.
    -steve-

  • Migration from SQL server to Oracle 10g

    Hi, I am new here,
    I would like to ask how to use SQL developer MWB to migration SQL Server to Oracle?
    I have go through the doc(s) like: getting start, user's guild, etc. and have following problems
    (1), where should the SQL developer installed? in SQL Server side? Oracle side? or any PC with connection to the databases?
    (2), do I need to get some plug-in(s) for MWB to work? If yes, which plug-in do I need and where are they?
    Thank you very much.

    Hi Chocobo,
    I put together a Quick Guide myself
    http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151_11.html
    I updated it to answer your questions.
    Hope that helps
    Dermot.

  • SQL*LOADER IN Oracle 10g Release 2

    Hi,
    Recently i installed oracle 10g release 2 on windows vista.I want to use sqlloader utility.Where can i found it.I checked for sqlldr.exe in oracle home folder,but i didn't find it.Any one plz help me regarding this..

    You would better to look here
    Using:
    http://download.oracle.com/docs/cd/B19306_01/win.102/b14304/tools.htm#i1006973
    It will be also good to look at:
    Concepts
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#SUTIL003
    SQL*Loader Control File Reference
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_control_file.htm#SUTIL005

Maybe you are looking for