DMBS_SQL.to_refcursor equivalent in Oracle 10g

Hello,
Is there any other way to get result as a refcursor in Oracle 10g with DBMS_SQL? I have the function that function generate dynamic query and execute with DBMS_SQL. This function called by java code for viewing result as report. How can I do this, is there equivalent in Oracle 10g for DMBS_SQL.to_refcursor? Please help.
Thanks,

ilkinesrefli wrote:
Is it difficult to understand my answers?Yes, because they are not accurate. You keep saying you can't use ref cursors and must use DBMS_SQL, but you have failed to show us why that is so.
It is impossible because there is dynamic where clause in my query. Show us why it's impossible.
BluShadow     please solve this one:
p_sql := 'select empno, ename, deptno from emp where deptno=:pdeptno';
if ... then
p_sql := p_sql || ' AND empno=:pempno';
end if;
...Is it possible by your way?Yes, ref cursors can be used for dynamic queries. basic example...
SQL> ed
Wrote file afiedt.buf
  1  create or replace function get_refcursor(p_sql in varchar2
  2                                          ,p_whereclause in varchar2 := null
  3                                          ,p_whereval in number := null) return sys_refcursor is
  4    v_rc sys_refcursor;
  5  begin
  6    if p_whereval is not null then
  7      open v_rc for p_sql||' where '||p_whereclause using p_whereval;
  8    else
  9      open v_rc for p_sql;
10    end if;
11    return v_rc;
12* end;
SQL> /
Function created.
SQL> var rc refcursor;
SQL> exec :rc := get_refcursor('select empno, ename, deptno from emp');
PL/SQL procedure successfully completed.
SQL> print rc;
     EMPNO ENAME          DEPTNO
      7369 SMITH              20
      7499 ALLEN              30
      7521 WARD               30
      7566 JONES              20
      7654 MARTIN             30
      7698 BLAKE              30
      7782 CLARK              10
      7788 SCOTT              20
      7839 KING               10
      7844 TURNER             30
      7876 ADAMS              20
      7900 JAMES              30
      7902 FORD               20
      7934 MILLER             10
14 rows selected.
SQL> exec :rc := get_refcursor('select empno, ename, deptno from emp', 'deptno = :1', 20);
PL/SQL procedure successfully completed.
SQL> print rc;
     EMPNO ENAME          DEPTNO
      7369 SMITH              20
      7566 JONES              20
      7788 SCOTT              20
      7876 ADAMS              20
      7902 FORD               20
SQL>So, please explain to us again why ref cursors are impossible to use and you have to use DBMS_SQL?

Similar Messages

  • 10g Express Edition equivalent for Oracle 8.1.7?

    Hi all,
    Exist any Oracle 10g Express Edition equivalent (free edition) for Oracle 8.1.7?
    Many thanks in advance.

    user5880436 wrote:
    Hi all,
    Exist any Oracle 10g Express Edition equivalent (free edition) for Oracle 8.1.7?
    Many thanks in advance.Express edition was started from 10G onwards. So there is no equivalent in 8 i.
    Regards
    Rajesh

  • WIN_API_SESSION.Timeout_Get_Inactive_Time equivalent in oracle Devsuite 10G

    Hello,
    What is the equivalent of "WIN_API_SESSION.Timeout_Get_Inactive_Time" in oracle 10G developer suite using webutil.
    I want to exit the form if the session is inactive for a set period of time calculated as above in earlier versions.
    Thanks and Regards
    Mohan

    Do you have any other solution on this?
    Regards,
    MKBH

  • Oracle 10g SQL Profiler Equivalent?

    As per the subject, I can monitor sessions via the web gui, but I need to see actual SQL statements that are hitting the 10g server. Is there an Oracle 10g SQL Profiler equivalent?

    XE?
    You might want to hunker down with some of the docco available at http://www.oracle.com/pls/db102/portal.portal_db?selected=1
    In particular, you could look at the 'Reference' manual (not SQL Reference, or any other ... Reference) and browse through the DBA_ and V$ views listed. The Concepts and Administration manuals are interesting as well.
    The specific views of interest include, but are not limited to, V$SQLAREA and V$SQLTEXT

  • Error while installing oracle 10g on centos 5.6 32 Bit

    Hi All,
    Please help me with the issue I facing while installing oracle 10g on centos 5.6 32bit. I did lot of research on google but I am getting same answer...the libXp package is missing, but I have check it...its already installed.
    [root@staging ~]# find / -name libXp.so.6
    /usr/lib/libXp.so.6
    /usr/lib64/libXp.so.6
    echo $DISPLAY
    <ipaddress>:0.0
    [oracle@staging database]$ DISPLAY=<ipaddress>:0.0; export DISPLAY
    [oracle@staging database]$ id
    uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba) context=root:system_r:unconfined_t:SystemLow-SystemHigh
    Below is the error message I am getting :
    oracle@staging database]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-06-27_05-37-17PM. Please wait ...[oracle@staging database]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2012-06-27_05-37-17PM/jre/1.4.2/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
         at java.lang.ClassLoader.loadLibrary0(Unknown Source)
         at java.lang.ClassLoader.loadLibrary(Unknown Source)
         at java.lang.Runtime.loadLibrary0(Unknown Source)
         at java.lang.System.loadLibrary(Unknown Source)
         at sun.security.action.LoadLibraryAction.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
         at sun.awt.DebugHelper.<clinit>(Unknown Source)
         at java.awt.Component.<clinit>(Unknown Source)
    I found some suggestion on google and tried to not use ip address in DISPLAY settings...
    if I am using 0.0 instead of IP below eg.
    [oracle@staging database]$ DISPLAY=:0.0; export DISPLAY
    The error I am receiving differnt error
    [oracle@staging database]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-06-27_05-34-40PM. Please wait ...
    DISPLAY not set. Please set the DISPLAY and try again.
    Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
    - For csh:                % setenv DISPLAY 192.168.1.128:0.0
    - For sh, ksh and bash:      $ DISPLAY=192.168.1.128:0.0; export DISPLAY
    Use the following command to see what shell is being used:
         echo $SHELL
    Use the following command to view the current DISPLAY environment variable setting:
         echo $DISPLAY
    - Make sure that client users are authorized to connect to the X Server.
    To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
    % xhost +
    To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
         % <full path to xclock.. see below>
    If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
    Typical path for xclock: /usr/X11R6/bin/xclock
    [oracle@staging database]$ echo $SHELL
    /bin/bash
    Please help me.

    satish.ygl wrote:
    Hi,
    I am getting the same error when i am applying patchset to 10201 to 10204. I am using RedHat Linux 4 version and I tried set $DISPLAY=<hostname/ip address>:0.0 and export=DISPLAY
    #xhost + and checked $PATH this is also is correct
    I did these steps still i am getting the following error
    pen an xterm, dtterm or xconsole as the user that started the session and type the following command:
    % xhost +
    To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
    % <full path to xclock... see below>
    If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
    Typical path for 'xclock': '/usr/X11R6/bin/xclock'
    Please help me in this scenario.
    thank You,
    Sri
    Edited by: satish.ygl on Oct 30, 2012 7:49 PMyou must log onto the DB Server as below (or functional equivalent)
    ssh -X oracle@DB_Server
    & the first & only command after logging onto the DB Server should be as below
    xclock
    If/when xclock fails, then OUI will fail.

  • Question on replication in Oracle 10G Release 2

    Good day,
    I have a few questions on setting up replication that fits my scenario described below. Thank you in advance for reading and answering my post.
    Scenario
    I need to replicate 100-200 tables from the first OLTP server to the second DSS server that is read-only. The servers are physically located in different countries. Both servers use Oracle 10G Release 2. Required frequency of refreshes is 1-3 hours.
    Questions
    1. Is it optimal to use materialized views with fast/force refreshes for implementation of this scenario? If no, what are the better options?
    2. How do network interruptions and latency affect stability of work of replication with materialized views?
    3. How big is additional performance overhead at OLTP (source) server due to setting up replication with materialized views?

    1) I guess it depends on how you define "optimal". It's certainly a reasonable option. You might also look at Streams or even logical standby databases. There are various trade-offs involved, so it really depends on your environment.
    2) What does "stability of work of replication" mean, exactly? Obviously, if the network fails, the replication job(s) will generate errors. Depending on how you set things up, the replication process will be retried after increasing intervals until it succeeds.
    3) Maintaining materialized view logs on the OLTP system could certainly impact performance-- the logs have to be maintained synchronously with the OLTP transactions. That may or may not noticably impact OLTP transaction performance-- it's probably roughly equivalent to putting a trigger on each of the 100-200 tables. Something like Streams is designed to put less load on the source system because changes are captured asynchronously.
    Justin

  • How can I Calcualte the geometric mean in oracle 10g

    dear all
    plz I need a function to calculate the geometric mean
    I uses oracle 10g
    thanks in advance

    Hi,
    Solomon Yakobson wrote:
    select  power(10,sum(log(10,val)) / count(*))
    from  value_table
    I'm sure you meant count *(val)*, not count (*).
    You can also use AVG instead of SUM and COUNT.
    There's nothing specail about the number 10; any number greater than 1 will do; just be sure to use the same number in both POWER and LOG. If you used e, that would be equivalent to using EXP and LN instead of POWER and LOG, so why not use EXP and LN in the first place?
    SELECT       job
    ,       power(10,sum(log(10,sal)) / count(*))     AS gm1
    ,       POWER ( 2
              , AVG (LOG (2, sal))
              )                    AS gm2
    ,       EXP (AVG (LN (sal)))               AS gm3
    FROM       scott.emp
    GROUP BY  job
    ORDER BY  job
    ;Output:
    JOB              GM1        GM2        GM3
    ANALYST         3000       3000       3000
    CLERK     1021.02742 1021.02742 1021.02742
    MANAGER    2748.9445  2748.9445  2748.9445
    PRESIDENT       5000       5000       5000
    SALESMAN  1391.57884 1391.57884 1391.57884

  • How to Connect to Oracle 9i database server via Oracle 10g XE

    I have installed Oracle 10g eXpress Edition and uninstalled Oracle 9i client database. I used Oracle 9i client to connect to another Database server on a local LAN. Is it possible to create a database link to the old Oracle 9i database server via Oracle 10g XE? If yes, do I need to add ODBC drivers?
    I want to achieve the following:
    1) Create a connection to the Oracle 9i database server using Ora101040 odbc drivers.
    2) Use a similar 9i tool (Enterprise Management Console) within Oracle 10g XE to access Oracle 9i Database tables on a LAN network.
    3) Create data access to Oracle 10g XE via some ODBC connection from a C++ runtime application.
    Hope to receive help from Oracle professionals.
    Thanks.

    I have installed Oracle 10g eXpress Edition and
    uninstalled Oracle 9i client database. I used OraclePlease clarify - you uninstalled the 9i database or the 9i client.
    9i client to connect to another Database server on a
    local LAN. Is it possible to create a database link
    to the old Oracle 9i database server via Oracle 10g
    XE? If yes, do I need to add ODBC drivers?
    Database links between Oracle databases do not require ODBC. They do require Oracle Networking (included with both Oracle9i Database and Oracle Database 10g XE) to be configured correctly.
    It is also possible to connect ot the 9i database using the 10g Instant Client (separate download)
    I want to achieve the following:
    1) Create a connection to the Oracle 9i database
    server using Ora101040 odbc drivers.Please clarify - what client do you wish to run that needs ODBC?
    2) Use a similar 9i tool (Enterprise Management
    Console) within Oracle 10g XE to access Oracle 9i
    Database tables on a LAN network.XE does not have an equivalent to Oracle Enterprise Manager. XE does come with HTMLdb preinstalled and configured, and HTMLdb provides a subset of the administration capabilities of Enterprise Manager.
    3) Create data access to Oracle 10g XE via some ODBC
    connection from a C++ runtime application.You can download ODBC drivers from the same location on OTN you downloaded XE. I do not know whether XE includes ODBC drivers. ODBC drivers will usually still require you to configure the Oracle Networking.
    There are a number of items that make me believe you do not have a good grasp of Oracle architecture and basics. If true, I encoureage you to start reading the Concepts manual found for the database at http://docs.oracle.com, or at least the O'Reilly book 'Oracle Essentials' found at http://oracle.oreilly.com

  • Small Business Server 2003 Compatibility with Oracle 10G, licensing?

    Hello all,
    Is Windows SBS 2003 compatible with Oracle 10G, I looked at the compatibility and didn't notice it but I wanted to see if anyone here had any experience with the two.

    The licensing isn't by cpu slots, it's by the number
    of cores times a multipier, which I believe for intel
    is .5, so if you have a cpu w/ 2 cores, you would
    purchase a 1 cpu license. If you have a quad core
    cpu, you would need to purchase a 2 cpu license. I
    would definitely talk to your sales rep about this to
    make sure the multipier is right (and if it has
    changed w/ intel quad technology).Thanks Jim. The multiplier used above for Intel is indeed correct. However, Oracle has (in the last few weeks) introduced the term 'socket' into it's licensing metrics as follows:
    "When licensing Oracle programs with Standard Edition One or Standard Edition in the product name, a processor is counted equivalent to an occupied socket. See http://www.oracle.com/corporate/pricing/technology-price-list.pdf "
    To quote another source (CRN):
    "..Standard Edition was licensed for servers with up to four single-core processor cores. For multicore chips, users could only license it for up to eight cores total. Oracle's formula was to multiply the number of cores by 0.50 to get the CPU license number to determine price. So a four-core box counted as two CPUs.
    Now Standard Edition can be licensed on servers with up to four sockets, or four processors running one-, two- or four-core chips (and possibly a higher number of cores)." This source overlooks to mention that the multiplier relates to Intel!
    Regards,
    Graham
    www.oracleonwindows.co.uk
    Regards, Graham

  • Compliance of Oracle 10g R2 with Windows XP SP2

    Hello everybody
    I am representing my company for making a decision of deploying appropriate versions for Oracle and Windows.
    The vendor suggested Oracle 9 on Windows Server 2003, whereas we opted for deploying Oracle 10g R2 with Windows XP SP2.
    According to the vendor
    XP is not a true 'server' product and therefore does not provide many server functions and may have restrictions on numbers of users that can connect.
    If the vendor's notion is correct, would anyone explain the limitations/restrictions of our solution.

    One of the first problems that you will encounter, inbound connections limit in Windows XP:
    http://support.microsoft.com/kb/314882
    Memory allocations are handled differently between Windows 2003 and XP (paged pool, non-paged pool, file system caching, etc.):
    http://msdn2.microsoft.com/en-us/library/aa366778.aspx
    In some cases the memory allocation differences can cause XP to display errors indicating "unable to allocate memory from the paged pool" or the non-paged pool, when Windows 2003 would otherwise continue functioning without problem. Windows 2003 offers a registry change to work around this problem:
    http://support.microsoft.com/kb/312362
    Microsoft will stop making Windows XP available for resale in June 2008, except on extremely light-weight computers, and update support will end before update support ends for Windows 2003.
    There are typically differences in the hardware that ships with a computer loaded with Windows XP and one that ships with Windows 2003. You will have a hard time finding a computer with Windows XP that ships with redundant power supplies, dual backplanes, SCSI RAID 10 support, dual network interfaces, built-in system/diagnostics, etc.
    While Windows 2003 is the server equivalent of Windows XP, there are many features in Windows 2003 that are not available in Windows XP. XP is designed to be rebooted frequently (shut down every night, or reboot once a week or once a month) and is geared toward foreground application performance. Windows Server 2003 is designed to be rebooted infrequently (apply security updates, recover from rare system fatal bugs) and is geared toward providing good background application performance (the Oracle database instance would be a background application).
    If you are unfamilar with Windows Server 2003, take a look at the books "Microsoft Windows Server 2003 Administrator's Companion" by Microsoft Press and "Mastering Windows Server 2003" by Sybex. Compare what you find in those books with what you might find in Microsoft's Windows XP Resource Kit book.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Sqlplus is not working after oracle 10g client installatio on linux server

    Him
    jsut now i installed oracle 10.2.0.1 client version in one my linux server. after successfully installation sqlplus is not working . could you please chekc and let me know what is the problem? below are my .profile details.
    # Set up the shell variables:
    EDITOR=vi
    export EDITOR
    ### Set the umask
    umask 022
    ### Set ulimit
    #ulimit -u 16384
    #ulimit -n 65536
    ### Set Oracle Environment
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/client_1
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
    export LIB_PATH=$ORACLE_HOME/lib
    export ORATAB=/etc/oratab
    export NLS_LANG=american_america.we8iso8859p1
    export THREADS_FLAG=native
    echo ' '
    echo 'Oracle 10G environment has been setup'
    echo 'Export the ORACLE_SID to target database before connecting'
    echo ' '

    841731 wrote:
    Him
    jsut now i installed oracle 10.2.0.1 client version in one my linux server. after successfully installation sqlplus is not working . could you please chekc and let me know what is the problem? below are my .profile details.
    # Set up the shell variables:
    EDITOR=vi
    export EDITOR
    ### Set the umask
    umask 022
    ### Set ulimit
    #ulimit -u 16384
    #ulimit -n 65536
    ### Set Oracle Environment
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/client_1
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
    export LIB_PATH=$ORACLE_HOME/lib
    export ORATAB=/etc/oratab
    export NLS_LANG=american_america.we8iso8859p1
    export THREADS_FLAG=native
    echo ' '
    echo 'Oracle 10G environment has been setup'
    echo 'Export the ORACLE_SID to target database before connecting'
    echo ' '" sqlplus is not working" is not an actionable error message. Unfortunately, you didn't show us what happens when you try to execute sqlplus.
    Essentially, what you've done is the equivalent of 'here's a picture of my garage. Why won't my car start?'

  • Oracle 10g TNS listener service

    Hi Friends,
    I have installed Oracle 10g in my windows
    vista. When i try to start TNS listener through services window
    manually, it is giving the below error.
    "windows could not start the OracleOraDb10g_home1TNSListener service
    on Local Computer.
    Error 3: The System cannot find the path specified"
    If you have an idea about this please help me out. I need to solve it
    immediately. Please respond for this as early as possible.
    Thanks,
    Surendra Kumar

    sridhar yerram wrote:
    My listner.ora contents are as follows :
    # listener.ora Network Configuration File: D:\oracle\product\10.1.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\product\10.1.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    My tnsnames.ora file as follows ;
    # tnsnames.ora Network Configuration File: D:\oracle\product\10.1.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    I was getting the following error when iam connecting using my tns name : scott/tiger@ORCL
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    all services for oracle are started , in services.msc i started all the services of oracle.
    May i know exactly what are the services necessary to run the oracle 10g
    regards
    sridharWhy are you reviving a thread that has been dormant for 18 months and had nothing that looked at all like your problem?
    Anyway ...
    First, Is your client (from which you are running sqlplus) on the same machine as the database? If not, it will never connect as 'localhost' is a non-routable address.
    Second, which version of windows is your database on?
    Third, we see what your listener and tnsnames files look like, but that's not the whole story. Show us the results of :
    c:> lsnrctl status(Use copy and paste to show us the full command and response from a command prompt)
    Fourth, read my standard explanation and see if it leads you to any clues.
    =================================
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Next, tns sends a request to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the request arrives at port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, you'll be connected.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"
    =====================================

  • Sess_sh in Oracle 10g

    Hello,
    I am reading about accessing Oracle using DataSources/JNDI and in the Oracle 8i document it mentions about sess_sh and bindds to bind DataSource objects in Oracle JNDI. Here is the information:
    Register the Data Source for the Oracle8i JNDI
    To bind the OracleDataSource, OracleConnectionPoolDataSource and OracleXADataSource instances into JNDI, use the bindds command of the Oracle8i sess_sh (session shell) tool. The sess_sh tool is furnished with Oracle8i as an interactive interface to the session namespace of a database instance. The sess_sh tool offers shell commands that give the session namespace much of the "look and feel" of a UNIX file system. (Once you start the sess_sh tool, a $ command-line prompt appears.) See the Oracle8i Java Tools Reference manual for a complete description on using the bindds command.
    Use the following syntax to bind a data source in an Oracle8i JNDI namespace:
    $ bindds <datasource_name> [options]
    I didn't find this in my 10g installation. Do I have to download a separate utility or is there anything equivalent in 10g?
    My other question is regarding Oracle JNDI, is there a reference implementation available with a 10g install that I can test with?
    Thanks in advance for any help.

    The following links describe the new Text features in Oracle 10g and 11g.
    http://download.oracle.com/docs/cd/B19306_01/text.102/b14218/whatsnew.htm#i969790
    http://download.oracle.com/docs/cd/B28359_01/text.111/b28304/whatsnew.htm#sthref6

  • How to see lock in oracle 10g

    hi,
    i m working on an application made in oracle 10g developer, & database is oracle 10g on aix ,
    some times i get some problem when user save any data through forms it gets hanged ,
    so tell me how to get rid of it , when i try to do it from sql navigator i see massges session is busy .
    so y this eror i m getting & how to resolve it.
    thxs

    Here you have some scripts:
    rem
    rem FUNCTION: Report all DB locks
    rem
    column osuser format a15 heading 'User'
    column session_id heading 'SID'
    column mode_held format a20 heading 'Mode|Held'
    column mode_requested format a20 heading 'Mode|Requested'
    column lock_id1 format a10 heading 'Lock|ID1'
    column lock_id2 format a10 heading 'Lock|ID2'
    column type heading 'Type|Lock'
    set feedback off echo off pages 59 lines 131
    start title132 'Report on All Locks'
    spool rep_out\&db\locks
    select nvl(a.osuser,'SYS') osuser,b.session_id,type,
    mode_held,mode_requested,
    lock_id1,lock_id2
    from sys.v_$session a, sys.dba_locks b
    where
    a.sid=b.session_id
    order by 2
    spool off
    pause press enter/return to continue
    clear columns
    set feedback on echo on pages 22 lines 80
    set headingsep ='|'
    set lines 160
    set pagesize 20
    ttitle 'Database Locking Conflict Report'
    btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
    column username      format a10     heading 'User'
    column terminal      format a15     heading 'Application|PC'
    column object           format a15     heading     'Table'
    column sql            format a15     heading 'SQL'
    column sid           format 999     heading 'SID'
    column lock_type      format a15     heading 'Lock|Type'
    column mode_held      format a11     heading 'Mode|Held'
    column mode_requested      format a10     heading 'Mode|Request'
    column lock_id1      format a8     heading 'Lock ID1'
    column lock_id2      format a8     heading 'Lock ID2'
    column first_load_time  format a19     heading 'Requested'
    break on lock_id1
    select a.sid,
           username,
           terminal,
           decode(a.type,'MR', 'Media Recovery',
                      'RT', 'Redo Thread',
                   'UN', 'User Name',
                   'TX', 'Transaction',
                   'TM', 'DML',
                   'UL', 'PL/SQL User Lock',
                   'DX', 'Distributed Xaction',
                     'CF', 'Control File',
                   'IS', 'Instance State',
                   'FS', 'File Set',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'TS', 'Temp Segment',
                   'IV', 'Library Cache Invalidation',
                   'LS', 'Log Start or Switch',
                   'RW', 'Row Wait',
                   'SQ', 'Sequence Number',
                   'TE', 'Extend Table',
                   'TT', 'Temp Table', a.type) lock_type,
            decode(a.lmode,0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.lmode)) mode_held,
       decode(a.request,
       0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.request)) mode_requested,
       to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
       c.object object,
       d.sql_text sql,
       e.first_load_time
    from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
       where (id1,id2) in
         (select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
         b.id2=a.id2 and b.request>0) and
         a.sid = v$session.sid and
         a.sid = c.sid and
         d.address = v$session.sql_address and
         d.hash_value = v$session.sql_hash_value and
         d.address = e.address
    order by a.id1, a.lmode desc
    set headingsep ='|'
    set lines 160
    set pagesize 20
    ttitle 'Database Locking Conflict Report'
    btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
    column username      format a10     heading 'User'
    column terminal      format a15     heading 'Application|PC'
    column object           format a15     heading     'Table'
    column sql            format a15     heading 'SQL'
    column sid           format 999     heading 'SID'
    column lock_type      format a15     heading 'Lock|Type'
    column mode_held      format a11     heading 'Mode|Held'
    column mode_requested      format a10     heading 'Mode|Request'
    column lock_id1      format a8     heading 'Lock ID1'
    column lock_id2      format a8     heading 'Lock ID2'
    column first_load_time  format a19     heading 'Requested'
    break on lock_id1
    select a.sid,
           username,
           terminal,
           decode(a.type,'MR', 'Media Recovery',
                      'RT', 'Redo Thread',
                   'UN', 'User Name',
                   'TX', 'Transaction',
                   'TM', 'DML',
                   'UL', 'PL/SQL User Lock',
                   'DX', 'Distributed Xaction',
                     'CF', 'Control File',
                   'IS', 'Instance State',
                   'FS', 'File Set',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'TS', 'Temp Segment',
                   'IV', 'Library Cache Invalidation',
                   'LS', 'Log Start or Switch',
                   'RW', 'Row Wait',
                   'SQ', 'Sequence Number',
                   'TE', 'Extend Table',
                   'TT', 'Temp Table', a.type) lock_type,
            decode(a.lmode,0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.lmode)) mode_held,
       decode(a.request,
       0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.request)) mode_requested,
       to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
       c.object object,
       d.sql_text sql,
       e.first_load_time
    from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
       where (id1,id2) in
         (select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
         b.id2=a.id2 and b.request>0) and
         a.sid = v$session.sid and
         a.sid = c.sid and
         d.address = v$session.sql_address and
         d.hash_value = v$session.sql_hash_value and
         d.address = e.address
    order by a.id1, a.lmode descCheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • Oracle 10g: Table Compress

    Guys,
    I was reading an article about table compression that I was reading for data warehousing environment.
    http://www.oracle.com/technology/products/bi/db/10g/pdf/twp_data_compression_10gr2_0505.pdf
    I didnt understand couple of things like
    Oracle’s compression algorithm is based upon eliminating duplicate values in each block - what does eliminating duplicate values in each block mean
    ALTER TABLE ... MOVE COMPRESS works in 10g what is its equivalent in Oracle 9i.
    Also is there a concept of table compression in Oracle 9i
    Any inputs/suggestions would help
    Thanks

    what does eliminating duplicate values in each block meanThat a compression method. Have only once the same info. That doesn't drop from the table duplicate rows. Important phrase is here :
    "Duplicate values in all the rows and columns in a block are stored once at the beginning of the block, in what is called a symbol table for that block. All occurrences of such values are replaced with a short reference to the symbol table."
    Also is there a concept of table compression in Oracle 9iThere is such thing :
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_73a.htm#2128735
    Nicolas.

Maybe you are looking for