Oracle Cheat Sheet



  1. Oracle Cheat Sheet
  2. Oracle Cheat Sheet Pentestmonkey
  • Categories: cheat-sheet, cli, database; #oracle, #sql, #sqlplus; 5 minutes read; In this post, I’m going to aggregate all those Oracle commands that I can never remember but are very useful to have somewhere written down. Table of Contents.
  • Basics sqlplus /nolog # from CL connect / as sysdba # connect startup # start Oracle server shutdown (immediate, abort) # shutdown Oracle server Related Unix commands tnsping dbname.
Oracle

Oracle Cheat Sheet

Oracle apex interactive grid cheat sheet

Oracle Cheat Sheet html (vttoth.com) Oracle SQL quick reference by EM Group pdf (tiger.la.asu.edu) Oracle Server Architecture by Dr. Lars Ditzel pdf (digilife.be) ORACLE Server 8i Quick Reference Card by Dr. Lars Ditzel pdf (digilife.be) Oracle Server 9i - Quick Reference Guide pdf (digilife.be). In this article we will provide Brief definition of Oracle with couple of cheat sheet from web. Brief definition of Oracle: Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is a proprietary multi-model database management system produced and marketed by Oracle Corporation. 1Oracle® Database SQL Language Quick Reference 11g Release 2 (11.2) E41085-04 January 2016.

Benign paroxysmal positional vertigo (BPPV) is an inner ear disorder in which changes in the position of the head, such as tipping the head backward, lead to sudden vertigo – a feeling that the room is spinning. The vertigo sensation can range from mild to severe and usually lasts only a few minutes. Vertigo. Drugs used to treat Vertigo The following list of medications are in some way related to, or used in the treatment of this condition. Select drug class All drug classes antihistamines (5) phenothiazine antiemetics (5) anticholinergic antiemetics (5). Peripheral vertigo is caused by a problem in the inner ear. Central vertigo is caused by a medical condition affecting the area of the brain that controls balance and spatial awareness. While a cause of vertigo can sometimes be identified, doctors cannot always determine exactly why it occurs. Peripheral Vertigo. A vertigo attack can last from a few seconds to hours. If you have severe vertigo, it can last for many days or months. Help with vertigo. There are things you can do to ease vertigo symptoms when they're happening, and to reduce the number of episodes you have. Vertigo is a 1958 American film noir psychological thriller film directed and produced by Alfred Hitchcock.The story was based on the 1954 novel D'entre les morts (From Among the Dead) by Boileau-Narcejac.The screenplay was written by Alec Coppel and Samuel A. The film stars James Stewart as former police detective John 'Scottie' Ferguson. Scottie is forced into early retirement.

Oracle Cheat Sheet Pentestmonkey

Data Guard Cheatsheet

Startup and Open Standby Database

Startup commands

startup nomount
alter database mount standby database;
alter database recover managed standby database disconnect;
select severity, error_code,message,to_char(timestamp,'DD-MON-YYYY HH24:MI:SS') from v$dataguard_status;

Open standby read only

alter database recover managed standby database cancel;
select OPEN_MODE from v$database;
Back to redo apply (it only works when users are disconnect from the database)
alter database recover managed standby database disconnect from session;

Errors when users are connecting:

SQL> alter database recover managed standby database disconnect from session;

alter database recover managed standby database disconnect from session

*

ERROR at line 1:

ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

Check Primary and Standby Status

Check role and status (both primary and standby)

select NAME, DB_UNIQUE_NAME, OPEN_MODE, DATABASE_ROLE from v$database;
select NAME, OPEN_MODE, DATABASE_ROLE from v$database; --9i db

Check protection mode on primary database

select protection_mode, protection_level from v$database;
-------------------- --------------------

Check processes and statuses

SELECT PROCESS, STATUS,SEQUENCE#,BLOCK#,BLOCKS, DELAY_MINS FROM V$MANAGED_STANDBY;

Log Apply

Start log apply in standby

alter database recover managed standby database disconnect from session;

Remove a delay from a standby

alter database recover managed standby database cancel;

alter database recover managed standby database nodelay disconnect;

Cancel managed recovery/stop log apply

alter database recover managed standby database cancel;

Disable/Enable archive log destinations

alter system set log_archive_dest_state_2 = 'defer';
alter system set log_archive_dest_state_2 = 'enable';

Logical standby apply stop/start



Logs

Check which logs are missing and log apply gap

alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
select sequence#, archived, applied, first_time, next_time from v$archived_log order by sequence#;
Run this on both primary and standby
select * from v$archive_gap;

, local.sequence# from
, sequence#
where dest_id=1) local
(select sequence#
where dest_id=2 and
/

See how up to date a physical standby is

selectmax(sequence#) current_seq fromv$log;


selectmax(applied_seq#) last_seq fromv$archive_dest_status;

Switch logs

alter system archive log current;

Register a missing log file

alter database register physical logfile '<fullpath/filename>';

If FAL doesn't work and it says the log is already registered

alter database register or replace physical logfile '<fullpath/filename>';
If that doesn't work, try this..
startup nomount
alter database recover automatic standby database;
wait for the recovery to finish - then cancel
startup nomount
alter database recover managed standby database disconnect;

Display info about all log destinations

To be run on the primary
set lines 100
set numwidth 15
column ID format 99
column 'SRLs' format 99
column active format 99
col type format a4
selectds.dest_id id
,ad.status
,ds.database_mode db_mode
,ad.archiver type
,ds.recovery_mode
,ds.protection_mode
,ds.standby_logfile_count 'SRLs'
,ds.standby_logfile_active active
,ds.archived_seq#
fromv$archive_dest_statusds
,v$archive_destad
whereds.dest_id = ad.dest_id
andad.status != 'INACTIVE'
order by
ds.dest_id
/

Display log destinations options



column id format 99
,archiver
,affirm
,net_timeout net_time
,reopen_secs reopen
fromv$archive_dest
dest_id

col member format a70
,st.sequence#
,lf.member
,v$logfilelf


Misc

Turn on fal tracing on the primary db


Stop the Data Guard broker