Archive for the ‘Security’ Category.

How to disable Oracle database vault

DISABLE Database vault

1) Shutdown database
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

2) Stop database control
[oracle@centos53 datvault]$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
https://centos53.server.cz:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ……  Stopped.

3) Relink Oracle

[oracle@centos53 datvault]$ cd $ORACLE_HOME/rdbms/lib
[oracle@centos53 lib]$ make -f ins_rdbms.mk dv_off
/usr/bin/ar d /u01/app/oracle/product/11.1.0/db_1/rdbms/lib/libknlopt.a kzvidv.o
/usr/bin/ar cr /u01/app/oracle/product/11.1.0/db_1/rdbms/lib/libknlopt.a /u01/app/oracle/product/11.1.0/db_1/rdbms/lib/kzvndv.o
[oracle@centos53 lib]$ cd $ORACLE_HOME/bin
[oracle@centos53 bin]$ relink oracle

4) startup database

[oracle@centos53 bin]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Jan 13 11:43:00 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  238530560 bytes
Fixed Size                  1299116 bytes
Variable Size             155192660 bytes
Database Buffers           79691776 bytes
Redo Buffers                2347008 bytes
Database mounted.
Database opened.

5) Disable triggers
SQL> ALTER TRIGGER DVSYS.DV_BEFORE_DDL_TRG DISABLE;

Trigger altered.

SQL> ALTER TRIGGER DVSYS.DV_AFTER_DDL_TRG DISABLE;

Trigger altered.

ENABLE Database vault

ALTER TRIGGER DVSYS.DV_BEFORE_DDL_TRG ENABLE;
ALTER TRIGGER DVSYS.DV_AFTER_DDL_TRG ENABLE;

make -f ins_rdbms.mk dv_on

Regards,

Tom

How to clear alerts in Grid control

Hi,

in my grid control still left old alerts on the first page. This alerts are obsolete and should be deleted automatically but isnt so I looked for any solution. Oracle forum
And there is.

1) connect as user SYSMAN to repository database and select you alert.

-you can use ths general query
SELECT * from MGMT_CURRENT_SEVERITY;

or specific for one target

select t.target_name,t.target_type,collection_timestamp,message,
‘exec em_severity.delete_current_severity(”’ ||t.target_guid || ”’,”’ ||metric_guid || ”’,”’ ||key_value || ”’)’ em_severity
from mgmt_targets t inner join mgmt_current_severity s on t.target_guid = s.target_guid
where target_name like ‘&target’;

TARGET_NAME
——————————————————————————–
TARGET_TYPE
—————————————————————-
COLLECTION_TIMESTA
——————
MESSAGE
——————————————————————————–
EM_SEVERITY
——————————————————————————–
dottk.taloha.tk
oracle_database
05-OCT-09

TARGET_NAME
——————————————————————————–
TARGET_TYPE
—————————————————————-
COLLECTION_TIMESTA
——————
MESSAGE
——————————————————————————–
EM_SEVERITY
——————————————————————————–
Snapshot Too Old Error detected: SQL ID 7nsy3bq9wp2hv, Snapshot SCN 0×0002.3d5b1
87c, Recent SCN 0×0002.3d5e6b21, Undo Tablespace UNDOTBS1, Current Undo Retentio
n 6093.

TARGET_NAME
——————————————————————————–
TARGET_TYPE
—————————————————————-
COLLECTION_TIMESTA
——————
MESSAGE
——————————————————————————–
EM_SEVERITY
——————————————————————————–
exec em_severity.delete_current_severity(’7EF58D39E522C52FE009EECEB83B2AED’,'109
613CA182F59DA38A43D8C1E79E7AB’,'UNDOTBS1′)

and now you can delete the messages (example)

exec em_severity.delete_current_severity(’7EF58D39E522C52FE009EECEB83B2AED’,'109613CA182F59DA38A43D8C1E79E7AB’,'UNDOTBS1′)

Regards,

Tom

How to use DBMS_LDAP package on Oracle

1) create wallet by Oeacle Wallet manager ( owm )
2) import certificate from certification authority
3) and there is part from example script from oracle

– Please customize the following variables as needed
ldap_host  := ‘<hostname>‘ ;
ldap_port  := ‘<port>‘;
ldap_user  := ‘uid=<user>,ou=<people>,dc=<company>,dc=com‘;
ldap_passwd:= ‘12345′;

– end of customizable settings

DBMS_OUTPUT.PUT(’DBMS_LDAP Search Example ‘);
DBMS_OUTPUT.PUT_LINE(’to directory .. ‘);
DBMS_OUTPUT.PUT_LINE(RPAD(’LDAP Host ‘,25,’ ‘) || ‘: ‘ || ldap_host);
DBMS_OUTPUT.PUT_LINE(RPAD(’LDAP Port ‘,25,’ ‘) || ‘: ‘ || ldap_port);

– Choosing exceptions to be raised by DBMS_LDAP library.
DBMS_LDAP.USE_EXCEPTION := TRUE;

my_session := DBMS_LDAP.init(ldap_host,ldap_port);

DBMS_OUTPUT.PUT_LINE (RPAD(’Ldap session ‘,25,’ ‘)  || ‘: ‘ ||
RAWTOHEX(SUBSTR(my_session,1,8)) ||
‘(returned from init)’);

– Establish SSL connection to the directory
retval := DBMS_LDAP.open_ssl(my_session,
‘file:<path to wallet directory>‘,
<wallet password>‘,
2); — NO_AUTH     : 1
– ONE_WAY_AUTH: 2
– TWO_WAY_AUTH: 3

DBMS_OUTPUT.PUT_LINE(RPAD(’open_ssl Returns ‘,25,’ ‘) || ‘: ‘
|| TO_CHAR(retval));

– bind to the directory
retval := DBMS_LDAP.simple_bind_s(my_session,
ldap_user, ldap_passwd);

OUTPUT
======

SQL> @sslbind.sql
DBMS_LDAP Search Example to directory ..
LDAP Host                : myldap.server.cz
LDAP Port                : 636
Ldap session             : 01000000(returned from init)
open_ssl Returns         : 0
simple_bind_s Returns    : 0
unbind_res Returns       : 0
Directory operation Successful .. exiting

PL/SQL procedure successfully completed.

You can get following error:

Error Message : ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown Error

Solution:
Check path, password and wallet name
path should ended by directory where is wallet saved
wallet name must be ewallet.p12

Regards,

Tom

TOPlist