Intro to System Administration - SEDC€¦ · Intro to System Administration Greg Gray Marc...

34
Intro to System Administration Greg Gray Marc Freedman Christian Apicella

Transcript of Intro to System Administration - SEDC€¦ · Intro to System Administration Greg Gray Marc...

Intro to System Administration

Greg GrayMarc 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 YY/MM/DD HH:MM:SS PID QUEUE SERVER TRANS USER-- -------- -------- ----- ---- ------------------------ ----- ------------1 15/05/07 07:14:26 17496 wuq1 /leetech/pub/webutil 82015 GREGG2 15/05/07 07:13:30 17518 gaq1 /gasystem/pub/gaweb 22028 GREGG3 15/05/07 07:13:27 17519 ccq1 /ccsystem/pub/ccweb 12002 MARCF4 15/05/07 07:13:23 17541 wuq2 /preview/pub/webutil 81003 MARCF5 15/05/07 07:10:19 12181 bpq1 /casystem/pub/hptoweb 020196 15/05/06 16:52:39 12970 caq1 /casystem/pub/caweb 02002 GREGG7 15/05/07 07:13:26 12981 caq1 /casystem/pub/caweb 02002 MARCF

List associated with port 32600

SMSMonitor:

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 utilityShell: /bin/bashKernel Version: Linux 2.6.18-348.1.1.el5 x86_64Uptime: 10:30:22 up 82 days, 20:09, 3 users, load average: 4.48, 4.08, 4.03Today's date is Thu May 30 10:30:22 EDT 2013Last Backup Ran: --Backup Copy End:Latest Backup size: 5.6GBackup status: SUCCESSIP Address: 10.204.0.82Netmask: 255.255.255.0Gateway: 10.204.0.254Public Address: 174.46.97.43Server Manufacturer: VMware,Server Model: VMware VirtualUPN Release version: 33.0.1.7Primary Backup: /mnt/backupIf 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 Exportstream /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 DiskTo IMPORT• If you need to load preview/pracview from disk, stream the

following commands.

• Streaming a Manual Importstream /usr/sedc/jobs/importcadisk [imports casystem to preview from disk]

stream /usr/sedc/jobs/importccdisk [imports ccsystem to preview from disk]

stream /usr/sedc/jobs/importgadisk [imports gasystem to pracview from disk]

stream /usr/sedc/jobs/importwudisk [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.

ExtractdumpThe -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.

extractdumpextractdump -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 <process-id> <answer>

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 printerspool queue on the system.

showlpdevSpool Printer

Printer Name Queue State Fence Comments-------------- ----- ----------- ----- --------------------------------

----formslp Open Spooler Out 4

lp Open Spooler Out 4lpreal Open Spooler Out 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 bythe “cupsdisable" command.

cupsenable lpreal

so (showout)soSpoolFile ID Owner Filename Created Size (bytes) Pr #C------------------ -------- --------------- ------------ ------------ -- --lp-755 root J1277_stdlst Mar 8 14:49 6572 1 1lp-751 root J1272_stdlst Mar 8 12:48 6580 1 1lp-748 root J1268_stdlst Mar 8 11:19 6602 1 1lp-746 root J1260_stdlst Mar 8 11:02 10544 1 1lp-744 root J1265_stdlst Mar 8 10:59 24031 1 1lp-743 root J1264_stdlst Mar 8 10:57 28260 1 1lp-742 root J1263_stdlst Mar 8 10:57 155598 1 1lp-741 root J1262_stdlst Mar 8 10:55 151280 1 1lp-740 root J1261_stdlst Mar 8 10:53 40490 1 1lp-739 root J1259_stdlst Mar 8 10:51 4392 1 1lp-737 root J1258_stdlst Mar 8 10:28 5379 1 1lp-736 root J1256_stdlst Mar 8 10:18 6560 1 1lp-734 root J1254_stdlst Mar 8 09:17 6556 1 1lp-101 root J0814_stdlst Jan 28 18:43 6349 1 1lp-100 root J0812_stdlst Jan 28 18:31 6420 1 1

15 Spoofles: 465613 bytes (1819 sectors)

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.# soSpoolFile ID Owner Filename Created Size (bytes) Pr #C------------------ -------- --------------- ------------ ------------ -- --lp-246 gafxtest J3029_stdlst Mar 26 15:09 7912 4 1lp-245 gafxtest UNIX2409_J3029 Mar 26 15:09 9512 4 1lp-640 root LP Mar 16 17:14 2510 4 1lp-276 listener SCTB2685_J2987 Mar 27 11:20 2510 1 1lp-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?