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

Commonly use oracle queries and commands

To View all databases 

SQL> SELECT NAME FROM v$database

Shutdown database
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Start the instance
SQL> startup;
ORACLE instance started.

Total System Global Area 4966053832 bytes
Fixed Size                  8906696 bytes
Variable Size             922746880 bytes
Database Buffers         4026531840 bytes
Redo Buffers                7868416 bytes
Database mounted
Open the database
SQL> alter database open;
SQL> select instance_name, status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
orcl MOUNTED

SQL> alter database open;
Database altered.

SQL> select instance_name, status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
orcl            OPEN


Running Total In SQL Server

Running total refers to the sum of values in all cells of a column that precedes the next cell in that particular column. Using Window Funct...