Search This Blog

Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Wednesday, January 8, 2025

List of Build in Functions - Oracle

 

 Oracle provides a comprehensive set of built-in functions categorized into various types. Here’s a list of the commonly used categories and functions:

1. String Functions

  • LOWER(char) – Converts to lowercase
  • UPPER(char) – Converts to uppercase
  • INITCAP(char) – Capitalizes the first letter
  • LENGTH(char) – Returns length of a string
  • SUBSTR(char, start, length) – Extracts substring
  • INSTR(char, substring) – Finds position of substring
  • TRIM(char) – Removes leading/trailing characters
  • LPAD(char, length, pad_char) – Left pad
  • RPAD(char, length, pad_char) – Right pad
  • REPLACE(char, search, replace) – Replaces text
  • CONCAT(char1, char2) – Concatenates strings

2. Numeric Functions

  • ABS(number) – Absolute value
  • ROUND(number, decimal_places) – Rounds to n decimal places
  • TRUNC(number, decimal_places) – Truncates to n decimal places
  • MOD(number1, number2) – Remainder of division
  • CEIL(number) – Rounds up to next whole number
  • FLOOR(number) – Rounds down to previous whole number
  • POWER(base, exponent) – Raises to the power
  • SQRT(number) – Square root
  • SIGN(number) – Returns -1, 0, or 1

3. Date Functions

  • SYSDATE – Returns current date and time
  • CURRENT_DATE – Date in current session timezone
  • ADD_MONTHS(date, number) – Adds months to date
  • LAST_DAY(date) – Last day of the month
  • MONTHS_BETWEEN(date1, date2) – Difference in months
  • NEXT_DAY(date, weekday) – Next specified weekday
  • ROUND(date, format) – Rounds date to the nearest unit
  • TRUNC(date, format) – Truncates date to specified unit

4. Conversion Functions

  • TO_CHAR(date_or_number, format) – Converts to string
  • TO_DATE(char, format) – Converts to date
  • TO_NUMBER(char) – Converts to number

5. Aggregate Functions

  • AVG(column) – Average
  • COUNT(column) – Number of rows
  • SUM(column) – Sum
  • MAX(column) – Maximum
  • MIN(column) – Minimum
  • STDDEV(column) – Standard deviation
  • VARIANCE(column) – Variance

6. Conditional Functions

  • CASE WHEN condition THEN result ELSE result END – Conditional logic
  • DECODE(expr, search, result, default) – Compares values
  • NVL(expr1, expr2) – Replace NULL
  • NVL2(expr1, expr2, expr3) – Replace based on NULL check
  • NULLIF(expr1, expr2) – Returns NULL if equal

7. Miscellaneous Functions

  • USER – Returns the current user
  • UID – Returns user ID
  • SYS_CONTEXT(namespace, parameter) – Returns environment context
  • ROWNUM – Row number in result set
  • ROWID – Unique row identifier

This list covers most of the built-in functions you will encounter in Oracle SQL. Each function plays a specific role in manipulating or retrieving data effectively.

Tuesday, June 3, 2014

AWR- Oracle performance/wokload reporting tool - really helpful


We have surfaced one database contention problem in Oracle during performance run and  got to know that
oracle has in build feature to provide system workload report which they call as AWR ( Automatic work load) tool.
Interestingly it helped a lot to find the table and query which was giving problem during performance run  and help to solve the issue.

More read @ following links, it has been introduced in oracle 10 onwards :

http://www.oracle-base.com/articles/10g/automatic-workload-repository-10g.php

Cheers ,

Kapil 

Sunday, November 4, 2012

How to unlock oracle user once Locked .


Problem :

ERROR [WrapperSimpleAppMain] [DataSourceImpl] error connecting to DataSource having url jdbc:oracle:thin:@10.203.245.45:1521:XE: ORA-28000: the account is locked

java.sql.SQLException: ORA-28000: the account is locked.

Solution :

Following way we should unlock the account . 




Cheers

Kapil 



Popular Posts