Friday, June 21, 2013

scheduling crontab jobs in Linux or Unix




1. Scheduling a Job For a Specific Time
The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.

Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.
30 08 10 06 * /home/ramesh/full-backup
  • 30 – 30th Minute
  • 08 – 08 AM
  • 10 – 10th Day
  • 06 – 6th Month (June)
  • * – Every day of the week
2. Schedule a Job For More Than One Instance (e.g. Twice a Day)
The following script take a incremental backup twice a day every day.

This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time.
00 11,16 * * * /home/ramesh/bin/incremental-backup
  • 00 – 0th Minute (Top of the hour)
  • 11,16 – 11 AM and 4 PM
  • * – Every day
  • * – Every month
  • * – Every day of the week
3. Schedule a Job for Specific Range of Time (e.g. Only on Weekdays)
If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.
Cron Job everyday during working hours
This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.m
00 09-18 * * * /home/ramesh/bin/check-db-status
  • 00 – 0th Minute (Top of the hour)
  • 09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
  • * – Every day
  • * – Every month
  • * – Every day of the week
Cron Job every weekday during working hours
This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m – 6 p.m.
00 09-18 * * 1-5 /home/ramesh/bin/check-db-status
  • 00 – 0th Minute (Top of the hour)
  • 09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
  • * – Every day
  • * – Every month
  • 1-5 -Mon, Tue, Wed, Thu and Fri (Every Weekday)

some basic sql's for beginners in Oracle database



Oracle Database Commands and Queries:

1.To view all the table from dictionary :
SQL> select table_name from dictionary;

2.To identify the database name :
SQL> select name from v$database;

3.To identify the instance name :
SQL> select instance from v$thread;

4.To know the size of the database blocks
SQL> select value from v$parameter where name =’db_block_size’;

5.List the name of the data files :
SQL> select name from v$datafile;

6.Identify the datafile that makes up the system tablespace :
SQL> select file_name from dba_data_files where tablespace_name = ‘SYSTEM’;

7.To check how much free space is available in database and how much is used:
SQL>select sum(bytes)/1024 “free space in KB” from dba_free_space;
SQL>select sum(bytes)/1024 “used space in KB” from dba_segments”;

8.List the name and creation date of database users :
SQL>select username, created from dba_users;

9.Where is the existing Control file located and what is the name?
SQL> select * from v$controlfile;
(or)
SQL> show parameter control;
(or)
SQL> select name from v$controlfile;

10.What is the initial sizing of the datafile section in your control file?
SQL>select records_total from v$controlfile_record_sectionwhere type = “DATAFILE”;

11.List the number and location of existing log files?
SQL> select member from v$logfile;

12.Display the number of redo log file groups and members your database has ?
SQL>select group#, members, status from v$log;

13.In which database mode is your database configured?
SQL> select log_mode from v$database;

14.Is archiving enabled?
SQL>select archiver from v$instance;

15.To view all the tablespaces name?
SQL>select tablespace_name from dba_tablespaces;

16.Identify the different types of segments in the database.
SQL>select DISTINCT segment_type from dba_segments;

script to drop all objects in your schema


This script can be used to drop all the objects in your schema,very useful when you want a fresh schema and start from scratch.no need to delete objects individually or recreate user.

-----------------------------------------------------------------------------
-----    plsql script to drop all the objects in your
-----      current schema
--------------------------------------------------------------
declare
v_str1 varchar2(200) := null;
cursor get_sql is
select
'drop '||object_type||' '|| object_name|| DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS PURGE') v_str1
from user_objects
where object_type in ('TABLE','VIEW','PACKAGE','TYPE','PROCEDURE','FUNCTION','TRIGGER','SEQUENCE','SYNONYM')
order by object_type,object_name;
begin
open get_sql;
loop
fetch get_sql into v_str1;
if get_sql%notfound
then exit;
end if;
execute immediate v_str1;
end loop;
close get_sql;
end;
/

Some very usefull sql's for Datagaurd

Backup - DataGuard

Startup commands
To remove a delay from a standby
Cancel managed recovery
Register a missing log file
If FAL doesn't work and it says the log is already registered
Check which logs are missing
Disable/Enable archive log destinations
Turn on fal tracing on the primary db
Stop the Data Guard broker
Show the current instance role
Logical standby apply stop/start
See how up to date a physical standby is
Display info about all log destinations
Display log destinations options
List any standby redo logs


Startup commands

 startup nomount
alter database mount standby database;
alter database recover managed standby database disconnect;


To remove a delay from a standby

 alter database recover managed standby database cancel;
alter database recover managed standby database nodelay disconnect;

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
  DISCONNECT FROM SESSION;

Cancel managed recovery

 alter database recover managed standby database cancel;

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...
shutdown immediate
startup nomount
alter database mount standby database;
alter database recover automatic standby database;

wait for the recovery to finish - then cancel
shutdown immediate
startup nomount
alter database mount standby database;
alter database recover managed standby database disconnect;



TO Check which archive logs are missing

Run this on the standby...

select local.thread#
,      local.sequence# from
       (select thread#
       ,       sequence#
       from    v$archived_log
       where dest_id=1) local
where  local.sequence# not in
       (select sequence#
       from v$archived_log
       where dest_id=2 and
       thread# = local.thread#)
/


To Disable/Enable archive log destinations 

 alter system set log_archive_dest_state_2 = 'defer';
defer =stop shipping the archive logs to target

alter system set log_archive_dest_state_2 = 'enable';
defer =start shipping the archive logs to target

Turn on fal tracing on the primary db

 alter system set LOG_ARCHIVE_TRACE = 128;

Stopping the Data Guard broker

 alter system set dg_broker_start=false
/

Check the current instance role in primary or standby

 select    database_role
from    v$database
/


Logical standby apply stop/start (if you are standby DB is a logical standby)

Stop...
alter database stop logical standby apply;

Start...
alter database start logical standby apply;



Check how upto date sync is in physical standby

Run this on the primary to check max applied sequence

set numwidth 15
select    max(sequence#) current_seq
from    v$log
/


Then run this on the standby to check max applied sequence

set numwidth 15
select    max(applied_seq#) last_seq
from    v$archive_dest_status
/


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

select    ds.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#
from    v$archive_dest_status    ds
,    v$archive_dest        ad
where    ds.dest_id = ad.dest_id
and    ad.status != 'INACTIVE'
order by
    ds.dest_id
/


Display log destinations options


To be run on the primary
set numwidth 8 lines 100
column id format 99
select    dest_id id
,    archiver
,    transmit_mode
,    affirm
,    async_blocks async
,    net_timeout net_time
,    delay_mins delay
,    reopen_secs reopen
,    register,binding
from    v$archive_dest
order by
    dest_id
/


List any standby redo logs

 set lines 100 pages 999
col member format a70
select    st.group#
,    st.sequence#
,    ceil(st.bytes / 1048576) mb
,    lf.member
from    v$standby_log    st
,    v$logfile    lf
where    st.group# = lf.group#
/

Wednesday, June 19, 2013

disable password verify function in oracle

Password verify function can be disabled by setting it to null.


To make the password more complex most DBA's set the complexity to  oracle provided package.As default password complexity provided in oracle script doesn't satisfy your organizations requirements.

SOLUTION:


alter profile default limit password_verify_function null;
To Enable it back :

Failed to shutdown DBConsole Gracefully

Environment:
Oracle:
Oracle 10g Release 2  10.2.0.5
OS:
Linux
Summary:
Fix Oracle EM problem:Failed to shutdown DBConsole Gracefully
Today on a Linux Oracle machine without Oracle Enterprise Manger, I would like to install Oracle EM.
Use command
emca -config dbcontrol db -repos create
It reports an error
- An instance of Oracle Enterprise Manager 10g Database Control is already running.
It is strange that I have never create or start an EM process.
So I try to stop the existing EM process
SQL> emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://oracletest:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control …
— Failed to shutdown DBConsole Gracefully —
failed.
It fails, and also fails when I want to start EM
SQL> emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://oracletest:1158/em/console/aboutApplication
– An instance of Oracle Enterprise Manager 10g Database Control is already running.
A metalink doc tells us, it may happens when /etc/hosts file does not have following rows
127.0.0.1    localhost.localdomain  localhost
The  metalink doc also tells us to check file emctl.pid
Under $ORACLE_HOME/$HOST_$ORACLE_SID, for example in my host under /oracle/app/oracle/product/10.2.0/oracletest_mes
/oracle/app/oracle/product/10.2.0/oracletest_mes> cat emctl.pid
36599
Use ps –ef to check 36599 process, it is really not a oracle EM dbconsole process,so that’s why emctl stop dbconsole can not stop its instance.
Delete emctl.pid, emctl stop dbconsole succeed.
But when recreate dbconsole, it fails again and show error that the port 3938 has been used.
Check $ORACLE_HOME/install/portlist.ini
Enterprise Manager Console HTTP Port (mes) = 1158
Enterprise Manager Agent Port (mes) = 3938
It tells us EM agent use 3938 port, that means EM has 2 processes, one is for dbconsole, and one is for emagent. So you know how to do next, kill emagent process and recreate dbconsole. And this time, everything is OK.

Drop the EMCA repository,sysman schema and objects

[oracle@linux200 bin]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jun 19, 2013 4:11:49 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: ORCL
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 19, 2013 4:12:28 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2013-06-19_04-11-48-PM.log.
Jun 19, 2013 4:12:29 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Jun 19, 2013 4:12:29 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...

ethod 2: Drop the repository schema and object (no quiesce):

Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects:

SQL> DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN';
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/
SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;


Wednesday, May 15, 2013

CREATE STANDBY DATABASE USING RMAN





[oracle@linux1 database]$ sqlplus /"As sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Sat Mar 2 19:10:41 2013
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE
--------- ------------------------------ ---------------- ----------
ORCL      orcl                           PRIMARY          READ WRITE

SQL> select log_mode,force_logging from v$database;
LOG_MODE     FOR
NOARCHIVELOG NO

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           3

SQL> show parameter db_recovery_file_dest;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery _area
db_recovery_file_dest_size           big integer 2G
change archivelog_dest:-
SQL> !mkdir -p /u01/app/oracle/oradata/chicago/arch

SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/chicago/arch' scope=both;
System altered.
enable archivelog with new destination:

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/oradata/chicago/arch
Oldest online log sequence     1
Current log sequence           3

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

SQL> startup mount;
ORACLE instance started.
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> alter database force logging;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/chicago/arch
Oldest online log sequence     1
Next log sequence to archive   3
Current log sequence           3

SQL> alter system switch logfile;
System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/chicago/arch
Oldest online log sequence     2
Next log sequence to archive   4
Current log sequence           4
SQL> !ls -al /u01/app/oracle/oradata/chicago/arch
total 23704
drwxr-xr-x 2 oracle oinstall     4096 Mar  2 19:32 .
drwxr-xr-x 3 oracle oinstall     4096 Mar  2 19:22 ..
-rw-r----- 1 oracle oinstall 24233984 Mar  2 19:32 1_3_809031038.dbf

SQL> select force_logging from v$database;
FOR
---
YES
SQL> select max(bytes),count(1) from v$log;

MAX(BYTES)   COUNT(1)
---------- ----------
  52428800          3

adding standby logfiles at same location as of archivelog:
SQL> alter database add standby logfile '/u01/app/oracle/oradata/chicago/sbylog01.log' size 52M;
Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/chicago/sbylog02.log' size 52M;
Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/chicago/sbylog03.log' size 52M;
Database altered.

SQL> select group#,type,member from v$logfile where type='STANDBY';

    GROUP# TYPE
---------- -------
MEMBER
--------------------------------------------------------------------------------
         4 STANDBY
/u01/app/oracle/oradata/chicago/sbylog01.log

         5 STANDBY
/u01/app/oracle/oradata/chicago/sbylog02.log

         6 STANDBY
/u01/app/oracle/oradata/chicago/sbylog03.log

To check the status of standby logfiles created
SQL> select group#,dbid,thread#,sequence#,status from v$standby_log;

    GROUP# DBID                                        THREAD#  SEQUENCE#
---------- ---------------------------------------- ---------- ----------
STATUS
----------
         4 UNASSIGNED                                        0          0
UNASSIGNED

         5 UNASSIGNED                                        0          0
UNASSIGNED

         6 UNASSIGNED                                        0          0
UNASSIGNED

setting DG_CONFIG:
SQL> show parameter log_archive_config
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_config                   string
SQL> alter system set log_archive_config='DG_CONFIG=(chicago,boston)' scope=spfile;
System altered.

setting log archive dest for primary database for all logfiles and all roles:

SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/chicago/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=chicago' scope=spfile;
System altered.

setting log archive transport from primary destination to standby database visa service name called boston :

SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=boston LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=boston' scope=spfile;
System altered.
enable the archive dests
SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE scope=spfile;
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=spfile;
System altered.

setting db_convert  to change the location stdby when a datafile is added on primary location use this if you are using different path from primary:

SQL> alter system set DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orclstdby/' scope=spfile;

addding below will add redologfiles on standby with changed location:

SQL> alter system set LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orclstdby/' scope=spfile;
System altered.

making the file management auto this will add datafiles added on primary to standby:

SQL> alter system set STANDBY_FILE_MANAGEMENT=auto scope=spfile;
System altered.
SQL> alter system set FAL_SERVER=boston scope=spfile;
System altered.
SQL> alter system set FAL_CLIENT=chicago scope=spfile;
System altered.
restart the db to take these parameters effect:

add listener config on standby as primary already has its settings:
[oracle@linux2 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = linux2)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SID_LIST_LISTENER =
(SID_LIST =
 (SID_DESC =
  (GLOBAL_DBNAME = boston)
   (ORACLE_HOME = /u01/app/oracle/11.1.0/db_1)
   (SID_NAME = boston)
  )
 )
tnsnames.ora on both should have values like:
# tnsnames.ora Network Configuration File: /u01/app/oracle/11.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
BOSTON =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = boston)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.119)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
create a initboston.ora file with db_name=primarydb (orcl)

create directory structure on standby, same as primary:
[oracle@linux2 oracle]$ mkdir -p /u01/app/oracle/admin/boston/adump
[oracle@linux2 oracle]$ mkdir -p /u01/app/oracle/oradata/boston
[oracle@linux2 oracle]$ mkdir -p /u01/app/oracle/oradata/boston/arch
[oracle@linux2 oracle]$ mkdir -p /u01/app/oracle/flash_recovery_area/boston

check the database connectivity between both the databases through the sqlplus:
SQL> conn sys/oracle@chicago as sysdba
SQL> conn sys/oracle@boston as sysdba

[oracle@linux2 ~]$ rman target sys/oracle@chicago auxiliary sys/oracle@boston
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Mar 3 10:57:18 2013
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database: ORCL (DBID=1336811768)
connected to auxiliary database (not started)

RMAN> run {
 allocate channel p1 type disk;
 allocate channel p2 type disk;
 allocate auxiliary channel s1 type disk;
 duplicate target database for standby from active database
 spfile
 parameter_value_convert'chicago','boston'
set db_unique_name='boston'
 set db_file_name_convert='/orcl/','/boston/'
 set log_file_name_convert='/orcl/','/boston/'
 set control_files='/u01/app/oracle/oradata/boston/control01.ctl','/u01/app/oracle/oradata/boston/control02.ctl'
 set log_archive_max_processes='5'
 set fal_client='boston'
 set fal_server='chicago'
 set standby_file_management='AUTO'
 set log_archive_config='dg_config=(chicago,boston)'
 set log_archive_dest_1='service=chicago ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=chicago'
 ;
 }



created physical db

SQL> select name,db_unique_name,open_mode,database_role from v$database;

NAME      DB_UNIQUE_NAME                 OPEN_MODE  DATABASE_ROLE
--------- ------------------------------ ---------- ----------------
ORCL      boston                         MOUNTED    PHYSICAL STANDBY

SQL> select log_mode from v$database;

LOG_MODE
------------
ARCHIVELOG

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     6
Next log sequence to archive   0
Current log sequence           8

SQL> !ps -ef|grep mrp
oracle    3973  3965  0 12:05 pts/1    00:00:00 /bin/bash -c ps -ef|grep mrp

[oracle@linux2 trace]$ pwd
/u01/app/oracle/diag/rdbms/boston/boston/t
[oracle@linux2 trace]$ vi alert_boston.log
[oracle@linux2 trace]$ tail -f alert_boston.log

start applying the archive logs :
sql>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

open database in read only mode
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL> alter database open read only;

start applying the logs again back to database (if you forget to add disconnect from session the mrp process with stop applying after you close session )
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;