oracle11g

ORA 12514 error:TNS listener error

荒凉一梦 提交于 2019-12-04 11:39:10
Ok everything worked fine till yesterday now i am suddenly getting this error ORA-12514: TNS:listener does not currently know of service requested in connect descriptor nothing had been modified XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = jainam-2b1c493d)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) ) EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY =

How to Connect Airflow to oracle database

余生颓废 提交于 2019-12-04 11:34:07
问题 I am trying to create a connection to an oracle db instance (oracle:thin) using Airflow. According to their documentation I entered my hostname followed by port number and SID: Host: example.com:1524/sid filled other fields as: Conn Type : Oracle Schema : username ( documentation says: use your username for schema ) Login : username Password : * * * After connection is setup, it gives the save error code for every query that I tried to execute ( ORA-12514 ). It seems like oracle doesn't let

Window functions SORT costly, can we overcome it?

怎甘沉沦 提交于 2019-12-04 11:27:23
My Requirement: Identify top 10 accounts of a DEPT_NUM , ordered by the account number in ascending order. Query: SELECT * FROM ( select acctnum,dept_num,row_number() OVER (PARTITION BY DEPT_NUM ORDER BY ACCTNUM) as row_identifier FROM MYTABLE ) WHERE row_identifier between 1 and 10; Trace: 7532 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 1480074522 -------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | ------------------------

Oracle — Import data into a table with a different name?

江枫思渺然 提交于 2019-12-04 11:15:47
I have a large (multi-GB) data file exported from an Oracle table. I want to import this data into another Oracle instance, but I want the table name to be different from the original table. Is this possible? How? Both importing and exporting systems are Oracle 11g. The table includes a BLOB column, if this makes any difference. Thanks! UPDATES : The idea here was to update a table while keeping the downtime on the system that's using it to a minimum. The solution (based on Vincent Malgrat 's answer and APC 's update) is: Assuming our table name is A Make a temp schema TEMP_SCHEMA Import our

Oracle specific timestamp format 'DD-MON-RR HH.MI.SSXFF AM'

蓝咒 提交于 2019-12-04 10:20:29
I have a problem with Oracle 11g specific timestamp format. This is what I have: select to_timestamp('21-OCT-15 08.24.30.000000000 PM','DD-MON-RR HH.MI.SSXFF AM') from dual; Response from database: ORA-01855: AM/A.M. or PM/P.M. required 01855. 00000 - "AM/A.M. or PM/P.M. required" I have also tried to alter session settings with several commands and still nothing. alter session set NLS_LANGUAGE='ENGLISH'; alter session set NLS_DATE_LANGUAGE='ENGLISH'; alter session set NLS_TIMESTAMP_FORMAT = 'DD-MON-RR HH.MI.SSXFF AM'; alter session set NLS_TIMESTAMP_TZ_FORMAT='DD-MON-RR HH.MI.SSXFF AM'; I can

deserialize java object from a blob

a 夏天 提交于 2019-12-04 10:18:09
first of all, i apologize, i'm about to ask a set of dumb questions. i don't know java AT ALL and i don't know if we are allowed to ask questions like these. if not - delete my topic. there's a table in oracle that stores a blob. it's binary and i'm able to decode it, the output looks like this ¬í sr /com.epam.insure.credentialing.forms.StorageBeanÀÓ ¯w/§ L variablest Ljava/util/Map;xpsr java.util.HashMapÚÁÃ`Ñ F loadFactorI thresholdxp?@ w t $_hasCompletedt t $_wf_progresssr java.lang.Integerâ ¤÷‡8 I valuexr java.lang.Number†¬•”à‹ xp t $_wf_statussq ~ t $_form_instance_idsr java.lang.Long;‹äÌ

Query which will give a list of dates between two date ranges

爷,独闯天下 提交于 2019-12-04 10:09:09
My question is similar to following question: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:14582643282111 The difference is my inner query returns two records and I have outer query. I need to write inner query something like this which will give me a list of dates between two date ranges (I am trying this query whcih does not execute). Select * from outerTable where my_date in ( select to_date(r.REQ_DATE) + rownum -1 from all_objects, (MY_INNER_QUERY Where ID =100) r where rownum <= to_date(r.DUE_DATE,'dd-mon-yyyy')-to_date(r.REQ_DATE,'dd-mon-yyyy')+1; ) My inner query

SQL query to resolve transitive dependencies in database

断了今生、忘了曾经 提交于 2019-12-04 09:53:19
SQLFIddle link for this data. Suppose I have a table with following Structure: create table rd(r1 number,r2 number, primary key (r1,r2)); Sample Data: | R1 | R2 | ----------- | 1 | 2 | | 1 | 4 | | 2 | 3 | | 3 | 1 | | 4 | 5 | What it means is that R1 is related to R2 , bi-directionally. So if there is an entry in database for 1,3 there won't be an entry like 3,1. According to above data: 1 is related to 2,4,3 directly. And 4 is related to 1 also . So via transitive dependency, 1 and 5 are also considered as related. Expected result: | R1 | R2 | ----------- | 1 | 2 | | 1 | 4 | | 1 | 3 | | 1 | 5

About create table as select (CTAS)

孤街醉人 提交于 2019-12-04 09:22:23
When we do: create table big2 as select * from big1; Are the indexes and constraints also copied over to the new table? Only NOT NULL constraints are copied. See FAQ . You can do CREATE TABLE big2 (bigid PRIMARY KEY) AS SELECT * FROM big1 tp create a primary key, but yes, for other indexes you'll want to copy and run the index creation scripts. Just for info, there is a simple way to remember indexes to recreate them after deleting source table: SELECT DBMS_METADATA.get_ddl('INDEX', index_name) FROM user_indexes WHERE TABLE_NAME = 'BIG1'; 来源: https://stackoverflow.com/questions/7798727/about

Change NLS Character set parameters on Oracle 11g XE

点点圈 提交于 2019-12-04 09:21:36
I am using Oracle 11g Express Edition. Currently when I check NLS character set parameter using SELECT * FROM nls_database_parameters; it gives the default values: NLS_CHARACTERSET: AL32UTF8 NLS_NCHAR_CHARACTERSET: AL16UTF16 I want to set both these parameters to UTF8. How can I do so? I have just installed Oracle 11g XE, so there is not data except those required by Oracle itself. Gary This worked for me where an application was checking for UTF8 rather than AL32UTF8 . SQL> shutdown immediate; SQL> startup restrict SQL> select name from v$database; SQL> ALTER DATABASE CHARACTER SET INTERNAL