Automating JobSubmission Shutdown and Startup April Sims OCP 8i 9i DBA Southern Utah University.

Slides:



Advertisements
Similar presentations
Pennsylvania BANNER Users Group 2006 Instance Neutral Cloning Script Robin Ying Imperial Valley.
Advertisements

AD User Import From SIMS.NET
CLS Process Variable Database By: Diony Medrano. CLS PV Database - Topics Background Design Constraints Design and Implementation Benefits and Future.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Job Submission.
Chapter 9 Auditing Database Activities
CS34311 CS3431 – Database Systems I Project Overview Elke A. Rundensteiner.
CS34311 CS3431 – Database Systems I Project Overview Murali Mani.
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
7/2/2015Murali Mani -- CS5421 Database Management Systems DB Application Development Project Statement + Introduction to Oracle.
Oracle SQL*plus John Ortiz. Lecture 10SQL: Overview2 Overview  SQL: Structured Query Language, pronounced S. Q. L. or sequel.  A standard language for.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Database Backup and Recovery
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
Adapted from Afyouni, Database Security and Auditing DB Auditing Examples (Ch. 9) Dr. Mario Guimaraes.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
UNIX Processes. The UNIX Process A process is an instance of a program in execution. Created by another parent process as its child. One process can be.
University of Wisconsin Hospital & Clinics Database / environment refresh steps.
Best Implementation Practices for Discoverer April Sims OCP 8i 9i.
FireRMS SQL Audit, Archiving & Purging Presented by Laura Small FireRMS Quality Assurance.
CHAPTER 21 Automating Jobs. Introduction to Automating Jobs DBAs rely heavily on automating jobs. DBAs cannot be effective without automation. Listed.
CHAPTER 2 Implementing a Database. Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Week 6 Lecture 2 System and Object Privileges. Learning Objectives  Identify and manage system and object privileges  Grant and revoke privileges to.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Linux Operations and Administration
Day 8 Exporting Displays Cronjobs Mount. Chapter 5 Chapter 5 talks about X windows. –You should read the chapter. –However, you do not need to pay particular.
Linux+ Guide to Linux Certification, Second Edition
IT2204: Systems Administration I 1 6b). Introduction to Linux.
Copyright (c) by CNAPTICS Corporation. All rights reserved.1 INFO Oracle Database 11g: Administration II Presented By: Marc S. Paller,
Access Training Linux/Unix Power Broker Access Custom Schema Database Access Customer Training Date: 25-JAN-2005.
Day 11 SAMBA NFS Logs Managing Users. SAMBA Implements the ability for a Linux machine to communicate with and act like a Windows file server. –Implements.
Running the Operational Codes for the Brahmaputra Tom Hopson.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
ABUG Harding April 24 th Searcy, AR 1 e~Print - Innovative Ways We Use It Presented by: Bruce Knox University of Arkansas Division of Agriculture.
1 Periodic Processes and the cron Daemon The cron daemon is where all timed events are initiated. The cron system is serviced by the cron daemon. What.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 9 Auditing Database Activities.
SIMSWeb “Internet Remote Access” The most advanced central station software in the universe !
1 More basics on DB access Elke A. Rundensteiner.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
1 Very basics on DB access Elke A. Rundensteiner.
User Environments Objectives –to provide appropriate environments for different types of users Contents –different login programs –user profiles –restricted.
Dynamic Batch Processing March 19 10:00 AM David Steger.
Troubleshooting 11i issues Adam Janbolat
Oracle7 Server 的安装和配置 n 环境设置 安装 Oracle7 数据库服务器 配置 SQL*NET.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Running the Operational Codes for the Brahmaputra Tom Hopson.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
1 Very basics on DB access CS Nov DBMS? Oracle Accounts already created Documentation: mySQL: To create an account,
UNIX-21 WEEK 2 4/5/2005. UNIX-22 TOPICS Functions (contd.) pushd, popd, dirs Debugging Shell scripts Scheduling Unix jobs Job Management.
Running the Operational Codes for the Brahmaputra Tom Hopson.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
6/19/2016 أساسيات الأتصال و الشبكات Communication & Networks Fundamentals lab 4.
Scripting (Just one of many tools.) P. Bailey. No, not this kind of scripting….  I wanted to find some cool graphics on scripting and I got….
Using Crontab with Ubuntu
Managing User Desktops with Group Policy
Running the Operational Codes for the Brahmaputra
Open Source Server Side Scripting Permissions & Users
Unix Commands PowerPoint
Basics on DB access Elke A. Rundensteiner.
e~Print - Innovative Ways We Use It
System Administration
LING 408/508: Computational Techniques for Linguists
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
Version A.01 H3064S Module 14 Slides
BACHELOR’S THESIS DEFENSE
BACHELOR’S THESIS DEFENSE
Periodic Processes Chapter 9.
Presentation transcript:

Automating JobSubmission Shutdown and Startup April Sims OCP 8i 9i DBA Southern Utah University

Topics Unix account for JOBSUB Unix Environment Variables File Permissions Modifying End User File Locations Writing Scripts Submitting Cron Entries Integrating with DB backups/shutdowns Maintaining JOBSUB Output

Unix account for JOBSUB Separate unix account needed to keep these files separate from SCT BANNER code. May have to allow a few endusers the ability to access their jobsubmission output. Consider using SAMBA. Financial Aid has uploads/downloads to different agencies.

Unix Environmental Variables Remove all ORACLE environmental variables from profile calling them inside each script. This allows you to complete upgrades, change databases, etc. without having to modify each and every script. Use a SID.ini file and “source” it inside the script. Also good to keep from hardcoding passwords is to start a password file as well.

Mods to oraenv # Install any "custom" code here # if [ "$ORACLE_SID" = “PPRD6" ] ; then. /u01/app/sct/banner01/admin/banenv. /u01/app/oracle/PPRD6.ini fi if [ "$ORACLE_SID" = "PPRD" ] ; then. /u01/app/sct/banner03/admin/banenv. /u01/app/oracle/PPRD.ini fi

PPRD6.ini ORACLE_HOME=/u01/app/oracle/product/oracle9i; export ORACLE_HOME SUU_EXE_HOME=/u01/app/suu/banner02/general/e xe; export SUU_EXE_HOME SUU_BANNER_LINKS=/u01/app/suu/banner02/links ; export SUU_BANNER_LINKS COBMODE=32 PATH=$SUU_EXE_HOME:$SUU_BANNER_LINKS: /u01/app/oracle/product/oracle9i/bin:$PATH ORACLE_SID=PPRD6 export ORACLE_SID PATH COBMODE

Password file.jobsub.pprd6 (named so that the leading. hides it from ls commands) general/password fimsmgr/password export PASS=`grep general $HOME/.jobsub.pprd6 | cut -f 2` sqlplus

File Permissions JOBSUB directory and below is owned by JOBSUB and group permissions is nobody….. To grant endusers an UNIX logon account then permissions can be changed to limit access. Requires at least read permission on the directory above. Demo

Modifying End User File Location Some job submission output is not uniquely identified. So..one person’s output overwrites someone else’s…SCT is rewriting code to prevent this in the future. SQL> insert guruprf

Writing Scripts #!/bin/ksh # SUU_BANNER_LINKS contains any modified banner code and is first in the path to pick the mods up instead of the vanilla code. # gurstart_prod.shl export ORAENV_ASK=NO export ORACLE_SID=PPRD6. /usr/local/bin/oraenv LOGFILE=$HOME; export LOGFILE HOME=$HOME/$ORACLE_SID; export HOME cd $HOME sh $SUU_BANNER_LINKS/gurjobs_pprd6.shl $ORACLE_SID GURJOBS > $HOME/gurjobs_start_$ORACLE_SID.log 2>&1 & HOME=$LOGFILE; export HOME

Submitting Cron Entries JOBSUB unix account has to be enabled to allow CRON To add crontab entries as banjobs crontab –e

Crontab cont’d # Fields are: # MM HH DD MM WW /cat/file/string/to/execute # minute (0-59), # hour (0-23), # day of the month (1-31), # month of the year (1-12), # day of the week (0-6 with 0=Sunday). #!/bin/ksh 3 15 * * 0-6 /u03/banjobs/clean_all.sh > /u03/banjobs/clean_all.log 2>&1 15,30,45, * * 0-6 /u03/banjobs/scripts/gurstart_PPRD6.ksh >gurjobs.log 2>&1

Integrating with DB backups or other tasks #!/usr/bin/ksh #nightly.ksh RUN as ROOT, no passwords needed. # Written by April Sims, DBA at SUU # This stops/starts all BANNER processes nightly for backups. # First I export the databases while they are still up. /bin/su - oracle -c "/u01/app/oracle/scripts/export.sh" <<EOF EOF # this stops all the jobsub processes, I run 2 different PROD ones so that in case one of them hangs. /bin/su - banjobs -c "/u03/banjobs/scripts/gurstop_prod.shl" <<EOF EOF /bin/su - banjobs -c "/u03/banjobs/scripts/gurstop_prod2.shl" <<EOF EOF /bin/su - banjobs -c "/u03/banjobs/scripts/gurstop_pprd.shl" <<EOF EOF # this stops sleep/wake processing /bin/rm /u03/banjobs/sleepwake/PROD/PROD.fgractg /bin/rm /u03/banjobs/sleepwake/PROD/PROD.forappl /bin/sleep 180 # This is a cold backup of certain databases /bin/su - oracle -c "/u01/app/oracle/scripts/cold.sh" <<EOF EOF /bin/su - banjobs -c "/u03/banjobs/scripts/gurstart_prod.shl" <<EOF EOF /bin/su - banjobs -c "/u03/banjobs/scripts/gurstart_prod2.shl" <<EOF EOF /bin/su - banjobs -c "/u03/banjobs/scripts/gurstart_pprd.shl" <<EOF EOF # Starts sleep/wake as a background process /bin/su - banjobs -c "/u03/banjobs/sleepwake/PROD/start_sleep_wake.shl &" <<EOF EOF exit

Maintaining JOBSUB Output Jobsub collector tables needed to be cleaned out on a regular basis….recommendation 2 weeks Script that cleans out the collector table and corresponding *.lis and *.log files. (you will also see *.DAT, *.rpf, *.clg, *.prt, *.out, *.err, *.srt, *.ext, *.htm)

Thanks to Dave Iler #!/usr/bin/bash –x cd /u03/banjobs/PPRD HOME=/u03/banjobs; export HOME ORACLE_SID=PPRD6 export ORACLE_SID ORAENV_ASK=NO ; export ORAENV_ASK PATH=/usr/local/bin:$PATH; export PATH. /usr/local/bin/oraenv export PASS=`grep general $HOME/.banjobs.pprd6 | cut -f 2` $ORACLE_HOME/bin/sqlplus <<EOF EOF exit

Clean_PPRD6.sql set pagesize 0 set feed off set term off spool /u03/banjobs/PPRD6/rmfiles_PPRD6.bash select '#!/usr/bin/bash -x' from dual; select 'oldir=`pwd`' from dual; select 'cd /u03/banjobs/PPRD6' from dual; select 'rm ' || guboutp_file_name from guboutp where sysdate-guboutp_date_saved > 30; select 'cd $oldir' from dual; spool off set feed on set term on delete from guroutp where (guroutp_user_id, guroutp_one_up_no, guroutp_file_number) in (select guboutp_user_id, guboutp_one_up_no, guboutp_file_number from guboutp where sysdate - guboutp_date_saved > 30); delete from guboutp where sysdate - guboutp_date_saved > 30; host chmod 500 /u03/banjobs/PPRD6/rmfiles_PPRD6.bash host /u03/banjobs/PPRD6/rmfiles_PPRD6.bash / exit

Result from 1 st script #!/usr/bin/bash -x oldir=`pwd` cd /u03/banjobs/PPRD6 rm gurpded_5750.lis rm gurpded_5750.log rm gurpded_5751.lis rm gurpded_5752.lis rm gurpded_5752.log rm gurpded_5751.log rm fgrfndh_5761.lis rm gurpded_5753.log rm fgrfndh_5760.lis rm fgrfndh_5760.log rm fgrfndh_5761.log rm farvalp_5765.lis rm farvalp_5765.log cd $oldir