Tuesday, January 02, 2018

Sunday, December 31, 2017

Reading List - 2018

I don't normally do New Year Resolutions, but during the Christmas break I was reading numerous articles on LinkedIn, I've always enjoyed Linkedin, with it's career connections and articles. However, I also realized how much wasted time I spent on Facebook and Twitter, so because it's that time of year, I am calling this my "New Year's Resolution": Spend more time bettering myself and my career

First up, purchase a kindle and I got a great deal. I wasn't looking for two kindles, but when I saw Amazon had a special deal, buy two kindles get $60 off, I couldn't pass the opportunity to gain some bonus points with my wife. Her kindle is a few years old and only 6gb, so I was able to get two Kindle Fire HD 8's for $99.

Create a list of books to read and afterwards write a review. I am sure this list will continue to grow, but for starters and in no particular order:

Hit Refresh, Microsoft CEO, Satya Nadella 

Business Adventures, John Brooks  

Mindset, Carol Dweck 

The Better Angels of Our Nature, Steven Pinker 

The Innovators, Walter Isaccson 

Hackers: Heroes of the Computer Revolution, Steven Levy 

The Four: The Hidden DNA of Amazon, Apple, Facebook, and Google, Scott Galloway

Not a book, but... Oracle E-Business Suite Architecture

Leave any book recommendations in the comments.


Wednesday, December 20, 2017

Determine what Linux Version

4 different commands that you can run to see information about your Linux distro.

[oracle@server ~]$ cat /etc/issue
Oracle Linux Server release 6.8



[oracle@server ~]$ cat /etc/*release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Oracle Linux Server release 6.8
NAME="Oracle Linux Server"
VERSION="6.8"
ID="ol"
VERSION_ID="6.8"
PRETTY_NAME="Oracle Linux Server 6.8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:6:8:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 6"
ORACLE_BUGZILLA_PRODUCT_VERSION=6.8
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=6.8
Red Hat Enterprise Linux Server release 6.8 (Santiago)
Oracle Linux Server release 6.8


Kernel Version commands
[oracle@server ~]$ uname -r
4.1.12-103.9.6.el6uek.x86_64

**Whether you are using 32 bit or 64 bit version... the x86_64 means a 64 bit kernel


[oracle@server ~]$ uname -a
Linux server 4.1.12-103.9.6.el6uek.x86_64 #2 SMP Wed Nov 15 18:03:27 PST 2017 x86_64 x86_64 x86_64 GNU/Linux

Create Data Guard standby using RMAN



Production server – serverProd
Standby server – serverStby
Production database – whseprod
Standby database - whsestby

Step 1: Using RMAN, Backup the database that includes backup of datafiles, archivelogs and controlfile for standby


[oracle@serverProd]$ rman target /
connected to target database: whseprod (DBID=123322)
RMAN> run {
allocate channel disk1 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
allocate channel disk2 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
allocate channel disk3 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
allocate channel disk4 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
allocate channel disk5 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
backup force  as BACKUPSET tag '%TAG' database;
backup as BACKUPSET tag '%TAG' archivelog;
release channel disk1;
release channel disk2;
release channel disk3;
release channel disk4;
release channel disk5;
}
RMAN> run {
allocate channel disk1 type disk format '/backup/whseprod_restore/%d%U' maxpiecesize 5 G;
backup force  as BACKUPSET tag '%TAG' current controlfile for standby;
release channel disk1;
}



Step 2: Move the backups to the standby server using ftp
               cd to directory that you want the files to go in on standby system
[oracle@serverStby ..]$ cd /backup/whseprod_restore
[oracle@serverStby /backup/whseprod_restore]$ ftp serverProd
ftp> bin
    ftp> prompt
change directory on the source system
                    ftp> cd /backup/whseprod_restore
                    ftp> mget *
                    ftp> quit


Step 3: Make proper changes in the parameter files of both primary and standby database

whseprod init file
DB_NAME=whseprod
DB_UNIQUE_NAME=whse
CONTROL_FILES='/whseredo/oradata/control01.ctl','/whseredo/oradata/control02.ctl','/whseredo/oradata/control03.ctl'

LOG_ARCHIVE_DEST_1='LOCATION=/whsearch/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES)'
alter system set FAL_CLIENT=whseprod scope=both;
alter system set FAL_SERVER=whsestby scope=both;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(whseprod, whsestby)' scope=both;
alter system set log_archive_dest_2 ='SERVICE=whsestby LGWR ASYNC=40960 DB_UNIQUE_name=whsestby OPTIONAL REOPEN=120 MAX_FAILURE=120 NET_TIMEOUT=900' scope=both;

alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE scope=both;
alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both;


 whsestby init file

DB_NAME=whse
DB_UNIQUE_NAME=whsestby
CONTROL_FILES='/whseredo/oradata/control01.ctl','/whseredo/oradata/control02.ctl','/whseredo/oradata/control03.ctl'

LOG_ARCHIVE_DEST_1='LOCATION=/whsearch/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES)'
alter system set FAL_CLIENT=whsestby scope=both;
alter system set FAL_SERVER=whseprod scope=both;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(whseprod, whsestby)' scope=both;
alter system set log_archive_dest_2 ='SERVICE=whseprod LGWR ASYNC=40960 DB_UNIQUE_name=whseprod OPTIONAL REOPEN=120 MAX_FAILURE=120 NET_TIMEOUT=900' scope=both;

alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE scope=both;
alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both;


Step 4: Do the restore and recover on standby database

           serverStby> rman target /
          RMAN> startup nomount
          RMAN> restore standby controlfile from '/backup/whseprod_restore/c-1778-20171202-02';
          serverStby>sqlplus as sysdba
          sql> alter database mount standby database;
          serverStby> rman target /
          RMAN> restore database

          Rman> list backup of archivelog all

***copied all of the archives that were created after the backup to the /whsearch/arch directory from the source

               cd to directory that you want the files to go in on standby system
[oracle@serverStby ..]$ cd /whsearch/arch
[oracle@serverStby /whsesarch/arch]$ ftp serverProd
ftp> bin
    ftp> prompt
change directory on the source system
                    ftp> cd /whsearch/arch
                    ftp> mget arch_111_2*
                    ftp> quit


          Rman> recover database


Step 5: Put the standby database in recover managed mode
        
        sql> alter database recover managed standby database disconnect from session;
Database altered.
Verify the Physical Standby Database Is Performing Properly
On the standby database, query the V$ARCHIVED_LOG view to identify existing files in
the archived redo log.
          sql> select sequence#, applied, to_char(first_time,'mm/dd/yy hh24:mi:ss') first from v$archived_log order by first_time;

Step 6: Add standby redo logs
          sql>alter database recover managed standby database cancel;
sql>alter database add standby logfile group 15 '/whseredo/oradata/whse_sr15.log' size 1048576000;
sql>alter database add standby logfile group 16 '/whseredo/oradata/whse_sr16.log' size 1048576000;
sql>alter database add standby logfile group 17 '/whseredo/oradata/whse_sr17.log' size 1048576000;
sql>alter database recover managed standby database disconnect from session;

Step 7: Add Data Guard Broker through OEM
                --make sure the standby’s are in oem
    --set preferred credentials by trying to log in through oem
      Click on primary database in OEM
      On Home Page ->availability->add standby database
      Choose third option Manage an Existing standby database with data guard broker and follow the on-screen instructions