Preview only show first 10 pages with watermark. For full document please download

Intro To System Administration

   EMBED


Share

Transcript

Intro to System Administration Greg Gray Marc Freedman Christian Apicella SEDC Database Server History RHEL Database Servers • • • The RHEL servers may be physical servers, VMware or Microsoft Hyper-V virtual servers. The physical RHEL servers are not limited to a single hardware manufacturer. SEDC recommends Dell’s 13th generation series of servers including the R630, R730, or R930. Red Hat Enterprise Linux Migration coming later this year! It will not cost you anything but will require some downtime for upg Oracle Database Enterprise Edition Oracle Enterprise Features: Advanced Security for UPN and MDM2 Oracle Enterprise Features: Active Data Guard for UPN Oracle 12c Feature: Advanced Compression (MDM2) Oracle 12c Feature: Database Partitioning (MDM2) Oracle 12c Feature: Oracle Multitenant Architecture (our future) SMS Listener • Streaming the smslistener job stream /usr/sedc/jobs/smslistener32600 smsmon [SEDC Test UPNDB:ts ~]$ smsmon SMSMonitor ver:32.01.01 Copyright 2011 Southeastern Data Cooperative Inc... No -1 2 3 4 5 6 7 YY/MM/DD -------15/05/07 15/05/07 15/05/07 15/05/07 15/05/07 15/05/06 15/05/07 HH:MM:SS -------07:14:26 07:13:30 07:13:27 07:13:23 07:10:19 16:52:39 07:13:26 PID ----17496 17518 17519 17541 12181 12970 12981 QUEUE ---wuq1 gaq1 ccq1 wuq2 bpq1 caq1 caq1 List associated with port 32600 SMSMonitor: SERVER -----------------------/leetech/pub/webutil /gasystem/pub/gaweb /ccsystem/pub/ccweb /preview/pub/webutil /casystem/pub/hptoweb /casystem/pub/caweb /casystem/pub/caweb TRANS ----82015 22028 12002 81003 02019 02002 02002 USER -----------GREGG GREGG MARCF MARCF GREGG MARCF Database backups • • • Daily, Month-end, Year-end Before running a software upgrade RHEL Daily backups are performed automatically by the system job named sudo /usr/sedc/jobs/daily_backup.sh RD1000 drive on physical RHEL server • To format a new RD1000 cartridge, sign in as the user named “utility” and issue the following command (Note: sdd or sde is the device name which will reference the appropriate RD1000 drive). sudo /opt/sedc/bin/format-tape.sh sdd • If you receive the message “RD1000 has already been formatted, Proceed and destroy?”, answer no. The tape is ready. RHEL Manual backup • • “sudo /usr/sedc/jobs/daily_backup.sh” - SEDC created job that utilizes Oracle RMAN (Recovery Manager-Oracle provided utility for backing-up, restoring, and recovering Oracle Databases). Example of manually executing RHEL Manual Backup sudo /usr/sedc/jobs/daily_backup.sh Checking your backup on RHEL • Sign into the RHEL server as “utility” and last backup status is displayed automatically. ############################################################################ Welcome utility Shell: /bin/bash Kernel Version: Linux 2.6.18-348.1.1.el5 x86_64 Uptime: 10:30:22 up 82 days, 20:09, 3 users, load average: 4.48, 4.08, 4.03 Today's date is Thu May 30 10:30:22 EDT 2013 Last Backup Ran: --Backup Copy End: Latest Backup size: 5.6G Backup status: SUCCESS IP Address: 10.204.0.82 Netmask: 255.255.255.0 Gateway: 10.204.0.254 Public Address: 174.46.97.43 Server Manufacturer: VMware, Server Model: VMware Virtual UPN Release version: 33.0.1.7 Primary Backup: /mnt/backup If you would like to use the upnmenu, please type in upnmenu and press ENTER ############################################################################ [SEDC Environment:utility ~]$ Checking your backup on RHEL • You can also use the tail command to check your backup on RHEL [SEDC Test UPNDB:ts ~]$ tail -100 /SEDC/conslog 01:00 05-06/root_cron/ backup: Begin Backup 01:00 05-06/root_cron/ backup: Oracle Backup Start sedc 01:02 05-06/root_cron/ backup: RMAN Backup for sedc SUCCESSFUL 01:02 05-06/root_cron/ backup: Oracle Backup End sedc 01:02 05-06/oracle_24166/ BEGIN J2390 / ExportCA 01:03 05-06/oracle_24166/ END J2390 / ExportCA / ExportCA 01:03 05-06/oracle_25381/ BEGIN J2391 / ExportGA 01:04 05-06/oracle_25381/ END J2391 / ExportGA / ExportGA 01:04 05-06/oracle_26393/ BEGIN J2392 / ExportCC 01:05 05-06/oracle_26393/ END J2392 / ExportCC / ExportCC 01:05 05-06/oracle_27599/ BEGIN J2393 / ExportWU 01:05 05-06/oracle_27599/ END J2393 / ExportWU / ExportWU 01:05 05-06/root_28573/ BEGIN J2394 / PurgeOldSpool 01:05 05-06/root_28573/ END J2394 / PurgeOldSpool / PurgeOldSpool 01:06 05-06/oracle_29515/ BEGIN J2395 / ImportCAdisk 01:11 05-06/oracle_29515/ END J2395 / ImportCAdisk / ImportCAdisk 01:17 05-06/root_cron/ backup: Disk Backup Start 01:24 05-06/root_cron/ backup: Filename = /mnt/backup/Daily/upnbackup_20150506_0117.tar.gz 01:24 05-06/root_cron/ backup: Disk Backup End 01:24 05-06/root_cron/ backup: Backup Copy Start 01:25 05-06/root_cron/ backup: Backup Copy End 01:25 05-06/root_cron/ backup: End Backup [SEDC Test UPNDB:ts ~]$ Loading Preview/Pracview To EXPORT • Exports can be performed while users are accessing the system or scheduled for a later point of time using the “stream” command. • Streaming a Manual Export stream /usr/sedc/jobs/exportca [exports casystem to disk] stream /usr/sedc/jobs/exportcc [exports ccsystem to disk] stream /usr/sedc/jobs/exportga [exports gasystem to disk] stream /usr/sedc/jobs/exportwu [exports Loading Preview/Pracview from Disk To IMPORT • If you need to load preview/pracview from disk, stream the following commands. • Streaming a Manual Import stream /usr/sedc/jobs/importcadisk stream /usr/sedc/jobs/importccdisk stream /usr/sedc/jobs/importgadisk disk] stream /usr/sedc/jobs/importwudisk [imports casystem to preview from disk] [imports ccsystem to preview from disk] [imports gasystem to pracview from [imports websdb to preview from disk] Loading Preview/Pracview from old backup using extractdump If you need to load preview/pracview from an old backup the utility, ts, and powernet users can use the new extractdump command. Usage information below. extractdump -? ----------Usage: extractdump [ -d date | -f filename ] [ -s ] [ account_name ... ] If no options are specified, extractdump will display the contents of the primary backup location. -d: Date to restore. Can be in date format - 5/5/14 - or any format accepted by date command - 'last monday', 'two days ago', etc. -f: Filename to restore. Extractdump The -d and -f options are mutually exclusive. -s: Use secondary backup location. account_name(s): A space delimited list of accounts to restore. i.e. casystem gasystem extraca casystem can be abbreviated as ca. gasystem can be abbreviated as ga. gasystem can be abbreviated as ga. websdb can be abbreviated as wb. To list the contents of the primary or secondary backup location. extractdump extractdump -s Extractdump To extract the casystem and gasystem dumpfiles from March2014MonthEnd.tar.gz. extractdump -f March2014MonthEnd.tar.gz ca ga To extract the casystem and gasystem dumpfiles from May 5th. extractdump -d 5/5 ca ga To extract the casystem dumpfile from last Monday. extractdump -d 'last monday' casystem loadworkfile / createworkfile (RHEL) • Some SEDC programs require the use of a workfile to simulate the /dev/worktape device that we had on HP-UX. The functionality mimicking input/output data to and from tapes has been reproduced on the Linux platforms utilizing symbolic links from a file to /dev/worktape. To create a file to which you want output written/read, utilize the “createworkfile” script. When a program is run that writes to/reads from a loaded file, it will generate a console request on the Linux system that will require a reply in order to complete its function. • To create (and load) a file named PRFC2013, the command would be: [UPN sandbox:utility ~]$ createworkfile PRFC2013 Unloaded workfile Loaded workfile /workblob/PRFC2013 to /dev/worktape • To view what files are available, enter the command: [UPN sandbox:utility ~]$ loadworkfile -l Work files in /workblob/: PRFC2013 (current workfile) PACB2013 • To change which file is loaded for access, enter the command: [UPN sandbox:utility ~]$ loadworkfile –n PACB2013 Unloaded workfile Loaded workfile /workblob/PACB2013 to /dev/worktape Recall / Reply • Most recall / reply commands are related to tape drives and printer forms. Example recall: 00:45/J7939/11994/a/FullBackup : next tape mounted and ready in /dev/backuptape? (y/n) Recall / Reply • The response format is reply Example reply: # recall ?15:06/lp202/19570/a/LOAD F/M - 1UP LABELS reply 19570 y showlpdev • showlpdev With no options, displays the current state of each printer spool queue on the system. showlpdev Printer Name ----------------formslp lp lpreal Spool Queue ----Open Open Open Printer State Fence Comments ----------- ----- -------------------------------Spooler Out Spooler Out Spooler Out 4 4 0 cupsdisable (RHEL) • cupsdisable printer-name Disables spoolfiles belonging to "printer-name" from physically printing on queue's associated printer. Spoolfiles are still allowed to be created in the queue; however, they will not physically print while the “cupsdisable" is in effect. cupsdisable lpreal cupsenable (RHEL) • cupsenable printer-name Enables physical printing on the printer associated with "printer-name". Re-enables printing interrupted by the “cupsdisable" command. cupsenable lpreal so (showout) so SpoolFile ID -----------------lp-755 lp-751 lp-748 lp-746 lp-744 lp-743 lp-742 lp-741 lp-740 lp-739 lp-737 lp-736 lp-734 lp-101 lp-100 15 Spoofles: Owner -------root root root root root root root root root root root root root root root 465613 bytes Filename --------------J1277_stdlst J1272_stdlst J1268_stdlst J1260_stdlst J1265_stdlst J1264_stdlst J1263_stdlst J1262_stdlst J1261_stdlst J1259_stdlst J1258_stdlst J1256_stdlst J1254_stdlst J0814_stdlst J0812_stdlst (1819 sectors) Created Size (bytes) Pr #C ------------ ------------ -- -Mar 8 14:49 6572 1 1 Mar 8 12:48 6580 1 1 Mar 8 11:19 6602 1 1 Mar 8 11:02 10544 1 1 Mar 8 10:59 24031 1 1 Mar 8 10:57 28260 1 1 Mar 8 10:57 155598 1 1 Mar 8 10:55 151280 1 1 Mar 8 10:53 40490 1 1 Mar 8 10:51 4392 1 1 Mar 8 10:28 5379 1 1 Mar 8 10:18 6560 1 1 Mar 8 09:17 6556 1 1 Jan 28 18:43 6349 1 1 Jan 28 18:31 6420 1 1 purgesp • purgesp lprequest Deletes the specified spoolfile(s) from the system. Understands the same shorthand for "lp" spoolfiles as "printsp" and "spoolf". Allows you to specify on one command line multiple spoolfiles to be deleted. purgesp To delete multiple spoolfiles on one command line: purgesp spoolfileid spoolfileid spoolfileid spoolfileid Determine commonality of all spoolfiles to delete (i.e. jobnumber, date, owner) BE CAREFUL so | grep commonality to see if it shows only the spoolfiles you want so | grep commonality | cut -f1 -d” “ to see if it creates only a list of spoolfileid’s you want (just the id’s, no other info). If satisfied, the on one command line: idsp idsp This command is used to identify the system location of spool files for backing up prior to printing or manipulation. # so SpoolFile ID Owner Filename Created Size (bytes) Pr #C ------------------ -------- --------------- ------------ ------------ -- -lp-246 gafxtest J3029_stdlst Mar 26 15:09 7912 4 1 lp-245 gafxtest UNIX2409_J3029 Mar 26 15:09 9512 4 1 lp-640 root LP Mar 16 17:14 2510 4 1 lp-276 listener SCTB2685_J2987 Mar 27 11:20 2510 1 1 lp-55 listener SCTB2029_J0006 Mar 28 10:43 2048 1 1 • [SEDC Environment:utility ~]$ idsp lp-55 /var/spool/cups/d00055-001 [SEDC Environment:utility ~]$ cp /var/spool/cups/d00055-001 /home/utility/SCTB2002 RHEL Commands • • • • • • • • • • • • • man (help page) cp (copy file) mv (rename file) rm (delete file) df (check disk space) ls (list contents) ll (long list, details) | (pipe) grep (search file for pattern) find (find a file in directory structure) cat (concatenate, copy, and print files) more (one page at a time) du –ks (print grand total of disk space in KB for all files in specified directory) Questions?