1. emcli, python, jython, and module not found (ImportError No Module Named n)

    I've been diving into more OEM Automation and collecting information here.

    While the Oracle example scripts are a great way to find out how to interact with OEM via the emcli and python/jython interface, there doesn't seem to be much info about how this all gets done. You feed a Python script to emcli and magic happens right?

    Adeesh Fulay has a great intro article here.

  2. Need to audit changes? Can't change source database at all? This may work...

    If you want to record copies of changed records on a target system you can do this with Golden Gate Software and not incur much in the way of source side resource drain.
  3. Automatically installing Oracle 18c with your Vagrant/VirtualBox deployment

    After Vagrant, VirtualBox, and the plugin that allows them to interact are installed, we will invoke Vagrant commands to get this work done. Vagrant can also do things like mount drives and kick of shell scripts, that's where the heavy lifting will be done to kick off the installed with a silent response file. The code we will be using is contained in a project on GitHub. Check out the Readme at https://github.com/dmann99 This is based on code by totalamateurhour.
  4. More disk space...

    Method 1 : Add a u01 on /dev/sdb

    If you need more disk space it looks like the EL Linux VMs were supplied with an extra unmounted disk. It is available at /dev/sdb but not partitioned.
  5. Automatically installing Oracle 12cR2 with your Vagrant/VirtualBox deployment

    This procedure will spin up a new fresh VM Spinning up a local 12cR2 Instance with Vagrant and Virtualbox. After Vagrant, VirtualBox, and the plugin that allows them to interact are installed, we will invoke Vagrant commands to get this work done. Vagrant can also do things like mount drives and kick of shell scripts, that's where the heavy lifting will be done to kick off the installed with a silent response file. The code we will be using is contained in a project on GitHub.
  6. Basic Install and test of Vagrant and Virtualbox

    1) Install Vagrant.

    Download software at https://www.vagrantup.com/ . Accept all defaults during the install.

    2) Install VirtualBox.

    Software is available at https://www.virtualbox.org/ . Accept all defaults during the install.

    3) Install Plugin for Vagrant/Virtualbox interaction.

  7. Installing Golden Gate Core Binaries

    Ensure access to the oracle OS user

    vagrant ssh
    
    sudo passwd oracle
    password
    password
    
    su oracle
    

    Prepare Install Binaries

    Download 122022_fbo_ggs_Linux_x64_shiphome.zip from Oracle and copy to the C:\work\[machine name]\oracle-12.2-vagrant\12.2.0.1 directory.
  8. Accessing your environment : SQLNet/OCI

    If your environment was set up with Host networking as described in these pages then the host and guest VMs all have IP addresses in the 192.168.88.* subnet.

    Your host machine (Windows or OSX) is accessible at 192.168.88.1.

    Your VMs are assigned 192.168.88.10, 192.168.88.11, etc.

  9. Accessing your environment : SSH

    • Change to the directory where you ran "vagrant up"
    • Type "vagrant ssh"

    If you want to run a SSH client like putty.exe from your host you can enter the IP address of your VM. In this environment this would be 192.168.88.10, 192.168.88.11, etc.

    Refer to this page for a more in-depth description of the networking environment.

  10. Accessing your environment : X Windows

    If your environment was set up with Host networking as described in these pages then the IP addresses are all in the 192.168.88.* subnet.

    Your host machine (Windows or OSX) is 192.168.88.1.

    Your VMs are assigned 192.168.88.10, 192.168.88.11, etc.

  11. Managing Multiple Environments

    Now that you have your first local Vagrant/VirtualBox deployment under your belt you may find it useful enough to desire multiple distinct environments. Or maybe you are experimenting with an environment (DataGuard, GoldenGate) that requires multiple VMs.

    Using advanced Vagrantfile features you can spin up multiple VMs with one "vagrant up" deployment command. I'll cover these in later blog posts.

    By updating individual Vagrantfile config files you can ensure new deployments do not have name or port collisions in your VirtualBox environment

  12. Vagrant, VirtualBox and Oracle

    This notebook contains info about automating deployments of VMs and Oracle software with Vagrant/Virtualbox.
  13. Oracle Enterprise Manager / Cloud Control

    Environment Overview

    To show info about currently running OMS including URLS, ports, and paths:
    cd $OMS_HOME/bin
    ./emctl status oms -details
    

    Reset Weblogic Admin Password

    12c , 13c Cloud Control: Steps for Modifying the Password for Weblogic and Nodemanager User Accounts in the Enterprise Manager Installation (Doc ID 1450798.1)

    Reset Weblogic Admin Server Password

  14. AWR Warehouse Operations

    Listing databases added to an AWR Warehouse with EMCLI

    $ emcli login username=username
    Enter password
    
    Login successful
    
    $ emcli awrwh_list_src_dbs
    
    Databases uploading to the AWR Warehouse:
    Target Name               Target Type      Owner   Version          Snapshot Upload Status  Snapshots Uploaded
    db1.business.com          rac_database     DMANN   11.2.0.4.180116  Enabled                 123
    db2.business.com          rac_database     DMANN   12.1.0.2.0       Enabled                 456
    

    Adding a DB to AWR Warehouse with EMCLI

    Ensure p

  15. AWR Warehouse Queries

    Some queries to help navigate the AWR warehouse:

    Databases/Instances with info in AWR Repository

    SELECT DBID, 
           DB_NAME, 
           INSTANCE_NUMBER, 
           INSTANCE_NAME, 
           HOST_NAME 
      FROM DBA_HIST_DATABASE_INSTANCE 
    ORDER BY DB_NAME, INSTANCE_NUMBER;
    
  16. ASM Information

    ASM Dictionary Views

    v$asm_aliasLists all aliases in all currently mounted diskgroups
    v$asm_clientLists all the databases currently accessing the diskgroups
    v$asm_diskLists all the disks discovered by the ASM instance
    v$asm_diskgroupLists all the diskgroups discovered by the ASM instance
    v$asm_fileLists all files that belong to diskgroups mounted by the ASM instance
    v$asm_operationReports information about current active operations.
  17. Unix Shell Scripting

    Finding file counts

    For Linux:
    cd $ORACLE_BASE/admin
    
    -- For Linux
    find -maxdepth 2 -type d | while read dir; do 
        count=$(find "$dir" -maxdepth 2 -iname \*.aud | wc -l)
        echo "$count ; $dir"
    done | grep adump | sort -n
    

    Getting around too many arguments:

    This method is scalable, does not have issues with argument list limits, and works well for millions of files. This example looks for files that match *.aud.
  18. Getting Started with Vagrant on Windows

    Software Tool Installs

    1) Install Cygwin. This is a Unix-like environment that can be run from Windows. Proceed to https://cygwin.com/install.html and run the installer for the 32 or 64 bit version of Cygwin that matches your Windows version. Install for all users. Accept the default packages and add "OpenSSH Client/Server", Curl, and WGet packages as well.

    2) Install Vagrant. Accept all defaults.

    3) Install VirtualBox. Accept all defaults.

  19. Data Guard Status

    Standby - Difference between SCN Timestamp and SYSTIMESTAMP of DB instance

    SELECT TO_CHAR(SCN_TO_TIMESTAMP(CURRENT_SCN), 'DD-MON-YYYY HH24:MI SSxFF') as LAST_COMMIT_TIME, 
    TO_CHAR(SYSTIMESTAMP, 'DD-MON-YYYY HH24:MI SSxFF') as CURRENT_DB_TIME 
    FROM V$DATABASE;
    

    Standby - Seconds Between SCN Timestamp and SYSTIMESTAMP of DB instance

    SELECT TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI'), 
           INST_ID, 
           ( CAST( SYSTIMESTAMP AS DATE ) - CAST( SCN_TO_TIMESTAMP(CURRENT_SCN) AS DATE ) ) * 86400 AS SECONDS_LAG
    FROM GV$DATABASE; 
  20. Gnu Screen Usage

    Gnu Screen is a helpful Linux utility which functions as a virtual terminal manager. With it you can manage multiple terminal sessions and detach/reconnect to sessions as needed in your workflow. The virtual terminals will continue to run and insulate you from unexpected disconnections and logouts.
  21. Presentations

    Visualization

    10/2012 @ East Coast Oracle Users Group - Explore New Data Dimensions with Application Express and Free/Open Source Graphing Libraries - PDF

  22. 12c Containers

    Working with PDBs

    Set your ORACLE_SID and log into the CDB instance using normal oraenv and sqlplus "/ as sysdba" method.
  23. RAC on NFS / ASM on NFS

    Why?

    I need to create a RAC cluster at a client site where they only have a NFS file server device.

    To ASM or not ASM?

    Options

    direct NFS

    Option 2 : ASM on NFS

    You can make use of ASM with NFS by creating shared files on NFS that will act as Raw devices to ASM.
  24. RAC

    Server Status/Startup/Shutdown

    # Status
    srvctl status database -d <dbname>
    srvctl config database -d <dbname>
    
    
    # Shutdown
    srvctl stop database -d <dbname>
    srvctl stop database -d <dbname> -i <instance> -o immediate
    
    # Startup
    srvctl start database -d <dbname>
    srvctl start database -d <dbname> -i <instance> -o immediate
    

    CRS Commands

    crsctl status resource
    
    crsctl status type
    
    crsctl status serverpool
    
    crsctl status server
    
    
    

    Recreate Srvctl Entry