Another Linux Command

1-Check Memory :

[oracle@192 ~]$ free -m

             total       used       free     shared    buffers     cached
Mem:          1010        997         13          0         71        685
-/+ buffers/cache:        240        770
Swap:         2000          0       2000

[oracle@192 ~]$ vmstat

procs ———–memory———- —swap– —–io—- –system– —–cpu——
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0  28820  72248 704336    0    0   117    49 1026  239  3  1 93  3  0

[oracle@192 ~]$ dmesg | grep RAM

BIOS-provided physical RAM map:
hdc: ATAPI 1X DVD-ROM DVD-R-RAM CD-R/RW drive, 32kB Cache, UDMA(33)

Finally : top command that you could use.

2-How Much this Os was running
 
[oracle@192 ~]$ uptime

 23:03:17 up  1:44,  2 users,  load average: 0.04, 0.11, 0.08

3-Check Some Hardware Information

CPU :

[oracle@192 ~]$ cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
stepping        : 2
cpu MHz         : 2261.079
cache size      : 3072 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx rdtscp lm constant_tsc up ida nonstop_tsc pni cx16 popcnt lahf_lm [8]
bogomips        : 4522.15

 Thank you
Osama mustafa

ORA-20222: Workload was not captured in the current database



Happy New Year For All , And Wish you All Best 

ORA-20222 “Given capture_id \”%s\” is invalid or the corresponding capture failed”

ORA-20222: Workload was not captured in the current database. Cannot export!
ORA-06512: at “SYS.DBMS_WORKLOAD_CAPTURE”, line 1588
ORA-06512: at line 2

 Regarding to Https://support.oracle.com Note :

DATABASE CAPTURE AND REPLAY COMMON ERRORS AND REASONS [ID 463263.1]
This Error 

is a generic error message that can occur due other underlying error during Capture.
Check the error accompanying with ORA-20222.

Ensure correct directory name is used including check the case-sensitivity of the directory name.
The directory name is case sensitive. Ensure READ and WRITE privilege on the DIRECTORY object to the which is the capture is written.

Thank you 
Osama mustafa

Happy New Year Again . 

Flashback data Archive

What Is Flashback Data Archive ?

is has another name called Oracle total Recall , and its ability to track and store all transactional changes to a table over its lifetime.


How Can I Use it ?

Step One

create default flashback archive on an existing tablespace.

Suntax :

create flashback archive  default tablespace retention ;

Example :

 conn / a sysdba
SQL > create flashback archive default Osama tablespace User retention 1 year;

Step Two :

Create Table to Store Information inside it

Conn Osama/Osama
Sql > Create table Store as select * from dba_objects; — For example 

Step Three:

We Need to enable flash archive on same table by

Sql > alter table Store flashback archive;

-You need to check time by :
select systimestamp from dual;
– Check Created Point By
select timestamp_to_scn(systimestamp) from dual;

The Above is the main Steps To Enable FlashBack data Archive.

Thank you
Osama Mustafa

Example Links :
1-Recall Example 
2-Recall Example 
3-Recall Example
4-Using Flashback Data Archive  

Database Vulnerabilities

in this post you will find 10 ways make your database easy to hack ,Special thank for Team Shatter , I post online Article about Database security before and as reminder read it again it . LETS START


1-default-blank-and-weak-username-and-passwords

We All know What we mean by Defaults and weak password (which not complex)

To create a strong password:

  • Don’t use words that can be easily guessed or found in the dictionary
  • Use a combination of letters, numbers and characters
  • Create a complex sentence instead of a word
  • Do not share your password with anyone or write it down and leave it in your desk drawer

2-sql-injections-in-the-database

sql injection : attack vector in the DBMS through Web applications because of a failure to sanitize user inputs.
SQL Injection in the DBMS exploits passing SQL commands as a parameter of a function or stored procedure. This will then execute the malicious SQL commands in the context of the component that provides the called function. This is often done using components with system or admin privileges resulting in privilege escalation.

3-excessive-user-and-group-privileges

avoid extensive user and group privileges:

  • Map Job Functions to Privileges on IT assets
  • Never Assign Privileges Directly to Guest Accounts or Public
  • Untangle The Web of User Entitlements
  • Implement Compensating Controls for What You Can’t Fix

4-Unnecessary Enabled Database Features.



These features provide database application developers with a lot more power when working with a DBMS.  The flipside of the coin is, the more power you give a developer, the more attack vectors you potentially expose to the bad guys.

5-check-your-database-configurations with your company Goal.

6-Buffer Overflows 

A buffer overflow is when the input to a function contains more data than the input buffer can hold. If the size of the input is not checked during the copy to that buffer, adjacent memory that is used for other purposes might get overwritten.

 In most cases, this will be more or less random and can lead to unpredictable behavior, like crashing the server. However, if an attacker is able to also change the code execution pointer to the location of the overwritten memory, it is possible to execute any kind of malicious code using the context of the DBMS process.

 This could lead to a potential total compromise of the system, resulting in loss of sensitive information and overall security.
To protect against these types of attacks, it is important to always keep your DBMS updated with the latest security patches available from the vendor, as well as monitoring for known attack signatures.

 7-Privilege Escalation 

privilege escalation attack is when the attacker is exploiting a known vulnerability in a DBMS that allows a user account with restricted privileges to execute instructions or query data that that typically requires higher privileges. Thus unlocking the locks in the candy store.

There are different common vulnerabilities that allow for privilege escalation. Sometimes misusing a function that runs under a sysdba, sa or similar security context. In other cases it is done by exploiting vulnerabilities that allow a low-privileged account to grant itself more rights.

To protect against these types of attacks, it is important to always keep your DBMS updated with the latest security patches available from the vendor, as well as continuously monitor for known attack signatures.

8-Denial of Service Attack DoS

Think of a washing machine. The more clothes you put in it, the more work it needs to do. If you overfill it with clothes, it gets overwhelmed and stops working.

The same thing happens with a Denial of Service attack. It creates so much traffic on a site, a server or even sections of the internet that it cannot function and shuts down.

The most infamous DoS involving database servers was in 2003 when a computer worm called the SQL Slammer compromised more than 75,000 servers and slowed internet traffic to a halt.

9-Unpatched Databases

 Many organizations don’t implement patches right away – some even wait a year or more. The most common excuses are the downtime involved with implementing patches and the time involved with testing these patches to make sure they don’t affect the production software. Whatever the excuse may be, organizations should use database activity monitoring to manage the gap between patches on its databases containing critical information PII data.

10-Unencrypted sensitive data


Encryption is an important part of housing sensitive data. Network traffic should also be encrypted to ensure that the passwords used to access sensitive, critical data cannot be seen by traffic.

Any information that goes over the network or stored in the database should be encrypted and kept from prying eyes. Some network configurations and database management systems might allow for critical information to be sent in clear text. To ensure this doesn’t occur, make sure you have the latest version of software and turn off text indexing.

Remember to back to my online article .
Thank you

Useful Link :
1-Team Shatter

Osama Mustafa

Oracle Password Security

As Certified Ethical hacker and Penetration  Testing Always people Asked me about if the Oracle Password can be Cracked or not ? You need to know that if the hacker want to get into your database and he will all you can do is make it harder for him , so don’t choose Easy password to crack

I post these topics not to use it in wrong way , No as DBA you need to know about Securing you database
and How to make it unbreakable.

For example check the below tools that used to crack Oracle Password

And Others Tools Found for free On Internet , for example Red database security (which is amazing company and website provide you with article/topics about oracle security ) provide some of these tools for free.

Thank you
Osama Mustafa