开启归档及附加日志

修改dm.ini开启归档和附加日志

RLOG_APPEND_LOGIC   = 2
ARCH_INI            = 1             #dmarch.ini

修改dmarch.ini,设置归档路径

[ARCHIVE_LOCAL1]
ARCH_TYPE                    = LOCAL
ARCH_DEST                    = /opt/dmdbms/data/ARCH
ARCH_FILE_SIZE           = 128
ARCH_SPACE_LIMIT         = 10240

重启数据库

检查是否开启

select PARA_NAME,PARA_VALUE from V$DM_INI where PARA_NAME in ('RLOG_APPEND_LOGIC','ARCH_INI');

select * from V$DM_ARCH_INI;

检查DBMS系统包是否创建

SELECT SF_CHECK_SYSTEM_PACKAGES;
或者
SELECT SF_CHECK_SYSTEM_PACKAGE('DBMS_LOGMNR');


创建DBMS系统包命令

SP_CREATE_SYSTEM_PACKAGES(1);   ---创建所有DBMS包
或者
SP_CREATE_SYSTEM_PACKAGES(1,'DBMS_LOGMNR');   ---创建指定DBMS包

未创建DBMS系统包,下面用户赋权时会提示Invalid database object报错:

用户创建及赋权

CREATE USER ZCBUS IDENTIFIED BY "*****************";
GRANT CREATE SESSION TO ZCBUS;
GRANT RESOURCE TO ZCBUS;
GRANT SELECT ANY TABLE TO ZCBUS;
GRANT SELECT ANY DICTIONARY TO ZCBUS;
GRANT SELECT ANY VIEW TO ZCBUS;
GRANT EXECUTE ON DBMS_LOGMNR TO ZCBUS;

用户权限查询

col PRIVILEGE for a30
col GRANTOR for a30
col TABLE_NAME for a30
select PRIVILEGE from  dba_sys_privs where  grantee='ZCBUS';
select granted_role from dba_role_privs where  grantee='ZCBUS';
select PRIVILEGE,GRANTOR,TABLE_NAME from dba_tab_privs where  grantee='ZCBUS';
文档更新时间: 2023-07-13 23:17   作者:周风磊