Sunday, June 29, 2008

oracle listener

  • lsnrctl stop/start/status
  • to disable log, run 'lsnrctl', then 'set log_status off', then 'save_config'
  • by default, trc_level is off

how to start EM for the datbase that was created using dbca

Besides the default database sid orcl, if you created 'test' database using 'dbca', the first EM port will be 5500, then 5501,5502 etc, how to manually stop/start EM for this port 5500?

ORACLE_SID=test
emctl stop dbconsole
emctl start dbconsole

Oracle fast commit

Because redo log are written whenever a user commits an Oracle transaction, they can be used to speed up database operations. When a user commits a transaction, Oracle can do one of two things to get the changes into the database on the disk:

  • write all the database blocks the transaction changed to their respective datafiles
  • write only the redo information, which typically involves much less I/O than writing the database blocks . This recording of the changes can be replayed to reproduce all the transaction's changes later, if they are needed due to a failure.

When a user commits a transaction, Oracle guarantees that the redo for those changes writes to the redo logs on disk. The actual changed database blocks will be written out to the datafiles later.

Oracle System Change Number

A key factor in preserving database integrity is an awareness of which transaction came first.

oracle listener and dispatcher and shared servers

  • the client contacts the Listener over the network
  • the Listener detects and incoming request and , based on Oracle Net configuration, determines that it's for a multithreaded server. Instead of handing the client off to a dedicated server, the Listener hands the client off to a dispatcher for the network protocol the client is using.
  • The Listner introduces the client and the dispatcher by letting each know the other's network address.
  • Once the client and the dispatcher know where to find each other, they communicate directly. The Listener is no longer required. The client sends each work request directly to the dispatcher.
  • The dispatcher places the client's request in the request queue in the SGA
  • The next available shared server process reads the request from the request queue and does the work.
  • The shared server places the results for the client's request in the response queue for the dispatcher that originally submitted the request.
  • The dispatcher reads the results from its queue.
  • The dispatcher sends the results to the client.

Saturday, June 28, 2008

oracle data dictionary

database: v$database, v$instance, v$version
shared server: v$queue, v$dispatcher, v$shared_server
tablespaces: dba_tablespaces, dba_data_files, dba_free_space
control files: v$controlfile, v$parameter, v$controlfile_record_section
datafiles: v$datafile, v$datafile_header, v$filestat, dba_data_files
segment : dba_segments
extents: dba_extents
redo threads, groups and numbers: v$thread, v$log, v$logfile
archiving status: v$database, v$log, v$archived_log, v$archive_dest
database instance: v$instance, v$parameter, v$system_parameter
user passwords: v$pwfile_users
processes: v$process, v$bgprocess,v$session,v$lock
rman recovery: v$recover_file
work area memory: v$pgastat, v$sysstat,v$sesstat.

Wednesday, June 25, 2008

EXEC DBMS_UTILITY.compile_schema(schema => 'JEPHE');

EXEC DBMS_UTILITY.compile_schema(schema => 'JEPHE');

run above command a few times, if the following command gets the same value before and after
running above command, then can stop run compilation.


select count(*) from dba_objects where status = 'INVALID’