Thursday, February 26, 2015

Background processes in oracle

Database Writer (DBWn)
:It is responsible to redo log buffer management. Almost all activities against the database are tracked in the online redo logs. As transaction are initiated and
eventually committed or rolled back, a record of this activity is written to these
log files.

Checkpoint (CKPT):
A checkpoint is an event that flushes modified data from buffer cache to disk and updates control file and data files. The CKPT process updates header of data files and control files and
DBWn writes actual blocks to file. Checkpoint occurs automatically when an
online redo log file fills (log switch).

System Monitor (SMON):
At startup, SMON’s job is to ensure that all the database files are consistent and
perform recovery if required. There is also an assortment of other cleanup
activities that may need to be done, which are SMON’s responsibility. The
SMON process by itself checks every so often to see whether there are any tasks
waiting for its attention.

Process Monitor (PMON):
Cleans up failed user processes and frees all resources used by failed process.

Archiver (ARCn):
It automatically saves copies of redo logs in a DBA specified storage location
when media recovery is enabled.

Recover (RECO):
Is used with distributed transaction to resolve failure.

Saturday, February 21, 2015

Steps to Configure database in archive log mode in oracle


 SQL> select NAME,LOG_MODE from v$database;

  NAME      LOG_MODE
   ———       ————
    ORCL      NOARCHIVELOG

SQL> shutdown immediate;
 Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1375792 bytes
Variable Size             281018832 bytes
Database Buffers          247463936 bytes
Redo Buffers                5804032 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     15
Next log sequence to archive   17
Current log sequence           17
SQL> select name,log_mode from V$database;

NAME      LOG_MODE
--------- ------------
ORCL      ARCHIVELOG



database is configured in archive log mode.





 

Monday, February 2, 2015

What are the types of SQL statement in Oracle .



Data Definition Language: CREATE, ALTER, DROP, TRUNCATE, REVOKE, NO AUDIT & COMMIT.
Data Manipulation Language: INSERT, UPDATE, DELETE, LOCK TABLE, EXPLAIN PLAN & SELECT.
Transactional Control: COMMIT & ROLLBACK
Session Control: ALTERSESSION & SET ROLE
System Control: ALTER SYSTEM.

How to Increase Import Size Limit in phpMyAdmin



 modified the  php.ini.

upload_max_filesize = 2M  to
 
upload_max_filesize = 200M 

Wednesday, January 21, 2015

Which user executing what type of command in oracle

SELECT SID,SERIAL#,v.schemaname,
DECODE(COMMAND,0,'None',2,'Insert',3,'Select',6,'Update',7,'Delete',8,'Drop',26,'Lock Table'
,44,'Commit',45,'Rollback',47,'PL/SQL Execute','Other') command FROM V$SESSION v


       SID    SERIAL# SCHEMANAME                     COMMAND     
---------- ---------- ------------------------------ --------------
         1          1 SYS                            None          
         2          1 SYS                            None          
         3          1 SYS                            None          
         4          1 SYS                            None          
         5          7 SYS                            None          
         8          1 SYS                            None          
         9         10 SYS                            None          
        63          5 SYS                            None          
        64          1 SYS                            None          
        65          1 SYS                            None          
        66          1 SYS                            None          
        69         52 SYS                            None          
        70          3 SYS                            None          
        72        485 SYS                            None          
       125          1 SYS                            None          
       126          1 SYS                            None          
       127          1 SYS                            None          
       128          1 SYS                            None          
       129          3 SYS                            None          
       131        631 DRSTR                    Select        
       132        448 SYSTEM                  Select        
       187          1 SYS                            None          
       188          1 SYS                            None          
       189          1 SYS                            None          
       190          1 SYS                            None          
       192          4 SYS                            None          
       194          1 SYS                            None          
       195          1 SYS                            None          
       199         27 SYS                            None          

 29 rows selected

Tuesday, January 13, 2015

snapshot too old error: ORA:01555

You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message.

Friday, January 9, 2015

how to check listener status in oracle

Oracle LSNRCTL – Listener Shutdown and Startup Procedures

 

1) Oracle listener is not running  .

  

connect user prabhakarh
pass:

1) sudo bash
2) connect oracle user (su - oracle)

C:\>lsnrctl status

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   32-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   32-bit Windows Error: 61: Unknown error

 

 

2) Oracle listener is running

C:\>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 10-JAN-2015 12:17
:41
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date                10-JAN-2015 12:17:34
Uptime                    0 days 0 hr. 0 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   E:\app\honnikery\product\11.2.0\dbhome_1\network\admin
\listener.ora
Listener Log File         e:\app\honnikery\diag\tnslsnr\honnikery-PC\listener\al
ert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

3. Stop Oracle Listener

$ lsnrctl stop



Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
 
 

4. Restart Oracle Listener

lsnrctl reload

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1521)))
The command completed successfully
 
 
listener full help 
 
 
 
C:\>lsnrctl

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 10-JAN-2015 12:28
:24

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:

start               stop                status
services            version             reload
save_config         trace               change_password
quit                exit                set*
show*

LSNRCTL>


Oracle Listener Help

1. View Available Listener Commands

lsnrctl help command will display all available listener commands. In Oracle 11g following are the available listener commands.

start – Start the Oracle listener
stop – Stop the Oracle listener
status – Display the current status of the Oracle listener
services – Retrieve the listener services information
version – Display the oracle listener version information
reload – This will reload the oracle listener SID and parameter files. This is equivalent to lsnrctl stop and lsnrctl start.
save_config – This will save the current settings to the listener.ora file and also take a backup of the listener.ora file before overwriting it. If there are no changes, it will display the message “No changes to save for LISTENER”
trace – Enable the tracing at the listener level. The available options are ‘trace OFF’, ‘trace USER’, ‘trace ADMIN’ or ‘trace SUPPORT’
spawn – Spawns a new with the program with the spawn_alias mentioned in the listener.ora file
change_password – Set the new password to the oracle listener (or) change the existing listener password.
show – Display log files and other relevant listener information.