Wednesday, 30 October 2019

Backup

https://drive.google.com/open?id=1uxMkSqx-520ZRG2sVipT6XiHTfCEFEv8

Wednesday, 2 October 2019

Oracle Apex 5 change parsing schema at run time


shared components > security > security attributes> database session > Initialization PL/SQL Code


BEGIN
if :APP_USER='SCOTT' THEN
apex_application.g_flow_owner := 'SCOTT';
ELSE
apex_application.g_flow_owner := 'HR';
END IF
END;

Monday, 30 September 2019

RMAN daily full compressed backup

[oraprod@taw-ora-db scripts]$ cat /home/oraprod/scripts/rman_daily_full.sh
# *====================================================================================+
# |  Author - Tahaluf AlEmaraat - Mohammed Al-Masri
# |                                                       |
# +====================================================================================+
# |
# | DESCRIPTION
# |     Take rman full backup
# | PLATFORM
# |     Linux/Solaris/HP-UX
# +===========================================================================+
#!/bin/bash

. ~/.bash_profile

fullBackup () {
rman log=/backup/CIRC/backups/logs/RMANDailyFull.log << EOF
connect target /
set echo on;
configure controlfile autobackup on;
run
{
ALLOCATE CHANNEL c1 DEVICE TYPE disk ;
ALLOCATE CHANNEL c2 DEVICE TYPE disk ;
backup AS COMPRESSED BACKUPSET full database tag FullBackup format '/backup/CIRC/backups/%d_%T_%s_%p_FULL.BKP' ;
sql 'alter system archive log current';
backup tag ARCHIVEBackup format '/backup/CIRC/backups/%d_%T_%s_%p_ARCHIVE.BKP' archivelog all delete all input ;
backup tag CONTROLBackup current controlfile format '/backup/CIRC/backups/%d_%T_%s_%p_CONTROL.BKP';
release channel c1;
release channel c2;
}
configure backup optimization clear;
configure controlfile autobackup clear;
#sql 'alter system archive log current';
exit
EOF
}
# Main
fullBackup
export log_name="RMANDailyFull_$(date +%Y%m%d_%H%M%S).log"
mv /backup/CIRC/backups/logs/RMANDailyFull.log /backup/CIRC/backups/logs/$log_name




[oraprod@taw-ora-db scripts]$ crontab -l
0 20 * * * /usr/bin/find /backup/FULL_BACKUP/ -name "*.BKP" -type f -mtime +3 -exec rm -f {} \;
* 22 * * *  /home/oracle/scripts/rman_daily_full.sh
~
~


Delete old RMAN and Archives

[oraprod@taw-ora-db scripts]$ cat /home/oraprod/scripts/delete_old_backups.sh
#!/bin/bash
find /backup/CIRC/archives -name "1_*.dbf" -mtime +14 | xargs rm -rf
export BACKUPS=/backup/CIRC/backups  # The patch of the AUDIT_DUMP_DEST
find $BACKUPS -type f -name '*.BKP' -mtime +7 -exec rm -rf {} \;
find $BACKUPS -type f -name 'c-*' -mtime +7 -exec rm -rf {} \;

Friday, 20 September 2019

How To Set the AUDIT_SYSLOG_LEVEL Paramete

1. Edit /etc/syslog.conf (upto RHEL5) or /etc/rsyslog.conf (RHEL6 onward) to including following lines 

(Must put lines before line "*.info ...", otherwise captured to /var/log/messages, rather than /var/log/oracle-audit)

# Classify Oracle audit log into local1.warning
local1.warning    /var/log/oracle-audit.log
*.info;mail.none;authpriv.none;cron.none                /var/log/messages


2. Restart syslogd  or rsyslogd service
[root@vmxdb01 ~]# service syslogd restart <-- font="" rhel5="">
[root@vmxdb01 ~]# systemctl restart rsyslog.service <-- font="" rhel7="">

3. Modify Oracle parameter audit_syslog_level & audit_trail

SQL> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/cdborcl/
                                                 adump
audit_sys_operations                 boolean     TRUE
audit_syslog_level                   string
audit_trail                          string      DB
unified_audit_sga_queue_size         integer     1048576

SQL> alter system set audit_trail=OS scope=spfile;

System altered.

SQL> alter system set audit_syslog_level="local1.warning" scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1342177280 bytes
Fixed Size                  2924160 bytes
Variable Size             855638400 bytes
Database Buffers          469762048 bytes
Redo Buffers               13852672 bytes
Database mounted.
Database opened.
SQL> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/cdborcl/
                                                 adump
audit_sys_operations                 boolean     TRUE
audit_syslog_level                   string      LOCAL1.WARNING
audit_trail                          string      OS
unified_audit_sga_queue_size         integer     1048576

4. Verify Oracle Audit Log generated

[root@vmxdb01 log]# tail -f /var/log/oracle-audit.log
Apr  9 22:18:27 vmxdb01 journal: Oracle Audit[5190]: LENGTH: "274" SESSIONID:[6] "190024" ENTRYID:[1] "1" STATEMENT:[1] "1" USERID:[10] "C##DONGHUA" USERHOST:[20] "vmxdb01.dbaglobe.com" TERMINAL:[5] "pts/1" ACTION:[3] "100" RETURNCODE:[4] "1045" COMMENT$TEXT:[26] "Authenticated by: DATABASE" OS$USERID:[6] "oracle" DBID:[10] "2860248834"
Apr  9 22:18:45 vmxdb01 journal: Oracle Audit[5196]: LENGTH: "283" SESSIONID:[6] "200019" ENTRYID:[1] "1" STATEMENT:[1] "1" USERID:[6] "SYSTEM" USERHOST:[20] "vmxdb01.dbaglobe.com" TERMINAL:[5] "pts/1" ACTION:[3] "100" RETURNCODE:[1] "0" COMMENT$TEXT:[26] "Authenticated by: DATABASE" OS$USERID:[6] "oracle" DBID:[10] "2860248834" PRIV$USED:[1] "5"
Apr  9 22:18:59 vmxdb01 journal: Oracle Audit[5196]: LENGTH: "227" SESSIONID:[6] "200019" ENTRYID:[1] "1" USERID:[6] "SYSTEM" ACTION:[3] "101" RETURNCODE:[1] "0" LOGOFF$PREAD:[1] "4" LOGOFF$LREAD:[4] "3013" LOGOFF$LWRITE:[2] "20" LOGOFF$DEAD:[1] "0" DBID:[10] "2860248834" SESSIONCPU:[2] "13"
Apr  9 22:18:59 vmxdb01 journal: Oracle Audit[5205]: LENGTH: "288" SESSIONID:[6] "200020" ENTRYID:[1] "1" STATEMENT:[1] "1" USERID:[10] "C##DONGHUA" USERHOST:[20] "vmxdb01.dbaglobe.com" TERMINAL:[5] "pts/1" ACTION:[3] "100" RETURNCODE:[1] "0" COMMENT$TEXT:[26] "Authenticated by: DATABASE" OS$USERID:[6] "oracle" DBID:[10] "2860248834" PRIV$USED:[1] "5"

Wednesday, 18 September 2019

Oracle Database RMAN 12.2.0.1.0 -- recover database until available redo;


run
{
restore database
recover database until available redo;
}

Tuesday, 10 September 2019

EBS R12 How to Limit Active Concurrent Requests by a User

As System Administrator you can limit the number of requests that may be active (status of Running) for an individual user. This ensures that a user cannot monopolize the request queue. For example, if a user with an Active Request Limit of 5 submits 20 requests, only 5 requests will be run at the same time. The remaining requests will be run when the number of active requests for the user drops below 5. Use the Profile Options window to set the Concurrent: Active Request Limit profile. To set a global limit for all users, set this option at the site level. You can then modify limits for individual users by setting this profile option at the User level.
The profile Concurrent: Active Request Limit profile can only be set at Site and User levels and is null by default. Null means unlimited.

Number of Visitors