Thursday, September 3, 2020

Who is doing the backup on your sql server

; WITH bus AS (

 SELECT database_name, machine_name, backup_finish_date, media_set_id, type,msdb.dbo.backupset.software_vendor_id,

 msdb.dbo.backupset.user_name,

        row_number () OVER(PARTITION BY database_name ORDER BY backup_finish_date DESC) AS rowno

 FROM   msdb.dbo.backupset

)

SELECT bus.machine_name AS ServerName, sdb.Name AS DatabaseName,

       COALESCE(convert(varchar(23), bus.backup_finish_date), 'No backup') AS BackupTime ,

      CASE bus.type 

      WHEN 'D' THEN 'Database' 

      WHEN 'L' THEN 'Log File'

      WHEN 'I' THEN 'Differential'

      END AS BackupType,software_vendor_id,user_name,

busf.physical_device_name AS Location

FROM sys.databases sdb

LEFT OUTER JOIN bus ON bus.database_name = sdb.name AND rowno <= 2

LEFT OUTER JOIN msdb.dbo.backupmediafamily busf ON busf.media_set_id = bus.media_set_id

WHERE database_id > 4

ORDER BY bus.machine_name

Friday, August 28, 2020

my smtp server

 ecphksmtp.ecp.priv

Wednesday, August 26, 2020

Tuesday, August 18, 2020

FAILED LOGIN ATTEMPTS ORACLE

 

! HPRD:atlas.ecp.priv:/dbapps/oracle> sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 18 02:40:33 2020


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> audit create session whenever not successful;



select os_username,  username, userhost,  to_char(timestamp,'mm/dd/yyyy hh24:mi:ss') 

logon_time,  action_name, returncode from dba_audit_session order by 4 desc;

Monday, August 10, 2020

LINUX SWITCH USER

 sudo visudo


oracle  ALL=(root) ALL

admrcavan   ALL=(applmgr) NOPASSWD:ALL


admrcavan@apollo's password:

Last login: Mon Aug 10 18:02:52 2020 from 10.162.91.247

[admrcavan@apollo ~]$ sudo -iu applmgr

 apollo:/dbapps/applmgr/HRD2/apps/apps_st/appl>




Wednesday, August 5, 2020

MANAGING UNIFIED_AUDIT_TRAIL

Archiving the Unified and Traditional Database Audit Trails

You should periodically archive and then purge the audit trail to prevent it from growing too large.

Archiving and purging both frees audit trail space and facilitates the purging of the database audit trail.

You can create an archive of the unified and traditional database audit trail by using Oracle Audit Vault and Database Firewall. You install Oracle Audit Vault and Database Firewall separately from Oracle Database.

After you complete the archive, you can purge the database audit trail contents.

  • To archive the unified, traditional standard, and traditional fine-grained audit records, copy the relevant records to a normal database table.

    For example:

    INSERT INTO table SELECT ... FROM UNIFIED_AUDIT_TRAIL ...;
    INSERT INTO table SELECT ... FROM SYS.AUD$ ...;
    INSERT INTO table SELECT ... FROM SYS.FGA_LOG$ ...;