oracle12c

Is there a LISTAGG WITHIN GROUP equivalent in SQLAlchemy?

冷暖自知 提交于 2019-12-07 12:37:06
问题 Here is a simple Oracle table: +-----------+---------+ | food | person | +-----------+---------+ | pizza | Adam | | pizza | Bob | | pizza | Charles | | ice cream | Donald | | hamburger | Emma | | hamburger | Frank | +-----------+---------+ And here are the results of an aggregated SELECT I'd like to do: +-----------+------------------+ | food | people | +-----------+------------------+ | hamburger | Emma,Frank | | ice cream | Donald | | pizza | Adam,Bob,Charles | +-----------+----------------

Oracle12C中scott账户与表问题

不羁的心 提交于 2019-12-07 08:27:43
安装了12c版本,发现没有scott用户和11g自带的emp,dept等等的表。于是尝试解锁用户,发现用户不存在。 SQL> alter user scott account unlock; alter user scott account unlock * ERROR at line 1: ORA-01918: user 'SCOTT' does not exist 手动创建用户,出错,和11g不太一样: SQL> create user scott identified by oracle; create user scott identified by oracle * ERROR at line 1: ORA-65096: invalid common user or role name 原因和pdb,cdb有关。Oracle 12C引入了CDB与PDB的新特性,在ORACLE 12C数据库引入的 多租用户环境(Multitenant Environment) 中,允许一个 数据库容器(CDB) 承载多个 可插拔数据库(PDB) 。 CDB全称为Container Database,中文翻译为数据库容器,PDB全称为Pluggable Database,即可插拔数据库。 在ORACLE 12C之前,实例与数据库是一对一或多对一关系(RAC):即一个实例只能与一个数据库相关联

Unique index vs. unique constraint that uses a unique index

只愿长相守 提交于 2019-12-07 07:49:27
问题 I am trying to compare two schemas to ensure that they are in sync. In one schema, I see a unique index on 2 columns. In addition to this, I see a unique constraint that uses the unique index. I'm new to Oracle, but my general understanding and according to this a unique constraint only ensures no duplicates, that it isn't necessarily indexed. For performance an index should be added over the FK columns to allow the constraint to be performed efficiently. In my target database, I have only

running oracle imp / exp in Ubuntu 14.04.3

杀马特。学长 韩版系。学妹 提交于 2019-12-07 06:15:23
问题 After installing the oracle packages oracle-instantclient12.2-basiclite-12.2.0.1.0-1.x86_64.rpm and oracle-instantclient12.2-tools-12.2.0.1.0-1.x86_64.rpm with alien -i I want to run the exp utility, but I got an error root@localhost:/usr/lib/oracle/12.2/client64/bin# ./exp ./exp: error while loading shared libraries: libclntsh.so.12.1: cannot open shared object file: No such file or directory root@localhost:/usr/lib/oracle/12.2/client64/bin# export declare -x DERBY_HOME="/usr/lib/jvm/java-8

Driver update to ojdbc7.jar gives error for oracle/security/pki/OraclePKIProvider

只愿长相守 提交于 2019-12-07 02:10:09
问题 I have been using ojdbc14.jar earlier and now want to upgrade it to ojdbc7.jar for supporting oracle12c. But while connecting server gives error for "oracle/security/pki/OraclePKIProvider". If I add oraclepki.jar to the classpath server starts up properly without any error. I am trying to figure out what special got added in ojdbc7.jar that its asking me to add oraclepki.jar, As with ojdbc14.jar it never asked me to add oraclepki into my classpath. Does anyone know what changes with ojdbc7

Oracle TO_DATE NOT throwing error

喜夏-厌秋 提交于 2019-12-06 17:30:41
问题 I just spotted curious behaviour of oracle TO_DATE function when used with format_mask parameter. Basically, what I see is that in one case it ignores given format mask, and parses input with its own mask, and in other cases it throws an exception. Example I expected behaviour - error thrown: SELECT TO_DATE('18-02-2016', 'DD/MON/YYYY') FROM dual ORA-01843: not a valid month Example II unexpected behaviour - date parsed: SELECT TO_DATE('18-feb-2016', 'DD/MM/YYYY') FROM dual February, 18 2016

Managed Oracle Client with Oracle Advanced Security Options

我只是一个虾纸丫 提交于 2019-12-06 16:46:48
On October 14th, Oracle release the latest version of their Oracle Managed Client which was described to support Network Data Encryption. http://www.oracle.com/technetwork/topics/dotnet/tech-info/odac12cr4ds-2704217.pdf https://www.nuget.org/packages/Oracle.ManagedDataAccess/ Although for some reason after trying multiple configuration, we still weren't able to get it to work. We keep getting the infamous ORA-12570: Network Session: Unexpected packet read error exception wrapped in The provider did not return a ProviderManifestToken string . The error in the alert log is the following TNS

Oracle Query to rollup QTY by Year- only last 3 years

对着背影说爱祢 提交于 2019-12-06 12:02:56
I have a requirement to find out MAX VALUE from SUM of Quantities Divided by YEAR (Need to write a Oracle Query). For Example ITEM_ID ORG_ID YEAR QTY 100 121 2015 10 100 121 2016 5 100 121 2017 8 101 146 2014 10 101 146 2015 11 101 146 2016 12 101 146 2017 13 My Output should be like this :- for Item_id 100,121 the max_avg should be max(10+5+8/3, 5+10/2, 10/1)... max (7.6, 7.5, 8) = 8 for Item_id 101,146 the max_avg should be (11+12+13/3, 12+13/2, 13/1)... max(11.5, 12, 12.5, 13) = 13... I should not consider 10+11+12+13/4 . I only need the consider the AVG rolled up by last 3 years and assign

How to connect to Azure Oracle 12c Database using sqlplus or sql developer cloud connection

五迷三道 提交于 2019-12-06 11:50:20
问题 I have 2 VM in azure one is a DB server and the other is a web server. I can get remote desktop connection for both these servers and web server can connect to Database wih sqlplus user/password@internal_network_ip:port/sid But however I cannot connect to Cloud DB from my local system. I tried sqlplus user/password@internal_ip:8552/sid ORA-12170: TNS:Connect timeout occurred sqlplus user/password@xxxx.something.net:8552/sid -- oracle port ORA-12170: TNS:Connect timeout occurred sqlplus user

When “PARTITION LIST SUBQUERY” is in the execution plan something (a bug?) de-instantiates the package

久未见 提交于 2019-12-06 10:26:23
问题 Is this an Oracle 12c bug? I run 64-bit Oracle 12.1.0.2 on Oracle Linux. Came across a strange thing: when the execution plan switches to using "PARTITION LIST SUBQUERY" then the package used in the affected query is loosing all of its variable's values. It looks like something de-instantiates the package just like after running DBMS_SESSION.RESET_PACKAGE. The query uses a partitioned table which partitions are limited by joining with another table limited using a variable from the package