Wednesday, March 18, 2015

ASM Background Processes


ASM Background Processes 

Like normal database instances ASM instance too have the usual background processes like SMON, PMON, DBWr, CKPT and LGWr.
In addition to that the ASM instance also have the following background processes.

1.RBAL-
Opens all device files as part of discovery and coordinate the rebalance activity.

2.ARBx -
These are the slave processes that do the rebalance activity.

3.GMON-
 This process is responsible for managing the disk-level activities(drop/off-line) and advancing disk group compatibility.

4.MARK-
The Mark Allocation Unit (AU) for Re sync Coordinator (MARK)process coordinates the updates to the Staleness Registry when the disks go off-line.
This process runs in the RDBMS instance and is started only when disks go off-line in ASM redundancy disk groups.

5.Onnn-
One or more slave process forming a pool of connection to the ASM instance for exchanging message.

6.PZ9x-
These processes are parallel slave processes (where x is a number),used in fetching data on behalf of GV$ queries.

7.VKTM-
 This process is used to maintain the fast timer and has the same functionality in the RDBMS instances.

Note--
On Unix, the ASM processes can be listed using the following command:

ps –ef|grep asm



Thursday, March 12, 2015

Difference Between CHAR vs VARCHAR


CHAR

1.Used to store character string value of fixed length.

2.The maximum no. of characters the data type can hold is 255 characters.

3.It's 50% faster than VARCHAR.

4.Uses static memory allocation.

5.It will waste a lot of disk space.

6.The system does not have to search for the end of string.

7. Use Char when the data entries in a column are expected to be the same size.

EX. 
Declare test Char(100);
test='Test'-
Then "test" occupies 100 bytes first four bytes with values and rest with blank data.



VARCHAR

1.Used to store variable length alphanumeric data.

2.The maximum this data type can hold is up to 4000 characters.

3.It's slower than CHAR.

4.Uses dynamic memory allocation.

5.It will not occupy any space.

6.In VARCHAR the system has to first find the end of string and then go for searching.

7. VARCHAR when the data entries in a column are expected to vary considerably in size.

EX. 
Declare test VARCHAR100);
test='Test'-
Then "test" occupies only 4+2=6 bytes. First four bytes for value and other two bytes for variable length information.


Conclusion:

1.When using the fixed length data's in column like phone number, use CHAR.
2.When using the variable length data's in column like address , use VARCHAR.



Difference Between Views vs Materialized Views



Views vs Materialized Views



1.First difference between View & Materlized View is that , In Views query result is not stored in the disk or database But MV allow to store query result in disk or table.

2. In case of view we always get latest data but in case of MV we need to refresh the view for getting latest data.

3.Performance of view is less than MV.

4.One more difference , In case of view its only the logical view of table no separate copy of table but in case of MV we get separate copy of table.

5.In case of MV we need extra trigger or some automatic method so that we can keep MV refreshed ,This is not required for view in database.

6.A materialized view may be used by the optimizer as a way of pre-aggregating certain interesting data sets in order to more efficiently answer business questions. A view is just a stored query that is executed at runtime.

7.A view occupies no space. but materialized view occupies space. It exists in the same way as a table:
 it sits on a disk and could be indexed or partitioned.




 

Wednesday, March 11, 2015

MONITOR AN IMPORT DATAPUMP JOB

MONITOR AN IMPORT DATAPUMP JOB (IMPDP)

Many time I find myself having to do imports of data and during the import process customers are asking for status on the import.  To help alleviate these questions and concerns there are a few ways to provide a status on the import process.  I will outline them below:

Use the UNIX “ps –ef” command to track the import the command problem.  Good way to make sure that the process hasn’t error our and quite.

From the UNIX command prompt, use the “tail –f” option against the import log file.  This will give you updates as the log file records the import process.

Set the “status” parameter either on the command line or in the parameter file for the import job.  This will display the status of the job on your standard output.

Use the database view “dba_datapump_jobs” to monitor the job.  This view will tell you a few key items about the job.  The important column in the view is STATUS.  If this column says “executing” then the job is currently running.

Lastly, a good way to watch this process is from the “v$session_longops” view.  This view will give you a way to calculate percentage completed.

There are 5 distinct ways of monitoring a datapump import job.  These approaches can also be used with datapump export jobs.  Overall, monitoring a datapump job could help you in resolving customer questions about how long it will take.

Difference Between Grep & Find


Grep & Find

The main difference between the two is that grep is used to search for a particular string in a file
 whereas
find is used to locate files in a directory,
also you might want to check out the two commands by typing 'man find' and 'man grep'.

Grep command:-> is used for finding any string in the file.
Ex-> 1. grep <String> <filename>
2.grep 'abc xyz' jump.txt

The Above noticable point that it display the whole line,in which line abc xyz string is found.

Find command :-> used to find the file or directory in given path,
Ex-> 1. find <filename>
2. find jump*
display all file name starting with jump,
3. find jump*game.txt

The above noticable point that it display all file in current directory starting with jump and ending with game.

Cluster Background process:


Cluster Background process:

There are difference between Rac and Cluster Background process. Cluster background Discription are Below:

A.Cluster ready Service Daemon (CRSD)
B.Cluster Synchronization Service (CSS)
C.Event Management Daemon (EVMD)
D.Disk Monitor daemon (diskmon)
E.Oracle Notification Service (ONS)

A.Cluster ready Service Daemon (CRSD)

1.Oracle clusterware uses CRS for interaction between the OS and the Database.
2.This metadata is stored in the OCR.
3.It is managing high availability operations in a cluster.
4.The crsd process generates events when the status of a resource changes.

B.Cluster Synchronization Service (CSS)

1.Manages the cluster configuration by controlling which nodes are members of the cluster and by notifying members
 when a node joins or leaves the cluster.
2.Oracle Clusterware performs synchronization of group/locks for the node.
3.Prevents data corruption in event of a split brain.
4.Read voting disk to determine the number and names of members in the cluster.
5.CSS tries to establish connection to all nodes in the cluster using the private interconnect.
6.CSS verifies the number of nodes already registered as part of the cluster by performing an active count function.
7.If no MASTER node has been established CSS authorizes the first node that attains the ACTIVE state as MASTER.
8.Read voting disk to determine the number and names of members in the cluster.
9.Determines the location of the OCR from the ocr.loc file and reads the OCR file to determine the location of the voting  disk.
10.CSS performs state changes to bring the voting disk online.

C.Event Management Daemon (EVMD)

1.It is a background process that publishes Oracle Clusterware events.
2.It is propagates events through the Oracle Notification Service (ONS).
3.EVMD is the communication bridge between the Cluster-Ready Service Daemon (CRSD) and CSSD.[ All communications between the
CRS and CSS happen via the EVMD].

D.Disk Monitor daemon (diskmon)

1.Monitors and performs input/output fencing for Oracle Exadata Storage Server.
2.Exadata storage can be added to any Oracle RAC node at any point in time, the diskmon daemon is always started when ocssd is start.

E.Oracle Notification Service (ONS)

1. It keeps the high availability information.
2.Whenever state of cluster resource changes ONS process , each node will communicate with each other .
3.It is a publish-and-subscribe service for communicating Fast Application Notification (FAN) events.









Sunday, March 8, 2015

RAC Background Processes


RAC Background Processes

A.Lock Monitor Processes (LMON)
B.Lock Monitor Services (LMS)
C.Lock Monitor Daemon Process ( LMD)
D.LCKn ( Lock Process)
E.DIAG (Diagnostic Daemon)
F.ACMS:(Atomic Controlfile to Memory Service)--(from Oracle 11g)

A.Lock Monitor Processes (LMON)-

1.It is also called as  GES [Global Enqueue Service] monitor.
2.LMON Maintains GCS memory structures.
3.LMON handles the abnormal termination of processes and instances.
4.LMON deals with Reconfiguration of locks & resources when an instance joins or leaves the cluster (During reconfiguration LMON generate the trace files)
5.LMON Processes manages the global locks & resources.
6.LMON also provides cluster group services.
7.It checks for instance deaths and listens for local messaging.
8.Lock monitor co-ordinates with the Process Monitor (PMON) to recover dead processes that hold instance locks.

B.Lock Monitor Services (LMS)

1.It is also called the GCS (Global Cache Services) processes.
2.It consumes significant amount of CPU time.
3.It is the cache fusion part and the most active process.
4.Each node will have 2 or more LMS processes.
5.LMS also constantly checks with the LMD background process (or our GES process) to get the lock requests placed by the LMD process.
6.It is advised to Increase the parameter value, if global cache activity is very high.
7.It handles the consistent copies of blocks that are transferred between instances.

C. Lock Monitor Daemon Process ( LMDn)

1.It also monitors for lock conversion time outs.
2.LMD process performs lock and deadlock detection globally.
3.LMD process also handles deadlock detection and remote enqueue requests.
4.LMON-provided services are also known as cluster group services (CGS).

D.LCKn (Lock Process)

1.This process is called as instance enqueue process.
2.It manages instance resource requests & cross instance calls for shared resources.
3.During instance recovery, it builds a list of invalid lock elements and validates lock elements.
4.This process manages non-cache fusion resource requests such as library and row cache requests.

E.DIAG (Diagnostic Daemon)

1.A new background process introduced in Oracle 10g featuring new enhanced diagnosability framework.
2.Regularly monitors the health of the instance.
3.It is also checks instance hangs & deadlocks.
4.It captures the vital diagnostics data for instance & process failures.

F.ACMS:(Atomic Controlfile to Memory Service)--(from Oracle 11g)
1.ACMS stands for Atomic Control file Memory Service.
2.ACMS is a agent that help to ensure committed data written into the disk from SGA.
























How to create user in MY SQL

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