Monday, February 27, 2012

How to kill data Pump Job


Import> STOP_JOB=IMMEDIATE

or

Export>STOP_JOB=IMMEDIATE

also u can use this script

Wednesday, February 15, 2012

ora-01720

Problem can be solved by giving privilege with  " WITH GRANT OPTION" ;

Wednesday, February 8, 2012

easy way of giving all privileges to an user from main database to another database

 select  'grant ' || privilege || ' on ' || grantor || '.' || table_name || ' to ' || grantee || ';' from dba_tab_privs where grantee='SCHEMA_NAME'

UTL_MAIL INSTALLATION AND ADDING INTO ACL

cd $ORACLE_HOME
cd rdbms/admin/
sqlplus / as sysdba

SQL> @utlmail.sql
then
SQL> @prvtmail.plb

SQL> GRANT EXECUTE ON UTL_MAIL TO PUBLIC;
-or-
SQL> GRANT EXECUTE ON UTL_MAIL TO system;

SQL>ALTER SYSTEM SET smtp_out_server = 'mail.srv' SCOPE=BOTH;

SQL>shutdown immediate;
SQL>startup;


when database is ready execute the below scripts to create and give privlages;
begin
  dbms_network_acl_admin.create_acl (
    acl         => 'utl_mail.xml',
    description => 'Allow mail to be send',
    principal   => 'SCOTT',
    is_grant    => TRUE,
    privilege   => 'connect'
    );
    commit;
end;

giving privilage;
begin
  dbms_network_acl_admin.add_privilege (
  acl       => 'utl_mail.xml',
  principal => 'SCOTT',
  is_grant  => TRUE,
  privilege => 'resolve'
  );
  commit;
end;
last step ;
assing ACL
begin
  dbms_network_acl_admin.assign_acl(
  acl  => 'utl_mail.xml',
  host => 'smtp server host name or address'
  );
  commit;
end;

Now u can send mail with ult_mail...

begin
  utl_mail.send(
  sender     => 'person@com.tr',
  recipients => 'person2@com.tr',
  message    => 'hi'
  );
  commit;
end;

if u wanna see who can send mail with UTL_MAIL ;

select owner, object_type from all_objects where object_name = 'UTL_FILE' ;

Thursday, February 2, 2012

Removing and Adding Send Mail Service at boot for linux

to remove
chkconfig --del sendmail
to add
chkconfig --add sendmail
to control
chkconfig --list sendmail