Schema check in 10g
Hi.
In 9i Oracle did a simple schema check on a schema based xmltype table on inserting. With a insert trigger you could get a full w3c schema check.
As far as I know in 10g should always happen a full schema check. But in my test case nothing happens without a trigger.
Register a schema:
BEGIN
DBMS_XMLSCHEMA.RegisterSchema(
'test.xsd',
getDocument('test.xsd'));
END;
CREATE TABLE Kundenliste_Schema OF XMLTYPE
XMLSCHEMA "test.xsd"
ELEMENT "test";
Without this trigger Oracle doesn't validate anything on inserting into the Kundenliste_schema table. WHY?
CREATE OR REPLACE TRIGGER
Validate_Kundenliste_Schema
BEFORE INSERT ON Kundenliste_Schema
FOR EACH ROW
DECLARE
XMLDATA XMLTYPE;
BEGIN
XMLDATA := :new.sys_nc_rowinfo$;
XMLTYPE.Schemavalidate(XMLDATA);
END;
After adding the trigger everything gets validated...
Do you have an explanation for this behaviour for me?
Thanks
Markus
Hi,
I have the same problem but I have noticed a strange behaviour.
Without a trigger it validates the input only partially.
It validates bad names of elements or bad order of elements but it doesn't validate if required attributes are there or not. It seems like attribute use="required" in XSD schema is just skipped during the validation.
If the trigger is created it also validate these attributes?
Could anyone help with this problem?
Similar Messages
-
Help In XML schema using oracle 10g
i want to give seminar in XML schema using oracle 10g. n i m very new in this topic. so help me out which topic i include & any document regarding this
XML Schema has various aspects.
1. Creating an XML Schema, which may be done in JDeveloper.
2. Initializing an XML document from an XML Schema, which may also be done in JDeveloper.
For creating and initializing an XML Schema please refer
http://www.regdeveloper.co.uk/2007/10/01/build_xml_schema_jdeveloper/
3. Validating an XML document with an XML Schema.
http://www.oracle.com/technology/pub/articles/vohra_xmlschema.html -
SQL QUERY to create new schema in Oracle 10g Express
Can anyone provide the SQL query to create a new schema in Oracle 10g Express edition.
Can anyone provide a SQl query to create a
schema/user named 'test' with username as 'system'
and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username. -
How to export a user and their schema from one 10g database to another?
Hi,
I would like to export a user and their entire schema from one 10g database to another one. How do I do this?
thx
adamIf you want to export a user and the schema owned to the user, and import to the same user in a different database, or a different user in the same database, you can use the exp and imp commands as described in the Utilities manual.
These commands are very versatile and have a lot of options - well worth learning properly. To give you a simplistic shortcut, see below - I create a user 'test_move', create some objects in the schema, export, create a new user in the database 'new_move' and import.
oracle@fuzzy:~> sqlplus system/?????
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 11 21:46:54 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create user test_move identified by test_move;
User created.
SQL> grant create session, resource to test_move;
Grant succeeded.
SQL> connect test_move/test_move
Connected.
SQL> create table test (x number);
Table created.
SQL> insert into test values (1);
1 row created.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
oracle@fuzzy:~> exp system/????? file=exp.dmp owner=test_move
Export: Release 10.2.0.1.0 - Production on Sat Mar 11 21:48:34 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST_MOVE
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST_MOVE
About to export TEST_MOVE's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST_MOVE's tables via Conventional Path ...
. . exporting table TEST 1 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
oracle@fuzzy:~> sqlplus system/?????
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 11 21:49:23 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create user new_move identified by new_move;
User created.
SQL> grant create session, resource to new_move;
Grant succeeded.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
oracle@fuzzy:~> imp system/????? file=exp.dmp fromuser=test_move touser=new_move
Import: Release 10.2.0.1.0 - Production on Sat Mar 11 21:50:12 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing TEST_MOVE's objects into NEW_MOVE
. . importing table "TEST" 1 rows imported
Import terminated successfully without warnings.
oracle@fuzzy:~> If moving between databases, remember to set the SID properly before the import. If keeping the same userid, skip the from/to stuff in the import.
There are many variations on the theme ...
You can simplify this. You can select tables individually. You can use a parameter file. You can transport all the constraints and data. You can skip the data and only move the definitions. You can get some help (imp/exp help=yes).
And, if it's all 10g, there is a new and improved facility called expdp/impdp (dp = data pump) which has a lot more capability as well, including direct transfer (no intermediate file) together with suspend/restart. Also documented in the Utilities manual. -
Disable Schema check in Oracle Directory Server
How does one disable schema checking in Oracle Directory Server. I couldnt figure it out. This is easily done in openLDAP , netscape LDAP server.
nullI am sorry if I wasn't clear. In Netscape/openLDAP , the term schemacheck implies. ( from open LDAP documentation ).
Option : schemacheck { on | off }
This option turns schema checking on or off. If schema checking is on, entries added or modified will be checked to ensure they obey the schema rules implied by their object class(es) as defined by the corresponding objectclass option(s). If schema checking is off this check is not done.
Default: on
The default is on in Oracle.
Thanks in advance ,
Ravi
null -
Check last time schema was accessed 10g
Oracle 10.2.0.4.0
I am validating a list of used/unused schema in a Oracle 10g database. I have a list of schema that I think do not have any dependencies on anything in the database( Not sure why it was created) . Just to make doubly sure, is there a view in Oracle to check the last time a schema was accessed by a user in the database?.
ThanksUse Oracle Auditing for the same. No such direct views are available.
How to view the List of statements executed in Oracle 11G database
Regards
Rajesh -
How to install 'SOABPEL' schema on Release 10g R2 on Windows environment
Hi,
I have just completed installation of Oracle 10g R2 (10.2.0.3) database on windows vista environment. the database has been successfully installed and i am able to connect it from the sql plus. BUT my purpose to install database is to do Advanced installation of SOA. For that i need to have few schemas like 'SOABPEL' already created in the database. Following is the problem i am facing while installing the schema in the database -
The schema files resides in soa_windows_x86_101310_disk1\install\soa_schemas\irca folder. As per the installation pdf, i need to run the irca.sh shell script to install the 'SOABPEL', 'SOAESB' and 'SOAOWSM' schemas. but i am not sure how do i run this shell script from the windows environment? I don't think i can use unix prompt for this? Please guide.
ThanksAnuj, when i try to run the batch file, i am getting following error. i guess this is oracle_home problem. i checked it in the environment variables, and it was blank. so i have set it up now and pointing to ojdbc14.jar file. but i am still getting the same error. do i need restart my pc? or do you have some other way to track it down?
The error is-
ERROR: Cannot find library - \jdbc\lib\ojdbc14.jar
Please verify that the ORACLE_HOME is set correctly.
Appreciate your help.
Thanks.
Edited by: user12059957 on Feb 2, 2011 11:59 AM -
Problem creating WebDav connection to review XML schema in JDeveloper 10g
I am trying to review some XML schema and cannot seem to create a WebDav connection. I entered all the relevant info and keep getting the following error :Testing connection...
Connection test failed: unable to connect
Unable to connect to WebDav Connection1 (http://localhost:8080/)
May require proxy to connect to the location,
when I tried to test the connection. The tips given in the help section didn't work either. Could someone please help me?Thanks for your prompt response.
I had done that before yet, it still doesn't work.
Please, bear with this newbie, for a second.
I think it may be relevant to mention that I am trying to create a connection on my local network.
Had no problems when I try to connect to enterprise manager,or iSQL*plus console, or creating a database connection through Jdeveloper, or even to the HTTP server through the browser. I am using windowsXP platform BTW, if it makes a difference, and Jdeveloper 10g. When I try to create the webDav Connection it still gives me the connection failed error, .....
Testing connection...
Connection test failed: unable to connect
May require proxy to connect to the location
Additionally ran this script ....
DECLARE
HTTP_PORT pls_integer := 8080;
FTP_PORT pls_integer := 2100;
config xmltype;
BEGIN
SELECT updateXML(dbms_xdb.cfg_get(),
'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',
HTTP_PORT) INTO config
FROM DUAL;
DBMS_XDB.CFG_UPDATE(config);
SELECT updateXML(dbms_xdb.cfg_get(),
'/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()',
FTP_PORT) INTO config
FROM DUAL;
DBMS_XDB.CFG_UPDATE(config);
END;
COMMIT;
-- Updates configuration
BEGIN
DBMS_XDB.CFG_REFRESH;
COMMIT;
END;
-- Creates /home Directory
DECLARE
result boolean;
BEGIN
result := dbms_xdb.createFolder('/home');
dbms_xdb.setAcl('/home','/sys/acls/all_all_acl.xml');
commit;
END;
list
OUTPUT from script....
PL/SQL procedure successfully completed.
Commit complete.
PL/SQL procedure successfully completed.
DECLARE
ERROR at line 1:
ORA-31003: Parent / already contains child entry home
ORA-06512: at "XDB.DBMS_XDB", line 195
ORA-06512: at line 4
Still no luck! What I am i doing wrong?
Any pointers will be appreciated. -
Dear all
I want ro export a schema from 10g to import 11g,please brief me steps what should i do to complete my job.You can use expdp utility for that purpose.
Look at this step by step guide:
http://www.oracle-base.com/articles/10g/OracleDataPump10g.php -
Comparing schema using OEM 10g
Hi,
IS there any way to compare schema from 2 different schema for Prod and test environments using OEM 10g.
I have a comparison script which will work for mr but the report generated is not easily readeble.
Please point out the steps if there is any option to do so in OEM 10g. My database version is 9i.
Thanks
AnkyYou can use Oracle Enterprise Manager Grid Control or SQL Developer, in either case you need to have the change management pack licensed other then that you are looking at 3rd party tools such as Toad, older version of OEM or custom scripts.
You can try some of these tools which include scripts, etc. as these may also be of help to you.
http://dgielis.blogspot.com/2006/01/compare-2-oracle-schemas.html
Mike M. -
Relational Star Schema with oWB 10g
Hi,
It is an interesting forum. I like to explore the different approached to build ETL using OWB to load Star Schema built around Oracle 10g relational structures.
How do we take advantage of additional features of Oracle DB 10g and OWB 10gR2?
What features does help? Which one should stay away from?
Thanks in advance.
RamHi ,
You can use Oracle SQL Developer Data Modeler .
SQL Developer Data Modeler provides a full spectrum of data and database modeling tools and utilities, including modeling for Entity Relationship Diagrams (ERD), Relational (database design), Data Type and Multi-dimensional modeling, full forward and reverse engineering and DDL code generation. The Data Modeler imports from and exports to a variety of sources and targets, provides a variety of formatting options and validates the models through a predefined set of design rules.
Oracle SQL Developer Data Modeler can connect to any supported Oracle Database and is platform independent
http://www.oracle.com/technology/products/database/datamodeler/index.html
Thanks,
Sutirtha -
hi,
Is it possible to import suppose hr schema from 9i database , where we are going to use exp utility and store in the directory object created through 9i
and than import using datapump in 10g by accessing the same directory object created through 9i
Thanks and Regards..Is it possible to import suppose hr schema from 9i database , where we are going to use exp utility and store in the directory object created through 9i
and than import using datapump in 10g by accessing the same directory object created through 9iThat's not possible, traditional exp and datapump expdp commands are not compatible. But you can use 10g traditional imp to import your 9i export file into 10g database. -
Hello,
I would like to know whether is it possible to build a star schema using Oracle OWB 10g?
If so how could I do build one? Any help is highly appreciable.
RegardsHi ,
You can use Oracle SQL Developer Data Modeler .
SQL Developer Data Modeler provides a full spectrum of data and database modeling tools and utilities, including modeling for Entity Relationship Diagrams (ERD), Relational (database design), Data Type and Multi-dimensional modeling, full forward and reverse engineering and DDL code generation. The Data Modeler imports from and exports to a variety of sources and targets, provides a variety of formatting options and validates the models through a predefined set of design rules.
Oracle SQL Developer Data Modeler can connect to any supported Oracle Database and is platform independent
http://www.oracle.com/technology/products/database/datamodeler/index.html
Thanks,
Sutirtha -
How get scott user database schema in oracle 10g express edition
hi
plz any on can tell me how to get the scott user database table details into the oracle 10g express edition
Iam created the user as scott but but i didn't get the table details
...plz give me the details correctly.You will go into this path C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. You can get scott.sql script yhen you need to run the script like @C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. Otherwise you just copy the below script and save it into one file then run that file using @
Rem Copyright (c) 1990 by Oracle Corporation
Rem NAME
REM UTLSAMPL.SQL
Rem FUNCTION
Rem NOTES
Rem MODIFIED
Rem gdudey 06/28/95 - Modified for desktop seed database
Rem glumpkin 10/21/92 - Renamed from SQLBLD.SQL
Rem blinden 07/27/92 - Added primary and foreign keys to EMP and DEPT
Rem rlim 04/29/91 - change char to varchar2
Rem mmoore 04/08/91 - use unlimited tablespace priv
Rem pritto 04/04/91 - change SYSDATE to 13-JUL-87
Rem Mendels 12/07/90 - bug 30123;add to_date calls so language independent
Rem
rem
rem $Header: utlsampl.sql 7020100.1 94/09/23 22:14:24 cli Generic<base> $ sqlbld.sql
rem
SET TERMOUT OFF
SET ECHO OFF
rem CONGDON Invoked in RDBMS at build time. 29-DEC-1988
rem OATES: Created: 16-Feb-83
GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY TIGER;
ALTER USER SCOTT DEFAULT TABLESPACE USERS;
ALTER USER SCOTT TEMPORARY TABLESPACE TEMP;
CONNECT SCOTT/TIGER
DROP TABLE DEPT;
CREATE TABLE DEPT
(DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
DNAME VARCHAR2(14) ,
LOC VARCHAR2(13) ) ;
DROP TABLE EMP;
CREATE TABLE EMP
(EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT);
INSERT INTO DEPT VALUES
(10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES
(30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES
(40,'OPERATIONS','BOSTON');
INSERT INTO EMP VALUES
(7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);
INSERT INTO EMP VALUES
(7499,'ALLEN','SALESMAN',7698,to_date('20-2-1981','dd-mm-yyyy'),1600,300,30);
INSERT INTO EMP VALUES
(7521,'WARD','SALESMAN',7698,to_date('22-2-1981','dd-mm-yyyy'),1250,500,30);
INSERT INTO EMP VALUES
(7566,'JONES','MANAGER',7839,to_date('2-4-1981','dd-mm-yyyy'),2975,NULL,20);
INSERT INTO EMP VALUES
(7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-yyyy'),1250,1400,30);
INSERT INTO EMP VALUES
(7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-yyyy'),2850,NULL,30);
INSERT INTO EMP VALUES
(7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-yyyy'),2450,NULL,10);
INSERT INTO EMP VALUES
(7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87')-85,3000,NULL,20);
INSERT INTO EMP VALUES
(7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-yyyy'),5000,NULL,10);
INSERT INTO EMP VALUES
(7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-yyyy'),1500,0,30);
INSERT INTO EMP VALUES
(7876,'ADAMS','CLERK',7788,to_date('13-JUL-87')-51,1100,NULL,20);
INSERT INTO EMP VALUES
(7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy'),950,NULL,30);
INSERT INTO EMP VALUES
(7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
INSERT INTO EMP VALUES
(7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
DROP TABLE BONUS;
CREATE TABLE BONUS
ENAME VARCHAR2(10) ,
JOB VARCHAR2(9) ,
SAL NUMBER,
COMM NUMBER
DROP TABLE SALGRADE;
CREATE TABLE SALGRADE
( GRADE NUMBER,
LOSAL NUMBER,
HISAL NUMBER );
INSERT INTO SALGRADE VALUES (1,700,1200);
INSERT INTO SALGRADE VALUES (2,1201,1400);
INSERT INTO SALGRADE VALUES (3,1401,2000);
INSERT INTO SALGRADE VALUES (4,2001,3000);
INSERT INTO SALGRADE VALUES (5,3001,9999);
COMMIT;
SET TERMOUT ON
SET ECHO ON -
ORA-31000 when register schema in oracle 10g
I am trying to register a schema in oracle10g rel2. The schema contain "<xs:include schemaLocation="papiNetCommonDefsV2R31.xsd"/>" and papiNetCommonDefsV2R31.xsd is successfully registered in Oracle repository. But i am still getting the error as
1 begin
2 dbms_xmlschema.registerSchema
3 ('http://localhost:8080/home/xdb/xsd/PurchaseOrderV2R31.xsd',
4 xdburitype('/home/xdb/xsd/PurchaseOrderV2R31.xsd').getCLOB(),
5 FALSE,
6 TRUE,
7 FALSE,
8 TRUE
9 );
10* end;
SQL> /
begin
ERROR at line 1:
ORA-31000: Resource 'papiNetCommonDefsV2R31.xsd' is not an XDB schema document
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
ORA-06512: at line 2.
I can view 'papiNetCommonDefsV2R31.xsd' when i run the query - select schema_url from user_xml_schemasHi Glyn,
Can you create a script that recreates the problem?
I have a similiar problem, but can not recreate the exact operations sequance that cause the ORA-07445.
Avi.
Maybe you are looking for
-
Unable to send messages from IS to AE.
Hi, I am getting 401 Unauthorized error in "Call Adapter" of the IS pipeline its a simple FIle-to-File scenario. I did search on the SDN but unable to find a answer. The user "PIISUSER" is not locked, I checked in SU01 transaction. The J2EE port m
-
I installed the new system yesterday. A few minutes ago I hit the new arrows in the top right of my screen. I have now lost the dock, the apple bar on top, and my favorites. Could someone tell me how to get my old page back, please.
-
Hello everyone I would like to know if I should get the 2008 MacBook Pro non unibody 2.4ghz 4gb of ram or should I get a macbook aluminum unibody with the same specs? And does anyone know which is thinner?
-
System refresh from non-cluster to a MSCS cluster system
I have a system (call GTA) running NW 7.0 SR2 with both ABAP and Java instance. It runs on WIndows 2003 64-bit and SQL Server 2005. Now we want to migrate to a new set of hardware with Microsoft cluster (MSCS). I have installed this new system (Call
-
Why can't I authorize my itunes
hello, My itunes have been like that for ages, since I got it.... How do i authorize my iTunes???? I know how to but I don't know how to fix the problem in the image attached Thanks heaps!!! Want to get some apps for my new iPod