Oracle

windows下怎样测试oracle安装是否成功以及在oracle中创建用户并赋予用户权限;和[Err] ORA-65096: 公用用户名或角色名无效的解决方案

元气小坏坏 提交于 2021-02-10 08:01:08
测试oracle数据安装是否成功,可 按顺序 执行以下两个步骤: 测试步骤 1: 请执行操作系统级的命令: tnsping orcl 上述命令假定全局数据库名是 orcl。以下是命令执行后的示例( 请在cmd命令窗口手工输入红色部分文字): C:\> tnsping orcl 其中, 结果 OK 至关重要 。 上述结果如果正确,表明侦听器配置无误。 步骤 2: 请执行操作系统级的命令: sqlplus system/password@orcl 上述命令假定 SYSTEM 用户对应的口令是 password,此处输入的password为你实际安装oracle时设置的口令密码。假定全局数据库名是 orcl。 以下是命令执行后的示例(请手工输入红色部分文字): C:\> sqlplus system/password@orcl 接下来 1. 打开Navicat,链接Oracle 2. Ctrl+Q,进入查询窗口创建用户。 创建用户的时候用户名以c##或者C##开头。(具体原因参见Oracle的官方文档https://docs.oracle.com/database/121/DBSEG/users.htm#DBSEG99780)下面是我在官方文档上面截的图 错误写法: create user zyt identified by 1234; 正确写法: create user c##zyt

PL/SQL assigning query results to a CLOB

僤鯓⒐⒋嵵緔 提交于 2021-02-10 07:54:30
问题 I have a problem, I am creating an CLOB variable with the contents of a query in oracle to email to users, the problem is that it does email as .csv but with no contents. I can not find the problems: CREATE OR REPLACE PROCEDURE trackekr(cursor1 IN OUT SYS_REFCURSOR) AS v_connection UTL_SMTP.connection; v_clob CLOB := EMPTY_CLOB(); v_len INTEGER; v_index INTEGER; c_mime_boundary CONSTANT VARCHAR2(256) := 'the boundary can be almost anything'; rec NUMBER(10, 0) := 0; d_id NUMBER(10, 0) := 0;

Spark/Scala load Oracle Table to Hive

对着背影说爱祢 提交于 2021-02-10 05:59:06
问题 I am loading few Oracle tables to Hive, it seems to be working but 2 tables are getting error - IllegalArgumentException: requirement failed: Decimal precision 136 exceeds max precision 38 I checked Oracle table and there is no column with Decimal (136) precision, in the source. Here is the Spark/Scala code in spark-shell : val df_oracle = spark.read.format("jdbc").option("url", "jdbc:oracle:thin:@hostname:port:SID").option("user",userName).option("password",passWord).option("driver", "oracle

I am trying to extract an XMLTYPE column from an Oracle table using JDBC and having some issues

跟風遠走 提交于 2021-02-10 05:53:20
问题 I am trying to extract an XMLTYPE column from an Oracle table using JDBC. I have the query: select "XML_FILE" FROM "TABLE_NAME" and when I run the query in the Oracle SQL Developer, it returns back all the XMLTYPE rows completely fine. But, when I run the following Java code, and run the same query, I always get "null" returned for every column. I'm not sure what could be going wrong and I've tried doing many different things, but nothing has been working. Important note - the XMLTYPE fields

How to solved problem with Oracle DBMS_LOB

痴心易碎 提交于 2021-02-10 05:52:16
问题 I am trying to save the information of an XML file in a database table and I am using this procedure: create or replace PROCEDURE P_FILEUPLOAD_XML (P_CMTT_CODE IN NUMBER DEFAULT 15, P_TEXT IN VARCHAR2, P_TEXT_NAR IN VARCHAR2, P_PATH IN VARCHAR2, P_FILENAME IN VARCHAR2, P_RET_VAL OUT NUMBER) IS GRUPO VARCHAR2(20); l_dir CONSTANT VARCHAR2(35) := P_PATH; l_fil CONSTANT VARCHAR2(30) := P_FILENAME; l_loc BFILE; -- Pointer to the BFILE l_ret BOOLEAN := FALSE; -- Return value l_pos NUMBER := 1; --

JPA+ORACLE: Can't pass boolean param to my stored procedure

旧时模样 提交于 2021-02-10 05:42:05
问题 I can not pass boolean param to my stored procedure in Oracle. If I set value directly in the query text (mypackage.Test(?, false, ?, ?);) all work fine... jdbc-driver: ojdbc6.jar container: Tomcat 7.0.28 hibernate-core+hibernate-entitymanager: 4.1.6.Final oracle: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production Here my realization: EntityManager em = defaultFactory.createEntityManager(); em.createNativeQuery("BEGIN mypackage.Test(?, ?, ?, ?); END;")// .setParameter(1, factId)//

Does the order of tables in straight joins, with no hint directives, affect performance?

折月煮酒 提交于 2021-02-10 05:38:16
问题 All SQL-based RDBMS' (versions up to 10 years old): Does the order of tables in a straight join query (with no hint directives) make a difference for optimum performance and memory management? I heard that the last join should be the largest table. How does your DB's query optimizer handle this scenario? 回答1: Just to add more on the subject... YES and NO, depends. That is my answer. It depends on many factors, wich RDBMS you are using (MySQL, MSSQL Server, Oracle, DB2...), type of join, size

Does the order of tables in straight joins, with no hint directives, affect performance?

£可爱£侵袭症+ 提交于 2021-02-10 05:38:12
问题 All SQL-based RDBMS' (versions up to 10 years old): Does the order of tables in a straight join query (with no hint directives) make a difference for optimum performance and memory management? I heard that the last join should be the largest table. How does your DB's query optimizer handle this scenario? 回答1: Just to add more on the subject... YES and NO, depends. That is my answer. It depends on many factors, wich RDBMS you are using (MySQL, MSSQL Server, Oracle, DB2...), type of join, size

Parse Json using Oracle SQL - JSON_TABLE

随声附和 提交于 2021-02-10 05:33:11
问题 I am trying to parse JSON using JSON_TABLE. Oracle DB version 12.1.0.2 { "Rownum": "1", "Name": "John", "AddressArray":["Address1", "Address2"], "TextObj":[{ "mName" : "Carol", "lName" : "Cena" }, { "mName" : "Mark", "lName" : "Karlo" } ] } Tried with below query but not getting expected result. select * from json_Table( '{ "Rownum": "1", "Name": "John", "AddressArray":["Address1", "Address2"], "TextObj":[{"mName" : "Carol","lName" : "Cena"}, {"mName" : "Mark","lName" : "Karlo"} ] }', '$'

oracle instantclient_11_2插件安装

痞子三分冷 提交于 2021-02-10 04:29:30
1.安装plsql 2.instantclient_11_2下载,解压到目录 D:\DevTools\instantclient_11_2 3.打开plsql, 点击“取消” 4.选择“工具”--》首选项---》连接--》oracle主目录填写D:\DevTools\instantclient_11_2 OCI库填写 D:\DevTools\instantclient_11_2\oci.dll 5.修改文件D:\DevTools\instantclient_11_2\NETWORK\ADMIN\tnsnames.ora WFZB_243 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = xxxx) ) ) 一. 目录结构 C:\PLSQL |-- instantclient_11_2 |-- tnsnames.ora |-- PLSQL Developer |-- readme.txt 二. 环境变量 NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK TNS_ADMIN = C:\software\PLSQL