AIX UNIX Script that identifies the files querying an Oracle Database and then copy (scp) those files to another server.
Budget: $30 – $250 USD
I'm looking for a UNIX (AIX) scripting expert to create a script that takes data (files) from several Oracle Database Servers and transfers it to another AIX server (BACKUP_SERVER).
STEP 1:
Assure the ORACLE_SID is correctly set. ORACLE_SID is prefixed in the example below by 'ora_pmon_'. This value should be passed on to the ORACLE_SID env variable.
EXMAPLE:
[oracle@work1 /]$ ps -ef | grep pmon
grid 4781 1 0 Aug14 ? 00:00:05 asm_pmon_+ASM
oracle 4964 1 0 Aug14 ? 00:00:05 ora_pmon_banca
oracle 6400 2677 0 21:39 pts/0 00:00:00 grep --color=auto pmon
[oracle@work1 /]$ export ORACLE_SID=banca
[oracle@work1 /]$ echo $ORACLE_SID
banca
Note: There could be more instances on a server, the files to be copied should be taken for ALL the corresponding oracle database instances!
STEP 2:
Connect to the database and identifying the Oracle files that need to be copied:
#1. Trace files (no core dumps) and alert log location should be retrieved from v$diag_info- example
#2. Audit files - retrievable from from v$parameter view (audit_file_dest parameter)
EXAMPLE:
SQL> select instance_name from v$instance; --> this is more of a verification; it's actually the ORACLE_SID value, that has been set at STEP_1.
INSTANCE_NAME
----------------
banca
SQL> select name, value from v$diag_info where NAME in ('Diag Trace', 'Diag Incident')
union
select name, value from v$parameter where name='audit_file_dest' OR name='audit_trail'
NAME VALUE
--------------------------------------------- ---------------------------------------------------------------------------
Diag Incident /u01/app/oracle/diag/rdbms/banca/banca/incident
Diag Trace /u01/app/oracle/diag/rdbms/banca/banca/trace
audit_file_dest /u01/app/oracle/admin/banca/adump
audit_trail OS
---
Trace files to be copied on the backup server are foundable in 'Diag Incident'
Alert log and other trace files to be copied on the backup server are foundable in 'Diag Trace'. Note the alert log is of the form: alert_<instance_name>.log
Audit files to be copied on the backup server reside in 'audit_file_dest'
>>> IF audit_trail is 'DB' then the AUDIT FILES should not be copied, or at least no error should be encountered when it tries to scp the audit files to the BACKUP_SERVERS, as there might not be any audit files anyways.
STEP 3
Once these 4 variables (at least) have been passed into the script (ORACLE_SID, Diag Incident location, Diag Trace location (incl. alert_banca.log) and audit_file_dest) all the files residing to these location should be copied into one single location on a one single server, generically called BACKUP_SERVER (using 'scp' command).
Required skills:
AIX Unix scripting
SQL (oracle)
Optional skills:
Networking
STEP 1:
Assure the ORACLE_SID is correctly set. ORACLE_SID is prefixed in the example below by 'ora_pmon_'. This value should be passed on to the ORACLE_SID env variable.
EXMAPLE:
[oracle@work1 /]$ ps -ef | grep pmon
grid 4781 1 0 Aug14 ? 00:00:05 asm_pmon_+ASM
oracle 4964 1 0 Aug14 ? 00:00:05 ora_pmon_banca
oracle 6400 2677 0 21:39 pts/0 00:00:00 grep --color=auto pmon
[oracle@work1 /]$ export ORACLE_SID=banca
[oracle@work1 /]$ echo $ORACLE_SID
banca
Note: There could be more instances on a server, the files to be copied should be taken for ALL the corresponding oracle database instances!
STEP 2:
Connect to the database and identifying the Oracle files that need to be copied:
#1. Trace files (no core dumps) and alert log location should be retrieved from v$diag_info- example
#2. Audit files - retrievable from from v$parameter view (audit_file_dest parameter)
EXAMPLE:
SQL> select instance_name from v$instance; --> this is more of a verification; it's actually the ORACLE_SID value, that has been set at STEP_1.
INSTANCE_NAME
----------------
banca
SQL> select name, value from v$diag_info where NAME in ('Diag Trace', 'Diag Incident')
union
select name, value from v$parameter where name='audit_file_dest' OR name='audit_trail'
NAME VALUE
--------------------------------------------- ---------------------------------------------------------------------------
Diag Incident /u01/app/oracle/diag/rdbms/banca/banca/incident
Diag Trace /u01/app/oracle/diag/rdbms/banca/banca/trace
audit_file_dest /u01/app/oracle/admin/banca/adump
audit_trail OS
---
Trace files to be copied on the backup server are foundable in 'Diag Incident'
Alert log and other trace files to be copied on the backup server are foundable in 'Diag Trace'. Note the alert log is of the form: alert_<instance_name>.log
Audit files to be copied on the backup server reside in 'audit_file_dest'
>>> IF audit_trail is 'DB' then the AUDIT FILES should not be copied, or at least no error should be encountered when it tries to scp the audit files to the BACKUP_SERVERS, as there might not be any audit files anyways.
STEP 3
Once these 4 variables (at least) have been passed into the script (ORACLE_SID, Diag Incident location, Diag Trace location (incl. alert_banca.log) and audit_file_dest) all the files residing to these location should be copied into one single location on a one single server, generically called BACKUP_SERVER (using 'scp' command).
Required skills:
AIX Unix scripting
SQL (oracle)
Optional skills:
Networking