函数的应用浅析_oracle_脚本之家,0002错误解决办

2019-11-25 18:43 来源:未知

表函数可接受查询语句或游标作为输入参数,并可输出多行数据。该函数可以平行执行,并可持续输出数据流,被称作管道式输出。应用表函数可将数据转换分阶段处理,并省去中间结果的存储和缓冲表。

Linux下安装Oracle 11g出现prvf-0002错误解决办法

1、在SQL Plus下,以DBA身份登陆

澳门金莎娱乐网站,1. 用游标传递数据

Linux下安装Oracle 11g,有时会提示一个错误:

用户名/密码@服务器SID as sysdba

利用游标 REF CURSOR 可将数据集传递到PL/SQL函数:

提示是不能获取本地节点名。

方法一:

SELECT * FROM TABLE (myfunction (CURSOR ); 

PRVF意思应是安装前的检查,没有查出缩写,我猜是Pre-Requisite VeriFication的缩写。若错了还请指正。

C:/Documents and Settings/ssy>sqlplus sys/system@test as sysdba

2. 利用两个实体化视图作为样板数据

使用oerr工具看看,

SQL*Plus: Release 9.2.0.1.0 - Production on 星期一 3月 17 18:01:41 2008 Copyright 1982, 2002, Oracle Corporation. All rights reserved. 连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production

CREATE MATERIALIZED VIEW sum_sales_country_mvBUILD IMMEDIATEREFRESH COMPLETEENABLE QUERY REWRITEASSELECT SUBSTR (s.calendar_month_desc, 1, 4) YEAR, c.country_id country, SUM  sum_amount_sold FROM sum_sales_month_mv s, customers c WHERE s.cust_id = c.cust_id AND c.country_id IN ('US', 'UK', 'FR', 'ES', 'JP', 'AU')GROUP BY SUBSTR (s.calendar_month_desc, 1, 4), c.country_id

CREATE MATERIALIZED VIEW sum_es_gend_mvBUILD DEFERREDREFRESH FASTENABLE QUERY REWRITEASSELECT SUBSTR (s.calendar_month_desc, 1, 4) YEAR, s.calendar_month_desc cal_month, c.cust_gender, SUM  sum_amount_sold FROM sum_sales_month_mv s, customer c WHERE s.cust_id = c.cust_id AND c.country_id = 'ES' AND sunstr (s.calendar_month_desc, 1, 4) = '2000'GROUP BY SUBSTR (s.calendar_month_desc, 1, 4), s.calendar_month_desc, c.cust_gender;
oerr prvf 00020002, ERROR_LOCAL_NODENAME_NOT_FOUND, "Could not retrieve local nodename"// *Cause: Unable to determine local host name using Java network functions.// *Action: Ensure that hostname is defined correctly using the 'hostname' command.

方法二:

3. 定义对象类型和基于对象类型的表类型

Oracle安装界面采用java语言编写,这里在使用java网络函数的时候无法确定本地主机名,所以提示此错误。解决建议是确保使用hostname命令可以得到正确的主机名。

C:/Documents and Settings/ssy>sqlplus /nolog SQL*Plus: Release 9.2.0.1.0 - Production on 星期一 3月 17 17:59:08 2008 Copyright 1982, 2002, Oracle Corporation. All rights reserved.

定义对象类型并且为进一步引用做好准备。

回想一下,确实开始改过主机名,hostname和/etc/hosts文件中可能不一致了。原始:

SQL> conn sys/system@test_192.168.80.38 as sysdba 已连接。SQL> quit

定义对象类型:TYPE sales_country_t

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

改为127.0.0.1 hostname主机名 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 hostname主机名 localhost localhost.localdomain localhost6 localhost6.localdomain6

2、查看用户的proifle是哪个,一般是default:

CREATE MATERIALIZED VIEW sum_es_gend_mvBUILD DEFERREDREFRESH FASTENABLE QUERY REWRITEASSELECT SUBSTR (s.calendar_month_desc, 1, 4) YEAR, s.calendar_month_desc cal_month, c.cust_gender, SUM  sum_amount_sold FROM sum_sales_month_mv s, customer c WHERE s.cust_id = c.cust_id AND c.country_id = 'ES' AND sunstr (s.calendar_month_desc, 1, 4) = '2000'GROUP BY SUBSTR (s.calendar_month_desc, 1, 4), s.calendar_month_desc, c.cust_gender;

再次开启runInstaller,可使用了:

sql>SELECT username,PROFILE FROM dba_users;

定义表类型:TYPE SUM_SALES_COUNTRY_T_TAB

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

3、查看指定概要文件的密码有效期设置:

CREATE TYPE sum_sales_country_t_tab AS TABLE OF sales_country_t;
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';

定义对象类型:TYPE sales_gender_t

4、将密码有效期由默认的180天修改成“无限制”:

TAG标签:
版权声明:本文由澳门金莎娱乐网站发布于数据库,转载请注明出处:函数的应用浅析_oracle_脚本之家,0002错误解决办