Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

0

好友

0

主题
1#
发表于 2011-12-9 15:15:39 | 查看: 11736| 回复: 18
1.
环境介绍
目前两台服务器均安装Centos 6.0 64+TOMCAT 7.0 +Oracle 11g r2  64,这两天服务器的TOMCAT作为应用服务,通过LVS +Keepalived实现业务的HA自动切换,两台TOMCAT业务分别读写各自的Oracle数据库,为达到TOMCATHA切换后两个数局库保持一致,需要实现两个Oracle数据库的数据同步。
服务器1:mtcp1
服务器2:mtcp2

--oracle 流复制
1.第一步创建流管理员和复制过程中用到的表空间
create tablespace streams_tbs DATAFILE '/opt/oracle/oradata/streams_tbs01.dbf' size 100M REUSE Autoextend on maxsize unlimited;
2.创建流复制管理员
CREATE USER strmadmin IDENTIFIED BY strmadmin
DEFAULT TABLESPACE streams_tbs QUOTA UNLIMITED ON streams_tbs;
3.给流管理员赋权限
GRANT DBA TO strmadmin;
#授权Stream管理用户
grant connect,resource,dba,aq_administrator_role to strmadmin;
/

Grant DBA TO STRMADMIN;
begin
DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');
end;
/
GRANT SELECT ANY DICTIONARY TO STRMADMIN;
grant insert any table TO STRMADMIN;
grant update any table TO STRMADMIN;
grant delete any table TO STRMADMIN;
grant select any table TO STRMADMIN;
grant alter any table TO STRMADMIN;
grant read on directory data_pump_dir to strmadmin;
grant write on directory data_pump_dir to strmadmin;
  --检查授权
  SELECT * FROM dba_streams_administrator;
  -----页面配置时出错后搜权
  execute MGMT_USER.MAKE_EM_USER
  ----
4.对两台数据库设置参数
-----------------
alter system set "_job_queue_interval"=1 scope=spfile;
alter system set global_names=true scope=spfile;
alter system set job_queue_processes=1000;
alter system set PARALLEL_MAX_SERVERS=40;
alter system set sga_target=0;
alter system set streams_pool_size=500M;
---
重新启动后方能生效
--------
设置oracle为归档模式
alter system set log_archive_dest_1=' location=/opt/oracle/oradata' scope=spfile;
alter system set log_archive_start=TRUE scope=spfile;
alter system set log_archive_format=' arch_%t-%s-%r.arc' scope=spfile;
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;
---#将logminer的数据字典从system表空间转移到新建的表空间,防止撑满system表空间
execute dbms_logmnr_d.set_tablespace('streams_tbs');
---------------------------
5.追加日志
  先检查追加日值日的属性
SELECT SCHEMA_NAME,
SUPPLEMENTAL_LOG_DATA_PK log_pk,
SUPPLEMENTAL_LOG_DATA_FK log_fk,
SUPPLEMENTAL_LOG_DATA_UI log_ui,
SUPPLEMENTAL_LOG_DATA_ALL log_all
FROM DBA_CAPTURE_PREPARED_SCHEMAS;
--追加日志
NAME
prepare_schema_instantiation()
FUNCTION
prepare a schema for instantiation
PARAMETERS
schema_name - (IN) the name of the schema to prepare
supplemental_logging - (IN) supplemental logging level
('NONE', 'KEYS', or 'ALL')
NOTES
KEYS means PRIMARY KEY, UNIQUE INDEX, and FOREIGN KEY levels combined.
----------------------------------------------------------------------------*/
PROCEDURE prepare_schema_instantiation(
schema_name IN VARCHAR2,
supplemental_logging IN VARCHAR2 DEFAULT 'KEYS');
--------------
6.在源库上创建到目标库strmadmin用户的database link:
--在mtcp1主机上
conn strmadmin/strmadmin;
Connected.
create database link orcl.mtcp2.com connect to strmadmin identified by strmadmin using 'orcl.mtcp2.com';
Database link created.
/* orcl.mtcp2.com 为目标库的全局数据库名,orcl为db_name,mtcp2.com为domain_name */
---在mtcp2主机上
conn strmadmin/strmadmin;
Connected.
create database link orcl.mtcp1.com connect to strmadmin identified by strmadmin
using 'orcl.mtcp1.com';
Database link created.
----------------------------------
---------------------------------
7.在源库中分别为capture(捕获)和apply(应用)创建队列queue:
begin
dbms_streams_adm.set_up_queue(
queue_table => 'apply_srctab',
queue_name => 'apply_src',
queue_user => 'strmadmin');
end;
/
PL/SQL procedure successfully completed.
begin
dbms_streams_adm.set_up_queue(
queue_table => 'capture_srctab',
queue_name => 'capture_src',
queue_user => 'strmadmin');
end;
/
PL/SQL procedure successfully completed.
-----------------------------------------------
在目标库分别为capture和apply创建队列queue:
conn [email=strmadmin/strmadmin@orcl.mtcp2.com]strmadmin/strmadmin@orcl.mtcp2.com[/email]
Connected.
begin
dbms_streams_adm.set_up_queue(
queue_table => 'apply_desttab',
queue_name => 'apply_dest',
queue_user => 'strmadmin');
end;
/
PL/SQL procedure successfully completed.
begin
dbms_streams_adm.set_up_queue(
queue_table => 'capture_desttab',
queue_name => 'capture_dest',
queue_user => 'strmadmin');
end;
/
PL/SQL procedure successfully completed.
================================================
在源库mtcp1上为gateway_yd模式创建创获进程 capture process:
conn [email=strmadmin/strmadmin@orcl.mtcp1.com]strmadmin/strmadmin@orcl.mtcp1.com[/email]
Connected.
begin
dbms_streams_adm.add_schema_rules(
schema_name => 'gateway_yd',   
streams_type => 'capture',
streams_name => 'capture_src',
queue_name => 'capture_src',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => null,
inclusion_rule => true);
end;
/
PL/SQL procedure successfully completed.
9.在源库mtcp1上创建应用进程apply process
conn [email=strmadmin/strmadmin@orcl.mtcp1.com]strmadmin/strmadmin@orcl.mtcp1.com[/email]
Connected.
begin
dbms_streams_adm.add_schema_rules (
schema_name => 'gateway_yd',
streams_type => 'apply',
streams_name => 'applys_src',
queue_name => 'apply_src',
include_dml => true,
include_ddl => true,
source_database => 'orcl.mtcp1.com');
end;
/
PL/SQL procedure successfully completed.

10.在源库mtcp1上配置propagation process:
conn [email=strmadmin/strmadmin@orcl.mtcp1.com]strmadmin/strmadmin@orcl.mtcp1.com[/email]
Connected.
begin
dbms_streams_adm.add_schema_propagation_rules (  
schema_name => 'gateway_yd',
streams_name => 'prop_src_to_dest',
source_queue_name => 'capture_src',
destination_queue_name => [email=]'apply_dest@orcl.mtcp2.com'[/email],
include_dml => true,
include_ddl => true,
source_database => 'orcl.mtcp1.com');
end;
/
-----出现错误
ERROR at line 1:
ORA-26723: user "STRMADMIN" requires the role "DV_STREAMS_ADMIN"
ORA-06512: at "SYS.DBMS_STREAMS_ADM_UTL_INVOK", line 349
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 439
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 397
ORA-06512: at line 2
---以sys用户再登陆后运行---
BEGIN
  DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
    grantee         => 'STRMADMIN',   
    grant_privileges => TURE);
END;
/
-----------------------
再次运行正常!!
------------------------
11.在目标库mtcp2上配置capture process:
conn [email=strmadmin/strmadmin@orcl.mtcp2.com]strmadmin/strmadmin@orcl.mtcp2.com[/email]
Connected.
   
begin
dbms_streams_adm.add_schema_rules(
schema_name => 'gateway_yd',
streams_type => 'capture',
streams_name => 'captures_dest',
queue_name => 'capture_dest',
include_dml => true,
include_ddl => true);
end;
/
---出错!
*
ERROR at line 1:
ORA-26723: user "STRMADMIN" requires the role "DV_STREAMS_ADMIN"
ORA-06512: at "SYS.DBMS_STREAMS_ADM_UTL_INVOK", line 349
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 439
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 397
ORA-06512: at line 2
-------------
---以sys用户再登陆后运行---
BEGIN
  DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
    grantee         => 'STRMADMIN',   
    grant_privileges => TURE);
END;
/
---------------------------------------------------
仍然出错
求高手帮忙看看如何解决!!
2#
发表于 2011-12-9 15:31:18
目标库

GRANT DBA TO strmadmin;

BEGIN
DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
grantee => 'strmadmin',
grant_privileges => true);
END;
/

SELECT * FROM dba_streams_administrator;

回复 只看该作者 道具 举报

3#
发表于 2011-12-9 15:33:30
执行完以上步骤
SQL> SELECT * FROM dba_streams_administrator;
USERNAME                       LOC ACC
------------------------------ --- ---
STRMADMIN                      YES YES

回复 只看该作者 道具 举报

4#
发表于 2011-12-9 15:35:04
运行
BEGIN
DBMS_APPLY_ADM.CREATE_APPLY(
queue_name => 'strmadmin.sync_apply_queue',
apply_name => 'sync_apply',
apply_captured => FALSE);
END;
/
还是
ERROR at line 1:
ORA-26723: user "STRMADMIN" requires the role "DV_STREAMS_ADMIN"
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 84
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 127
ORA-06512: at "SYS.DBMS_LOGREP_UTIL_INVOK", line 41
ORA-06512: at "SYS.DBMS_APPLY_ADM", line 616
ORA-06512: at line 2

回复 只看该作者 道具 举报

5#
发表于 2011-12-9 16:04:31
Grant DV_STREAMS_ADMIN to STRMADMIN

再试下

回复 只看该作者 道具 举报

6#
发表于 2011-12-9 16:08:09
执行 Grant DV_STREAMS_ADMIN to STRMADMIN;
Grant DV_STREAMS_ADMIN to STRMADMIN
      *
ERROR at line 1:
ORA-01919: role 'DV_STREAMS_ADMIN' does not exist

回复 只看该作者 道具 举报

7#
发表于 2011-12-9 16:10:44
conn / as sysdba
grant DV_STREAMS_ADMIN to STRMADMIN;

回复 只看该作者 道具 举报

8#
发表于 2011-12-9 16:13:00
SQL> conn / as sysdba
Connected.
SQL> grant DV_STREAMS_ADMIN to STRMADMIN;
grant DV_STREAMS_ADMIN to STRMADMIN
      *
ERROR at line 1:
ORA-01919: role 'DV_STREAMS_ADMIN' does not exist

任然不行!
SQL> SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE='DV_STREAMS_ADMIN';
no rows selected

回复 只看该作者 道具 举报

9#
发表于 2011-12-9 16:17:41
sqlplus / as sysdba

@?/rdbms/admin/catmacg.sql

grant DV_STREAMS_ADMIN to STRMADMIN

回复 只看该作者 道具 举报

10#
发表于 2011-12-9 16:26:10
GRANT SELECT ON dvsys.dv$identity TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$identity_map TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$mac_policy TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$mac_policy_factor TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$monitor_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$ols_policy TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$ols_policy_label TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$policy_label TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_auth TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_object TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_command_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$role TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule_set TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule_set_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_grantee TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_object TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_object_owner TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT dv_admin TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_patch_admin to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_streams_admin to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_secanalyst TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_public TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_monitor to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
grant SELECT on dvsys.ku$_dv_realm_view           to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_member_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_auth_view      to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isr_view             to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isrm_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_view        to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_member_view to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_command_rule_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_role_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_view          to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_link_view     to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_type_view     to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_view        to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_map_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_view           to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_member_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_auth_view      to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isr_view             to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isrm_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_view        to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_member_view to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_command_rule_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_role_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_view          to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_link_view     to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_type_view     to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_view        to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_map_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> Grant DV_STREAMS_ADMIN to STRMADMIN;
SQL> Grant DV_STREAMS_ADMIN to STRMADMIN;
Grant DV_STREAMS_ADMIN to STRMADMIN
*
ERROR at line 1:
ORA-01031: insufficient privileges

回复 只看该作者 道具 举报

11#
发表于 2011-12-9 16:27:20
出了很多错,屏幕显示不过来,拷贝了后半部分贴出来!

回复 只看该作者 道具 举报

12#
发表于 2011-12-9 16:28:31
是不是缺少那个包呀?

回复 只看该作者 道具 举报

13#
发表于 2011-12-9 16:33:07
先登录到sys 然后执行

conn / as sysdba

@?/rdbms/admin/catmacg.sql

grant DV_STREAMS_ADMIN to STRMADMIN

回复 只看该作者 道具 举报

14#
发表于 2011-12-9 16:45:42
GRANT SELECT ON dvsys.dba_dv_pub_privs TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dba_dv_user_privs_all TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$code TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$command_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$document TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$factor TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$factor_link TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$factor_scope TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$factor_type TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$identity TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$identity_map TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$mac_policy TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$mac_policy_factor TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$monitor_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$ols_policy TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$ols_policy_label TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$policy_label TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_auth TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_object TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$realm_command_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$role TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule_set TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$rule_set_rule TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_grantee TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_object TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT SELECT ON dvsys.dv$sys_object_owner TO dv_secanalyst
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
GRANT dv_admin TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_patch_admin to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_streams_admin to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_secanalyst TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_public TO dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
GRANT dv_monitor to dv_owner with admin option
*
ERROR at line 1:
ORA-01031: insufficient privileges
grant SELECT on dvsys.ku$_dv_realm_view           to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_member_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_auth_view      to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isr_view             to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isrm_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_view        to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_member_view to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_command_rule_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_role_view            to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_view          to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_link_view     to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_type_view     to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_view        to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_map_view    to dv_owner
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_view           to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_member_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_realm_auth_view      to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isr_view             to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_isrm_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_view        to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_rule_set_member_view to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_command_rule_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_role_view            to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_view          to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_link_view     to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_factor_type_view     to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_view        to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
grant SELECT on dvsys.ku$_dv_identity_map_view    to dv_streams_admin
                      *
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
SQL> grant DV_STREAMS_ADMIN to STRMADMIN;
grant DV_STREAMS_ADMIN to STRMADMIN
*
ERROR at line 1:
ORA-01031: insufficient privileges

回复 只看该作者 道具 举报

15#
发表于 2011-12-9 16:53:37
SQL> grant DV_STREAMS_ADMIN to STRMADMIN;
grant DV_STREAMS_ADMIN to STRMADMIN
*
ERROR at line 1:
ORA-01031: insufficient privileges
       
你没有用sysdba 权限执行脚本?

回复 只看该作者 道具 举报

16#
发表于 2011-12-9 16:58:38
@?/rdbms/admin/catmacg.sql



SQL>  grant DV_STREAMS_ADMIN to hr;

Grant succeeded.

我这里是可以的, 自己检查 权限问题

回复 只看该作者 道具 举报

17#
发表于 2013-8-23 21:26:47
还没弄明白为什么用 SYS 用户登陆执行 授权语句会报下面的错:
SQL> grant DV_STREAMS_ADMIN to STRMADMIN;
grant DV_STREAMS_ADMIN to STRMADMIN
*
ERROR at line 1:
ORA-01031: insufficient privileges

但是当我以 STRMADMIN 登陆执行该语句后,居然成功了,结果如下:
SQL>  grant DV_STREAMS_ADMIN to STRMADMIN;

Grant succeeded.

SQL> SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE='DV_STREAMS_ADMIN';

GRANTEE                        GRANTED_ROLE                      ADM DEF
------------------------------ ------------------------------ --- ---
STRM                               DV_STREAMS_ADMIN               NO  YES

SQL>

求解释!

回复 只看该作者 道具 举报

18#
发表于 2013-8-23 22:21:01

SQL> grant DV_STREAMS_ADMIN to maclean;

授权成功。

SQL> show user;
USER 为 "SYS"


1、 你没说版本

2、 重新做一次 之前flush shared_pool;

回复 只看该作者 道具 举报

19#
发表于 2014-9-5 10:25:23
和楼主出现同样的情况,没找到原因,不过谢谢楼主的 帖子!

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-21 02:18 , Processed in 0.051618 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569