Execute on DBMS_LOB
ORDS 2.0.10 on Tomcat 8.0.15
Oracle Database 11.1
We recently refreshed our database and tightened up security and to my surprise, APEX with OHS/Apache still works fine but APEX on ORDS gives an error about needing execute on DBMS_LOB.
Questions
1. Is it sufficient to grant EXECUTE access to just APEX_PUBLIC_USER or is a PUBLIC grant required?
2. More importantly, why does OHS *not* need the grant?!
Thanks
Request Path passes syntax validation
Mapping request to database pool: PoolMap [_failed=false, _lastUpdate=-1, _pattern=null, _poolName=apex, _regex=null, _type=REGEX, _workspaceIdentifier=null, _serviceName=null]
Applied database connection info
Attempting to process with PL/SQL Gateway
==== Processing Request: ====
GET /apex/
==== Headers in Request ====
accept: text/html, application/xhtml+xml, */*
accept-language: en-US
user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
accept-encoding: gzip, deflate
host: foo.bar.com:8080
connection: Keep-Alive
cookie: ORA_WWV_REMEMBER_UN=ADMIN:xxx; _ga=GA1.2.130838378.1414603134
authorization: YIIKWwYGKwYBBQUCoIIK....
==== Cookies in Request ====
ORA_WWV_REMEMBER_UN = ADMIN
_ga = GA1.2.130838378.1414603134
Using default page: apex
SID: 997
isValidRequest(), procedure name: <apex>
Validating: apex
*** Total number of arguments: 1
Parse: 1 ms
begin
apex;
commit;
end;
*** Total number of arguments: 1
Exec: 13 ms
get_page FAILED:ORA-06550: line 16, column 7:
PLS-00201: identifier 'DBMS_LOB' must be declared
ORA-06550: line 16, column 7:
Looking closer at the Java error stack, I see this
at oracle.dbtools.apex.OWA.getPage(OWA.java:258)
I realize that Oracle's out-of-the-box installation grants access to PUBLIC on all the Oracle-supplied SYS.DBMS_* packages but our environment has heightened security by revoking public access and granting access only to specific accounts that need the access, including APEX_xxxxxx.
But since this "getPage" is a new component introduced as a side-effect of using ORDS (as opposed to other deployment options like OHS or EPG), maybe the documentation should make it clear that the minimally privileged database user APEX_PUBLIC_USER needs EXECUTE privilege on SYS.DBMS_LOB when using ORDS.
Thanks
Similar Messages
-
Dbms_lob.createtemporary
If I issue a
dbms_lob.createtemporary(X, TRUE,dbms_lob.call);
command within a PL/SQL procedure is it necessary to follow up with a
dbms_lob.close(X)
command or by its temporary nature will it automatically close and free itself up when the procedure ends.
I have taken over support for some code which uses temporary lobs and I an unfamiliar with them
The code executes a
dbms_lob.FREETEMPORARY(X)
prior to the
dbms_lob.createtemporary(X, TRUE,dbms_lob.call)
but it seems to be throwing an exception (in most if not all circumstances, I haven't managed to spend the time monitoring the exceptions yet)
ThanksDo not only create temporary lobs but also remove them
dbms_lob.FREETEMPORARY
Regards
Marcus -
Database security with PUBLIC EXECUTE privileges for Application Express
I recently tried installing APEX into an existing database containing a data warehouse. Security on this database is quite controlled and PUBLIC EXECUTE to SYS owned objects had been removed. Ie there was no PUBLIC EXECUTE on:
DBMS_LOB
UTL_HTTP
UTL_FILE
UTL_SMTP
UTL_RAW.
When I tried to install APEX, I got all kinds of errors and logged a TAR. The analyst told me to grant execute to public to the above SYS owned objects. This contradicts the "Policies" in 10G Grid control and the Metalink Notes 131752.1 &
Note:247093.1.
Can these execute privileges be changed to another user in the htmlDB
application such as FLOWS_FILES? Or HTMLDB_PUBLIC_USER? What is the security reccomendations for Oracle Application Express? Calling any product managers out there....Developers/users have started clicking around and are now getting errors. There is a function called CUSTOM_AUTH and one called CUSTOM_HASH which do not compile. They have complain about not seeing UTL_RAW so had been relying on PUBLIC synonyms. here's the 1 function:
create or replace function custom_hash (p_username in varchar2, p_password in varchar2)
return varchar2
is
l_password varchar2(4000);
l_salt varchar2(4000) := '2ZVKZMILYMGVFRFXOZIVZ72RJNJY8V';
begin
-- This function should be wrapped, as the hash algorhythm is exposed here.
-- You can change the value of l_salt or the method of which to call the
-- DBMS_OBFUSCATOIN toolkit, but you much reset all of your passwords
-- if you choose to do this.
l_password := utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5
(input_string => p_password || substr(l_salt,10,13) || p_username ||
substr(l_salt, 4,10)));
return l_password;
end; -
Error while deploying a mapping in owb 11.2
Hi,
I am using OWB 11.2 and when i try to deploy a mapping i get the following error. Is it some permission issue.
Please let me know if anyone has faced similar issue. Its very urgent.
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_LOB' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_LOB' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3530)
at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4718)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1062)
at sqlj.runtime.ExecutionContext$OracleContext.oracleExecuteUpdate(ExecutionContext.java:1570)
at oracle.wh.service.impl.runtime.runtime_access.RuntimeDeploymentDefiner.defineDeployment(RuntimeDeploymentDefiner.java:1094)
at oracle.wh.service.impl.runtime.RuntimePlatformServiceImpl.createDeploymentAuditId(RuntimePlatformServiceImpl.java:1409)
at oracle.wh.ui.runtime.application.WHRuntimeCommandGenerateDeploy._internalDeploy(WHRuntimeCommandGenerateDeploy.java:2382)
at oracle.wh.ui.runtime.application.WHRuntimeCommandGenerateDeploy.doDeploymentAsynch(WHRuntimeCommandGenerateDeploy.java:2117)
at oracle.wh.ui.runtime.application.WHRuntimeCommandGenerateDeploy.doDeploymentAsynch(WHRuntimeCommandGenerateDeploy.java:2112)
at oracle.wh.ui.runtime.application.WHRuntimeCommandHandler$3.construct(WHRuntimeCommandHandler.java:1194)
at oracle.wh.ui.runtime.SwingWorker$2.run(SwingWorker.java:124)
at java.lang.Thread.run(Thread.java:595)Hi,
have you tried to grant the user you use for connecting:
GRANT EXECUTE ON DBMS_LOB TO your_usr WITH GRANT OPTIONYou need the "WITH GRANT OPTION" if the sql is executed within some view or package.
Regards,
Carsten. -
i am using the following description to create a web service reference:
web reference :REST
Name :Yahoo Map
URL :http://local.yahooapis.com/MapsService/V1/mapImage
HTTP Method: GET
Basic Authentication: No
Add Parameter:
Name Type
appid String
location String
Output Format: XML
XPath to Output Parameters : /Result
Output Parameter:
Name Path Type
Url /text() String
Then i tried to create form and report on webservice:
Web Service Reference Type: Yahoo Map
Operation: doREST
All the fields i keep as default
I tick the checkbox (url)in report Parameter
After clicking next whereever required i click create button
I get the following error
ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
Please someone help to solve this as i need to fix it urgently.i exported the application from apex.oracle.com and imported it to our environment
import went fine, but when I ran the IR page I got
ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
evidently the problem is a lack of public execute on DBMS_LOB, which is used in the generated IR source.
while waiting for the DBA to grant privs on DBMS_LOB, changing the dbms_lob.getlength call to length() fixes the IR.
however, i am not getting the download link on the associated form page... changed templates, that's not the issue -- we'll see if that's a dbms_lob issue as well -
Procedure to create new table using existing metadata
Hi All,
THis is what I want to achieve,
I want to create procedure which will take a input parameter as name of a table lets say 'EMP',
and this procedure will check whether that table exist or not?
if exist then
it will create a new table with name appending _dummy to existing table name (ex: new table will be EMP_DUMMY) ,
and new table should have the same table structure ,index and constraint imposed on EMP table.
NB: It should not be created using as select like create table EMP_DUMMY as select * from EMP where condition=false;
Can any one please help me how to achieve this?Hi,
you can use the DBMS_METADATA package
declare
cddl clob;
ctable varchar2(80):='EMP';
cowner varchar2(80):='HR';
begin
cddl:=dbms_metadata.get_ddl ('TABLE',ctable,cowner);
cddl:=replace(cddl, 'CREATE TABLE "'||cowner||'"."'||ctable||'"','CREATE TABLE "'||cowner||'"."'||ctable||'_DUMMY"');
dbms_output.put_line(substr(cddl,1,1200));
execute immediate dbms_lob.substr(cddl,least(dbms_lob.getlength(cddl),32000));
cddl:=dbms_metadata.get_dependent_ddl ('INDEX',ctable,cowner);
cddl:=replace(cddl,'ON "'||cowner||'"."'||ctable,'ON "'||cowner||'"."'||ctable||'_DUMMY');
execute immediate dbms_lob.substr(cddl,least(dbms_lob.getlength(cddl),32000));
end;but you'll need to adapt (ex: existing contraint name etc) -
Performing filtering, highlights or markups on searches
Greetings,
I have developed a content management system which stores, searches etc a table containing different kinds of electronic documents stored as BLOBs. I am trying to integrate into the search function the ability to display a hundred or so characters including the matching query words and the surrounding text. I have managed to do this and have come up with several possible alternatives. The problem is that all of them are too slow.
The first solution I came up with was to execute the CTX_DOC.MARKUP procedure, and then retrieve the CLOB to my application where I split it up according to the markup tags which served as delmiters and then selected the desired amount of text to display. This has several issues with it. The CLOB is passed back to the web application over the network, when only a fraction of it needs to be displayed. This roundtrip is excessive. This however is not the cause of the excessive slow in performance.
The second alternative would be to execute the CTX_DOC.HIGHLIGHT and MARKUP procedures, which would store the location of the query results in the markup up document. Once this is done, I would execute the dbms_lob.substr procedure combining the CLOB produced by MARKUP and the query offsets and lengths from HIGHLIGHT. First I would alter the lengths stored in the HIGHLIGHT result table so that the surrounding text would be displayed. I would then return a varchar2 with the results and display them in my application. This too however seems to take too long.
Does anyone know of an efficient way to highlight select terms and the surrounding text without resulting to executing such delaying procedures?We have solved this highlighting issue using XML and XSLT.
The database transforms the output of a query into XML, including the search terms used (by the user). A XSL style sheet transforms the XML into (X)HTML and the search terms will be highlighted in the text.
This works fast, also on multi-row pages. Ctx_doc can only highlight a single row at a time. -
I am doing an export and import with the DBMS_DATAPUMP api. I am doing a SCHEMA version. Do explicit table grants get included in the dump file. After I import the SCHEMA back into the database I have to regrant execute on DBMS_LOB and DBMS_SQL to my SCHEMA. Is this correct?
thanks.Hi,
Yes, this is correct. Let's say you are exporting schemas=scott, what will get exported are grants owned by scott, not grants given to scott.
Dean -
ORA-22288: file or LOB operation FILEOPEN failed
Hello,
I have a small db procedure that tries to load files into a tablecolumn using DBMS_LOB.LOADFROMFILE.
I use: create or replace directory FILES_DIR as '\\server\Attachments';
this is the place where the files are located. I can access this directory using my Windows login.
When i then execute 'select DBMS_LOB.FILEEXISTS', it says '1', so ok so far.
Before I can load I have to open the file using DBMS_LOB.OPEN.
However, when I execute the procedure it gives me the error ORA-222888...
My DB-services are started using my Windows login.
If I try to map a network drive like z: = '\\server\Attachments', DBMS_LOB.FILEEXISTS says '0'.
How can it be that the DB says yes the file exists, but no I can't open it while the services are running with logins that can actually access the files?
I' ve searched the internet all day, is there a solution?
Thanks in advance,
Frankwhen I use the mapped drive, the file doesn't even exists for the db:
DBMS_LOB.FILEEXISTS says '0'.
when I use the UNC format, the file actually exists but then gives the error ORA-2228 on DBMS_LOB.OPEN.
So I tried net use z: \\server\attachments /USER:x\y in cmd, but the file still doesn't exist for the db
I also tried 'net use \\machine\..' like you proposed but can't seem to understand it's meaning.
The actual question is how can I let the file exist for the db using a mapped network drive? -
How to configure webutil 1.06 with oracle Developer suite 10g R2
Hello everyone,
My computer configuration is
OS-> Windows 7 Ultimate (32-bit)
RAM-> 1GB
I have successfully installed oracle XE and developer suite 10g R2 in my computer. Now i want to configure webutil. Please give me the step-by-step procedure for it.
Thanks in advance.hi
plz search this forum u will find so many answered threads anyways.
plz read the following.
Webutil Settings
Requirements
· Download Jacob 1.8 archive and webutil 1.06
(Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
webutil can be downloaded from http://otn.oracle.com )
Database Setup
Login as SYS
create user webutil identified by webutil
default tablespace users
temporary tablespace temp;
grant connect, create session, create procedure, create public synonym to webutil;
grant resource, connect to webutil;
grant execute on dbms_lob to webutil;
login as webutl user and run
create_webutil_db.sql
create public synonym webutil_db for webutil.webutil_db;
grant execute on webutil_db to public;
set serveroutput on
declare
a boolean;
begin
a:=webutil_db.closeblob(1);
If a then
dbms_output.put_line('webutil/blob setup '||'TRUE');
else
dbms_output.put_line(' webutil/blob setup '||'FALSE');
end if;
end;
copy jacob.jar and copy frmwebutil.jar to ORACLE_HOME/forms/java directory.
Make sure you can download these using the below
http://machinename.com/forms/java/jacob.jar
http://machinename.com/forms/java/frmwebutil.jar
Create directory webutil under [OraHome]/forms/webutil and .
copy jacob.dll , JNIsharedstubs.dll, d2kwutil.dll
Check the permissions. Read /Execute
Forms.conf AliasMatch ^/forms/webutil/(..*)
$ORACLE_HOME/forms/webutil/$1"
http://machinename.com/forms/webutil/jacob.dll
http://machinename.com/forms/webutil/JNIsharedstubs.dll
http://machinename.com/forms/webutil/d2kwutil.dll
In the default.env update
WEBUTIL_CONFIG=/opt/oracle/product/10gas/forms/server/webutil.cfg
CLASSPATH=c:\temp\webutil\lib\frmwebutil.jar;c:\"Program Files"\Java\j2re1.4.2_06\lib\rt.jar (Include rt.jar)
Also include C:\Dev10g\forms\java\ frmall.jar
Settings for webutil.cfg
logging.file=c:\temp\webutil.log
logging.enabled=TRUE
logging.errorsonly=TRUE
logging.connections=TRUE
transfer.database.enabled=TRUE
transfer.appsrv.enabled=TRUE
transfer.appsrv.workAreaRoot=<Enter Directory /folder on Server>
transfer.appsrv.accessControl=TRUE
transfer.appsrv.read.1=<Enter Directory /folder on Server>
transfer.appsrv.write.1=<Enter Directory /folder on Server>
Entry in the formsweb.cfg
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=on
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=basejpi.htm
baseHTMLjpi=webutiljpi.htm
#archive_jini=frmall_jinit.jar
lookAndFeel=oracle
form=WELCOME.fmx
userid=webutil/Webutil$123@ORCL
width=955
height=545
jpi_download_page=https://java.sun.com/products/archive/j2se/1.4.2_09/index.ht ml
jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
jpi_codebase=https://java.sun.com/products/plugin/autodl/jinstall-1_4-windows- i586. cab#Version=1,4,0,0
jpi_mimetype=application/x-java-applet;version=1.4
Sign jacob.jar ( Not mandatory )
Open a DOS command prompt.
Add [OraHome]\jdk\bin to the PATH:
set PATH=[OraHome]\jdk\bin;%PATH%
Sign the file, and check the output for success:
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
[Previously this point stated that frmwebutil.jar also needed to be signed. This is no longer necessary and should not be done.]
Start Forms Builder and connect to a schema in the RDBMS used in step (4).
Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
If the PLX is not generated, the Webutil.pll library would have to be attached with
full path information to all forms wishing to use WebUtil. This is NOT recommended.
Create a new FMB.
Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
There is no need to Subclass the WebutilConfig object.
Attach the Webutil.pll Library, and remove the path.
Create a new button on a new canvas, with the code
show_webutil_information (TRUE);
in a WHEN-BUTTON-PRESSED trigger.
Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
the "Application Server URL" is empty.
Then append "?config=webutil" at the end, so you end up with a URL of the form
http://server:port/forms/frmservlet?config=webutil
Compile the webutil.pll and attach it to the fmb. Compile it
Debugging
Clear the browser cache and enable the jinitator / sun java plugin.
For Sun Java Plugin
Start ->Settings ->Control –Panel->Java->Advanced ->Show Java Console
Debugging ->Select All
Clear the plugin cache and once again access the URL. Make sure all the dlls,jar files
are getting downloaded.
FRM-92050 failed to connect to server /forms90/;90serlvet -1
oracle.forms.net,connectionexeption : form session failed during startup.
Java console shows -
When you are not able to download the webutil.jar file
java.lang.ClassNotFoundException:
java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source) at
java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
Cause
Ensure that the ORACLE_HOME in the .Env file points to a correct home.
Frm-40735 when-custom-item-event triger raised unhandled exception ora-06508
Cause
Ported webutil to Unix . The form appears , but when a call is made to webutil
functions, it resulted in the above error .The reason was PLL was not compiled
on unix .
Reference
Metalink Note 418970.1 ORA-06508 When Starting Webutil
Read / Write - image file
The code was not erroring out, but the image was not getting copied in the
image item .
Cause
transfer.appsrv.workAreaRoot=<name of the temp directory >
transfer.appsrv.accessControl=TRUE was not specified in the webutil.cfg file
The root of the location in which WebUtil can store temporary files
uploaded from the client.
While Writing Image file ( remember its the client to which the image
is written to ).
Example
client_image.write_image_file('d:\myimg\','GIF','CTRL.MY_IMG',
maximize_compression, original_depth);
Then ensure that on the thin client , there exist a directory called as "myimg" in the D drive .
One should watch out for the error in the console or the log depending on how
the logging has been set to .In case if the directory does not exist on the
client message appears that cannot create a file ...
These are the steps that occurs -
1) WebUtil creates a working directory that is private to the user
on the applciation server using the value of transfer.appsrv.workAreaRoot
This is that <ipaddress>\<ntuser name> directory
2) The basic forms Write Image file is used to extract a temporary copy
of the image into that directory.
3) The image is downloaded into the client machine and saved as the name
that you specified as the filename in the write_image_file command.
4) The temporary copy of the image held in the workAreaRoot on the Appserver
is cleaned up.
4) Client_host - The command is supposed to run the executable on the client .
But if you are trying to call an exe which is not in the path , you will not
get any error.
Error Message while opening the fmb in the forms builder
Add jacob.jar and frmwebutil.jar to CLASSPATH or FORMS_BUILDER_CLASSPATH ... otherwise there is an error message when opening the canvas in the new created fmb
{code}
hope this helps u.
sarah -
404 error after restoring the database
Friends, our dba team restored the Flows_030000 schema after a complete monthly refresh of our server (RMAN restore). Now when I try to access the APEX admin page or any of the applications it gives me a 404 error saying '/pls/apex/apex_admin/ was not found on this server'.
I looked at the apache error log file and found the following
mod_plsql: /pls/apex/apex_admin HTTP-404 ORA-04063: package body "FLOWS_030000.WWV_FLOW_SECURITY" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at "FLOWS_030000.F", line 276
ORA-06512: at "FLOWS_030000.APEX_ADMIN", line 5
ORA-06512: at line 10.
The RMAN refresh is a regular monthly process for us it was going smooth for the past one year ever since we deployed Apex 2.2. Last month we upgraded it to 3.0 and this is the first refresh after the upgrade.
I feel it is most probably a priveleges issue. But not sure what it could be.
Guys, any thoughts or any experiences facing the same kind of situation?You could do a new install in a different database and see what privileges the FLOWS_030000 schema has that were granted by SYS, for example (don't use these results):
SQL> select granted_role from dba_role_privs where grantee='FLOWS_030000';
GRANTED_ROLE
SELECT_CATALOG_ROLE
RESOURCE
CONNECT
SQL> select privilege from dba_sys_privs where grantee='FLOWS_030000';
PRIVILEGE
CREATE OPERATOR
DROP ANY DIRECTORY
CREATE PROCEDURE
CREATE JOB
CREATE ANY CONTEXT
CREATE DIMENSION
CREATE MATERIALIZED VIEW
ALTER DATABASE
CREATE ANY DIRECTORY
CREATE VIEW
CREATE CLUSTER
DROP USER
DROP TABLESPACE
CREATE ROLE
CREATE PUBLIC SYNONYM
CREATE SYNONYM
CREATE TABLE
CREATE INDEXTYPE
CREATE TRIGGER
EXECUTE ANY PROCEDURE
SELECT ANY TABLE
CREATE USER
CREATE DATABASE LINK
CREATE SEQUENCE
ALTER USER
CREATE TABLESPACE
ALTER SYSTEM
DROP PUBLIC SYNONYM
ALTER SESSION
CREATE LIBRARY
CREATE TYPE
31 rows selected.
SQL>
SQL> select owner||':'||table_name||':'||privilege from dba_tab_privs where grantee='FLOWS_030000' and grantor='SYS';
SYS:EXPORT_FILES_DEMO:WRITE
SYS:EXPORT_FILES_DEMO:READ
SYS:DBMS_REGISTRY:EXECUTE
SYS:UTL_FILE:EXECUTE
SYS:UTL_SMTP:EXECUTE
SYS:UTL_HTTP:EXECUTE
SYS:DBMS_LOB:EXECUTE
SYS:DBMS_LOCK:EXECUTE
SYS:DBMS_SYS_SQL:EXECUTE
SYS:DBMS_FLASHBACK:EXECUTE
SYS:DBMS_RLS:EXECUTE
SYS:DBMS_CRYPTO:EXECUTE
SYS:WWV_FLOW_VAL:EXECUTE
SYS:SEG$:SELECT
SYS:TS$:SELECT
SYS:OBJ$:SELECT
SYS:USER$:SELECT
SYS:ARGUMENT$:SELECT
SYS:V_$SQL_PLAN:SELECT
SYS:V_$PROCESS:SELECT
SYS:V_$SESSION:SELECT
SYS:V_$LOCKED_OBJECT:SELECT
SYS:V_$SESSTAT:SELECT
SYS:V_$MYSTAT:SELECT
SYS:V_$SYSSTAT:SELECT
SYS:V_$STATNAME:SELECT
SYS:V_$PARAMETER:SELECT
SYS:V_$DATABASE:SELECT
SYS:V_$SQL:SELECT
SYS:V_$OPEN_CURSOR:SELECT
SYS:V_$TIMER:SELECT
SYS:V_$SESSION_WAIT:SELECT
SYS:V_$SESS_IO:SELECT
SYS:DBA_PROFILES:SELECT
SYS:ALL_COL_COMMENTS:SELECT
SYS:DBA_COL_COMMENTS:SELECT
SYS:DBA_COL_PRIVS:SELECT
SYS:DBA_DB_LINKS:SELECT
SYS:DBA_INDEXES:SELECT
SYS:ALL_IND_COLUMNS:SELECT
SYS:DBA_IND_COLUMNS:SELECT
SYS:ALL_OBJECTS:SELECT
SYS:DBA_OBJECTS:SELECT
SYS:DBA_ROLLBACK_SEGS:SELECT
SYS:USER_ROLE_PRIVS:SELECT
SYS:DBA_ROLE_PRIVS:SELECT
SYS:USER_SYS_PRIVS:SELECT
SYS:DBA_SYS_PRIVS:SELECT
SYS:ALL_SEQUENCES:SELECT
SYS:DBA_SEQUENCES:SELECT
SYS:DBA_SYNONYMS:SELECT
SYS:ALL_SYNONYMS:SELECT
SYS:ALL_TABLES:SELECT
SYS:DBA_TABLES:SELECT
SYS:ALL_TAB_COLUMNS:SELECT
SYS:DBA_TAB_COLUMNS:SELECT
SYS:ALL_TAB_COMMENTS:SELECT
SYS:DBA_TAB_COMMENTS:SELECT
SYS:DBA_TAB_PRIVS:SELECT
SYS:ALL_USERS:SELECT
SYS:DBA_USERS:SELECT
SYS:ALL_VIEWS:SELECT
SYS:DBA_VIEWS:SELECT
SYS:ALL_CONSTRAINTS:SELECT
SYS:DBA_CONSTRAINTS:SELECT
SYS:ALL_CONS_COLUMNS:SELECT
SYS:DBA_CONS_COLUMNS:SELECT
SYS:DBA_TYPES:SELECT
SYS:DBA_RECYCLEBIN:SELECT
SYS:DBA_LOCK:SELECT
SYS:ALL_ERRORS:SELECT
SYS:DBA_ERRORS:SELECT
SYS:DBA_SOURCE:SELECT
SYS:ALL_TRIGGERS:SELECT
SYS:DBA_TRIGGERS:SELECT
SYS:DBA_TRIGGER_COLS:SELECT
SYS:ALL_DEPENDENCIES:SELECT
SYS:DBA_DEPENDENCIES:SELECT
SYS:DBA_JOBS:SELECT
SYS:DBA_SEGMENTS:SELECT
SYS:DBA_EXTENTS:SELECT
SYS:DBA_FREE_SPACE:SELECT
SYS:DBA_DATA_FILES:SELECT
SYS:DBA_TABLESPACES:SELECT
SYS:DBA_RSRC_PLAN_DIRECTIVES:SELECT
SYS:DBA_SNAPSHOTS:SELECT
SYS:DBA_FEATURE_USAGE_STATISTICS:SELECT
SYS:DBA_JAVA_POLICY:SELECT
88 rows selected.
SQL>
You might want to do the same for FLOWS_FILES.
Scott -
Refresh AW data from PLSQL package
Hi,
I have a question about refreshing AW.
I use by AWM generated maintain script.
I try to do it from PLSQL.
(Oracle version 10.2....)
questions :
1) Why I can't catch any exception in my code?
2) The execution of the DBMS_AW.execute is not synchronized,
it means my function returns,
but XML_LOAD_LOG is still running.
3) Which meaning have xml attributes as "TrackStatus", "MaxJobQueues" etc...
4) Can I take influence on executing by changing those attributes?
Thanks to all who can give me more Information.
here is the example function code (I'm happy to share it):
FUNCTION refresh_aw(aw_owner_name VARCHAR2, awname VARCHAR2) RETURN PLS_INTEGER
AS
erm VARCHAR2(200);
erc VARCHAR2(10);
alone NUMBER := 0;
msg VARCHAR2(200);
curr_procedure VARCHAR2(30) := 'refresh_aw';
aw_command VARCHAR2(1000) := NULL;
xml_clob clob;
xml_str varchar2(4000);
strl NUMBER := 0;
res PLS_INTEGER := 0;
BEGIN
/* delete all dimensions data before refreshing */
res := delete_aw_dim(aw_owner_name, awname);
IF res = failure_flag THEN
RETURN failure_flag;
END IF;
BEGIN
aw_command := 'aw detach ' || aw_owner_name || '.' || awname;
DBMS_AW.execute(aw_command);
EXCEPTION WHEN OTHERS THEN NULL;
END;
/* write xml for all dimensions */
DBMS_LOB.CREATETEMPORARY(xml_clob,TRUE);
dbms_lob.open(xml_clob, DBMS_LOB.LOB_READWRITE);
xml_str := ' <BuildDatabase Id="Action2" AWName="' || aw_owner_name || '.' || awname || '" BuildType="EXECUTE" RunSolve="true" CleanMeasures="true" CleanAttrs="true" CleanDim="true" TrackStatus="false" MaxJobQueues="1">';
SELECT LENGTH(xml_str) INTO strl FROM DUAL;
dbms_lob.writeappend(xml_clob, strl, xml_str);
FOR dimenzija IN (SELECT d.AW_OWNER
, d.AW_NAME
, d.AW_LOGICAL_NAME
FROM ALL_OLAP2_AW_DIMENSIONS d
WHERE UPPER(d.AW_OWNER) = UPPER(aw_owner_name)
AND UPPER(d.AW_NAME) = UPPER(awname) )
LOOP
xml_str := ' <BuildList XMLIDref="' || dimenzija.AW_LOGICAL_NAME ||'.DIMENSION" />';
SELECT LENGTH(xml_str) INTO strl FROM DUAL;
dbms_lob.writeappend(xml_clob, strl, xml_str);
END LOOP;
/* now write xml for all cubes */
FOR kube IN (SELECT k.AW_OWNER
, k.AW_NAME
, k.AW_LOGICAL_NAME
FROM ALL_OLAP2_AW_CUBES k
WHERE UPPER(k.AW_OWNER) = UPPER(aw_owner_name)
AND UPPER(k.AW_NAME) = UPPER(awname) )
LOOP
xml_str := ' <BuildList XMLIDref="' || kube.AW_LOGICAL_NAME ||'.CUBE" />';
SELECT LENGTH(xml_str) INTO strl FROM DUAL;
dbms_lob.writeappend(xml_clob, strl, xml_str);
END LOOP;
xml_str := ' </BuildDatabase>';
SELECT LENGTH(xml_str) INTO strl FROM DUAL;
dbms_lob.writeappend(xml_clob, strl, xml_str);
dbms_lob.close(xml_clob);
xml_str := dbms_aw_xml.execute(xml_clob);
dbms_lob.freetemporary(xml_clob);
RETURN success_flag;
EXCEPTION
WHEN OTHERS THEN
erm := SQLERRM;
erc := TO_CHAR(SQLCODE);
DBMS_OUTPUT.PUT_LINE('error: ' || erm);
RETURN failure_flag;
END refresh_aw;These are my thoughts on your questions
1) Why I can't catch any exception in my code? - try the following before executing the AW build procedure:
set serveroutput on size 1000000
exec cwm2_olap_manager.set_echo_on;
2) The execution of the DBMS_AW.execute is not synchronized, it means my function returns, but XML_LOAD_LOG is still running - There are two ways to execute code, in background which releases the calling interface straight away or immediate where the interface is locked until the build completes. The property BuildType controls this feature:
BuildType="BACKGOUND"
BuildType="EXECUTE"
3) Which meaning have xml attributes as "TrackStatus", "MaxJobQueues" etc...
Not sure about TrackStatus, the Java doc is not really helpful but it provides the following:
Specifies whether to track the loading of data into the analytic workspace. To track the status of the data load, specify true as the input value. To not track the status, specify false.
Clear as mud to me. I will have to test this on my laptop. Max job queues manages the number of parallel jobs used during the build process. You need to have use partitioning on your cube to get the most from this feature and ideally you should have multiple CPUs as well.
You can get more information from the Java doc :
http://download-uk.oracle.com/docs/cd/B19306_01/olap.102/b14351/toc.htm
refer to the BuildDatabase class.
4) Can I take influence on executing by changing those attributes? - Yes, but be careful because the length of the text string has to be tracked and passed to calling program. The code should look something like this:
dbms_lob.writeappend(xml_clob, 185, ' <BuildDatabase
Id="Action2" AWName="GSW_AW.GSW_AW" Buil
dType="EXECUTE" RunSolve="true" CleanMeasures="false"
CleanAttrs="false" CleanDim="false" TrackStatu
s="false" MaxJobQueues="0">');
where the number 185 refers to the number of characters inserted into the XML_CLOB
Hope this helps.
Keith -
RCU-6130:Action failed.RCU-6131:Error while trying to connect to database
Hi,
Iam facing issue while installing RCU in UBUNTU, its unable to create MDS schema showing "RCU-6130:Action failed.RCU-6131:Error while trying to connect to database" error.
Any solutions welcome plz2013-03-20 17:53:17.450 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 30
2013-03-20 17:53:17.450 rcu:Extracted SQL Statement: [CREATE USER &&1 IDENTIFIED BY &&2 DEFAULT TABLESPACE &&3 TEMPORARY TABLESPACE &&4]
2013-03-20 17:53:17.450 rcu:Statement Type: 'DDL Statement'
JDBC SQLException - ErrorCode: 1920SQLState:42000 Message: ORA-01920: user name 'DEV_MDS' conflicts with another user or role name
JDBC SQLException handled by error handler
2013-03-20 17:53:17.475 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 32
2013-03-20 17:53:17.475 rcu:Extracted SQL Statement: [GRANT connect TO &&1]
2013-03-20 17:53:17.475 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.542 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 33
2013-03-20 17:53:17.543 rcu:Extracted SQL Statement: [GRANT create type TO &&1]
2013-03-20 17:53:17.543 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.559 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 34
2013-03-20 17:53:17.559 rcu:Extracted SQL Statement: [GRANT create procedure TO &&1]
2013-03-20 17:53:17.559 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.576 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 35
2013-03-20 17:53:17.576 rcu:Extracted SQL Statement: [GRANT create table TO &&1]
2013-03-20 17:53:17.576 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.592 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 36
2013-03-20 17:53:17.593 rcu:Extracted SQL Statement: [GRANT create sequence TO &&1]
2013-03-20 17:53:17.593 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.609 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 39
2013-03-20 17:53:17.609 rcu:Extracted SQL Statement: [ALTER USER &&1 QUOTA unlimited ON &&3]
2013-03-20 17:53:17.610 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.634 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/mds_user.sql'Line Number: 40
2013-03-20 17:53:17.635 rcu:Extracted SQL Statement: [DECLARE
cnt NUMBER;
package_not_found EXCEPTION;
PRAGMA EXCEPTION_INIT(package_not_found, -00942);
insufficient_privs EXCEPTION;
PRAGMA EXCEPTION_INIT(insufficient_privs, -01031);
BEGIN
cnt := 0;
SELECT count(*) INTO cnt FROM dba_tab_privs WHERE grantee = 'PUBLIC'
AND owner='SYS' AND table_name='DBMS_OUTPUT'
AND privilege='EXECUTE';
IF (cnt = 0) THEN
-- Grant MDS user execute on dbms_output only if PUBLIC
-- doesn't have the privilege.
EXECUTE IMMEDIATE 'GRANT execute ON dbms_output TO &&1';
END IF;
cnt := 0;
SELECT count(*) INTO cnt FROM dba_tab_privs WHERE grantee = 'PUBLIC'
AND owner='SYS' AND table_name='DBMS_LOB'
AND privilege='EXECUTE';
IF (cnt = 0) THEN
-- Grant MDS user execute on dbms_lob only if PUBLIC
-- doesn't have the privilege.
EXECUTE IMMEDIATE 'GRANT execute ON dbms_lob TO &&1';
END IF;
EXCEPTION
-- If the user doesn't have privilege to access dbms_* package,
-- database will report that the package cannot be found. RCU
-- even doesn't throw the exception to the user, since ORA-00942
-- is an ignored error defined in its global configuration xml
-- file.
WHEN package_not_found THEN
RAISE insufficient_privs;
WHEN OTHERS THEN
RAISE;
END;
2013-03-20 17:53:17.635 rcu:Statement Type: 'BEGIN/END Anonymous Block'
2013-03-20 17:53:17.694 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 27
2013-03-20 17:53:17.694 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 28
2013-03-20 17:53:17.694 rcu:Extracted SQL Statement: [SET ECHO ON]
2013-03-20 17:53:17.694 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.694 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 29
2013-03-20 17:53:17.695 rcu:Extracted SQL Statement: [SET FEEDBACK 1]
2013-03-20 17:53:17.695 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.695 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 30
2013-03-20 17:53:17.695 rcu:Extracted SQL Statement: [SET NUMWIDTH 10]
2013-03-20 17:53:17.695 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.695 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 31
2013-03-20 17:53:17.695 rcu:Extracted SQL Statement: [SET LINESIZE 80]
2013-03-20 17:53:17.695 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.695 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 32
2013-03-20 17:53:17.695 rcu:Extracted SQL Statement: [SET TRIMSPOOL ON]
2013-03-20 17:53:17.695 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.696 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 33
2013-03-20 17:53:17.696 rcu:Extracted SQL Statement: [SET TAB OFF]
2013-03-20 17:53:17.696 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.696 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 34
2013-03-20 17:53:17.696 rcu:Extracted SQL Statement: [SET PAGESIZE 100]
2013-03-20 17:53:17.696 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.696 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration//mds/sql/cremds-rcu.sql'Line Number: 35
2013-03-20 17:53:17.696 rcu:Extracted SQL Statement: [ALTER SESSION SET CURRENT_SCHEMA=&&1]
2013-03-20 17:53:17.696 rcu:Statement Type: 'DDL Statement'
2013-03-20 17:53:17.712 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 36
2013-03-20 17:53:17.713 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 37
2013-03-20 17:53:17.713 rcu:Extracted SQL Statement: [SET ECHO ON]
2013-03-20 17:53:17.713 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.713 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 38
2013-03-20 17:53:17.713 rcu:Extracted SQL Statement: [SET FEEDBACK 1]
2013-03-20 17:53:17.713 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.713 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 39
2013-03-20 17:53:17.713 rcu:Extracted SQL Statement: [SET NUMWIDTH 10]
2013-03-20 17:53:17.713 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.714 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 40
2013-03-20 17:53:17.714 rcu:Extracted SQL Statement: [SET LINESIZE 80]
2013-03-20 17:53:17.714 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.714 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 41
2013-03-20 17:53:17.714 rcu:Extracted SQL Statement: [SET TRIMSPOOL ON]
2013-03-20 17:53:17.714 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.714 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 42
2013-03-20 17:53:17.714 rcu:Extracted SQL Statement: [SET TAB OFF]
2013-03-20 17:53:17.714 rcu:Skipping Unsupported Statement
2013-03-20 17:53:17.714 rcu:Extracting Statement from File Name: '/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremds.sql'Line Number: 43
2013-03-20 17:53:17.715 rcu:Extracted SQL Statement: [SET PAGESIZE 100]
2013-03-20 17:53:17.715 rcu:Skipping Unsupported Statement
/obiapps/RCU/rcuHome/rcu/integration/mds/sql/cremdcmtbs.sql (No such file or directory) -
"Unsupported LOB type" error occurs when executing DBMS_LOB.FRAGMENT_INSERT
Dear all,
I try to run DBMS_LOB.FRAGMENT_INSERT, but got error saying:
ORA-43856: Unsupported LOB type for SECUREFILE LOB operationSuppose I have the following code:
declare
note_clob clob;
note_clob2 clob;
note_bfile bfile;
buffer varchar2(10000);
note_var varchar2(10000);
warning int;
dest_off int:=1;
src_off int:=1;
lang_ctx int:=0;
amount int:=1500;
begin
--Create temp
dbms_lob.createtemporary(note_clob,true);
--Initialize BFILE
note_bfile:=bfilename('TEMP_DIR','note.txt');
--Open bfile
dbms_lob.fileopen(note_bfile);
dbms_lob.loadclobfromfile(note_clob,note_bfile,dbms_lob.lobmaxsize,dest_off,src_off,0,lang_ctx,warning);
dbms_lob.fileclose(note_bfile);
--Fragement Insert
amount:=3;
dest_off:=10;
buffer:='end';
dbms_lob.fragment_insert(note_clob,amount,dest_off,buffer); <==LINE 30
--Read
amount:=50;
dbms_lob.read(note_clob,amount,1,note_var);
dbms_output.put_line(note_var);
end;
/and I got:
ERROR at line 1:
ORA-43856: Unsupported LOB type for SECUREFILE LOB operation
ORA-06512: at "SYS.DBMS_LOB", line 1076
ORA-06512: at line 30What did I miss?
Best regard,
ValJust a wrap-up (mostly for my own benefit :-) ) :
<li>As I understand the docs, SECUREFILE/BASICFILE is a matter of how the LOB is stored in the table.
<li>SECUREFILE/BASICFILE therefore does not apply to temporary LOBs - they are not stored in a table.
<li>The new FRAGMENT procedures in DBMS_LOB only works on SECUREFILE.
<li>Therefore the FRAGMENT procedures can only work on permanent LOBs in tables in columns defined as SECUREFILE.
<li>And so FRAGMENT procedures cannot work on temporary LOBs at all.
Just loading data into a LOB does not make it permant - it is still temporary until stored in a table.
A workaround would be to create a table with a LOB column defined as SECUREFILE and insert a record into this table.
Then in your code replace the CREATETEMPORARY with selecting that LOB locator from that table.
That way you work on a permanent SECUREFILE LOB in a table rather than a temporary LOB.
Or if the goal of your procedure at some point is to take the LOB and insert into a table, then reverse your logic:
Start with inserting your record with an EMPTY_LOB() (assuming your column is defined SECUREFILE) and use RETURNING clause to retrieve the LOB locator of that inserted LOB.
Then load that LOB from your BFILE and continue from there.
(Or the third workaround is to write the code avoiding use of FRAGMENT procedures ;-) ) -
Error in using DBMS_LOB Package
Hi,
I am attaching a PDF File through a database procedure as shown below
create or replace procedure load_document(document_id in number, filename IN varchar2, doc_desc IN VARCHAR2, doc_type IN VARCHAR2) as
f_lob bfile;
b_lob blob;
--document_name varchar2(30);
--mime_type varchar2(30);
document_name oea_documents.document_name%TYPE;
mime_type oea_documents.document_mime_type%TYPE;
dot_pos number;
v_file_type VARCHAR2(10);
begin
-- Find the position of the dot ('.') located in the filename
dot_pos := instr(filename,'.');
-- Get the filename without extension and use it as image name
document_name := substr(filename,1,dot_pos-1);
-- Build the mime type . Retrieve the file extension and add it to 'image/'
v_file_type := SUBSTR( filename, dot_pos+1, Length(Filename) );
IF ( UPPER(v_file_type) IN ('JPG','JPEG','TIF','TIFF','GIF') ) THEN
mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
ELSIF ( UPPER(v_file_type) = 'PDF' ) THEN
mime_type := 'application/pdf';
ELSIF ( UPPER(v_file_type) = 'DOC' )THEN
mime_type := 'application/msword';
ELSIF ( UPPER( v_file_type) = 'XLS') THEN
mime_type := 'application/ms-excel';
ELSE
mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
END IF;
insert into oea_documents (document_id,
document_name,
document_mime_type,
document,
document_description,
document_type
values(document_id, document_name, mime_type, empty_blob(),doc_desc,doc_type) return document into b_lob;
-- /!\ Directory name has to be UpperCase !
f_lob := bfilename('FILE_LOAD',filename);
o_dset_test('5');
dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
o_dset_test('6');
dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
FILE_LOAD is a folder on the database server(unix).
I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.
while executing this procedure I am getting the error ora-22288(Invalid file or directory).
But this occurs randomly
For instance i tried to attach a pdf file with the name cross.pdf ,it gave me the above error and when i renamed the file as Cross.pdf it attached successfully.
The error comes whilke executing the statement dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
Please guide on the above issue.Hi,
Welcome to the forum!
user1356624 wrote:
f_lob := bfilename('FILE_LOAD',filename);
FILE_LOAD is a folder on the database server(unix).
I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.The first argument to BFILENAME is the name of a directory object, as found in the directory_name column of all_directories. That is not the same thing as a folder name, which is found in the directory_path column of all_directories. Look up [CREATE DIRECTORY|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5007.htm#sthref6211] in the SQL Language manual for a description of Oracle's directory objects.
If you have problems with this, post the results of
SELECT *
FROM all_directories;It might also be useful to see the Oracle "CREATE DIRECTORY" command that was used.
As you probably noticed, this site compresses white space by default.
When you post code or results on this site, type these 6 characters:
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Edited by: Frank Kulash on Aug 10, 2009 3:35 PM
Added link.
Maybe you are looking for
-
Problem in VL04 Background job
Hi Experts, When I enter the shipping points ,sales area ,office and other mandatory feild and execute in foreground the deliveries are shown. But when I do the execution in background . In the SM37 screen the job gets cancelled. The job log says : J
-
Hi Experts ABAP Error in BI calling PSA table to my program it contains more than 200000 records also applying grouping in select statement But it showing dump . please correct me if any wrong in my code. BREAK-POINT. DATA : BEGIN OF ITAB4 O
-
I am trying to connect to oracle8.0.5 database from JDK1.3 on windows 2000 os my program code is as follows import java.sql.*; class JEmpt{ public static void main (String args []) throws SQLException { try Class.forName("oracle.j
-
100% zoom in gpicview behaves weird
Hi! Is it just me or you guys also have this problem after recent gpicview update? Now that I open a large pic and set zoom to 100%, I can't drag the image with mouse and move it to see different parts. When I move the image, it resets to some other
-
Will this SATA hard drive work in my PB?
My PB is the 1.67Ghz model. Last one made before MacBook Pro came into being. I see it has an ATA Ultra drive...wondering if a SATA will work in it, like the one below? HITACHI HTS723225L9A360 / 0A57546 Travelstar 5K320 250GB 7200 RPM 16MB cache SATA