Rem
Rem $Header: rdbms/admin/xse111.sql /main/3 2010/06/06 21:49:30 snadhika Exp $
Rem
Rem xse111.sql
Rem
Rem Copyright (c) 2007, 2010, Oracle and/or its affiliates.
Rem All rights reserved.
Rem
Rem NAME
Rem xse111.sql - XS downgrade to 11.1
Rem
Rem DESCRIPTION
Rem This script is invoked from the XDB top-level downgrade script
Rem
Rem NOTES
Rem
Rem
Rem MODIFIED (MM/DD/YY)
Rem snadhika 04/14/10 - remove PREDICATE xmlindex
Rem rpang 03/30/09 - downgrade PL/SQL network ACL security objects
Rem rburns 01/03/08 - drop more packages
Rem sichandr 01/07/08 - drop xmlindex for security class
Rem jsamuel 12/27/07 - xml index on xsprincipals
Rem rburns 11/06/07 - add 11.1 XS downgrade
Rem taahmed 10/11/07 - downgrade DAV::dav security class
Rem snadhika 10/11/07 - Drop ALL_XSC_SECURITY_CLASS_STATUS view and
Rem sys.xs$catview_util
Rem asurpur 10/10/07 - Upgrade XS$cache_actions and xs$cache_delete
Rem jnarasin 03/29/07 - Remove dbms_auth, dbms_passwd, midtier_auth
Rem dynamic roles
Rem jnarasin 05/03/07 - Fix Bug 6020435
Rem asurpur 03/20/07 - Fix bug 5885811 - uid change for xspublic
Rem asurpur 03/20/07 - Fix bug 5885813 - add xsauthenticated to xspublic
Rem taahmed 03/18/07 - remove space from resolve privilege
Rem jsamuel 01/25/07 - downgrade script for XS project branch
Rem jsamuel 01/25/07 - Created
Rem
Rem ===================================================================
Rem BEGIN XS Downgrade from Current Release to 11.2
Rem ===================================================================
-- uncomment for next release
--@@xse112.sql
Rem ===================================================================
Rem END XS Downgrade from Current Release to 11.2
Rem ===================================================================
Rem ===================================================================
Rem BEGIN XS Downgrade from Current Release to 11.1
Rem ===================================================================
@@nacle111.sql
-- Drop xml index for xs$securityclass
--drop index XDB.SC_XIDX;
-- Drop index on xs$principals
--drop index xdb.prin_xidx;
/* Downgrade DAV::dav security class.
*/
execute dbms_xdb.deleteresource('/sys/xs/securityclasses/dav.xml');
DECLARE
b BOOLEAN;
BEGIN
b := DBMS_XDB.createResource(
'/sys/xs/securityclasses/dav.xml',
'
DAV privileges
xdb:systemPrivileges
');
END;
/
/* Security classes that are modified need to deleted first and then recreated
to the orginal version (11.0)
These xml files should be moved to separate location in the future as well.
*/
execute dbms_xdb.deleteresource('/sys/xs/securityclasses/principalsc.xml');
execute dbms_xdb.deleteresource('/sys/xs/securityclasses/xssystemsc.xml');
/* Recreating the Principal Security Class to the original version (11.0)*/
declare
tmp boolean := false;
begin
if (NOT DBMS_XDB.existsResource('/sys/xs/securityclasses/principalsc.xml'))
then
tmp := DBMS_XDB.CreateResource('/sys/xs/securityclasses/principalsc.xml',
'
PrincipalSecurityClass
dav:dav
Create a Light Weight User Session
Terminate a Light Weight User Session
Attach to a Light Weight User Session
Modify contents of a Light Weight User Session
Switch User of a Light Weight User Session
Assign User to an anonymous Light Weight User Session
Create/Delete/Change properties of Namespaces.
Set a Light Weight User Session Attribute
Read value of a Light Weight User Session Attribute
');
end if;
end;
/
begin
dbms_xdb.deleteresource('/sys/xs/roles/xspublic.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
declare
tmp boolean := false;
begin
tmp := DBMS_XDB.CreateResource('/sys/xs/roles/xspublic.xml',
'
2147483649
4B0F192BF5214F9BBF058025E8E23B89
xspublic
');
end;
/
begin
dbms_xdb.deleteresource('/sys/xs/users/xsguest.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
Rem Add the xsguest user
declare
tmp boolean := false;
begin
tmp := DBMS_XDB.CreateResource('/sys/xs/users/xsguest.xml',
'
2147483651
3ACB6B1172E54FF9BF70497B70C7B733
xsguest
');
end;
/
Rem delete the xsauthenticated user
begin
dbms_xdb.deleteresource('/sys/xs/roles/xsauthenticated.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
Rem Add the xsauthenticated role
declare
tmp boolean := false;
begin
tmp := DBMS_XDB.CreateResource('/sys/xs/roles/xsauthenticated.xml',
'
2147483650
82B7C3CCBF794F2EBFAA4E8ED7A9AF30
xsauthenticated
');
end;
/
Rem delete the dbms_auth role
begin
dbms_xdb.deleteresource('/sys/xs/roles/dbms_auth.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
Rem delete the dbms_passwd role
begin
dbms_xdb.deleteresource('/sys/xs/roles/dbms_passwd.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
Rem delete the midtier_auth role
begin
dbms_xdb.deleteresource('/sys/xs/roles/midtier_auth.xml',
DBMS_XDB.DELETE_RECURSIVE_FORCE);
end;
/
/*
Schema changes cannot be downgraded yet until we have CopyEvolve to work and
modify the exisiting user documents to conform to the old schema.
The schema will be downgraded to the original version of the .xsd file. The
following way of downgrading the schema can be done if there won't be any
associated xml documents. */
/*
@@catxdbh
exec dbms_metadata_hack.cre_dir;
begin
dbms_xmlschema.deleteSchema('http://xmlns.oracle.com/xs/principal.xsd',
dbms_xmlschema.delete_cascade_force);
end;
/
Rem Register principal schema
declare
PRINCIPALXSD BFILE := dbms_metadata_hack.get_bfile('xsprin.xsd');
DSDURL varchar2(100) := 'http://xmlns.oracle.com/xs/principal.xsd';
begin
dbms_xmlschema.registerSchema(DSDURL, PRINCIPALXSD,
owner=>'XDB',
local=>FALSE,
GENTYPES=>FALSE,
GENTABLES=>FALSE,
OPTIONS=>DBMS_XMLSCHEMA.REGISTER_BINARYXML);
end;
/
create table XDB.XS$PRINCIPALS of XMLType XMLType xmlschema "http://xmlns.oracle.com/xs/principal.xsd" element "principal";
*/
delete from XDB.XS$CACHE_ACTIONS;
Rem add seed values for this table
insert into XDB.XS$CACHE_ACTIONS(ROW_KEY, TIME_VAL) values (1, systimestamp);
insert into XDB.XS$CACHE_ACTIONS(ROW_KEY, TIME_VAL) values (2, systimestamp);
insert into XDB.XS$CACHE_ACTIONS(ROW_KEY, TIME_VAL) values (3, systimestamp);
insert into XDB.XS$CACHE_ACTIONS(ROW_KEY, TIME_VAL) values (4, systimestamp);
insert into XDB.XS$CACHE_ACTIONS(ROW_KEY, TIME_VAL) values (9, systimestamp);
-- since the contents do not matter, drop and recreate
drop table XDB.XS$CACHE_DELETE;
Rem now create the Delete table
create table XDB.XS$CACHE_DELETE
(
ACLOID VARCHAR(32),
SECCLS_QNAME VARCHAR2(4000),
DEL_DATE TIMESTAMP NOT NULL
);
comment on table XDB.XS$CACHE_DELETE is
'Table to retain deleted ACLOIDs and SecurityClass TokenIDs'
/
comment on column XDB.XS$CACHE_DELETE.ACLOID is
'Column to store deleted ACLOIDs for a certain window of time'
/
comment on column XDB.XS$CACHE_DELETE.SECCLS_QNAME is
'Column to store deleted SecurityClass QNames'
/
comment on column XDB.XS$CACHE_DELETE.DEL_DATE is
'Column to store the dates of the deleted objects'
/
create or replace public synonym XS$CACHE_DELETE for XDB.XS$CACHE_DELETE;
grant select on XS$CACHE_DELETE to public;
/
Rem =================================================================
Rem Drop all new packages, views, and public syonyms at the end
Rem =================================================================
drop public synonym ALL_XSC_SECURITY_CLASS_STATUS;
drop view sys.ALL_XSC_SECURITY_CLASS_STATUS;
drop package sys.xs$catview_util;
drop public synonym DBMS_XS_UTIL;
drop view V$XS_SESSION;
drop public synonym V$XS_SESSION;
Rem ===================================================================
Rem END XS Downgrade from Current Release to 11.1
Rem ===================================================================