Wednesday, November 18, 2015

Dynamic Performance Examples

Dynamic Performance

V$CONTROLFILE
V$DATABASE
V$DATAFILE
V$INSTANCE
V$PARAMETER
V$SESSION
V$SGA
$SPPARAMETER
V$TABLESPACE
V$THREAD
V$VERSION

Examples
V$CONTROLFILE: Lists the names of the control files
V$DATABASE: Contains database information from the control file.
• V$DATAFILE: Contains data file information from the control file
• V$INSTANCE: Displays the state of the current instance
V$PARAMETER: Lists parameters and values currently in effect for the session
V$SESSION: Lists session information for each current session
V$SGA: Contains summary information on the system global area (SGA)
V$SPPARAMETER: Lists the contents of the SPFILE
• V$TABLESPACE: Displays tablespace information from the control file
V$THREAD: Contains thread information from the control file.
V$VERSION: Version numbers of core library components in the Oracle server


More detail of examples:

1.The V$FIXED_TABLE view can also be queried to get a listing of the dynamic performance views:

SQL> SELECT * FROM V$FIXED_TABLE;

2.To get an overview of the data dictionary views, the DICTIONARY view or its synonym
DICT can be queried.

SQL> SELECT * FROM dictionary;
Include the WHERE clause to narrow your responses:

SQL> SELECT * FROM dictionary
2 WHERE table_name LIKE DBA_SEG%

3.To view the contents of the view, use the SELECT command.
SQL> SELECT * from V$INSTANCE;

4.To get a list of columns within a view, use the DESCRIBE keyword:
SQL> DESCRIBE V$INSTANCE; 




Data Dictionary Views in Oracle

Data Dictionary Views in Oracle

Oracle data dictionary views will start with any one of 3 character strings i.e. starts with DBA_ or ALL_ or USER_

 DBA: What is in all the schemas
ALL: What the user can access
USER: What is in the user’s schema


DBA_ views --> All information and objects in the Oracle data dictionary. These will be accessible by users having DBA privileges.

ALL_ views --> All information and objects accessible by a user.

USER_ views --> All information and objects owned by a user.




How to create user in MY SQL

Create  a new MySQL user Account mysql > CREATE USER ' newuser '@'localhost' IDENTIFIED BY ' password '...