Skip to main content

Posts

Showing posts from July, 2016

How to shutdown and startup Oracle physical standby database and enable recovery.

How to shutdown and startup Oracle physical standby database and enable recovery. You can do it with automatic or disconnecting you from the session. 1) Without disconnecting from the session. sqlplus "/ as sysdba" shutdown immediate startup nomount ALTER DATABASE MOUNT STANDBY DATABASE; ALTER DATABASE RECOVER AUTOMATIC STANDBY DATABASE; 2) Disconnecting from the session.   sqlplus "/ as sysdba" shutdown immediate startup nomount ALTER DATABASE MOUNT STANDBY DATABASE; alter database recover managed standby database disconnect from session;

How to create a broker configuration in Oracle database 11g.

How to create a broker configuration in Oracle database 11g. 1- Create Data Guard broker configuration (Connect in primary database server) bash-4.1$ dgmgrl sys/******* DGMGRL for Solaris: Version 11.2.0.2.0 - 64bit Production Copyright (c) 2000, 2009, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected. DGMGRL> 2- Check if configuration exists (So, we'll need to create the configuration with broker between Primary and stand by server) : DGMGRL> show configuration; ORA-16532: Data Guard broker configuration does not exist Configuration details cannot be determined by DGMGRL DGMGRL> 3- Create configuration : 3.1 DGMGRL> CREATE CONFIGURATION 'tst_pr' AS PRIMARY DATABASE IS 'tst_pri' CONNECT IDENTIFIER IS 'tst_pri';     Configuration "tst" created with primary database "tst_pri"     DGMGRL> 3.2 DGMGRL> enable configuration;     Enabled.     DG

How to check the log GAP amount for a Oracle physical stand by database

How to check the log GAP ammount for an Oracle physical stand by database : column applied_time for a40 set linesize 200 SELECT DB_NAME,  APPLIED_TIME, LOG_ARCHIVED-LOG_APPLIED AMMOUNT_LOG_GAP, (case when ((APPLIED_TIME is not null and (LOG_ARCHIVED-LOG_APPLIED) is null) or (APPLIED_TIME is null and (LOG_ARCHIVED-LOG_APPLIED) is not null) or ((LOG_ARCHIVED-LOG_APPLIED) > 0)) then 'Error!! We have Gap on the database!!' else 'OK!' end) Status FROM ( SELECT INSTANCE_NAME DB_NAME FROM GV$INSTANCE where INST_ID = 1 ), ( SELECT MAX(SEQUENCE#) LOG_ARCHIVED FROM V$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES' and THREAD#=1 ), ( SELECT MAX(SEQUENCE#) LOG_APPLIED FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED='YES' and THREAD#=1 ), ( SELECT TO_CHAR(MAX(COMPLETION_TIME),'DD-MON-YYYY:HH24:MI') APPLIED_TIME FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED='YES' and THREAD#=1 ) UNION SELECT DB_NAME,  APPLIED_TIM

BTRFS File System on Red Hat

BTRF FILE SYSTEM ON RED HAT 1.-CREATING A BTRF FILE SYSTEM M mkfs.btrfs / dev / device   # mkfs.btrfs / dev / sdc1     2.-MOUNTING A BTRF FILE SYSTEM   mount / dev / device / mount-point   # mount / dev / sdc1 / btrfstest   3.-RESIZING A BTRF FILE SYSTEM    You can increase the btrs file system in this case +200M   btrfs filesystem resize amount / mount-point   #btrfs filesystem resize +500M /btrfstst   Resize '/btrfstest' of '+500M'    4.-SHRINKING A BTRFS FILE SYSTEM btrfs filesystem show / mount-point + devid 1 size 1.00GiB used 224.75MiB path /dev/vda devid 2 size 400.00MiB used 204.75MiB path /dev/vdb devid 3 size 2.00GiB used 8.00MiB path /dev/vdc devid 4 size 3.00GiB used 8.00MiB path /dev/vdd btrfs filesystem resize devid : amount /mount-point   # btrfs filesystem resize 2:300M /btrfstest  Resize '/btrfstest' of '2:300M'  You has reduced the file system to 300M, you wi