Created
July 28, 2024 13:59
-
-
Save dincosman/3f6456966c0e01725948fbb9725b2271 to your computer and use it in GitHub Desktop.
Database Audit Records spooler shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set Oracle environment variables | |
source /home/oracle/.bashrc | |
export ORAENV_ASK=NO | |
export ORACLE_SID=bltdb1 | |
. oraenv bltdb1 | |
#export ORACLE_PDB_SID=testpdb | |
# Execute SQL query and spool output to file | |
$ORACLE_HOME/bin/sqlplus -s /nolog << EOF | |
conn / as sysdba | |
SET LONG 50000 | |
SET LONGCHUNKSIZE 50000 | |
SET LINESIZE 32767 | |
SET PAGESIZE 0 | |
SET FEEDBACK OFF | |
SET TRIMSPOOL ON | |
SET TAB OFF | |
SET SERVEROUTPUT OFF | |
SET VERIFY OFF | |
SET HEADING OFF | |
SET TERMOUT OFF | |
SET ECHO OFF | |
@audit_record_spooler.sql | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment