• AIX 6.1 Oracle 10G 数据库GoldenGate实施


    安装环境说明:

    源端:AIX 6.1

          10.190.1.215

    目标端:Linux

          10.191.1.10

     

            

    1:源端创建goldengate 表空间。

     

    表空间的要求:最小500m,大点3-5G,设置自动扩展。

    SQL>  set pagesize 9999

    col tablespace_name for a15

     col file_name for a45

    select tablespace_name ,file_name from dba_data_files;

     

    在源端创建GoldenGate表空间

    SQL>  create tablespace goldengate datafile '/oradata2/hncdfhq/goldengate01.dbf' size 500m autoextend on;

     

     

    2:源端创建goldengate模式用户

     

    SQL>  create user goldengate identified by goldengate default tablespace goldengate temporary tablespace TEMP_SPC;

    grant connect to goldengate;

    grant alter any table to goldengate;

    grant alter session to goldengate;

    grant create session to goldengate;

    grant flashback any table to goldengate;

    grant select any dictionary to goldengate;

    grant select any table to goldengate;

    grant resource to goldengate;

    grant select any transaction to goldengate;

    grant dba to goldengate;

     

     

    3:源端开启归档

     

    SQL>  archive log list;

    Database log modeArchive Mode

    Automatic archivalEnabled

    Archive destination/oradata2/arch

    Oldest online log sequence56336

    Next log sequence to archive56338

    Current log sequence56338

     

    4:源端和目标端配置环境变量

     

    源端:

    在/home/oracle/.profile添加如下内容

    export LIBPATH=$LIBPATH:$ORACLE_HOME/lib

    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

     

    目标端:

    在 /home/oracle/.bash_profile添加如下内容

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

      

        

     

    5:AIX系统的要求

     

    需要XL C/C++ Runtime v10.1 or later以及libpthreads version 5.3.0.51or later,如不符合以上条件需先进行XLC和libpthreads库的升级。

    注:收集xlC和libpthreads版本,方法如下:

    查看xlC版本:

    # xlC –qversion

    Or

    # lslpp -l | grep -i xlc

     

    查看libpthreads版本:

    # lslpp -h bos.rte.libpthreads

     

    源端和目标端/etc/hosts文件要求IP与hostname要一一对应。

     

    确定Goldengate使用的端口没有被占用。

     

     

    6:源端和目标端安装goldengate软件

     

    源端goldengte软件所在目录: /oradata2/goldengate

    目标端goldengte软件所在目录: /goldengate/goldengate/hq

    要求所在目录oracle要有读写权限

    因为goldengate 11 和Oracle 11G 一样,都是可以直接安装patch包,而不用先安装低版本再升级,所以本次安装,安装的是goldengate 11,只传这个patch包到目标端解压就可以

    解压完成以后,如果在安装目录,敲人  ./ggsci 命令后,出现如下所示,则为安装成功:

     

    $ ./ggsci

     

    Oracle GoldenGate Command Interpreter for Oracle

    Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230

    AIX 5L, ppc, 64bit (optimized), Oracle 10.2 on Apr 23 2012 07:27:46

     

    Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

     

    GGSCI (hncdfdb1) 1>

     

    当在命令行敲命令:$ ./ggsci   会报如下的错,说明环境变量没有配置oracle lib包,环境变量没有设好。

    $ ./ggsci

    exec(): 0509-036 Cannot load program ./ggsci because of the following errors:

            0509-150   Dependent module libclntsh.so could not be loaded.

            0509-022 Cannot load module libclntsh.so.

            0509-026 System error: A file or directory in the path name does not exist.

     

    $ ./ggsci

    ./ggsci: error while loading shared libraries: libnnz10.so: cannot open shared object file: No such file or directory 

     

     

    7:源端和目标端创建goldengate目录

     

    源端:

     

    GGSCI (hncdfdb1) 1> create subdirs

     

    Parameter files/oradata2/goldengate/dirprm: already exists

    Report files/oradata2/goldengate/dirrpt: created

    Checkpoint files/oradata2/goldengate/dirchk: created

    Process status files/oradata2/goldengate/dirpcs: created

    SQL script files/oradata2/goldengate/dirsql: created

    Database definitions files/oradata2/goldengate/dirdef: created

    Extract data files /oradata2/goldengate/dirdat: created

    Temporary files/oradata2/goldengate/dirtmp: created

    Stdout files/oradata2/goldengate/dirout: created

     

    目标端:

     

    GGSCI (zaibei) 1> create subdirs

     

    Creating subdirectories under current directory /goldengate/goldengate/hq

     

    Parameter files/goldengate/goldengate/hq/dirprm: already exists

    Report files/goldengate/goldengate/hq/dirrpt: created

    Checkpoint files/goldengate/goldengate/hq/dirchk: created

    Process status files/goldengate/goldengate/hq/dirpcs: created

    SQL script files/goldengate/goldengate/hq/dirsql: created

    Database definitions files/goldengate/goldengate/hq/dirdef: created

    Extract data files/goldengate/goldengate/hq/dirdat: created

    Temporary files/goldengate/goldengate/hq/dirtmp: created

    Stdout files/goldengate/goldengate/hq/dirout: created

     

     

    8:源端开启补充日志与强制日志模式、安装sequence支持

    此操作尽量在业务量不繁忙的时候执行

    SQL>  select SUPPLEMENTAL_LOG_DATA_MIN,

     SUPPLEMENTAL_LOG_DATA_PK,

    SUPPLEMENTAL_LOG_DATA_UI,

     SUPPLEMENTAL_LOG_DATA_FK,

     SUPPLEMENTAL_LOG_DATA_ALL from v$database;

     

    SUPPLEME SUP SUP SUP SUP

    -------- --- --- --- ---

    NO  NO  NONO  NO

     

    SQL>  alter database add supplemental log data;

     

    SQL>  alter database add supplemental log data (primary key, unique,foreign key) columns;

     

    SQL>  select SUPPLEMENTAL_LOG_DATA_MIN,

     SUPPLEMENTAL_LOG_DATA_PK,

    SUPPLEMENTAL_LOG_DATA_UI,

     SUPPLEMENTAL_LOG_DATA_FK,

     SUPPLEMENTAL_LOG_DATA_ALL from v$database;

     

    SUPPLEME SUP SUP SUP SUP

    -------- --- --- --- ---

    YES        YES YES YES NO

     

    SQL>  alter system archive log current;

     

    System altered.

     

    确保最小附加日志,pk,ui,fk附加日志打开。而all columns的附加日志关闭。

    如果all columns的附加日志打开的话,则需要使用以下语句予以关闭:

    SQL>  alter database drop supplemental log data (ALL) columns;

     

    如果出现问题,可以通过以下语句进行回退:

    SQL>  alter database drop supplemental log data ;

    SQL>  alter database drop supplemental log data (primary key, unique,foreign key) columns;

    SQL>  alter system archive log current;

     

    源端开启数据库强制日志模式

    SQL>  alter database force logging;

      

    安装sequence支持:

    到goldengate的安装目录

    SQL>   @sequence.sql

     

    SQL>   GRANT EXECUTE on goldengate.updateSequence TO goldengate;

     

    SQL>   ALTER TABLE sys.seq$ ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;

     

     

    9:源端和目标端配置goldengate 收集进程参数

    源端和目标端都要执行

    GGSCI  >  edit params mgr

     

    port 7855   

    DYNAMICPORTLIST 7856-7866

    AUTOSTART EXTRACT * 

    AUTORESTART EXTRACT *

    PURGEOLDEXTRACTS ./dirdat/*, usecheckpoints, minkeepdays 3

    LAGREPORTHOURS 1   

    LAGINFOMINUTES 30  

    LAGCRITICALMINUTES 45

     

    启动goldengate守护进程

    GGSCI  >  start mgr

     

    查看进程状态,如下即为启动:

    GGSCI  >  info all  

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

    MANAGER     RUNNING 

     

     

    10:在源端设置要复制的表

     

    设置表级附加日志:

    SQL>  set pagesize 9999

    select 'alter table '|| owner||'.'||table_name||' logging;'from dba_tables where owner in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL') and logging='NO';

    'ALTERTABLE'||OWNER||'.'||TABLE_NAME||'LOGGING;'

    --------------------------------------------------------------------------------

    alter table DBUSRPUB.TKTCARDMZREC logging;

    alter table DBUSRPUB.TEM_GOODSPRICE_REP logging;

    alter table DBUSRPUB.TEMP_CALCTKPARK logging;

    alter table DBUSRPUB.GOODSPRICE_TMP logging;

    alter table DBUSRPUB.GOODSMFPRICE_TMP logging;

    alter table DBUSRPUB.ADJUSTCOST_LIST logging;

    alter table DBUSRMKT.TKTSELLYQCALC logging;

    alter table DBUSRMKT.TKTGROUPYQCALC logging;

    alter table DBUSRMKT.TKTFQTEMPLIST logging;

    alter table DBUSRMKT.TKTCALCMAXFQZJB logging;

    alter table DBUSRMKT.SUPPCLOSE_T_8 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_7 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_6 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_5 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_4 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_3 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_2 logging;

    alter table DBUSRMKT.SUPPCLOSE_T_1 logging;

    alter table DBUSRMKT.STOCKTRACK logging;

    alter table DBUSRMKT.SELLLISTTEMP logging;

    alter table DBUSRMKT.REPMFCATTEMP logging;

    alter table DBUSRMKT.REPLENISHTEMP logging;

    alter table DBUSRMKT.PAYMENTTEMP logging;

    alter table DBUSRMKT.BINSTRHEAD_TEMP logging;

    alter table DBUSRSET.SUPPAYEDDETAIL_TEMP logging;

    alter table DBUSRSET.SUPPAYDETAIL_TEMP logging;

    alter table DBUSRPOP.TKTCARDMZREC logging;

    alter table DBUSRPOP.TEMP_CALCTKPARK logging;

    alter table CONGOU.USERPOST logging;

    alter table CONGOU.USERACCOUNT logging;

    alter table CONGOU.TEMPLATEORGUSE logging;

    alter table CONGOU.TEMPLATEORGSETRES logging;

    alter table CONGOU.TEMPLATEORGSET logging;

    alter table CONGOU.TEMPLATEORG logging;

    alter table CONGOU.ROLESRES logging;

    alter table CONGOU.ROLES logging;

    alter table CONGOU.POSTSRES logging;

    alter table CONGOU.POSTS logging;

    alter table CONGOU.ORGANIZATIONBIND logging;

    alter table CONGOU.ORGANIZATION logging;

    alter table CONGOU.MODULERES logging;

    alter table CONGOU.MODULEMETHODS logging;

    alter table CONGOU.MODULE logging;

    alter table CONGOU.MAINPAGERES logging;

    alter table CONGOU.MAINPAGE logging;

    alter table CONGOU.ENTERPRISE logging;

    alter table CONGOU.DEPARTMENTRES logging;

    alter table CONGOU.DEPARTMENT logging;

    alter table CONGOU.DBNODERES logging;

    alter table CONGOU.DBNODE logging;

     

    50 rows selected.

    执行上述alter table语句。

     

    设置分区表附加日志:    

    SQL> select 'alter table '|| table_owner||'.'||table_name||' logging;'from dba_tab_partitions where table_owner in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL') and logging='NO';

     

    no rows selected

     

     

    查看表列类型是否在goldengate支持之内:

    官方文档名字:

    GoldenGate Oracle Installation and Setup Guide Release 11.2.1

     

    所在章节:

    1.5.9 Non-supported Oracle data types

    如下列出的就是不支持的类型

    Oracle GoldenGate does not support the following data types.

    ■ Abstract data types (ADT) with scalar, LOBs, VARRAYS, nested tables, and/or REFsANYDATA

    ■ ANYDATASET

    ■ ANYTYPE

    ■ BFILE

    ■ MLSLABEL

    ■ ORDDICOM

    ■ TIMEZONE_ABBR

    ■ URITYPE

    ■ UROWID

     

    查看数据库数据字典,数据库中的数据类型:

     

    SQL> select DATA_TYPE from dba_tab_columns where OWNER in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL') group by DATA_TYPE;

     

    DATA_TYPE

    --------------------------------------------------------------------------------

    LONG RAW

    LONG

    FLOAT

    TIMESTAMP(6)

    NVARCHAR2

    NUMBER

    CHAR

    CLOB

    DATE

    UNDEFINED

    VARCHAR2

    BLOB

     

    12 rows selected.

     

    查看复制的表中是否有压缩表:因为goldengate不支持压缩表

    SQL> select COMPRESSION from dba_tables where owner in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL') group by COMPRESSION;

     

    COMPRESS

    --------

    DISABLED

     

     

    查看复制的分区表中是否有压缩表:

    SQL> select 'alter table '||table_owner||'.'||table_name||' move partition '||partition_name||'nocompress update indexes;'from dba_tab_partitions where table_owner in('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL')and compression='ENABLED';

    no rows selected

     

     

    11:源端设置表级附加日志

     

    SQL>    spool add_trandata.txt

    set pagesize 9999

    select 'add trandata '||owner||'.'||table_name from dba_tables where owner in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

     

    SQL>    spool off;

     

     

    由于上述语句查到的输出语句较多,这里就不一一列出。把输出的语句,登陆ggsci后执行之。

     

    GGSCI  >  dblogin userid goldengate, password goldengate;

    Successfully logged into database.

     

    执行那些一堆命令。

     

    GGSCI  >  add trandata DBUSRSYS.*

    add trandata DBUSRPUB.*

    add trandata CONGOU.*

    add trandata DBUSRPOP.*

    add trandata DBUSRSET.*

    add trandata PORTAL.*

    add trandata DBUSRXMLT.*

    add trandata DBUSRMKT.*

    add trandata DBLINKUSR.*

     

     

    12: 源端创建capture进程

     

    GGSCI (hncdfdb1) 1>  add extract ext_hq, tranlog, begin now, threads 1;

     

    GGSCI (hncdfdb1) 2>  info all

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

    MANAGER     RUNNING                                          

    EXTRACT     STOPPED     EXT_HQ00:00:00      00:00:32    

     

    GGSCI (hncdfdb1) 3>  add exttrail ./dirdat/r1, extract ext_hq, MEGABYTES 200

     

    查看数据库的字符集:

    SQL>  set pagesize 9999 

    col name for a35

    col value for a30

    select * from nls_database_parameters;

     

    PARAMETER               VALUE

    ------------------------------ ------------------------------

    NLS_LANGUAGE                AMERICAN

    NLS_TERRITORY                AMERICA

    NLS_CURRENCY                $

    NLS_ISO_CURRENCY         AMERICA

    NLS_NUMERIC_CHARACTERS              .,

    NLS_CHARACTERSET              ZHS16GBK

    NLS_CALENDAR                GREGORIAN

    NLS_DATE_FORMAT               DD-MON-RR

    NLS_DATE_LANGUAGE            AMERICAN

    NLS_SORT                  BINARY

    NLS_TIME_FORMAT               HH.MI.SSXFF AM

    NLS_TIMESTAMP_FORMAT            DD-MON-RR HH.MI.SSXFF AM

    NLS_TIME_TZ_FORMAT          HH.MI.SSXFF AM TZR

    NLS_TIMESTAMP_TZ_FORMATDD-MON-RR HH.MI.SSXFF AM TZR

    NLS_DUAL_CURRENCY            $

    NLS_COMP                 BINARY

    NLS_LENGTH_SEMANTICS              BYTE

    NLS_NCHAR_CONV_EXCP              FALSE

    NLS_NCHAR_CHARACTERSET         AL16UTF16

    NLS_RDBMS_VERSION            10.2.0.5.0

     

    注意以上查询的红色字体部分,要和以下红色部分一样:

     

    GGSCI (hncdfdb1) 1>  edit params ext_hq

    EXTRACT ext_hq

    setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

    setenv (ORACLE_SID=hncdfhq)

    userid goldengate, password goldengate

    REPORTCOUNT EVERY 1 MINUTES, RATE

    numfiles 5000

    DISCARDFILE ./dirrpt/ext_hq.dsc, APPEND, MEGABYTES 1000

    DISCARDROLLOVER AT 3:00

    exttrail ./dirdat/r1, megabytes 200

    dynamicresolution

    TRANLOGOPTIONS EXCLUDEUSER goldengate

    TRANLOGOPTIONS convertucs2clobs

    TABLE  DBUSRSYS.*;

    TABLE  CONGOU.*;

    TABLE  DBUSRPOP.*;

    TABLE  PORTAL.*;

    TABLE  DBUSRXMLT.*;

    TABLE  DBUSRMKT.*;

    TABLE  DBLINKUSR.*;

    TABLE  DBUSRSET.*;

    TABLE  DBUSRPUB.*;

     

    启动capture 进程

    GGSCI (hncdfdb1) 1>  start ext_hq

     

    Sending START request to MANAGER ...

    EXTRACT EXT_HQ starting

     

    GGSCI (hncdfdb1) 2>  info all

     

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

     

    MANAGER     RUNNING                                           

    EXTRACT     RUNNING     EXT_HQ00:00:02      00:00:03   

     

     

    13:源端创建datapump进程

     

    GGSCI (zaibei) 8>  add extract dpe_hq, exttrailsource ./dirdat/r1

     

    GGSCI (zaibei) 9>  add rmttrail ./dirdat/d1, EXTRACT dpe_hq, MEGABYTES 200

     

    GGSCI (zaibei) 10>  edit params dpe_hq

     

    extract dpe_hq

    dynamicresolution

    passthru

    rmthost 10.191.1.10, mgrport 7855, compress

    rmttrail ./dirdat/d1

    numfiles 5000

    TABLE  DBUSRSYS.*;

    TABLE  CONGOU.*;

    TABLE  DBUSRPOP.*;

    TABLE  PORTAL.*;

    TABLE  DBUSRXMLT.*;

    TABLE  DBUSRMKT.*;

    TABLE  DBLINKUSR.*;

    TABLE  DBUSRSET.*;

    TABLE  DBUSRPUB.*;

      

     

    启动datapump进程:

    GGSCI (zaibei) 11> start dpe_hq

     

    Sending START request to MANAGER ...

    EXTRACT DPE_HQ starting

     

    GGSCI (zaibei) 12> info all

     

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

     

    MANAGER     RUNNING                                           

    EXTRACT     RUNNING     DPE_HQ00:00:00      00:02:50    

     

     

    14:验证源端capture和datapump进程

     

    源端

    $ pwd

    /oradata2/goldengate

    $ ls -l dirdat

    总用量40

    -rw-rw-rw-. 1 oracle oinstall 38886 6月  20 12:22 r1000000

     

    目标端

    [oracle@test-gg goldengate]$ pwd

    /oradb/goldengate

    [oracle@test-gg goldengate]$ ls -l dirdat

    total 40

    -rw-rw-rw-. 1 oracle oinstall 39117 Jun 20 12:20 d1000000

     

     

    15:目标端创建表空间、创建用户、赋用户权限

       

    源端查询表空间情况

    SQL> set pagesize 9999

    col file_name for a60

     col tablespace_name for a10

     select  namefrom v$tablespace;

    NAME

    ------------------------------

    SYSTEM

    RBSG_SPC

    SYSAUX

    TEMP_SPC

    DATA_SPC

    INDX_SPC

    USERS

    GOLDENGATE

     

    8 rows selected

     

    在目标数据库创建和源数据库同名并空间致少相同的表空间

    SQL> create tablespace RBSG_SPC datafile '/goldengate/oradata/hncdfhq/rbsg_spc.dbf' size 4G autoextend on;

     create tablespace DATA_SPC datafile '/goldengate/oradata/hncdfhq/data_spc.dbf' size 4G autoextend on;

    create tablespace INDX_SPC datafile '/goldengate/oradata/hncdfhq/indx_spc.dbf' size 4G autoextend on;

    create tablespace GOLDENGATE datafile '/goldengate/oradata/hncdfhq/goldengate01.dbf ' size 4G autoextend on;

     

    在源端查询用户默认的表空间

    SQL> col username for a15

     col default_tablespace for a15

     col TEMPORARY_TABLESPACE for a15

    select username,default_tablespace,TEMPORARY_TABLESPACE from dba_users where username in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

     

    USERNAME        DEFAULT_TABLESP TEMPORARY_TABLE

    --------------- --------------- ---------------

    DBUSRPUB        DATA_SPC        TEMP_SPC

    DBUSRMKT        DATA_SPC        TEMP_SPC

    DBUSRPOP        USERS           TEMP_SPC

    DBUSRXMLT       DATA_SPC        TEMP_SPC

    DBUSRSET        DATA_SPC        TEMP_SPC

    DBUSRSYS        DATA_SPC        TEMP_SPC

    CONGOU         DATA_SPC        TEMP_SPC

    PORTAL          USERS           TEMP_SPC

    DBLINKUSR       DATA_SPC        TEMP_SPC

     

    9 rows selected.

     

    目标端创建临时表空间

    SQL> create temporary tablespace TEMP_SPC tempfile '/goldengate/oradata/hncdfhq/temp_spc.dbf' size 4G autoextend on;

     

    在目标端创建用户

    SQL> create user DBUSRSYS     identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

      create user DBUSRPUB    identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     create user CONGOU     identified by future default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     create user DBUSRPOP    identified by future  default tablespace USERS    temporary tablespace TEMP_SPC;

     create user DBUSRSET    identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     create user PORTALidentified by future  default tablespace USERS    temporary tablespace TEMP_SPC;

     create user DBUSRXMLT  identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     create user DBUSRMKT   identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     create user DBLINKUSR   identified by future  default tablespace DATA_SPC temporary tablespace TEMP_SPC;

     

    在源端查询,然后在目标端赋予用户权限

    SQL>  set pagesize 9999

          select 'grant '|| privilege ||' to CONGOU;' from dba_sys_privs where grantee='CONGOU'

    union

    select 'grant '|| privilege ||' to CONGOU;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='CONGOU' )

    union

    select 'grant '|| privilege ||' to CONGOU;' from dba_tab_privs where grantee='CONGOU';

     

    grant ADMINISTER ANY SQL TUNING SET to CONGOU;

    grant ADMINISTER DATABASE TRIGGER to CONGOU;

    grant ADMINISTER RESOURCE MANAGER to CONGOU;

    grant ADMINISTER SQL TUNING SET to CONGOU;

    grant ADVISOR to CONGOU;

    grant ALTER ANY CLUSTER to CONGOU;

    grant ALTER ANY DIMENSION to CONGOU;

    grant ALTER ANY EVALUATION CONTEXT to CONGOU;

    grant ALTER ANY INDEX to CONGOU;

    grant ALTER ANY INDEXTYPE to CONGOU;

    grant ALTER ANY LIBRARY to CONGOU;

    grant ALTER ANY MATERIALIZED VIEW to CONGOU;

    grant ALTER ANY OUTLINE to CONGOU;

    grant ALTER ANY PROCEDURE to CONGOU;

    grant ALTER ANY ROLE to CONGOU;

    grant ALTER ANY RULE SET to CONGOU;

    grant ALTER ANY RULE to CONGOU;

    grant ALTER ANY SEQUENCE to CONGOU;

    grant ALTER ANY SQL PROFILE to CONGOU;

    grant ALTER ANY TABLE to CONGOU;

    grant ALTER ANY TRIGGER to CONGOU;

    grant ALTER ANY TYPE to CONGOU;

    grant ALTER DATABASE to CONGOU;

    grant ALTER PROFILE to CONGOU;

    grant ALTER RESOURCE COST to CONGOU;

    grant ALTER ROLLBACK SEGMENT to CONGOU;

    grant ALTER SESSION to CONGOU;

    grant ALTER SYSTEM to CONGOU;

    grant ALTER TABLESPACE to CONGOU;

    grant ALTER USER to CONGOU;

    grant ANALYZE ANY DICTIONARY to CONGOU;

    grant ANALYZE ANY to CONGOU;

    grant AUDIT ANY to CONGOU;

    grant AUDIT SYSTEM to CONGOU;

    grant BACKUP ANY TABLE to CONGOU;

    grant BECOME USER to CONGOU;

    grant CHANGE NOTIFICATION to CONGOU;

    grant COMMENT ANY TABLE to CONGOU;

    grant CREATE ANY CLUSTER to CONGOU;

    grant CREATE ANY CONTEXT to CONGOU;

    grant CREATE ANY DIMENSION to CONGOU;

    grant CREATE ANY DIRECTORY to CONGOU;

    grant CREATE ANY EVALUATION CONTEXT to CONGOU;

    grant CREATE ANY INDEX to CONGOU;

    grant CREATE ANY INDEXTYPE to CONGOU;

    grant CREATE ANY JOB to CONGOU;

    grant CREATE ANY LIBRARY to CONGOU;

    grant CREATE ANY MATERIALIZED VIEW to CONGOU;

    grant CREATE ANY OPERATOR to CONGOU;

    grant CREATE ANY OUTLINE to CONGOU;

    grant CREATE ANY PROCEDURE to CONGOU;

    grant CREATE ANY RULE SET to CONGOU;

    grant CREATE ANY RULE to CONGOU;

    grant CREATE ANY SEQUENCE to CONGOU;

    grant CREATE ANY SQL PROFILE to CONGOU;

    grant CREATE ANY SYNONYM to CONGOU;

    grant CREATE ANY TABLE to CONGOU;

    grant CREATE ANY TRIGGER to CONGOU;

    grant CREATE ANY TYPE to CONGOU;

    grant CREATE ANY VIEW to CONGOU;

    grant CREATE CLUSTER to CONGOU;

    grant CREATE DATABASE LINK to CONGOU;

    grant CREATE DIMENSION to CONGOU;

    grant CREATE EVALUATION CONTEXT to CONGOU;

    grant CREATE EXTERNAL JOB to CONGOU;

    grant CREATE INDEXTYPE to CONGOU;

    grant CREATE JOB to CONGOU;

    grant CREATE LIBRARY to CONGOU;

    grant CREATE MATERIALIZED VIEW to CONGOU;

    grant CREATE OPERATOR to CONGOU;

    grant CREATE PROCEDURE to CONGOU;

    grant CREATE PROFILE to CONGOU;

    grant CREATE PUBLIC DATABASE LINK to CONGOU;

    grant CREATE PUBLIC SYNONYM to CONGOU;

    grant CREATE ROLE to CONGOU;

    grant CREATE ROLLBACK SEGMENT to CONGOU;

    grant CREATE RULE SET to CONGOU;

    grant CREATE RULE to CONGOU;

    grant CREATE SEQUENCE to CONGOU;

    grant CREATE SESSION to CONGOU;

    grant CREATE SYNONYM to CONGOU;

    grant CREATE TABLE to CONGOU;

    grant CREATE TABLESPACE to CONGOU;

    grant CREATE TRIGGER to CONGOU;

    grant CREATE TYPE to CONGOU;

    grant CREATE USER to CONGOU;

    grant CREATE VIEW to CONGOU;

    grant DEBUG ANY PROCEDURE to CONGOU;

    grant DEBUG CONNECT SESSION to CONGOU;

    grant DELETE ANY TABLE to CONGOU;

    grant DEQUEUE ANY QUEUE to CONGOU;

    grant DROP ANY CLUSTER to CONGOU;

    grant DROP ANY CONTEXT to CONGOU;

    grant DROP ANY DIMENSION to CONGOU;

    grant DROP ANY DIRECTORY to CONGOU;

    grant DROP ANY EVALUATION CONTEXT to CONGOU;

    grant DROP ANY INDEX to CONGOU;

    grant DROP ANY INDEXTYPE to CONGOU;

    grant DROP ANY LIBRARY to CONGOU;

    grant DROP ANY MATERIALIZED VIEW to CONGOU;

    grant DROP ANY OPERATOR to CONGOU;

    grant DROP ANY OUTLINE to CONGOU;

    grant DROP ANY PROCEDURE to CONGOU;

    grant DROP ANY ROLE to CONGOU;

    grant DROP ANY RULE SET to CONGOU;

    grant DROP ANY RULE to CONGOU;

    grant DROP ANY SEQUENCE to CONGOU;

    grant DROP ANY SQL PROFILE to CONGOU;

    grant DROP ANY SYNONYM to CONGOU;

    grant DROP ANY TABLE to CONGOU;

    grant DROP ANY TRIGGER to CONGOU;

    grant DROP ANY TYPE to CONGOU;

    grant DROP ANY VIEW to CONGOU;

    grant DROP PROFILE to CONGOU;

    grant DROP PUBLIC DATABASE LINK to CONGOU;

    grant DROP PUBLIC SYNONYM to CONGOU;

    grant DROP ROLLBACK SEGMENT to CONGOU;

    grant DROP TABLESPACE to CONGOU;

    grant DROP USER to CONGOU;

    grant ENQUEUE ANY QUEUE to CONGOU;

    grant EXECUTE ANY CLASS to CONGOU;

    grant EXECUTE ANY EVALUATION CONTEXT to CONGOU;

    grant EXECUTE ANY INDEXTYPE to CONGOU;

    grant EXECUTE ANY LIBRARY to CONGOU;

    grant EXECUTE ANY OPERATOR to CONGOU;

    grant EXECUTE ANY PROCEDURE to CONGOU;

    grant EXECUTE ANY PROGRAM to CONGOU;

    grant EXECUTE ANY RULE SET to CONGOU;

    grant EXECUTE ANY RULE to CONGOU;

    grant EXECUTE ANY TYPE to CONGOU;

    grant EXPORT FULL DATABASE to CONGOU;

    grant FLASHBACK ANY TABLE to CONGOU;

    grant FORCE ANY TRANSACTION to CONGOU;

    grant FORCE TRANSACTION to CONGOU;

    grant GLOBAL QUERY REWRITE to CONGOU;

    grant GRANT ANY OBJECT PRIVILEGE to CONGOU;

    grant GRANT ANY PRIVILEGE to CONGOU;

    grant GRANT ANY ROLE to CONGOU;

    grant IMPORT FULL DATABASE to CONGOU;

    grant INSERT ANY TABLE to CONGOU;

    grant LOCK ANY TABLE to CONGOU;

    grant MANAGE ANY FILE GROUP to CONGOU;

    grant MANAGE ANY QUEUE to CONGOU;

    grant MANAGE FILE GROUP to CONGOU;

    grant MANAGE SCHEDULER to CONGOU;

    grant MANAGE TABLESPACE to CONGOU;

    grant MERGE ANY VIEW to CONGOU;

    grant ON COMMIT REFRESH to CONGOU;

    grant QUERY REWRITE to CONGOU;

    grant READ ANY FILE GROUP to CONGOU;

    grant RESTRICTED SESSION to CONGOU;

    grant RESUMABLE to CONGOU;

    grant SELECT ANY DICTIONARY to CONGOU;

    grant SELECT ANY SEQUENCE to CONGOU;

    grant SELECT ANY TABLE to CONGOU;

    grant SELECT ANY TRANSACTION to CONGOU;

    grant UNDER ANY TABLE to CONGOU;

    grant UNDER ANY TYPE to CONGOU;

    grant UNDER ANY VIEW to CONGOU;

    grant UNLIMITED TABLESPACE to CONGOU;

    grant UPDATE ANY TABLE to CONGOU;

     

    SQL>  select 'grant '|| privilege ||' to DBLINKUSR;' from dba_sys_privs where grantee='DBLINKUSR'

    union

    select 'grant '|| privilege ||' to DBLINKUSR;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBLINKUSR' )

    union

    select 'grant '|| privilege ||' to DBLINKUSR;' from dba_tab_privs where grantee='DBLINKUSR';

     

    grant ADMINISTER ANY SQL TUNING SET to DBLINKUSR;

    grant ADMINISTER DATABASE TRIGGER to DBLINKUSR;

    grant ADMINISTER RESOURCE MANAGER to DBLINKUSR;

    grant ADMINISTER SQL TUNING SET to DBLINKUSR;

    grant ADVISOR to DBLINKUSR;

    grant ALTER ANY CLUSTER to DBLINKUSR;

    grant ALTER ANY DIMENSION to DBLINKUSR;

    grant ALTER ANY EVALUATION CONTEXT to DBLINKUSR;

    grant ALTER ANY INDEX to DBLINKUSR;

    grant ALTER ANY INDEXTYPE to DBLINKUSR;

    grant ALTER ANY LIBRARY to DBLINKUSR;

    grant ALTER ANY MATERIALIZED VIEW to DBLINKUSR;

    grant ALTER ANY OUTLINE to DBLINKUSR;

    grant ALTER ANY PROCEDURE to DBLINKUSR;

    grant ALTER ANY ROLE to DBLINKUSR;

    grant ALTER ANY RULE SET to DBLINKUSR;

    grant ALTER ANY RULE to DBLINKUSR;

    grant ALTER ANY SEQUENCE to DBLINKUSR;

    grant ALTER ANY SQL PROFILE to DBLINKUSR;

    grant ALTER ANY TABLE to DBLINKUSR;

    grant ALTER ANY TRIGGER to DBLINKUSR;

    grant ALTER ANY TYPE to DBLINKUSR;

    grant ALTER DATABASE to DBLINKUSR;

    grant ALTER PROFILE to DBLINKUSR;

    grant ALTER RESOURCE COST to DBLINKUSR;

    grant ALTER ROLLBACK SEGMENT to DBLINKUSR;

    grant ALTER SESSION to DBLINKUSR;

    grant ALTER SYSTEM to DBLINKUSR;

    grant ALTER TABLESPACE to DBLINKUSR;

    grant ALTER USER to DBLINKUSR;

    grant ANALYZE ANY DICTIONARY to DBLINKUSR;

    grant ANALYZE ANY to DBLINKUSR;

    grant AUDIT ANY to DBLINKUSR;

    grant AUDIT SYSTEM to DBLINKUSR;

    grant BACKUP ANY TABLE to DBLINKUSR;

    grant BECOME USER to DBLINKUSR;

    grant CHANGE NOTIFICATION to DBLINKUSR;

    grant COMMENT ANY TABLE to DBLINKUSR;

    grant CREATE ANY CLUSTER to DBLINKUSR;

    grant CREATE ANY CONTEXT to DBLINKUSR;

    grant CREATE ANY DIMENSION to DBLINKUSR;

    grant CREATE ANY DIRECTORY to DBLINKUSR;

    grant CREATE ANY EVALUATION CONTEXT to DBLINKUSR;

    grant CREATE ANY INDEX to DBLINKUSR;

    grant CREATE ANY INDEXTYPE to DBLINKUSR;

    grant CREATE ANY JOB to DBLINKUSR;

    grant CREATE ANY LIBRARY to DBLINKUSR;

    grant CREATE ANY MATERIALIZED VIEW to DBLINKUSR;

    grant CREATE ANY OPERATOR to DBLINKUSR;

    grant CREATE ANY OUTLINE to DBLINKUSR;

    grant CREATE ANY PROCEDURE to DBLINKUSR;

    grant CREATE ANY RULE SET to DBLINKUSR;

    grant CREATE ANY RULE to DBLINKUSR;

    grant CREATE ANY SEQUENCE to DBLINKUSR;

    grant CREATE ANY SQL PROFILE to DBLINKUSR;

    grant CREATE ANY SYNONYM to DBLINKUSR;

    grant CREATE ANY TABLE to DBLINKUSR;

    grant CREATE ANY TRIGGER to DBLINKUSR;

    grant CREATE ANY TYPE to DBLINKUSR;

    grant CREATE ANY VIEW to DBLINKUSR;

    grant CREATE CLUSTER to DBLINKUSR;

    grant CREATE DATABASE LINK to DBLINKUSR;

    grant CREATE DIMENSION to DBLINKUSR;

    grant CREATE EVALUATION CONTEXT to DBLINKUSR;

    grant CREATE EXTERNAL JOB to DBLINKUSR;

    grant CREATE INDEXTYPE to DBLINKUSR;

    grant CREATE JOB to DBLINKUSR;

    grant CREATE LIBRARY to DBLINKUSR;

    grant CREATE MATERIALIZED VIEW to DBLINKUSR;

    grant CREATE OPERATOR to DBLINKUSR;

    grant CREATE PROCEDURE to DBLINKUSR;

    grant CREATE PROFILE to DBLINKUSR;

    grant CREATE PUBLIC DATABASE LINK to DBLINKUSR;

    grant CREATE PUBLIC SYNONYM to DBLINKUSR;

    grant CREATE ROLE to DBLINKUSR;

    grant CREATE ROLLBACK SEGMENT to DBLINKUSR;

    grant CREATE RULE SET to DBLINKUSR;

    grant CREATE RULE to DBLINKUSR;

    grant CREATE SEQUENCE to DBLINKUSR;

    grant CREATE SESSION to DBLINKUSR;

    grant CREATE SYNONYM to DBLINKUSR;

    grant CREATE TABLE to DBLINKUSR;

    grant CREATE TABLESPACE to DBLINKUSR;

    grant CREATE TRIGGER to DBLINKUSR;

    grant CREATE TYPE to DBLINKUSR;

    grant CREATE USER to DBLINKUSR;

    grant CREATE VIEW to DBLINKUSR;

    grant DEBUG ANY PROCEDURE to DBLINKUSR;

    grant DEBUG CONNECT SESSION to DBLINKUSR;

    grant DELETE ANY TABLE to DBLINKUSR;

    grant DEQUEUE ANY QUEUE to DBLINKUSR;

    grant DROP ANY CLUSTER to DBLINKUSR;

    grant DROP ANY CONTEXT to DBLINKUSR;

    grant DROP ANY DIMENSION to DBLINKUSR;

    grant DROP ANY DIRECTORY to DBLINKUSR;

    grant DROP ANY EVALUATION CONTEXT to DBLINKUSR;

    grant DROP ANY INDEX to DBLINKUSR;

    grant DROP ANY INDEXTYPE to DBLINKUSR;

    grant DROP ANY LIBRARY to DBLINKUSR;

    grant DROP ANY MATERIALIZED VIEW to DBLINKUSR;

    grant DROP ANY OPERATOR to DBLINKUSR;

    grant DROP ANY OUTLINE to DBLINKUSR;

    grant DROP ANY PROCEDURE to DBLINKUSR;

    grant DROP ANY ROLE to DBLINKUSR;

    grant DROP ANY RULE SET to DBLINKUSR;

    grant DROP ANY RULE to DBLINKUSR;

    grant DROP ANY SEQUENCE to DBLINKUSR;

    grant DROP ANY SQL PROFILE to DBLINKUSR;

    grant DROP ANY SYNONYM to DBLINKUSR;

    grant DROP ANY TABLE to DBLINKUSR;

    grant DROP ANY TRIGGER to DBLINKUSR;

    grant DROP ANY TYPE to DBLINKUSR;

    grant DROP ANY VIEW to DBLINKUSR;

    grant DROP PROFILE to DBLINKUSR;

    grant DROP PUBLIC DATABASE LINK to DBLINKUSR;

    grant DROP PUBLIC SYNONYM to DBLINKUSR;

    grant DROP ROLLBACK SEGMENT to DBLINKUSR;

    grant DROP TABLESPACE to DBLINKUSR;

    grant DROP USER to DBLINKUSR;

    grant ENQUEUE ANY QUEUE to DBLINKUSR;

    grant EXECUTE ANY CLASS to DBLINKUSR;

    grant EXECUTE ANY EVALUATION CONTEXT to DBLINKUSR;

    grant EXECUTE ANY INDEXTYPE to DBLINKUSR;

    grant EXECUTE ANY LIBRARY to DBLINKUSR;

    grant EXECUTE ANY OPERATOR to DBLINKUSR;

    grant EXECUTE ANY PROCEDURE to DBLINKUSR;

    grant EXECUTE ANY PROGRAM to DBLINKUSR;

    grant EXECUTE ANY RULE SET to DBLINKUSR;

    grant EXECUTE ANY RULE to DBLINKUSR;

    grant EXECUTE ANY TYPE to DBLINKUSR;

    grant EXPORT FULL DATABASE to DBLINKUSR;

    grant FLASHBACK ANY TABLE to DBLINKUSR;

    grant FORCE ANY TRANSACTION to DBLINKUSR;

    grant FORCE TRANSACTION to DBLINKUSR;

    grant GLOBAL QUERY REWRITE to DBLINKUSR;

    grant GRANT ANY OBJECT PRIVILEGE to DBLINKUSR;

    grant GRANT ANY PRIVILEGE to DBLINKUSR;

    grant GRANT ANY ROLE to DBLINKUSR;

    grant IMPORT FULL DATABASE to DBLINKUSR;

    grant INSERT ANY TABLE to DBLINKUSR;

    grant LOCK ANY TABLE to DBLINKUSR;

    grant MANAGE ANY FILE GROUP to DBLINKUSR;

    grant MANAGE ANY QUEUE to DBLINKUSR;

    grant MANAGE FILE GROUP to DBLINKUSR;

    grant MANAGE SCHEDULER to DBLINKUSR;

    grant MANAGE TABLESPACE to DBLINKUSR;

    grant MERGE ANY VIEW to DBLINKUSR;

    grant ON COMMIT REFRESH to DBLINKUSR;

    grant QUERY REWRITE to DBLINKUSR;

    grant READ ANY FILE GROUP to DBLINKUSR;

    grant RESTRICTED SESSION to DBLINKUSR;

    grant RESUMABLE to DBLINKUSR;

    grant SELECT ANY DICTIONARY to DBLINKUSR;

    grant SELECT ANY SEQUENCE to DBLINKUSR;

    grant SELECT ANY TABLE to DBLINKUSR;

    grant SELECT ANY TRANSACTION to DBLINKUSR;

    grant UNDER ANY TABLE to DBLINKUSR;

    grant UNDER ANY TYPE to DBLINKUSR;

    grant UNDER ANY VIEW to DBLINKUSR;

    grant UNLIMITED TABLESPACE to DBLINKUSR;

    grant UPDATE ANY TABLE to DBLINKUSR;

     

    SQL>  select 'grant '|| privilege ||' to DBUSRMKT;' from dba_sys_privs where grantee='DBUSRMKT'

    union

    select 'grant '|| privilege ||' to DBUSRMKT;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRMKT' )

    union

    select 'grant '|| privilege ||' to DBUSRMKT;' from dba_tab_privs where grantee='DBUSRMKT';

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRMKT;

    grant ADMINISTER DATABASE TRIGGER to DBUSRMKT;

    grant ADMINISTER RESOURCE MANAGER to DBUSRMKT;

    grant ADMINISTER SQL TUNING SET to DBUSRMKT;

    grant ADVISOR to DBUSRMKT;

    grant ALTER ANY CLUSTER to DBUSRMKT;

    grant ALTER ANY DIMENSION to DBUSRMKT;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRMKT;

    grant ALTER ANY INDEX to DBUSRMKT;

    grant ALTER ANY INDEXTYPE to DBUSRMKT;

    grant ALTER ANY LIBRARY to DBUSRMKT;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRMKT;

    grant ALTER ANY OUTLINE to DBUSRMKT;

    grant ALTER ANY PROCEDURE to DBUSRMKT;

    grant ALTER ANY ROLE to DBUSRMKT;

    grant ALTER ANY RULE SET to DBUSRMKT;

    grant ALTER ANY RULE to DBUSRMKT;

    grant ALTER ANY SEQUENCE to DBUSRMKT;

    grant ALTER ANY SQL PROFILE to DBUSRMKT;

    grant ALTER ANY TABLE to DBUSRMKT;

    grant ALTER ANY TRIGGER to DBUSRMKT;

    grant ALTER ANY TYPE to DBUSRMKT;

    grant ALTER DATABASE to DBUSRMKT;

    grant ALTER PROFILE to DBUSRMKT;

    grant ALTER RESOURCE COST to DBUSRMKT;

    grant ALTER ROLLBACK SEGMENT to DBUSRMKT;

    grant ALTER SESSION to DBUSRMKT;

    grant ALTER SYSTEM to DBUSRMKT;

    grant ALTER TABLESPACE to DBUSRMKT;

    grant ALTER USER to DBUSRMKT;

    grant ANALYZE ANY DICTIONARY to DBUSRMKT;

    grant ANALYZE ANY to DBUSRMKT;

    grant AUDIT ANY to DBUSRMKT;

    grant AUDIT SYSTEM to DBUSRMKT;

    grant BACKUP ANY TABLE to DBUSRMKT;

    grant BECOME USER to DBUSRMKT;

    grant CHANGE NOTIFICATION to DBUSRMKT;

    grant COMMENT ANY TABLE to DBUSRMKT;

    grant CREATE ANY CLUSTER to DBUSRMKT;

    grant CREATE ANY CONTEXT to DBUSRMKT;

    grant CREATE ANY DIMENSION to DBUSRMKT;

    grant CREATE ANY DIRECTORY to DBUSRMKT;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRMKT;

    grant CREATE ANY INDEX to DBUSRMKT;

    grant CREATE ANY INDEXTYPE to DBUSRMKT;

    grant CREATE ANY JOB to DBUSRMKT;

    grant CREATE ANY LIBRARY to DBUSRMKT;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRMKT;

    grant CREATE ANY OPERATOR to DBUSRMKT;

    grant CREATE ANY OUTLINE to DBUSRMKT;

    grant CREATE ANY PROCEDURE to DBUSRMKT;

    grant CREATE ANY RULE SET to DBUSRMKT;

    grant CREATE ANY RULE to DBUSRMKT;

    grant CREATE ANY SEQUENCE to DBUSRMKT;

    grant CREATE ANY SQL PROFILE to DBUSRMKT;

    grant CREATE ANY SYNONYM to DBUSRMKT;

    grant CREATE ANY TABLE to DBUSRMKT;

    grant CREATE ANY TRIGGER to DBUSRMKT;

    grant CREATE ANY TYPE to DBUSRMKT;

    grant CREATE ANY VIEW to DBUSRMKT;

    grant CREATE CLUSTER to DBUSRMKT;

    grant CREATE DATABASE LINK to DBUSRMKT;

    grant CREATE DIMENSION to DBUSRMKT;

    grant CREATE EVALUATION CONTEXT to DBUSRMKT;

    grant CREATE EXTERNAL JOB to DBUSRMKT;

    grant CREATE INDEXTYPE to DBUSRMKT;

    grant CREATE JOB to DBUSRMKT;

    grant CREATE LIBRARY to DBUSRMKT;

    grant CREATE MATERIALIZED VIEW to DBUSRMKT;

    grant CREATE OPERATOR to DBUSRMKT;

    grant CREATE PROCEDURE to DBUSRMKT;

    grant CREATE PROFILE to DBUSRMKT;

    grant CREATE PUBLIC DATABASE LINK to DBUSRMKT;

    grant CREATE PUBLIC SYNONYM to DBUSRMKT;

    grant CREATE ROLE to DBUSRMKT;

    grant CREATE ROLLBACK SEGMENT to DBUSRMKT;

    grant CREATE RULE SET to DBUSRMKT;

    grant CREATE RULE to DBUSRMKT;

    grant CREATE SEQUENCE to DBUSRMKT;

    grant CREATE SESSION to DBUSRMKT;

    grant CREATE SYNONYM to DBUSRMKT;

    grant CREATE TABLE to DBUSRMKT;

    grant CREATE TABLESPACE to DBUSRMKT;

    grant CREATE TRIGGER to DBUSRMKT;

    grant CREATE TYPE to DBUSRMKT;

    grant CREATE USER to DBUSRMKT;

    grant CREATE VIEW to DBUSRMKT;

    grant DEBUG ANY PROCEDURE to DBUSRMKT;

    grant DEBUG CONNECT SESSION to DBUSRMKT;

    grant DELETE ANY TABLE to DBUSRMKT;

    grant DEQUEUE ANY QUEUE to DBUSRMKT;

    grant DROP ANY CLUSTER to DBUSRMKT;

    grant DROP ANY CONTEXT to DBUSRMKT;

    grant DROP ANY DIMENSION to DBUSRMKT;

    grant DROP ANY DIRECTORY to DBUSRMKT;

    grant DROP ANY EVALUATION CONTEXT to DBUSRMKT;

    grant DROP ANY INDEX to DBUSRMKT;

    grant DROP ANY INDEXTYPE to DBUSRMKT;

    grant DROP ANY LIBRARY to DBUSRMKT;

    grant DROP ANY MATERIALIZED VIEW to DBUSRMKT;

    grant DROP ANY OPERATOR to DBUSRMKT;

    grant DROP ANY OUTLINE to DBUSRMKT;

    grant DROP ANY PROCEDURE to DBUSRMKT;

    grant DROP ANY ROLE to DBUSRMKT;

    grant DROP ANY RULE SET to DBUSRMKT;

    grant DROP ANY RULE to DBUSRMKT;

    grant DROP ANY SEQUENCE to DBUSRMKT;

    grant DROP ANY SQL PROFILE to DBUSRMKT;

    grant DROP ANY SYNONYM to DBUSRMKT;

    grant DROP ANY TABLE to DBUSRMKT;

    grant DROP ANY TRIGGER to DBUSRMKT;

    grant DROP ANY TYPE to DBUSRMKT;

    grant DROP ANY VIEW to DBUSRMKT;

    grant DROP PROFILE to DBUSRMKT;

    grant DROP PUBLIC DATABASE LINK to DBUSRMKT;

    grant DROP PUBLIC SYNONYM to DBUSRMKT;

    grant DROP ROLLBACK SEGMENT to DBUSRMKT;

    grant DROP TABLESPACE to DBUSRMKT;

    grant DROP USER to DBUSRMKT;

    grant ENQUEUE ANY QUEUE to DBUSRMKT;

    grant EXECUTE ANY CLASS to DBUSRMKT;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRMKT;

    grant EXECUTE ANY INDEXTYPE to DBUSRMKT;

    grant EXECUTE ANY LIBRARY to DBUSRMKT;

    grant EXECUTE ANY OPERATOR to DBUSRMKT;

    grant EXECUTE ANY PROCEDURE to DBUSRMKT;

    grant EXECUTE ANY PROGRAM to DBUSRMKT;

    grant EXECUTE ANY RULE SET to DBUSRMKT;

    grant EXECUTE ANY RULE to DBUSRMKT;

    grant EXECUTE ANY TYPE to DBUSRMKT;

    grant EXPORT FULL DATABASE to DBUSRMKT;

    grant FLASHBACK ANY TABLE to DBUSRMKT;

    grant FORCE ANY TRANSACTION to DBUSRMKT;

    grant FORCE TRANSACTION to DBUSRMKT;

    grant GLOBAL QUERY REWRITE to DBUSRMKT;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRMKT;

    grant GRANT ANY PRIVILEGE to DBUSRMKT;

    grant GRANT ANY ROLE to DBUSRMKT;

    grant IMPORT FULL DATABASE to DBUSRMKT;

    grant INSERT ANY TABLE to DBUSRMKT;

    grant LOCK ANY TABLE to DBUSRMKT;

    grant MANAGE ANY FILE GROUP to DBUSRMKT;

    grant MANAGE ANY QUEUE to DBUSRMKT;

    grant MANAGE FILE GROUP to DBUSRMKT;

    grant MANAGE SCHEDULER to DBUSRMKT;

    grant MANAGE TABLESPACE to DBUSRMKT;

    grant MERGE ANY VIEW to DBUSRMKT;

    grant ON COMMIT REFRESH to DBUSRMKT;

    grant QUERY REWRITE to DBUSRMKT;

    grant READ ANY FILE GROUP to DBUSRMKT;

    grant RESTRICTED SESSION to DBUSRMKT;

    grant RESUMABLE to DBUSRMKT;

    grant SELECT ANY DICTIONARY to DBUSRMKT;

    grant SELECT ANY SEQUENCE to DBUSRMKT;

    grant SELECT ANY TABLE to DBUSRMKT;

    grant SELECT ANY TRANSACTION to DBUSRMKT;

    grant UNDER ANY TABLE to DBUSRMKT;

    grant UNDER ANY TYPE to DBUSRMKT;

    grant UNDER ANY VIEW to DBUSRMKT;

    grant UNLIMITED TABLESPACE to DBUSRMKT;

    grant UPDATE ANY TABLE to DBUSRMKT;

     

    SQL>  select 'grant '|| privilege ||' to DBUSRPOP;' from dba_sys_privs where grantee='DBUSRPOP'

    union

    select 'grant '|| privilege ||' to DBUSRPOP;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRPOP' )

    union

    select 'grant '|| privilege ||' to DBUSRPOP;' from dba_tab_privs where grantee='DBUSRPOP';

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRPOP;

    grant ADMINISTER DATABASE TRIGGER to DBUSRPOP;

    grant ADMINISTER RESOURCE MANAGER to DBUSRPOP;

    grant ADMINISTER SQL TUNING SET to DBUSRPOP;

    grant ADVISOR to DBUSRPOP;

    grant ALTER ANY CLUSTER to DBUSRPOP;

    grant ALTER ANY DIMENSION to DBUSRPOP;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRPOP;

    grant ALTER ANY INDEX to DBUSRPOP;

    grant ALTER ANY INDEXTYPE to DBUSRPOP;

    grant ALTER ANY LIBRARY to DBUSRPOP;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRPOP;

    grant ALTER ANY OUTLINE to DBUSRPOP;

    grant ALTER ANY PROCEDURE to DBUSRPOP;

    grant ALTER ANY ROLE to DBUSRPOP;

    grant ALTER ANY RULE SET to DBUSRPOP;

    grant ALTER ANY RULE to DBUSRPOP;

    grant ALTER ANY SEQUENCE to DBUSRPOP;

    grant ALTER ANY SQL PROFILE to DBUSRPOP;

    grant ALTER ANY TABLE to DBUSRPOP;

    grant ALTER ANY TRIGGER to DBUSRPOP;

    grant ALTER ANY TYPE to DBUSRPOP;

    grant ALTER DATABASE to DBUSRPOP;

    grant ALTER PROFILE to DBUSRPOP;

    grant ALTER RESOURCE COST to DBUSRPOP;

    grant ALTER ROLLBACK SEGMENT to DBUSRPOP;

    grant ALTER SESSION to DBUSRPOP;

    grant ALTER SYSTEM to DBUSRPOP;

    grant ALTER TABLESPACE to DBUSRPOP;

    grant ALTER USER to DBUSRPOP;

    grant ANALYZE ANY DICTIONARY to DBUSRPOP;

    grant ANALYZE ANY to DBUSRPOP;

    grant AUDIT ANY to DBUSRPOP;

    grant AUDIT SYSTEM to DBUSRPOP;

    grant BACKUP ANY TABLE to DBUSRPOP;

    grant BECOME USER to DBUSRPOP;

    grant CHANGE NOTIFICATION to DBUSRPOP;

    grant COMMENT ANY TABLE to DBUSRPOP;

    grant CREATE ANY CLUSTER to DBUSRPOP;

    grant CREATE ANY CONTEXT to DBUSRPOP;

    grant CREATE ANY DIMENSION to DBUSRPOP;

    grant CREATE ANY DIRECTORY to DBUSRPOP;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRPOP;

    grant CREATE ANY INDEX to DBUSRPOP;

    grant CREATE ANY INDEXTYPE to DBUSRPOP;

    grant CREATE ANY JOB to DBUSRPOP;

    grant CREATE ANY LIBRARY to DBUSRPOP;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRPOP;

    grant CREATE ANY OPERATOR to DBUSRPOP;

    grant CREATE ANY OUTLINE to DBUSRPOP;

    grant CREATE ANY PROCEDURE to DBUSRPOP;

    grant CREATE ANY RULE SET to DBUSRPOP;

    grant CREATE ANY RULE to DBUSRPOP;

    grant CREATE ANY SEQUENCE to DBUSRPOP;

    grant CREATE ANY SQL PROFILE to DBUSRPOP;

    grant CREATE ANY SYNONYM to DBUSRPOP;

    grant CREATE ANY TABLE to DBUSRPOP;

    grant CREATE ANY TRIGGER to DBUSRPOP;

    grant CREATE ANY TYPE to DBUSRPOP;

    grant CREATE ANY VIEW to DBUSRPOP;

    grant CREATE CLUSTER to DBUSRPOP;

    grant CREATE DATABASE LINK to DBUSRPOP;

    grant CREATE DIMENSION to DBUSRPOP;

    grant CREATE EVALUATION CONTEXT to DBUSRPOP;

    grant CREATE EXTERNAL JOB to DBUSRPOP;

    grant CREATE INDEXTYPE to DBUSRPOP;

    grant CREATE JOB to DBUSRPOP;

    grant CREATE LIBRARY to DBUSRPOP;

    grant CREATE MATERIALIZED VIEW to DBUSRPOP;

    grant CREATE OPERATOR to DBUSRPOP;

    grant CREATE PROCEDURE to DBUSRPOP;

    grant CREATE PROFILE to DBUSRPOP;

    grant CREATE PUBLIC DATABASE LINK to DBUSRPOP;

    grant CREATE PUBLIC SYNONYM to DBUSRPOP;

    grant CREATE ROLE to DBUSRPOP;

    grant CREATE ROLLBACK SEGMENT to DBUSRPOP;

    grant CREATE RULE SET to DBUSRPOP;

    grant CREATE RULE to DBUSRPOP;

    grant CREATE SEQUENCE to DBUSRPOP;

    grant CREATE SESSION to DBUSRPOP;

    grant CREATE SYNONYM to DBUSRPOP;

    grant CREATE TABLE to DBUSRPOP;

    grant CREATE TABLESPACE to DBUSRPOP;

    grant CREATE TRIGGER to DBUSRPOP;

    grant CREATE TYPE to DBUSRPOP;

    grant CREATE USER to DBUSRPOP;

    grant CREATE VIEW to DBUSRPOP;

    grant DEBUG ANY PROCEDURE to DBUSRPOP;

    grant DEBUG CONNECT SESSION to DBUSRPOP;

    grant DELETE ANY TABLE to DBUSRPOP;

    grant DEQUEUE ANY QUEUE to DBUSRPOP;

    grant DROP ANY CLUSTER to DBUSRPOP;

    grant DROP ANY CONTEXT to DBUSRPOP;

    grant DROP ANY DIMENSION to DBUSRPOP;

    grant DROP ANY DIRECTORY to DBUSRPOP;

    grant DROP ANY EVALUATION CONTEXT to DBUSRPOP;

    grant DROP ANY INDEX to DBUSRPOP;

    grant DROP ANY INDEXTYPE to DBUSRPOP;

    grant DROP ANY LIBRARY to DBUSRPOP;

    grant DROP ANY MATERIALIZED VIEW to DBUSRPOP;

    grant DROP ANY OPERATOR to DBUSRPOP;

    grant DROP ANY OUTLINE to DBUSRPOP;

    grant DROP ANY PROCEDURE to DBUSRPOP;

    grant DROP ANY ROLE to DBUSRPOP;

    grant DROP ANY RULE SET to DBUSRPOP;

    grant DROP ANY RULE to DBUSRPOP;

    grant DROP ANY SEQUENCE to DBUSRPOP;

    grant DROP ANY SQL PROFILE to DBUSRPOP;

    grant DROP ANY SYNONYM to DBUSRPOP;

    grant DROP ANY TABLE to DBUSRPOP;

    grant DROP ANY TRIGGER to DBUSRPOP;

    grant DROP ANY TYPE to DBUSRPOP;

    grant DROP ANY VIEW to DBUSRPOP;

    grant DROP PROFILE to DBUSRPOP;

    grant DROP PUBLIC DATABASE LINK to DBUSRPOP;

    grant DROP PUBLIC SYNONYM to DBUSRPOP;

    grant DROP ROLLBACK SEGMENT to DBUSRPOP;

    grant DROP TABLESPACE to DBUSRPOP;

    grant DROP USER to DBUSRPOP;

    grant ENQUEUE ANY QUEUE to DBUSRPOP;

    grant EXECUTE ANY CLASS to DBUSRPOP;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRPOP;

    grant EXECUTE ANY INDEXTYPE to DBUSRPOP;

    grant EXECUTE ANY LIBRARY to DBUSRPOP;

    grant EXECUTE ANY OPERATOR to DBUSRPOP;

    grant EXECUTE ANY PROCEDURE to DBUSRPOP;

    grant EXECUTE ANY PROGRAM to DBUSRPOP;

    grant EXECUTE ANY RULE SET to DBUSRPOP;

    grant EXECUTE ANY RULE to DBUSRPOP;

    grant EXECUTE ANY TYPE to DBUSRPOP;

    grant EXPORT FULL DATABASE to DBUSRPOP;

    grant FLASHBACK ANY TABLE to DBUSRPOP;

    grant FORCE ANY TRANSACTION to DBUSRPOP;

    grant FORCE TRANSACTION to DBUSRPOP;

    grant GLOBAL QUERY REWRITE to DBUSRPOP;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRPOP;

    grant GRANT ANY PRIVILEGE to DBUSRPOP;

    grant GRANT ANY ROLE to DBUSRPOP;

    grant IMPORT FULL DATABASE to DBUSRPOP;

    grant INSERT ANY TABLE to DBUSRPOP;

    grant LOCK ANY TABLE to DBUSRPOP;

    grant MANAGE ANY FILE GROUP to DBUSRPOP;

    grant MANAGE ANY QUEUE to DBUSRPOP;

    grant MANAGE FILE GROUP to DBUSRPOP;

    grant MANAGE SCHEDULER to DBUSRPOP;

    grant MANAGE TABLESPACE to DBUSRPOP;

    grant MERGE ANY VIEW to DBUSRPOP;

    grant ON COMMIT REFRESH to DBUSRPOP;

    grant QUERY REWRITE to DBUSRPOP;

    grant READ ANY FILE GROUP to DBUSRPOP;

    grant RESTRICTED SESSION to DBUSRPOP;

    grant RESUMABLE to DBUSRPOP;

    grant SELECT ANY DICTIONARY to DBUSRPOP;

    grant SELECT ANY SEQUENCE to DBUSRPOP;

    grant SELECT ANY TABLE to DBUSRPOP;

    grant SELECT ANY TRANSACTION to DBUSRPOP;

    grant UNDER ANY TABLE to DBUSRPOP;

    grant UNDER ANY TYPE to DBUSRPOP;

    grant UNDER ANY VIEW to DBUSRPOP;

    grant UNLIMITED TABLESPACE to DBUSRPOP;

    grant UPDATE ANY TABLE to DBUSRPOP;

     

    SQL>  select 'grant '|| privilege ||' to DBUSRPUB;' from dba_sys_privs where grantee='DBUSRPUB'

    union

    select 'grant '|| privilege ||' to DBUSRPUB;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRPUB' )

    union

    select 'grant '|| privilege ||' to DBUSRPUB;' from dba_tab_privs where grantee='DBUSRPUB';

     

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRPUB;

    grant ADMINISTER DATABASE TRIGGER to DBUSRPUB;

    grant ADMINISTER RESOURCE MANAGER to DBUSRPUB;

    grant ADMINISTER SQL TUNING SET to DBUSRPUB;

    grant ADVISOR to DBUSRPUB;

    grant ALTER ANY CLUSTER to DBUSRPUB;

    grant ALTER ANY DIMENSION to DBUSRPUB;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRPUB;

    grant ALTER ANY INDEX to DBUSRPUB;

    grant ALTER ANY INDEXTYPE to DBUSRPUB;

    grant ALTER ANY LIBRARY to DBUSRPUB;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRPUB;

    grant ALTER ANY OUTLINE to DBUSRPUB;

    grant ALTER ANY PROCEDURE to DBUSRPUB;

    grant ALTER ANY ROLE to DBUSRPUB;

    grant ALTER ANY RULE SET to DBUSRPUB;

    grant ALTER ANY RULE to DBUSRPUB;

    grant ALTER ANY SEQUENCE to DBUSRPUB;

    grant ALTER ANY SQL PROFILE to DBUSRPUB;

    grant ALTER ANY TABLE to DBUSRPUB;

    grant ALTER ANY TRIGGER to DBUSRPUB;

    grant ALTER ANY TYPE to DBUSRPUB;

    grant ALTER DATABASE to DBUSRPUB;

    grant ALTER PROFILE to DBUSRPUB;

    grant ALTER RESOURCE COST to DBUSRPUB;

    grant ALTER ROLLBACK SEGMENT to DBUSRPUB;

    grant ALTER SESSION to DBUSRPUB;

    grant ALTER SYSTEM to DBUSRPUB;

    grant ALTER TABLESPACE to DBUSRPUB;

    grant ALTER USER to DBUSRPUB;

    grant ANALYZE ANY DICTIONARY to DBUSRPUB;

    grant ANALYZE ANY to DBUSRPUB;

    grant AUDIT ANY to DBUSRPUB;

    grant AUDIT SYSTEM to DBUSRPUB;

    grant BACKUP ANY TABLE to DBUSRPUB;

    grant BECOME USER to DBUSRPUB;

    grant CHANGE NOTIFICATION to DBUSRPUB;

    grant COMMENT ANY TABLE to DBUSRPUB;

    grant CREATE ANY CLUSTER to DBUSRPUB;

    grant CREATE ANY CONTEXT to DBUSRPUB;

    grant CREATE ANY DIMENSION to DBUSRPUB;

    grant CREATE ANY DIRECTORY to DBUSRPUB;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRPUB;

    grant CREATE ANY INDEX to DBUSRPUB;

    grant CREATE ANY INDEXTYPE to DBUSRPUB;

    grant CREATE ANY JOB to DBUSRPUB;

    grant CREATE ANY LIBRARY to DBUSRPUB;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRPUB;

    grant CREATE ANY OPERATOR to DBUSRPUB;

    grant CREATE ANY OUTLINE to DBUSRPUB;

    grant CREATE ANY PROCEDURE to DBUSRPUB;

    grant CREATE ANY RULE SET to DBUSRPUB;

    grant CREATE ANY RULE to DBUSRPUB;

    grant CREATE ANY SEQUENCE to DBUSRPUB;

    grant CREATE ANY SQL PROFILE to DBUSRPUB;

    grant CREATE ANY SYNONYM to DBUSRPUB;

    grant CREATE ANY TABLE to DBUSRPUB;

    grant CREATE ANY TRIGGER to DBUSRPUB;

    grant CREATE ANY TYPE to DBUSRPUB;

    grant CREATE ANY VIEW to DBUSRPUB;

    grant CREATE CLUSTER to DBUSRPUB;

    grant CREATE DATABASE LINK to DBUSRPUB;

    grant CREATE DIMENSION to DBUSRPUB;

    grant CREATE EVALUATION CONTEXT to DBUSRPUB;

    grant CREATE EXTERNAL JOB to DBUSRPUB;

    grant CREATE INDEXTYPE to DBUSRPUB;

    grant CREATE JOB to DBUSRPUB;

    grant CREATE LIBRARY to DBUSRPUB;

    grant CREATE MATERIALIZED VIEW to DBUSRPUB;

    grant CREATE OPERATOR to DBUSRPUB;

    grant CREATE PROCEDURE to DBUSRPUB;

    grant CREATE PROFILE to DBUSRPUB;

    grant CREATE PUBLIC DATABASE LINK to DBUSRPUB;

    grant CREATE PUBLIC SYNONYM to DBUSRPUB;

    grant CREATE ROLE to DBUSRPUB;

    grant CREATE ROLLBACK SEGMENT to DBUSRPUB;

    grant CREATE RULE SET to DBUSRPUB;

    grant CREATE RULE to DBUSRPUB;

    grant CREATE SEQUENCE to DBUSRPUB;

    grant CREATE SESSION to DBUSRPUB;

    grant CREATE SYNONYM to DBUSRPUB;

    grant CREATE TABLE to DBUSRPUB;

    grant CREATE TABLESPACE to DBUSRPUB;

    grant CREATE TRIGGER to DBUSRPUB;

    grant CREATE TYPE to DBUSRPUB;

    grant CREATE USER to DBUSRPUB;

    grant CREATE VIEW to DBUSRPUB;

    grant DEBUG ANY PROCEDURE to DBUSRPUB;

    grant DEBUG CONNECT SESSION to DBUSRPUB;

    grant DELETE ANY TABLE to DBUSRPUB;

    grant DEQUEUE ANY QUEUE to DBUSRPUB;

    grant DROP ANY CLUSTER to DBUSRPUB;

    grant DROP ANY CONTEXT to DBUSRPUB;

    grant DROP ANY DIMENSION to DBUSRPUB;

    grant DROP ANY DIRECTORY to DBUSRPUB;

    grant DROP ANY EVALUATION CONTEXT to DBUSRPUB;

    grant DROP ANY INDEX to DBUSRPUB;

    grant DROP ANY INDEXTYPE to DBUSRPUB;

    grant DROP ANY LIBRARY to DBUSRPUB;

    grant DROP ANY MATERIALIZED VIEW to DBUSRPUB;

    grant DROP ANY OPERATOR to DBUSRPUB;

    grant DROP ANY OUTLINE to DBUSRPUB;

    grant DROP ANY PROCEDURE to DBUSRPUB;

    grant DROP ANY ROLE to DBUSRPUB;

    grant DROP ANY RULE SET to DBUSRPUB;

    grant DROP ANY RULE to DBUSRPUB;

    grant DROP ANY SEQUENCE to DBUSRPUB;

    grant DROP ANY SQL PROFILE to DBUSRPUB;

    grant DROP ANY SYNONYM to DBUSRPUB;

    grant DROP ANY TABLE to DBUSRPUB;

    grant DROP ANY TRIGGER to DBUSRPUB;

    grant DROP ANY TYPE to DBUSRPUB;

    grant DROP ANY VIEW to DBUSRPUB;

    grant DROP PROFILE to DBUSRPUB;

    grant DROP PUBLIC DATABASE LINK to DBUSRPUB;

    grant DROP PUBLIC SYNONYM to DBUSRPUB;

    grant DROP ROLLBACK SEGMENT to DBUSRPUB;

    grant DROP TABLESPACE to DBUSRPUB;

    grant DROP USER to DBUSRPUB;

    grant ENQUEUE ANY QUEUE to DBUSRPUB;

    grant EXECUTE ANY CLASS to DBUSRPUB;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRPUB;

    grant EXECUTE ANY INDEXTYPE to DBUSRPUB;

    grant EXECUTE ANY LIBRARY to DBUSRPUB;

    grant EXECUTE ANY OPERATOR to DBUSRPUB;

    grant EXECUTE ANY PROCEDURE to DBUSRPUB;

    grant EXECUTE ANY PROGRAM to DBUSRPUB;

    grant EXECUTE ANY RULE SET to DBUSRPUB;

    grant EXECUTE ANY RULE to DBUSRPUB;

    grant EXECUTE ANY TYPE to DBUSRPUB;

    grant EXPORT FULL DATABASE to DBUSRPUB;

    grant FLASHBACK ANY TABLE to DBUSRPUB;

    grant FORCE ANY TRANSACTION to DBUSRPUB;

    grant FORCE TRANSACTION to DBUSRPUB;

    grant GLOBAL QUERY REWRITE to DBUSRPUB;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRPUB;

    grant GRANT ANY PRIVILEGE to DBUSRPUB;

    grant GRANT ANY ROLE to DBUSRPUB;

    grant IMPORT FULL DATABASE to DBUSRPUB;

    grant INSERT ANY TABLE to DBUSRPUB;

    grant LOCK ANY TABLE to DBUSRPUB;

    grant MANAGE ANY FILE GROUP to DBUSRPUB;

    grant MANAGE ANY QUEUE to DBUSRPUB;

    grant MANAGE FILE GROUP to DBUSRPUB;

    grant MANAGE SCHEDULER to DBUSRPUB;

    grant MANAGE TABLESPACE to DBUSRPUB;

    grant MERGE ANY VIEW to DBUSRPUB;

    grant ON COMMIT REFRESH to DBUSRPUB;

    grant QUERY REWRITE to DBUSRPUB;

    grant READ ANY FILE GROUP to DBUSRPUB;

    grant RESTRICTED SESSION to DBUSRPUB;

    grant RESUMABLE to DBUSRPUB;

    grant SELECT ANY DICTIONARY to DBUSRPUB;

    grant SELECT ANY SEQUENCE to DBUSRPUB;

    grant SELECT ANY TABLE to DBUSRPUB;

    grant SELECT ANY TRANSACTION to DBUSRPUB;

    grant UNDER ANY TABLE to DBUSRPUB;

    grant UNDER ANY TYPE to DBUSRPUB;

    grant UNDER ANY VIEW to DBUSRPUB;

    grant UNLIMITED TABLESPACE to DBUSRPUB;

    grant UPDATE ANY TABLE to DBUSRPUB;

     

     

     

    SQL>  select 'grant '|| privilege ||' to DBUSRSET;' from dba_sys_privs where grantee='DBUSRSET'

    union

    select 'grant '|| privilege ||' to DBUSRSET;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRSET' )

    union

    select 'grant '|| privilege ||' to DBUSRSET;' from dba_tab_privs where grantee='DBUSRSET';

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRSET;

    grant ADMINISTER DATABASE TRIGGER to DBUSRSET;

    grant ADMINISTER RESOURCE MANAGER to DBUSRSET;

    grant ADMINISTER SQL TUNING SET to DBUSRSET;

    grant ADVISOR to DBUSRSET;

    grant ALTER ANY CLUSTER to DBUSRSET;

    grant ALTER ANY DIMENSION to DBUSRSET;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRSET;

    grant ALTER ANY INDEX to DBUSRSET;

    grant ALTER ANY INDEXTYPE to DBUSRSET;

    grant ALTER ANY LIBRARY to DBUSRSET;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRSET;

    grant ALTER ANY OUTLINE to DBUSRSET;

    grant ALTER ANY PROCEDURE to DBUSRSET;

    grant ALTER ANY ROLE to DBUSRSET;

    grant ALTER ANY RULE SET to DBUSRSET;

    grant ALTER ANY RULE to DBUSRSET;

    grant ALTER ANY SEQUENCE to DBUSRSET;

    grant ALTER ANY SQL PROFILE to DBUSRSET;

    grant ALTER ANY TABLE to DBUSRSET;

    grant ALTER ANY TRIGGER to DBUSRSET;

    grant ALTER ANY TYPE to DBUSRSET;

    grant ALTER DATABASE to DBUSRSET;

    grant ALTER PROFILE to DBUSRSET;

    grant ALTER RESOURCE COST to DBUSRSET;

    grant ALTER ROLLBACK SEGMENT to DBUSRSET;

    grant ALTER SESSION to DBUSRSET;

    grant ALTER SYSTEM to DBUSRSET;

    grant ALTER TABLESPACE to DBUSRSET;

    grant ALTER USER to DBUSRSET;

    grant ANALYZE ANY DICTIONARY to DBUSRSET;

    grant ANALYZE ANY to DBUSRSET;

    grant AUDIT ANY to DBUSRSET;

    grant AUDIT SYSTEM to DBUSRSET;

    grant BACKUP ANY TABLE to DBUSRSET;

    grant BECOME USER to DBUSRSET;

    grant CHANGE NOTIFICATION to DBUSRSET;

    grant COMMENT ANY TABLE to DBUSRSET;

    grant CREATE ANY CLUSTER to DBUSRSET;

    grant CREATE ANY CONTEXT to DBUSRSET;

    grant CREATE ANY DIMENSION to DBUSRSET;

    grant CREATE ANY DIRECTORY to DBUSRSET;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRSET;

    grant CREATE ANY INDEX to DBUSRSET;

    grant CREATE ANY INDEXTYPE to DBUSRSET;

    grant CREATE ANY JOB to DBUSRSET;

    grant CREATE ANY LIBRARY to DBUSRSET;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRSET;

    grant CREATE ANY OPERATOR to DBUSRSET;

    grant CREATE ANY OUTLINE to DBUSRSET;

    grant CREATE ANY PROCEDURE to DBUSRSET;

    grant CREATE ANY RULE SET to DBUSRSET;

    grant CREATE ANY RULE to DBUSRSET;

    grant CREATE ANY SEQUENCE to DBUSRSET;

    grant CREATE ANY SQL PROFILE to DBUSRSET;

    grant CREATE ANY SYNONYM to DBUSRSET;

    grant CREATE ANY TABLE to DBUSRSET;

    grant CREATE ANY TRIGGER to DBUSRSET;

    grant CREATE ANY TYPE to DBUSRSET;

    grant CREATE ANY VIEW to DBUSRSET;

    grant CREATE CLUSTER to DBUSRSET;

    grant CREATE DATABASE LINK to DBUSRSET;

    grant CREATE DIMENSION to DBUSRSET;

    grant CREATE EVALUATION CONTEXT to DBUSRSET;

    grant CREATE EXTERNAL JOB to DBUSRSET;

    grant CREATE INDEXTYPE to DBUSRSET;

    grant CREATE JOB to DBUSRSET;

    grant CREATE LIBRARY to DBUSRSET;

    grant CREATE MATERIALIZED VIEW to DBUSRSET;

    grant CREATE OPERATOR to DBUSRSET;

    grant CREATE PROCEDURE to DBUSRSET;

    grant CREATE PROFILE to DBUSRSET;

    grant CREATE PUBLIC DATABASE LINK to DBUSRSET;

    grant CREATE PUBLIC SYNONYM to DBUSRSET;

    grant CREATE ROLE to DBUSRSET;

    grant CREATE ROLLBACK SEGMENT to DBUSRSET;

    grant CREATE RULE SET to DBUSRSET;

    grant CREATE RULE to DBUSRSET;

    grant CREATE SEQUENCE to DBUSRSET;

    grant CREATE SESSION to DBUSRSET;

    grant CREATE SYNONYM to DBUSRSET;

    grant CREATE TABLE to DBUSRSET;

    grant CREATE TABLESPACE to DBUSRSET;

    grant CREATE TRIGGER to DBUSRSET;

    grant CREATE TYPE to DBUSRSET;

    grant CREATE USER to DBUSRSET;

    grant CREATE VIEW to DBUSRSET;

    grant DEBUG ANY PROCEDURE to DBUSRSET;

    grant DEBUG CONNECT SESSION to DBUSRSET;

    grant DELETE ANY TABLE to DBUSRSET;

    grant DEQUEUE ANY QUEUE to DBUSRSET;

    grant DROP ANY CLUSTER to DBUSRSET;

    grant DROP ANY CONTEXT to DBUSRSET;

    grant DROP ANY DIMENSION to DBUSRSET;

    grant DROP ANY DIRECTORY to DBUSRSET;

    grant DROP ANY EVALUATION CONTEXT to DBUSRSET;

    grant DROP ANY INDEX to DBUSRSET;

    grant DROP ANY INDEXTYPE to DBUSRSET;

    grant DROP ANY LIBRARY to DBUSRSET;

    grant DROP ANY MATERIALIZED VIEW to DBUSRSET;

    grant DROP ANY OPERATOR to DBUSRSET;

    grant DROP ANY OUTLINE to DBUSRSET;

    grant DROP ANY PROCEDURE to DBUSRSET;

    grant DROP ANY ROLE to DBUSRSET;

    grant DROP ANY RULE SET to DBUSRSET;

    grant DROP ANY RULE to DBUSRSET;

    grant DROP ANY SEQUENCE to DBUSRSET;

    grant DROP ANY SQL PROFILE to DBUSRSET;

    grant DROP ANY SYNONYM to DBUSRSET;

    grant DROP ANY TABLE to DBUSRSET;

    grant DROP ANY TRIGGER to DBUSRSET;

    grant DROP ANY TYPE to DBUSRSET;

    grant DROP ANY VIEW to DBUSRSET;

    grant DROP PROFILE to DBUSRSET;

    grant DROP PUBLIC DATABASE LINK to DBUSRSET;

    grant DROP PUBLIC SYNONYM to DBUSRSET;

    grant DROP ROLLBACK SEGMENT to DBUSRSET;

    grant DROP TABLESPACE to DBUSRSET;

    grant DROP USER to DBUSRSET;

    grant ENQUEUE ANY QUEUE to DBUSRSET;

    grant EXECUTE ANY CLASS to DBUSRSET;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRSET;

    grant EXECUTE ANY INDEXTYPE to DBUSRSET;

    grant EXECUTE ANY LIBRARY to DBUSRSET;

    grant EXECUTE ANY OPERATOR to DBUSRSET;

    grant EXECUTE ANY PROCEDURE to DBUSRSET;

    grant EXECUTE ANY PROGRAM to DBUSRSET;

    grant EXECUTE ANY RULE SET to DBUSRSET;

    grant EXECUTE ANY RULE to DBUSRSET;

    grant EXECUTE ANY TYPE to DBUSRSET;

    grant EXPORT FULL DATABASE to DBUSRSET;

    grant FLASHBACK ANY TABLE to DBUSRSET;

    grant FORCE ANY TRANSACTION to DBUSRSET;

    grant FORCE TRANSACTION to DBUSRSET;

    grant GLOBAL QUERY REWRITE to DBUSRSET;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRSET;

    grant GRANT ANY PRIVILEGE to DBUSRSET;

    grant GRANT ANY ROLE to DBUSRSET;

    grant IMPORT FULL DATABASE to DBUSRSET;

    grant INSERT ANY TABLE to DBUSRSET;

    grant LOCK ANY TABLE to DBUSRSET;

    grant MANAGE ANY FILE GROUP to DBUSRSET;

    grant MANAGE ANY QUEUE to DBUSRSET;

    grant MANAGE FILE GROUP to DBUSRSET;

    grant MANAGE SCHEDULER to DBUSRSET;

    grant MANAGE TABLESPACE to DBUSRSET;

    grant MERGE ANY VIEW to DBUSRSET;

    grant ON COMMIT REFRESH to DBUSRSET;

    grant QUERY REWRITE to DBUSRSET;

    grant READ ANY FILE GROUP to DBUSRSET;

    grant RESTRICTED SESSION to DBUSRSET;

    grant RESUMABLE to DBUSRSET;

    grant SELECT ANY DICTIONARY to DBUSRSET;

    grant SELECT ANY SEQUENCE to DBUSRSET;

    grant SELECT ANY TABLE to DBUSRSET;

    grant SELECT ANY TRANSACTION to DBUSRSET;

    grant UNDER ANY TABLE to DBUSRSET;

    grant UNDER ANY TYPE to DBUSRSET;

    grant UNDER ANY VIEW to DBUSRSET;

    grant UNLIMITED TABLESPACE to DBUSRSET;

    grant UPDATE ANY TABLE to DBUSRSET;

     

    SQL>select 'grant '|| privilege ||' to DBUSRSYS;' from dba_sys_privs where grantee='DBUSRSYS'

    union

    select 'grant '|| privilege ||' to DBUSRSYS;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRSYS' )

    union

    select 'grant '|| privilege ||' to DBUSRSYS;' from dba_tab_privs where grantee='DBUSRSYS';

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRSYS;

    grant ADMINISTER DATABASE TRIGGER to DBUSRSYS;

    grant ADMINISTER RESOURCE MANAGER to DBUSRSYS;

    grant ADMINISTER SQL TUNING SET to DBUSRSYS;

    grant ADVISOR to DBUSRSYS;

    grant ALTER ANY CLUSTER to DBUSRSYS;

    grant ALTER ANY DIMENSION to DBUSRSYS;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRSYS;

    grant ALTER ANY INDEX to DBUSRSYS;

    grant ALTER ANY INDEXTYPE to DBUSRSYS;

    grant ALTER ANY LIBRARY to DBUSRSYS;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRSYS;

    grant ALTER ANY OUTLINE to DBUSRSYS;

    grant ALTER ANY PROCEDURE to DBUSRSYS;

    grant ALTER ANY ROLE to DBUSRSYS;

    grant ALTER ANY RULE SET to DBUSRSYS;

    grant ALTER ANY RULE to DBUSRSYS;

    grant ALTER ANY SEQUENCE to DBUSRSYS;

    grant ALTER ANY SQL PROFILE to DBUSRSYS;

    grant ALTER ANY TABLE to DBUSRSYS;

    grant ALTER ANY TRIGGER to DBUSRSYS;

    grant ALTER ANY TYPE to DBUSRSYS;

    grant ALTER DATABASE to DBUSRSYS;

    grant ALTER PROFILE to DBUSRSYS;

    grant ALTER RESOURCE COST to DBUSRSYS;

    grant ALTER ROLLBACK SEGMENT to DBUSRSYS;

    grant ALTER SESSION to DBUSRSYS;

    grant ALTER SYSTEM to DBUSRSYS;

    grant ALTER TABLESPACE to DBUSRSYS;

    grant ALTER USER to DBUSRSYS;

    grant ANALYZE ANY DICTIONARY to DBUSRSYS;

    grant ANALYZE ANY to DBUSRSYS;

    grant AUDIT ANY to DBUSRSYS;

    grant AUDIT SYSTEM to DBUSRSYS;

    grant BACKUP ANY TABLE to DBUSRSYS;

    grant BECOME USER to DBUSRSYS;

    grant CHANGE NOTIFICATION to DBUSRSYS;

    grant COMMENT ANY TABLE to DBUSRSYS;

    grant CREATE ANY CLUSTER to DBUSRSYS;

    grant CREATE ANY CONTEXT to DBUSRSYS;

    grant CREATE ANY DIMENSION to DBUSRSYS;

    grant CREATE ANY DIRECTORY to DBUSRSYS;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRSYS;

    grant CREATE ANY INDEX to DBUSRSYS;

    grant CREATE ANY INDEXTYPE to DBUSRSYS;

    grant CREATE ANY JOB to DBUSRSYS;

    grant CREATE ANY LIBRARY to DBUSRSYS;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRSYS;

    grant CREATE ANY OPERATOR to DBUSRSYS;

    grant CREATE ANY OUTLINE to DBUSRSYS;

    grant CREATE ANY PROCEDURE to DBUSRSYS;

    grant CREATE ANY RULE SET to DBUSRSYS;

    grant CREATE ANY RULE to DBUSRSYS;

    grant CREATE ANY SEQUENCE to DBUSRSYS;

    grant CREATE ANY SQL PROFILE to DBUSRSYS;

    grant CREATE ANY SYNONYM to DBUSRSYS;

    grant CREATE ANY TABLE to DBUSRSYS;

    grant CREATE ANY TRIGGER to DBUSRSYS;

    grant CREATE ANY TYPE to DBUSRSYS;

    grant CREATE ANY VIEW to DBUSRSYS;

    grant CREATE CLUSTER to DBUSRSYS;

    grant CREATE DATABASE LINK to DBUSRSYS;

    grant CREATE DIMENSION to DBUSRSYS;

    grant CREATE EVALUATION CONTEXT to DBUSRSYS;

    grant CREATE EXTERNAL JOB to DBUSRSYS;

    grant CREATE INDEXTYPE to DBUSRSYS;

    grant CREATE JOB to DBUSRSYS;

    grant CREATE LIBRARY to DBUSRSYS;

    grant CREATE MATERIALIZED VIEW to DBUSRSYS;

    grant CREATE OPERATOR to DBUSRSYS;

    grant CREATE PROCEDURE to DBUSRSYS;

    grant CREATE PROFILE to DBUSRSYS;

    grant CREATE PUBLIC DATABASE LINK to DBUSRSYS;

    grant CREATE PUBLIC SYNONYM to DBUSRSYS;

    grant CREATE ROLE to DBUSRSYS;

    grant CREATE ROLLBACK SEGMENT to DBUSRSYS;

    grant CREATE RULE SET to DBUSRSYS;

    grant CREATE RULE to DBUSRSYS;

    grant CREATE SEQUENCE to DBUSRSYS;

    grant CREATE SESSION to DBUSRSYS;

    grant CREATE SYNONYM to DBUSRSYS;

    grant CREATE TABLE to DBUSRSYS;

    grant CREATE TABLESPACE to DBUSRSYS;

    grant CREATE TRIGGER to DBUSRSYS;

    grant CREATE TYPE to DBUSRSYS;

    grant CREATE USER to DBUSRSYS;

    grant CREATE VIEW to DBUSRSYS;

    grant DEBUG ANY PROCEDURE to DBUSRSYS;

    grant DEBUG CONNECT SESSION to DBUSRSYS;

    grant DELETE ANY TABLE to DBUSRSYS;

    grant DEQUEUE ANY QUEUE to DBUSRSYS;

    grant DROP ANY CLUSTER to DBUSRSYS;

    grant DROP ANY CONTEXT to DBUSRSYS;

    grant DROP ANY DIMENSION to DBUSRSYS;

    grant DROP ANY DIRECTORY to DBUSRSYS;

    grant DROP ANY EVALUATION CONTEXT to DBUSRSYS;

    grant DROP ANY INDEX to DBUSRSYS;

    grant DROP ANY INDEXTYPE to DBUSRSYS;

    grant DROP ANY LIBRARY to DBUSRSYS;

    grant DROP ANY MATERIALIZED VIEW to DBUSRSYS;

    grant DROP ANY OPERATOR to DBUSRSYS;

    grant DROP ANY OUTLINE to DBUSRSYS;

    grant DROP ANY PROCEDURE to DBUSRSYS;

    grant DROP ANY ROLE to DBUSRSYS;

    grant DROP ANY RULE SET to DBUSRSYS;

    grant DROP ANY RULE to DBUSRSYS;

    grant DROP ANY SEQUENCE to DBUSRSYS;

    grant DROP ANY SQL PROFILE to DBUSRSYS;

    grant DROP ANY SYNONYM to DBUSRSYS;

    grant DROP ANY TABLE to DBUSRSYS;

    grant DROP ANY TRIGGER to DBUSRSYS;

    grant DROP ANY TYPE to DBUSRSYS;

    grant DROP ANY VIEW to DBUSRSYS;

    grant DROP PROFILE to DBUSRSYS;

    grant DROP PUBLIC DATABASE LINK to DBUSRSYS;

    grant DROP PUBLIC SYNONYM to DBUSRSYS;

    grant DROP ROLLBACK SEGMENT to DBUSRSYS;

    grant DROP TABLESPACE to DBUSRSYS;

    grant DROP USER to DBUSRSYS;

    grant ENQUEUE ANY QUEUE to DBUSRSYS;

    grant EXECUTE ANY CLASS to DBUSRSYS;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRSYS;

    grant EXECUTE ANY INDEXTYPE to DBUSRSYS;

    grant EXECUTE ANY LIBRARY to DBUSRSYS;

    grant EXECUTE ANY OPERATOR to DBUSRSYS;

    grant EXECUTE ANY PROCEDURE to DBUSRSYS;

    grant EXECUTE ANY PROGRAM to DBUSRSYS;

    grant EXECUTE ANY RULE SET to DBUSRSYS;

    grant EXECUTE ANY RULE to DBUSRSYS;

    grant EXECUTE ANY TYPE to DBUSRSYS;

    grant EXECUTE to DBUSRSYS;

    grant EXPORT FULL DATABASE to DBUSRSYS;

    grant FLASHBACK ANY TABLE to DBUSRSYS;

    grant FORCE ANY TRANSACTION to DBUSRSYS;

    grant FORCE TRANSACTION to DBUSRSYS;

    grant GLOBAL QUERY REWRITE to DBUSRSYS;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRSYS;

    grant GRANT ANY PRIVILEGE to DBUSRSYS;

    grant GRANT ANY ROLE to DBUSRSYS;

    grant IMPORT FULL DATABASE to DBUSRSYS;

    grant INSERT ANY TABLE to DBUSRSYS;

    grant LOCK ANY TABLE to DBUSRSYS;

    grant MANAGE ANY FILE GROUP to DBUSRSYS;

    grant MANAGE ANY QUEUE to DBUSRSYS;

    grant MANAGE FILE GROUP to DBUSRSYS;

    grant MANAGE SCHEDULER to DBUSRSYS;

    grant MANAGE TABLESPACE to DBUSRSYS;

    grant MERGE ANY VIEW to DBUSRSYS;

    grant ON COMMIT REFRESH to DBUSRSYS;

    grant QUERY REWRITE to DBUSRSYS;

    grant READ ANY FILE GROUP to DBUSRSYS;

    grant RESTRICTED SESSION to DBUSRSYS;

    grant RESUMABLE to DBUSRSYS;

    grant SELECT ANY DICTIONARY to DBUSRSYS;

    grant SELECT ANY SEQUENCE to DBUSRSYS;

    grant SELECT ANY TABLE to DBUSRSYS;

    grant SELECT ANY TRANSACTION to DBUSRSYS;

    grant UNDER ANY TABLE to DBUSRSYS;

    grant UNDER ANY TYPE to DBUSRSYS;

    grant UNDER ANY VIEW to DBUSRSYS;

    grant UNLIMITED TABLESPACE to DBUSRSYS;

    grant UPDATE ANY TABLE to DBUSRSYS;

     

     

    SQL>  select 'grant '|| privilege ||' to DBUSRXMLT;' from dba_sys_privs where grantee='DBUSRXMLT'

    union

    select 'grant '|| privilege ||' to DBUSRXMLT;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='DBUSRXMLT' )

    union

    select 'grant '|| privilege ||' to DBUSRXMLT;' from dba_tab_privs where grantee='DBUSRXMLT';

     

    grant ADMINISTER ANY SQL TUNING SET to DBUSRXMLT;

    grant ADMINISTER DATABASE TRIGGER to DBUSRXMLT;

    grant ADMINISTER RESOURCE MANAGER to DBUSRXMLT;

    grant ADMINISTER SQL TUNING SET to DBUSRXMLT;

    grant ADVISOR to DBUSRXMLT;

    grant ALTER ANY CLUSTER to DBUSRXMLT;

    grant ALTER ANY DIMENSION to DBUSRXMLT;

    grant ALTER ANY EVALUATION CONTEXT to DBUSRXMLT;

    grant ALTER ANY INDEX to DBUSRXMLT;

    grant ALTER ANY INDEXTYPE to DBUSRXMLT;

    grant ALTER ANY LIBRARY to DBUSRXMLT;

    grant ALTER ANY MATERIALIZED VIEW to DBUSRXMLT;

    grant ALTER ANY OUTLINE to DBUSRXMLT;

    grant ALTER ANY PROCEDURE to DBUSRXMLT;

    grant ALTER ANY ROLE to DBUSRXMLT;

    grant ALTER ANY RULE SET to DBUSRXMLT;

    grant ALTER ANY RULE to DBUSRXMLT;

    grant ALTER ANY SEQUENCE to DBUSRXMLT;

    grant ALTER ANY SQL PROFILE to DBUSRXMLT;

    grant ALTER ANY TABLE to DBUSRXMLT;

    grant ALTER ANY TRIGGER to DBUSRXMLT;

    grant ALTER ANY TYPE to DBUSRXMLT;

    grant ALTER DATABASE to DBUSRXMLT;

    grant ALTER PROFILE to DBUSRXMLT;

    grant ALTER RESOURCE COST to DBUSRXMLT;

    grant ALTER ROLLBACK SEGMENT to DBUSRXMLT;

    grant ALTER SESSION to DBUSRXMLT;

    grant ALTER SYSTEM to DBUSRXMLT;

    grant ALTER TABLESPACE to DBUSRXMLT;

    grant ALTER USER to DBUSRXMLT;

    grant ANALYZE ANY DICTIONARY to DBUSRXMLT;

    grant ANALYZE ANY to DBUSRXMLT;

    grant AUDIT ANY to DBUSRXMLT;

    grant AUDIT SYSTEM to DBUSRXMLT;

    grant BACKUP ANY TABLE to DBUSRXMLT;

    grant BECOME USER to DBUSRXMLT;

    grant CHANGE NOTIFICATION to DBUSRXMLT;

    grant COMMENT ANY TABLE to DBUSRXMLT;

    grant CREATE ANY CLUSTER to DBUSRXMLT;

    grant CREATE ANY CONTEXT to DBUSRXMLT;

    grant CREATE ANY DIMENSION to DBUSRXMLT;

    grant CREATE ANY DIRECTORY to DBUSRXMLT;

    grant CREATE ANY EVALUATION CONTEXT to DBUSRXMLT;

    grant CREATE ANY INDEX to DBUSRXMLT;

    grant CREATE ANY INDEXTYPE to DBUSRXMLT;

    grant CREATE ANY JOB to DBUSRXMLT;

    grant CREATE ANY LIBRARY to DBUSRXMLT;

    grant CREATE ANY MATERIALIZED VIEW to DBUSRXMLT;

    grant CREATE ANY OPERATOR to DBUSRXMLT;

    grant CREATE ANY OUTLINE to DBUSRXMLT;

    grant CREATE ANY PROCEDURE to DBUSRXMLT;

    grant CREATE ANY RULE SET to DBUSRXMLT;

    grant CREATE ANY RULE to DBUSRXMLT;

    grant CREATE ANY SEQUENCE to DBUSRXMLT;

    grant CREATE ANY SQL PROFILE to DBUSRXMLT;

    grant CREATE ANY SYNONYM to DBUSRXMLT;

    grant CREATE ANY TABLE to DBUSRXMLT;

    grant CREATE ANY TRIGGER to DBUSRXMLT;

    grant CREATE ANY TYPE to DBUSRXMLT;

    grant CREATE ANY VIEW to DBUSRXMLT;

    grant CREATE CLUSTER to DBUSRXMLT;

    grant CREATE DATABASE LINK to DBUSRXMLT;

    grant CREATE DIMENSION to DBUSRXMLT;

    grant CREATE EVALUATION CONTEXT to DBUSRXMLT;

    grant CREATE EXTERNAL JOB to DBUSRXMLT;

    grant CREATE INDEXTYPE to DBUSRXMLT;

    grant CREATE JOB to DBUSRXMLT;

    grant CREATE LIBRARY to DBUSRXMLT;

    grant CREATE MATERIALIZED VIEW to DBUSRXMLT;

    grant CREATE OPERATOR to DBUSRXMLT;

    grant CREATE PROCEDURE to DBUSRXMLT;

    grant CREATE PROFILE to DBUSRXMLT;

    grant CREATE PUBLIC DATABASE LINK to DBUSRXMLT;

    grant CREATE PUBLIC SYNONYM to DBUSRXMLT;

    grant CREATE ROLE to DBUSRXMLT;

    grant CREATE ROLLBACK SEGMENT to DBUSRXMLT;

    grant CREATE RULE SET to DBUSRXMLT;

    grant CREATE RULE to DBUSRXMLT;

    grant CREATE SEQUENCE to DBUSRXMLT;

    grant CREATE SESSION to DBUSRXMLT;

    grant CREATE SYNONYM to DBUSRXMLT;

    grant CREATE TABLE to DBUSRXMLT;

    grant CREATE TABLESPACE to DBUSRXMLT;

    grant CREATE TRIGGER to DBUSRXMLT;

    grant CREATE TYPE to DBUSRXMLT;

    grant CREATE USER to DBUSRXMLT;

    grant CREATE VIEW to DBUSRXMLT;

    grant DEBUG ANY PROCEDURE to DBUSRXMLT;

    grant DEBUG CONNECT SESSION to DBUSRXMLT;

    grant DELETE ANY TABLE to DBUSRXMLT;

    grant DEQUEUE ANY QUEUE to DBUSRXMLT;

    grant DROP ANY CLUSTER to DBUSRXMLT;

    grant DROP ANY CONTEXT to DBUSRXMLT;

    grant DROP ANY DIMENSION to DBUSRXMLT;

    grant DROP ANY DIRECTORY to DBUSRXMLT;

    grant DROP ANY EVALUATION CONTEXT to DBUSRXMLT;

    grant DROP ANY INDEX to DBUSRXMLT;

    grant DROP ANY INDEXTYPE to DBUSRXMLT;

    grant DROP ANY LIBRARY to DBUSRXMLT;

    grant DROP ANY MATERIALIZED VIEW to DBUSRXMLT;

    grant DROP ANY OPERATOR to DBUSRXMLT;

    grant DROP ANY OUTLINE to DBUSRXMLT;

    grant DROP ANY PROCEDURE to DBUSRXMLT;

    grant DROP ANY ROLE to DBUSRXMLT;

    grant DROP ANY RULE SET to DBUSRXMLT;

    grant DROP ANY RULE to DBUSRXMLT;

    grant DROP ANY SEQUENCE to DBUSRXMLT;

    grant DROP ANY SQL PROFILE to DBUSRXMLT;

    grant DROP ANY SYNONYM to DBUSRXMLT;

    grant DROP ANY TABLE to DBUSRXMLT;

    grant DROP ANY TRIGGER to DBUSRXMLT;

    grant DROP ANY TYPE to DBUSRXMLT;

    grant DROP ANY VIEW to DBUSRXMLT;

    grant DROP PROFILE to DBUSRXMLT;

    grant DROP PUBLIC DATABASE LINK to DBUSRXMLT;

    grant DROP PUBLIC SYNONYM to DBUSRXMLT;

    grant DROP ROLLBACK SEGMENT to DBUSRXMLT;

    grant DROP TABLESPACE to DBUSRXMLT;

    grant DROP USER to DBUSRXMLT;

    grant ENQUEUE ANY QUEUE to DBUSRXMLT;

    grant EXECUTE ANY CLASS to DBUSRXMLT;

    grant EXECUTE ANY EVALUATION CONTEXT to DBUSRXMLT;

    grant EXECUTE ANY INDEXTYPE to DBUSRXMLT;

    grant EXECUTE ANY LIBRARY to DBUSRXMLT;

    grant EXECUTE ANY OPERATOR to DBUSRXMLT;

    grant EXECUTE ANY PROCEDURE to DBUSRXMLT;

    grant EXECUTE ANY PROGRAM to DBUSRXMLT;

    grant EXECUTE ANY RULE SET to DBUSRXMLT;

    grant EXECUTE ANY RULE to DBUSRXMLT;

    grant EXECUTE ANY TYPE to DBUSRXMLT;

    grant EXPORT FULL DATABASE to DBUSRXMLT;

    grant FLASHBACK ANY TABLE to DBUSRXMLT;

    grant FORCE ANY TRANSACTION to DBUSRXMLT;

    grant FORCE TRANSACTION to DBUSRXMLT;

    grant GLOBAL QUERY REWRITE to DBUSRXMLT;

    grant GRANT ANY OBJECT PRIVILEGE to DBUSRXMLT;

    grant GRANT ANY PRIVILEGE to DBUSRXMLT;

    grant GRANT ANY ROLE to DBUSRXMLT;

    grant IMPORT FULL DATABASE to DBUSRXMLT;

    grant INSERT ANY TABLE to DBUSRXMLT;

    grant LOCK ANY TABLE to DBUSRXMLT;

    grant MANAGE ANY FILE GROUP to DBUSRXMLT;

    grant MANAGE ANY QUEUE to DBUSRXMLT;

    grant MANAGE FILE GROUP to DBUSRXMLT;

    grant MANAGE SCHEDULER to DBUSRXMLT;

    grant MANAGE TABLESPACE to DBUSRXMLT;

    grant MERGE ANY VIEW to DBUSRXMLT;

    grant ON COMMIT REFRESH to DBUSRXMLT;

    grant QUERY REWRITE to DBUSRXMLT;

    grant READ ANY FILE GROUP to DBUSRXMLT;

    grant RESTRICTED SESSION to DBUSRXMLT;

    grant RESUMABLE to DBUSRXMLT;

    grant SELECT ANY DICTIONARY to DBUSRXMLT;

    grant SELECT ANY SEQUENCE to DBUSRXMLT;

    grant SELECT ANY TABLE to DBUSRXMLT;

    grant SELECT ANY TRANSACTION to DBUSRXMLT;

    grant UNDER ANY TABLE to DBUSRXMLT;

    grant UNDER ANY TYPE to DBUSRXMLT;

    grant UNDER ANY VIEW to DBUSRXMLT;

    grant UNLIMITED TABLESPACE to DBUSRXMLT;

    grant UPDATE ANY TABLE to DBUSRXMLT;

                        

    SQL>select 'grant '|| privilege ||' to PORTAL;' from dba_sys_privs where grantee='PORTAL'

    union

    select 'grant '|| privilege ||' to PORTAL;' from dba_sys_privs where grantee in

    (select granted_role from dba_role_privs where grantee='PORTAL' )

    union

    select 'grant '|| privilege ||' to PORTAL;' from dba_tab_privs where grantee='PORTAL';

     

    grant ADMINISTER ANY SQL TUNING SET to PORTAL;

    grant ADMINISTER DATABASE TRIGGER to PORTAL;

    grant ADMINISTER RESOURCE MANAGER to PORTAL;

    grant ADMINISTER SQL TUNING SET to PORTAL;

    grant ADVISOR to PORTAL;

    grant ALTER ANY CLUSTER to PORTAL;

    grant ALTER ANY DIMENSION to PORTAL;

    grant ALTER ANY EVALUATION CONTEXT to PORTAL;

    grant ALTER ANY INDEX to PORTAL;

    grant ALTER ANY INDEXTYPE to PORTAL;

    grant ALTER ANY LIBRARY to PORTAL;

    grant ALTER ANY MATERIALIZED VIEW to PORTAL;

    grant ALTER ANY OUTLINE to PORTAL;

    grant ALTER ANY PROCEDURE to PORTAL;

    grant ALTER ANY ROLE to PORTAL;

    grant ALTER ANY RULE SET to PORTAL;

    grant ALTER ANY RULE to PORTAL;

    grant ALTER ANY SEQUENCE to PORTAL;

    grant ALTER ANY SQL PROFILE to PORTAL;

    grant ALTER ANY TABLE to PORTAL;

    grant ALTER ANY TRIGGER to PORTAL;

    grant ALTER ANY TYPE to PORTAL;

    grant ALTER DATABASE to PORTAL;

    grant ALTER PROFILE to PORTAL;

    grant ALTER RESOURCE COST to PORTAL;

    grant ALTER ROLLBACK SEGMENT to PORTAL;

    grant ALTER SESSION to PORTAL;

    grant ALTER SYSTEM to PORTAL;

    grant ALTER TABLESPACE to PORTAL;

    grant ALTER USER to PORTAL;

    grant ANALYZE ANY DICTIONARY to PORTAL;

    grant ANALYZE ANY to PORTAL;

    grant AUDIT ANY to PORTAL;

    grant AUDIT SYSTEM to PORTAL;

    grant BACKUP ANY TABLE to PORTAL;

    grant BECOME USER to PORTAL;

    grant CHANGE NOTIFICATION to PORTAL;

    grant COMMENT ANY TABLE to PORTAL;

    grant CREATE ANY CLUSTER to PORTAL;

    grant CREATE ANY CONTEXT to PORTAL;

    grant CREATE ANY DIMENSION to PORTAL;

    grant CREATE ANY DIRECTORY to PORTAL;

    grant CREATE ANY EVALUATION CONTEXT to PORTAL;

    grant CREATE ANY INDEX to PORTAL;

    grant CREATE ANY INDEXTYPE to PORTAL;

    grant CREATE ANY JOB to PORTAL;

    grant CREATE ANY LIBRARY to PORTAL;

    grant CREATE ANY MATERIALIZED VIEW to PORTAL;

    grant CREATE ANY OPERATOR to PORTAL;

    grant CREATE ANY OUTLINE to PORTAL;

    grant CREATE ANY PROCEDURE to PORTAL;

    grant CREATE ANY RULE SET to PORTAL;

    grant CREATE ANY RULE to PORTAL;

    grant CREATE ANY SEQUENCE to PORTAL;

    grant CREATE ANY SQL PROFILE to PORTAL;

    grant CREATE ANY SYNONYM to PORTAL;

    grant CREATE ANY TABLE to PORTAL;

    grant CREATE ANY TRIGGER to PORTAL;

    grant CREATE ANY TYPE to PORTAL;

    grant CREATE ANY VIEW to PORTAL;

    grant CREATE CLUSTER to PORTAL;

    grant CREATE DATABASE LINK to PORTAL;

    grant CREATE DIMENSION to PORTAL;

    grant CREATE EVALUATION CONTEXT to PORTAL;

    grant CREATE EXTERNAL JOB to PORTAL;

    grant CREATE INDEXTYPE to PORTAL;

    grant CREATE JOB to PORTAL;

    grant CREATE LIBRARY to PORTAL;

    grant CREATE MATERIALIZED VIEW to PORTAL;

    grant CREATE OPERATOR to PORTAL;

    grant CREATE PROCEDURE to PORTAL;

    grant CREATE PROFILE to PORTAL;

    grant CREATE PUBLIC DATABASE LINK to PORTAL;

    grant CREATE PUBLIC SYNONYM to PORTAL;

    grant CREATE ROLE to PORTAL;

    grant CREATE ROLLBACK SEGMENT to PORTAL;

    grant CREATE RULE SET to PORTAL;

    grant CREATE RULE to PORTAL;

    grant CREATE SEQUENCE to PORTAL;

    grant CREATE SESSION to PORTAL;

    grant CREATE SYNONYM to PORTAL;

    grant CREATE TABLE to PORTAL;

    grant CREATE TABLESPACE to PORTAL;

    grant CREATE TRIGGER to PORTAL;

    grant CREATE TYPE to PORTAL;

    grant CREATE USER to PORTAL;

    grant CREATE VIEW to PORTAL;

    grant DEBUG ANY PROCEDURE to PORTAL;

    grant DEBUG CONNECT SESSION to PORTAL;

    grant DELETE ANY TABLE to PORTAL;

    grant DEQUEUE ANY QUEUE to PORTAL;

    grant DROP ANY CLUSTER to PORTAL;

    grant DROP ANY CONTEXT to PORTAL;

    grant DROP ANY DIMENSION to PORTAL;

    grant DROP ANY DIRECTORY to PORTAL;

    grant DROP ANY EVALUATION CONTEXT to PORTAL;

    grant DROP ANY INDEX to PORTAL;

    grant DROP ANY INDEXTYPE to PORTAL;

    grant DROP ANY LIBRARY to PORTAL;

    grant DROP ANY MATERIALIZED VIEW to PORTAL;

    grant DROP ANY OPERATOR to PORTAL;

    grant DROP ANY OUTLINE to PORTAL;

    grant DROP ANY PROCEDURE to PORTAL;

    grant DROP ANY ROLE to PORTAL;

    grant DROP ANY RULE SET to PORTAL;

    grant DROP ANY RULE to PORTAL;

    grant DROP ANY SEQUENCE to PORTAL;

    grant DROP ANY SQL PROFILE to PORTAL;

    grant DROP ANY SYNONYM to PORTAL;

    grant DROP ANY TABLE to PORTAL;

    grant DROP ANY TRIGGER to PORTAL;

    grant DROP ANY TYPE to PORTAL;

    grant DROP ANY VIEW to PORTAL;

    grant DROP PROFILE to PORTAL;

    grant DROP PUBLIC DATABASE LINK to PORTAL;

    grant DROP PUBLIC SYNONYM to PORTAL;

    grant DROP ROLLBACK SEGMENT to PORTAL;

    grant DROP TABLESPACE to PORTAL;

    grant DROP USER to PORTAL;

    grant ENQUEUE ANY QUEUE to PORTAL;

    grant EXECUTE ANY CLASS to PORTAL;

    grant EXECUTE ANY EVALUATION CONTEXT to PORTAL;

    grant EXECUTE ANY INDEXTYPE to PORTAL;

    grant EXECUTE ANY LIBRARY to PORTAL;

    grant EXECUTE ANY OPERATOR to PORTAL;

    grant EXECUTE ANY PROCEDURE to PORTAL;

    grant EXECUTE ANY PROGRAM to PORTAL;

    grant EXECUTE ANY RULE SET to PORTAL;

    grant EXECUTE ANY RULE to PORTAL;

    grant EXECUTE ANY TYPE to PORTAL;

    grant EXPORT FULL DATABASE to PORTAL;

    grant FLASHBACK ANY TABLE to PORTAL;

    grant FORCE ANY TRANSACTION to PORTAL;

    grant FORCE TRANSACTION to PORTAL;

    grant GLOBAL QUERY REWRITE to PORTAL;

    grant GRANT ANY OBJECT PRIVILEGE to PORTAL;

    grant GRANT ANY PRIVILEGE to PORTAL;

    grant GRANT ANY ROLE to PORTAL;

    grant IMPORT FULL DATABASE to PORTAL;

    grant INSERT ANY TABLE to PORTAL;

    grant LOCK ANY TABLE to PORTAL;

    grant MANAGE ANY FILE GROUP to PORTAL;

    grant MANAGE ANY QUEUE to PORTAL;

    grant MANAGE FILE GROUP to PORTAL;

    grant MANAGE SCHEDULER to PORTAL;

    grant MANAGE TABLESPACE to PORTAL;

    grant MERGE ANY VIEW to PORTAL;

    grant ON COMMIT REFRESH to PORTAL;

    grant QUERY REWRITE to PORTAL;

    grant READ ANY FILE GROUP to PORTAL;

    grant RESTRICTED SESSION to PORTAL;

    grant RESUMABLE to PORTAL;

    grant SELECT ANY DICTIONARY to PORTAL;

    grant SELECT ANY SEQUENCE to PORTAL;

    grant SELECT ANY TABLE to PORTAL;

    grant SELECT ANY TRANSACTION to PORTAL;

    grant UNDER ANY TABLE to PORTAL;

    grant UNDER ANY TYPE to PORTAL;

    grant UNDER ANY VIEW to PORTAL;

    grant UNLIMITED TABLESPACE to PORTAL;

    grant UPDATE ANY TABLE to PORTAL;

     

     

    查询源端角色

    SQL> select distinct granted_role from dba_role_privs wheregrantee in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

    GRANTED_ROLE

    ------------------------------

    CONNECT

    ROLE_APPPOSERP

    ROLE_DBPOSERP

    DBA

     

    在目标端创建角色

    SQL>create role ROLE_DBPOSERP;

    create role ROLE_APPPOSERP;

      

       在源端查询,在目标端赋予角色权限

    SQL>set pagesize 9999

    select 'grant '|| PRIVILEGE ||' to ROLE_DBPOSERP;' from dba_tab_privs where grantee='ROLE_DBPOSERP'

    union

    select 'grant '|| PRIVILEGE ||' to ROLE_DBPOSERP;' from dba_sys_privs where grantee='ROLE_DBPOSERP';

     

    grant ALTER SESSION to ROLE_DBPOSERP;

    grant ALTER TABLESPACE to ROLE_DBPOSERP;

    grant CREATE ANY INDEX to ROLE_DBPOSERP;

    grant CREATE ANY MATERIALIZED VIEW to ROLE_DBPOSERP;

    grant CREATE ANY SEQUENCE to ROLE_DBPOSERP;

    grant CREATE ANY TABLE to ROLE_DBPOSERP;

    grant CREATE SESSION to ROLE_DBPOSERP;

    grant CREATE TABLESPACE to ROLE_DBPOSERP;

    grant CREATE USER to ROLE_DBPOSERP;

    grant DELETE ANY TABLE to ROLE_DBPOSERP;

    grant DROP ANY INDEX to ROLE_DBPOSERP;

    grant DROP ANY MATERIALIZED VIEW to ROLE_DBPOSERP;

    grant DROP ANY SEQUENCE to ROLE_DBPOSERP;

    grant DROP ANY TABLE to ROLE_DBPOSERP;

    grant DROP USER to ROLE_DBPOSERP;

    grant EXECUTE ANY PROCEDURE to ROLE_DBPOSERP;

    grant GRANT ANY ROLE to ROLE_DBPOSERP;

    grant INSERT ANY TABLE to ROLE_DBPOSERP;

    grant SELECT ANY SEQUENCE to ROLE_DBPOSERP;

    grant SELECT ANY TABLE to ROLE_DBPOSERP;

    grant UPDATE ANY TABLE to ROLE_DBPOSERP;

     

    SQL>select 'grant '|| PRIVILEGE ||' to ROLE_APPPOSERP;' from dba_tab_privs where grantee='ROLE_APPPOSERP'

    union

    select 'grant '|| PRIVILEGE ||' to ROLE_APPPOSERP;' from dba_sys_privs where grantee='ROLE_APPPOSERP';

     

    grant CREATE ANY MATERIALIZED VIEW to ROLE_APPPOSERP;

    grant CREATE SESSION to ROLE_APPPOSERP;

    grant DELETE ANY TABLE to ROLE_APPPOSERP;

    grant DROP ANY MATERIALIZED VIEW to ROLE_APPPOSERP;

    grant EXECUTE ANY PROCEDURE to ROLE_APPPOSERP;

    grant INSERT ANY TABLE to ROLE_APPPOSERP;

    grant SELECT ANY SEQUENCE to ROLE_APPPOSERP;

    grant SELECT ANY TABLE to ROLE_APPPOSERP;

    grant UPDATE ANY TABLE to ROLE_APPPOSERP;

                   

       在源端查询,在目标端赋予用户角色

    SQL>select 'grant '||granted_role,' to '||grantee ||';'from dba_role_privs where grantee in  ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

     

     

    grant DBA                             to CONGOU;

    grant DBA                             to DBUSRPOP;

    grant DBA                             to DBUSRSYS;

    grant DBA                             to DBUSRPUB;

    grant DBA                             to DBUSRSET;

    grant ROLE_DBPOSERP                   to DBUSRSYS;

    grant CONNECT                         to PORTAL;

    grant DBA                             to DBLINKUSR;

    grant ROLE_APPPOSERP                  to DBLINKUSR;

    grant CONNECT                         to DBUSRXMLT;

    grant DBA                             to PORTAL;

    grant DBA                             to DBUSRXMLT;

    grant ROLE_DBPOSERP                   to DBUSRSET;

    grant CONNECT                         to CONGOU;

    grant ROLE_DBPOSERP                   to PORTAL;

    grant ROLE_DBPOSERP                   to DBLINKUSR;

    grant ROLE_DBPOSERP                   to DBUSRMKT;

    grant ROLE_DBPOSERP                   to DBUSRPUB;

    grant DBA                             to DBUSRMKT;

    grant ROLE_DBPOSERP                   to CONGOU;

    grant ROLE_DBPOSERP                   to DBUSRPOP;

     

    16:源端导出数据、目标端导入数据

    获取源库SCN

    SQL> spool current_scn

    select to_char(current_scn) from v$database;

     

    TO_CHAR(CURRENT_SCN)

    ----------------------------------------

    5564003570857

    SQL> spool off

    源端导出数据

    SQL> create or replace directory my_dir as'/oradata1/expdp_hq';

    grant read on directory my_dir to system;

      grant write on directory my_dir to system;

     

    $  expdp system/future  directory=my_dir parallel=15 SCHEMAS=CONGOU,DBLINKUSR,DBUSRMKT,DBUSRPOP,DBUSRPUB,DBUSRSET,DBUSRSYS,DBUSRXMLT,PORTAL  flashback_scn= 5565513085044  dumpfile=my_dir:full%U.dmp;

       

    源端导出结构,不导出数据

    $expdp system/futuredirectory=my_dir parallel=5 SCHEMAS=CONGOU,DBLINKUSR,DBUSRMKT,DBUSRPOP,DBUSRPUB,DBUSRSET,DBUSRSYS,DBUSRXMLT,PORTAL CONTENT=METADATA_ONLY dumpfile=my_dir:metadata_only%U.dmp;

     

     $    exp system/future FULL=Y ROWS=N file=/oradata1/expdp_hq/exp_row_n.dmp

     

    将源端导出的数据复制到目标主机

     

    把exp的数据imp到目标数据库

    SQL> create or replace directory my_dir as'/goldengate/expdp_hq';

    grant read on directory my_dir to system;

    grant write on directory my_dir to system;

     

    目标端导入数据

    [oracle@zaibei expdp_hq]$     impdp system/future directory=my_dir parallel=5 dumpfile=full01.dmp,full02.dmp,full03.dmp,full04.dmp,full05.dmp,full06.dmp,full07.dmp,full08.dmp,full09.dmp,full10.dmp,full11.dmp,full12.dmp,full13.dmp,full14.dmp ,full15.dmp SCHEMAS=CONGOU,DBLINKUSR,DBUSRMKT,DBUSRPOP,DBUSRPUB,DBUSRSET,DBUSRSYS,DBUSRXMLT,PORTAL;

        

    目标端导入结构

    [oracle@zaibei expdp_hq]$     impdp system/future directory=my_dir parallel=5 dumpfile=metadata_only01.dmp CONTENT=METADATA_ONLY SCHEMAS=CONGOU,DBLINKUSR,DBUSRMKT,DBUSRPOP,DBUSRPUB,DBUSRSET,DBUSRSYS,DBUSRXMLT,PORTAL;

        

         [oracle@zaibei expdp_hq]$ imp system/future FULL=Y ROWS=N file=/goldengate/expdp_hq/exp_row_n.dmp

     

    17:目标端禁用触发器trigger和外键约束

    SQL>  set pagesize 9999

    select 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name||';'

    from dba_constraints

    where constraint_type in ('R') and

    owner in('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL')

    order by status,owner;

     

     

    SQL>  select 'alter trigger '||owner||'.'||trigger_name||' disable;'

    from dba_triggers

    where owner in('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL')

    order by status,owner;

     

    SQL>    declare

    v_sql varchar2(2000);

    CURSOR c_trigger IS SELECT 'alter trigger '||owner||'.'||trigger_name||' disable' from dba_triggers where status='ENABLED' and owner in('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

    BEGIN

    OPEN c_trigger;

    LOOP

    FETCH c_trigger INTO v_sql;

    EXIT WHEN c_trigger%NOTFOUND;

    execute immediate v_sql;

    end loop;

    close c_trigger;

    end;

    /

     

    SQL>  declare

    v_sql varchar2(2000);

    CURSOR c_trigger IS SELECT 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name from dba_constraints where constraint_type='R' and owner in ('CONGOU','DBLINKUSR','DBUSRMKT','DBUSRPOP','DBUSRPUB','DBUSRSET','DBUSRSYS','DBUSRXMLT','PORTAL');

    BEGIN

    OPEN c_trigger;

    LOOP

    FETCH c_trigger INTO v_sql;

    EXIT WHEN c_trigger%NOTFOUND;

    execute immediate v_sql;

    end loop;

    close c_trigger;

    end;

    /

     

     

    18:禁止目标端job守护进程

     

    SQL>  shutdown immediate;

     

    SQL>  startup nomount;

     

    SQL>  show parameter job

     

    NAME                              TYPE                             VALUE

    ------------------------------------ ----------------------

    job_queue_processes                   integer10

     

    SQL>  alter system set job_queue_processes=0 scope=both sid='*';

     

    SQL>  alter database mount;

     

    SQL>  alter database open;

     

     

    19:目标端创建goldengate用户

     

    SQL>  drop user goldengate cascade;

    create user goldengate identified by goldengate default tablespace goldengate temporary tablespace TEMP_SPC;

    grant connect to goldengate;

    grant alter any table to goldengate;

    grant alter session to goldengate;

    grant create session to goldengate;

    grant flashback any table to goldengate;

    grant select any dictionary to goldengate;

    grant select any table to goldengate;

    grant resource to goldengate;

    grant select any transaction to goldengate;

    grant dba to goldengate;

     

     

    20:目标端如果没有临时需要文件添加

     

    SQL>  select file_name from dba_temp_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    /oradb/hncdfhq/temp01.dbf

    /oradb/hncdfhq/temp_spc.dbf

     

    21:目标端一些操作

     

    目标端查询db_links

    SQL>  set pagesize 9999

          col owner for a20

          col db_link for a20

    select owner,db_link from dba_db_links;   

     

    目标删除db_links

    SQL>  set pagesize 9999

    select ' drop PUBLIC database link '|| db_link ||';' from dba_db_links where owner='PUBLIC'

    union

    select ' drop  database link '|| db_link ||';' from dba_db_links where owner !='PUBLIC';

     

     SQL>  drop PUBLIC database link HNCDFHQ_221;

     drop PUBLIC database link M01;

     drop PUBLIC database link OLDCDFHQ;

     drop PUBLIC database link POSMGR;

     drop PUBLIC database link ZSHQ;

     conn DBUSRPUB/future

    drop  database link MKT;

    conn PORTAL/future

    drop  database link HNCDFHQ_221;

    conn DBUSRMKT/future

    drop  database link MGR_CS;

    drop  database link MIGXE;

    drop  database link ZSCDFHQ;

    drop  database link ZSHQ;

    conn / as sysdba

     

     

    22:目标端创建replicat进程

     

    GGSCI (zaibei) 1>  dblogin userid goldengate, password goldengate

    GGSCI (zaibei) 2>  add checkpointtable goldengate.rep_hq_checkpoint

    GGSCI (zaibei) 3>  add replicat rep_hq, exttrail ./dirdat/d1, checkpointtable goldengate.rep_hq_checkpoint

     

    GGSCI (zaibei) 4>  edit params rep_hq

    REPLICAT rep_hq

    SETENV (NLS_LANG="American_America.ZHS16GBK")

    SETENV (ORACLE_SID=hncdfhq)

    USERID goldengate, PASSWORD goldengate

    REPORTCOUNT EVERY 30 MINUTES, RATE

    REPERROR DEFAULT, ABEND

    numfiles 5000

    --HANDLECOLLISIONS

    assumetargetdefs

    DISCARDFILE ./dirrpt/rep_hq.dsc, APPEND, MEGABYTES 1000

    ALLOWNOOPUPDATES

    map DBUSRSYS.*, target DBUSRSYS.*;

    map CONGOU.*, target CONGOU.*;

    map DBUSRPOP.*, target DBUSRPOP.*;

    map PORTAL.*, target PORTAL.*;

    map DBUSRXMLT.*, target DBUSRXMLT.*;

    map DBUSRMKT.*, target DBUSRMKT.*;

    map DBLINKUSR.*, target DBLINKUSR.*;

    map DBUSRSET.*, target DBUSRSET.*;

    map DBUSRPUB.*, target DBUSRPUB.*;

     

    NLS_LANG变量要和数据库语言环境一致;

    确保需要复制的表都出现在map参数中;

     

    第一次启动Replicat进程需要指定aftercsn scn_number参数;

    scn_number为数据库exp/expdp指定的flashback_scn值。语句后面逗号之后一定要有空格

     

    GGSCI (zaibei) 5>  start rep_hq, aftercsn  5565513085044   

     

    GGSCI (zaibei) 6> info all

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

     

    MANAGER     RUNNING                                           

    EXTRACT     RUNNING     DPE_HQ00:00:00      00:00:04   

    REPLICAT    RUNNING     REP_HQ00:00:00      00:00:01  

     

    至此,GoldenGate初始化完成。

    严重提示:以后启动Replicat进程不能指定csn参数!

     

     

    23:源端数据库运行DDL支持脚本

     

    源端进入goldengate安装目录(因为这些脚本在该目录下),以sysdba角色运行:

    SQL> !pwd

    /oradata2/goldengate

    关闭回收站功能

    SQL>  show parameter recyclebin

    NAME                               TYPE   VALUE

    ------------------------------------ ----------- ------------------------------

    recyclebin                        string  on

     

    SQL>  alter system set recyclebin=off scope=both;

     

    清空回收站

    SQL>  purge recyclebin;

     

    运行goldengate DDL支持配置脚本,顺序必须一致

    SQL>  @marker_setup.sql

    SQL>  @ddl_setup.sql

    SQL>  @role_setup.sql

     

    授权并且要授给goldengate用户操作ddl复制相关对象的权限

    SQL>  grant GGS_GGSUSER_ROLE to goldengate;

     

    启动ddl捕获触发器

    SQL>  @ddl_enable;

     

    如果报错的话就还原回去@marker_remove.sql 、@ddl_remove.sql、 @ddl_disable

     

     

    24:源端capture进程配置DDL捕获

      

    在源端:

    GGSCI (hncdfdb1) 1>edit params ext_hq

     

    EXTRACT ext_hq

    setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

    setenv (ORACLE_SID=hncdfhq)

    userid goldengate, password goldengate

    REPORTCOUNT EVERY 1 MINUTES, RATE

    numfiles 5000

    DISCARDFILE ./dirrpt/ext_hq.dsc, APPEND, MEGABYTES 1000

    DISCARDROLLOVER AT 3:00

    exttrail ./dirdat/r1, megabytes 200

    dynamicresolution

    TRANLOGOPTIONS EXCLUDEUSER goldengate

    TRANLOGOPTIONS convertucs2clobs

    DDL INCLUDE ALL

    TABLE  DBUSRSYS.*;

    TABLE  CONGOU.*;

    TABLE  DBUSRPOP.*;

    TABLE  PORTAL.*;

    TABLE  DBUSRXMLT.*;

    TABLE  DBUSRMKT.*;

    TABLE  DBLINKUSR.*;

    TABLE  DBUSRSET.*;

    TABLE  DBUSRPUB.*;

     

    GGSCI (hncdfdb1) 2>stop ext_hq

    GGSCI (hncdfdb1) 3>start ext_hq

     

    GGSCI (hncdfdb1) 4>  info all

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

     

    MANAGER     RUNNING                                          

    EXTRACT     RUNNING     EXT_HQ00:03:10      00:00:02

     

    目标端:

    GGSCI (zaibei) 1>  edit params rep_hq

     

    REPLICAT rep_hq

    SETENV (NLS_LANG="American_America.ZHS16GBK")

    SETENV (ORACLE_SID=hncdfhq)

    USERID goldengate, PASSWORD goldengate

    REPORTCOUNT EVERY 30 MINUTES, RATE

    REPERROR DEFAULT, ABEND

    numfiles 5000

    --HANDLECOLLISIONS

    assumetargetdefs

    DISCARDFILE ./dirrpt/rep_hq.dsc, APPEND, MEGABYTES 1000

    ALLOWNOOPUPDATES

    DDL INCLUDE MAPPED

    map DBUSRSYS.*, target DBUSRSYS.*;

    map CONGOU.*, target CONGOU.*;

    map DBUSRPOP.*, target DBUSRPOP.*;

    map PORTAL.*, target PORTAL.*;

    map DBUSRXMLT.*, target DBUSRXMLT.*;

    map DBUSRMKT.*, target DBUSRMKT.*;

    map DBLINKUSR.*, target DBLINKUSR.*;

    map DBUSRSET.*, target DBUSRSET.*;

    map DBUSRPUB.*, target DBUSRPUB.*;

     

     

    GGSCI (zaibei) 1>  stop rep_hq

    GGSCI (zaibei) 2>  start rep_hq

    GGSCI (zaibei) 3>  info all

     

    Program     Status      Group       Lag at Chkpt  Time Since Chkpt

     

    MANAGER     RUNNING                                          

    REPLICAT    RUNNING     REP_HQ00:00:00      00:00:07 

     

     

    25:源端Capture进程配置DDL捕获后自动添加TRANDATA

     

    在源端的ext_hq 参数文件中 DDL INCLUDE ALL 后面添加如下三行:

    DDL INCLUDE ALL

    DDLOPTIONS ADDTRANDATA

    DDLOPTIONS GETREPLICATES            

    DDLOPTIONS REPORT

     

    而目标端的rep_hq  DDL INCLUDE MAPPED后面添加如下一行

    DDL INCLUDE MAPPED

    DDLOPTIONS REPORT

     

    之后源端和目标端都要重启进程

    注:DDLPTIONS后面没有逗号!

     

     

    转载于:https://www.cnblogs.com/liang545621/p/7529123.html

  • 相关阅读:
    unity3d 免费好用的数据库处理框架 数据库直连框架
    为.NET搭建Linux的开发环境,鄙视那些将简单事情复杂化的人
    为Linux重新开发MVC,有图有真相
    让我们一起用开源数据库和开源框架废弃Access
    C#子线程执行完后,调用主线程的方法
    javascript 将 table 导出 Excel ,可跨行跨列
    Easyui中 messager.alert 后某文本框获得焦点
    Easyui中 alert 带回调函数的 消息框
    wamp 在本地安装PHP环境, 开启 curl 扩展
    H+ 编辑tab页 保存后 刷新列表tab页 并关闭自已。tabA页调用tabB页的方法
  • 原文地址:https://www.cnblogs.com/twodog/p/12139356.html
Copyright © 2020-2023  润新知