How To Drop Extract Capture Process Permanently on GoldenGate

I will give some code and explain to how to drop extract capture processes permanently on GoldenGate.

You can drop all extract capture processes with the below PL/SQL code.

BEGIN
     FOR i IN (SELECT capture_name FROM dba_capture)
     LOOP
         DBMS_CAPTURE_ADM.STOP_CAPTURE(i.capture_name, true);
         DBMS_CAPTURE_ADM.DROP_CAPTURE (i.capture_name, true);
     END LOOP;
 END;
 /

If you want to continues manual, you can follow the below code. It will work.

$ sqlplus / as sysdba
SQL> select capture_name from dba_capture;
Result:
CAPTURE_NAME
-------------
GGS$CAP_DSSSDDSS
SQL> exec DBMS_CAPTURE_ADM.STOP_CAPTURE('GGS$CAP_DSSSDDSS', true);
SQL> exec DBMS_CAPTURE_ADM.DROP_CAPTURE('GGS$CAP_DSSSDDSS', true);

If your capture process status is active while operation time, probably you will get the below error. Before drop operation, you must call STOP_CAPTURE procedure. Otherwise, you will get the below error.

ORA-01338 Other process is attached to Logminer session
ORA-06512 at "SYS.DBMS_CAPTURE_ADM_INTERNAL", line 238
ORA-06512 at "SYS.DBMS_CAPTURE_ADM_INTERNAL", line 225
ORA-06512 at "SYS.DBMS_CAPTURE_ADM", line 268

Lastly, you can drop to GoldenGate capture process in GoldenGate bash terminal with the below code.

GGSCI> dblogin userid gguser password xxxx
GGSCI> stop extract_process_name
GGSCI> unregister extract extract_process_name
GGSCI> delete extract_process_name

How to Enable/Disable Unified Audit

Hello everyone, I want to explain how to enable/disable unified audit option on Oracle Databases. When you enable or disable unified audit option, all databases must be closed while operation time.

You can check the unified audit that open or closed status with the below code

SQL> SELECT VALUE FROM V$OPTION WHERE PARAMETER = 'Unified Auditing';

VALUE
-------
NO

You can open a unified audit option with the below code.

$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk uniaud_on ioracle

When operation completed, you can check to unified audit status.

SQL> SELECT VALUE FROM V$OPTION WHERE PARAMETER = 'Unified Auditing';
VALUE
-------
YES

Also, you can purge to logs on the databases with the below code.

BEGIN 
DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(
audit_trail_type =>  DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
use_last_arch_timestamp =>  FALSE);
END;
/

You can purge to logs on the OS with the below code.

EXEC DBMS_AUDIT_MGMT.DROP_PURGE_JOB('CLEANUP_OS_DB_AUDIT_RECORDS'); 


BEGIN
DBMS_AUDIT_MGMT.DEINIT_CLEANUP(
AUDIT_TRAIL_TYPE   => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL);
END;
/

Lastly, you can disable to unified audit with the below code.

$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk uniaud_off ioracle 

and check

SQL> SELECT VALUE FROM V$OPTION WHERE PARAMETER = 'Unified Auditing';

VALUE
-------
NO

Uninstall GlobalProtect Vpn on MacOS Without İnstall File

You can uninstall GlobalProtect application with bash code. Firstly you should create uninstall_gp.sh in the home or another directory like this.

$ touch uninstall_gp.sh

Then open with vi editor and paste below code to the uninstall_gp.sh file.

#!/bin/sh
USER_ID=`id -u`
if [ "$USER_ID" -ne 0 ]; then
    echo "You must be root to run the script. Use sudo $0"
    exit
fi
install_dir=/Applications/GlobalProtect.app/Contents/Resources
app_log_dir=/Library/Logs/PaloAltoNetworks/GlobalProtect
mkdir -p "$app_log_dir"
((
    checkAndWaitProcess()
    {
        if [[ "$2" ]]; then
            T="$2"
        else
            T=5
        fi
        C=0
        while [[ C -lt $T ]] &&
              ( killall -s "$1" >/dev/null 2>/dev/null )
        do
            let C=C+1
            sleep 1
        done
        killall -s $1 >/dev/null 2>/dev/null
        return $?
    }
    pan_info()
    {
        curtime=`date`
        echo $curtime ' ' $1 >> ${app_log_dir}/PanGPInstall.log
    }
    curver=`defaults read ${install_dir}/../Info CFBundleShortVersionString`
    if [[ "$HOME" ]]; then
        USER=`stat -f "%Su" "$HOME"`
        pan_info "Uninstalling GlobalProtect version ${curver}, user ${USER}"
        pan_info "unload user gps, gpa"
        sudo -u"$USER" launchctl remove com.paloaltonetworks.gp.pangps
        sudo -u"$USER" launchctl remove com.paloaltonetworks.gp.pangpa
    else
        pan_info "Uninstalling GlobalProtect version ${curver}"
    fi
    pan_info "unload gps, gpsd and gpa"
    launchctl remove com.paloaltonetworks.gp.pangpa
    launchctl remove com.paloaltonetworks.gp.pangps
    launchctl remove com.paloaltonetworks.gp.pangpsd
    #wait for 15 sec. while PanGPS quits
    if checkAndWaitProcess "PanGPS" 5; then
        pan_info "PanGPS didn't quit within 5 sec. Killing"
        killall -15 PanGPS
        if checkAndWaitProcess "PanGPS" 5; then
            pan_info "PanGPS didn't quit after kill within 5 sec."
        fi
    fi
    #wait for 5 sec. while GlobalProtect quits
    if checkAndWaitProcess "GlobalProtect" 5; then
        pan_info "GlobalProtect didn't quit within 5 sec. Killing"
        killall -15 GlobalProtect
        if checkAndWaitProcess "GlobalProtect" 5; then
            pan_info "GlobalProtect didn't quit after kill within 5 sec."
        fi
    fi
    pan_info "Cleanup Dynamic Store"
    echo "remove State:/Network/Service/gpd.pan/IPv4" | scutil
    echo "remove State:/Network/Service/gpd.pan/DNS"  | scutil
    pan_info "rm all"
    rm -f "/Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist"
    rm -f "/Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist"
    rm -f "/Library/LaunchDaemons/com.paloaltonetworks.gp.pangpsd.plist"
    rm -rf "/Library/Application Support/PaloAltoNetworks/GlobalProtect"
    rm -rf "/Applications/GlobalProtect.app"
    rm -rf "/Applications/GlobalProtect.app.bak"
    rm -rf "/System/Library/Extensions/gplock"*.kext
    rm -rf "/Library/Extensions/gplock"*.kext
    #Mercy kill if processes are stuck
    killall -9 GlobalProtect
    killall -9 PanGPS
    rm -rf /Library/Preferences/com.paloaltonetworks.GlobalProtect*
    rm -rf /Library/Preferences/PanGPS*
    if [[ "$HOME" ]]; then
        rm -rf "$HOME/Library/Application Support/PaloAltoNetworks/GlobalProtect"
        rm -rf "$HOME"/Library/Preferences/com.paloaltonetworks.GlobalProtect*
        rm -rf "$HOME"/Library/Preferences/PanGPS*
        #remove password entry from keychain
        security delete-generic-password -l GlobalProtect -s GlobalProtect
    fi
    pan_info "Unload driver"
    ifconfig gpd0 down
    kextunload -b com.paloaltonetworks.kext.pangpd
    pan_info "Unload gplock"
    kextunload -b com.paloaltonetworks.GlobalProtect.gplock
    #10.9 addition to clear system preferences cache
    killall -SIGTERM cfprefsd
    pan_info "uninstall packages from globalprotect"
    for pkg in `pkgutil --pkgs |grep com.paloaltonetworks.globalprotect`
    do
        pkgutil --forget "$pkg"
    done
    rm -rf /Library/Logs/PaloAltoNetworks/GlobalProtect/*
    echo "Uninstallation finished."
)  2>&1) >> ${app_log_dir}/PanGPInstall.log

Then you can run uninstall_gp.sh file via bash terminal like this:

$ sudo sh uninstall_gp.sh

Great! GlobalProtect application has removed.