/* OWB 9.0.4 and OWB 9.2 compliant. Assmption: user dumps have been created using all defaults (i.e. grants have also been exported). Usernames of runtime repository user and target user that was exported will be the same as usernames that will be used for import. If this prerequisite is not fulfilled, then grants will have to be given differently; also location registration would have to be updated. OWBRT_SYS has also been exported. If the user still exists, then restore is obviously not needed. */ sqlplus /nolog connect sys/@ as sysdba /* see comment in assumption!!! */ create user identified by default tablespace temporary tablespace / grant CONNECT to ; grant RESOURCE to ; grant AQ_ADMINISTRATOR_ROLE to ; grant AQ_USER_ROLE to ; grant JAVADEBUGPRIV to ; grant JAVAIDPRIV to ; grant JAVASYSPRIV to ; grant JAVAUSERPRIV to ; grant JAVA_ADMIN to ; grant JAVA_DEPLOY to ; grant alter session to ; grant unlimited tablespace to ; grant administer database trigger to ; grant execute on dbms_lock to ; grant execute on dbms_aq to ; grant execute on dbms_aqadm to ; /* see comment in assumption!!! */ create user identified by default tablespace temporary tablespace / grant connect to ; /* see comment in assumption!!! */ create user identified by default tablespace temporary tablespace / grant CONNECT to ; grant RESOURCE to ; grant SELECT_CATALOG_ROLE to ; grant HS_ADMIN_ROLE to ; grant AQ_USER_ROLE to ; grant CREATE VIEW to ; grant CREATE TABLE to ; grant ALTER SESSION to ; grant CREATE SESSION to ; grant CREATE SYNONYM to ; grant CREATE TRIGGER to ; grant CREATE ANY TYPE to ; grant CREATE SEQUENCE to ; grant CREATE SNAPSHOT to ; grant CREATE DIMENSION to ; grant CREATE INDEXTYPE to ; grant CREATE PROCEDURE to ; grant DROP ANY DIRECTORY to ; grant DROP PUBLIC SYNONYM to ; grant CREATE ANY DIRECTORY to ; grant CREATE DATABASE LINK to ; grant GLOBAL QUERY REWRITE to ; grant UNLIMITED TABLESPACE to ; grant CREATE PUBLIC SYNONYM to ; grant SELECT ANY DICTIONARY to ; grant execute on dbms_aq to ; grant execute on dbms_aqadm to ; /* Create OWBRT_SYS only if user does not exist anymore. */ create user owbrt_sys identified by owbrt_sys default tablespace temporary tablespace / grant connect to owbrt_sys ; grant resource to owbrt_sys ; grant INSERT ANY TABLE to owbrt_sys; grant SELECT ANY TABLE to owbrt_sys; grant DROP PUBLIC SYNONYM to owbrt_sys; grant CREATE ANY PROCEDURE to owbrt_sys; grant UNLIMITED TABLESPACE to owbrt_sys; grant CREATE PUBLIC SYNONYM to owbrt_sys; grant EXECUTE ANY PROCEDURE to owbrt_sys; create role wb_d_; revoke wb_d_ from sys; create role wb_r_; revoke wb_r_ from sys; create role wb_u_; revoke wb_u_ from sys; create role wb_a_; revoke wb_a_ from sys; grant wb_u_ to wb_d_; grant wb_u_ to wb_r_; grant wb_u_ to wb_a_; grant wb_d_ to ; grant wb_r_ to ; grant wb_a_ to ; grant wb_u_ to ; alter user default role connect ; /* Import dump files in the following order: OWBRT_SYS, , , . */ imp owbrt_sys/owbrt_sys@ /* Next import will generate a number of compilation warnings due to invalid view definitions. */ imp /@ /* Before continuing, make sure all objects in schema are valid, either using dbms_utility.compile_schema or via alter compile (body; in case of package bodies). All objects should validate correctly. */ imp /@ /* If you created external tables that use directory definitions you may have to create those definitions beforehand or grant the privileges to the user (if the directories already exist). Otherwise you get import warnings. If you have advanced queues in the target schema, you will have to grant AQ_ADMINISTRATOR_ROLE to (connect as sys) before you start the import. IMP-01031 Insufficient privileges is the error message you will get otherwise. As the AQ_ADMINISTRATOR_ROLE is not a standard role, consider to revoke it again after the import. If you have used the XML toolkit or other Java procedures, grant JAVASYSPRIV to (connect as sys) before you start the import. IMP-01031 Insufficient privileges is the error message you will get otherwise. Consider revoking after the import has finished. If you explicitly granted other system or object privileges to the target schema then you will have to restore those also. */ imp /@ /* Runtime platform service should be available. Consider checking using \owb\rtp\sql\service_doctor.sql. */