Support ID 100475
Microsoft Patch for VPN KB958644
bcv_mgmt -g ALL_EXCEPTOS_CFG -o sync_split
Patrol Configuration Manager
New Agent
Tools/Reporting
Agent & OS
Active KM Modules
dump_hist
PCM
New Agent
IP -> IP Address
Display Name
Ports
svcadm disable ipfilter
svcs -a |grep ipfilter
Tamara Nuri 512-326-6763
restore.ksh
sync.ksh
lsof -i tcp:7010 -Fp|tr -d p
system_stats_
ipc_bbi_stats_
/tuxulog/.pp
Put above in shared folder
vxdg -g
vxassist -b make
vxassist -g
symmir -f ALL_EXCEPT_OS_CFG -sid 0411 query -bg
bcv_mgmt.pl -o vximport -g ALL_EXCEPT_OS_CFG
symcfg discover
symmir -f
Patrol Disks
/vbaperf/disk2/CDs2/PatrolAgent3730
dump_hist
fix_hist
dumpe2fs /dev/sdb3 | grep -i 'Block size'
./bcv_mgmt.pl -o sync_split -g ONLY_OS_CFG -f
How to Start cicsrecv on vbaperf
IMPORTANT
Start as tpadmin
/usr/vba/tpa/script/ecs.cicsrecv_up.ksh
symmir -sid 0411 -f FULL_RESTORE_CFG que -i 5
symmir -sid 0411 -f FULL_RESTORE_CFG split -cons -nop
symmir -f FULL_RESTORE_CFG -sid 0411 query -bg|more
Procedure to boot Tuxedo:
Revision history:
Aug. 14, 2004 - first draft
There are several methods to boot Tuxedo, but the preferred method is to use “tux_menu” while logged in as tpadmin, because this will leave messages in the logfiles.
[vbaperf/vbaperf/local/scripts] su - tpadmin
|-----------------------------------------------------------------|
| This system is for the use of authorized users only. |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their |
| activities on this system monitored and recorded by system |
| personnel. |
| |
| In the course of monitoring individuals improperly using this |
| system, or in the course of system maintenance, the activities |
| of authorized users may also be monitored. |
| |
| Anyone using this system expressly consents to such monitoring |
| and is advised that if such monitoring reveals possible |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials. |
|-----------------------------------------------------------------|
$ tux_menu
Press "Enter" key to continue . . .
1) Quit
2)
3) Boot TUXEDO
4) Boot a Server Group
5) Boot a Server
6)
7) Shutdown TUXEDO
8) Shutdown a Server Group
9) Shutdown a Server
10)
11) Show Workstation Connections
12) Show Transaction Queues
13) Show TUXEDO Status
14) Show User Log
15) Show Administrator Log
Press "Enter" key to redisplay menu. Action ? 3
Boot TUXEDO!
Are you sure? [y or n]? y
# # # ###### # # ### # # #####
# # # # # # # ## # # ## # # #
# # # # # # # # # # # # # # #
# # # # # ###### # # # # # # # # ####
# # # ####### # # # # # # # # # # #
# # # # # # # # ## # # ## # #
## ## # # # # # # ### # # #####
Use "Show Administrator Log" to see error messages!
Press "Enter" key to continue . . .
Press "Enter" key to redisplay menu. Action ?
1) Quit
2)
3) Boot TUXEDO
4) Boot a Server Group
5) Boot a Server
6)
7) Shutdown TUXEDO
8) Shutdown a Server Group
9) Shutdown a Server
10)
11) Show Workstation Connections
12) Show Transaction Queues
13) Show TUXEDO Status
14) Show User Log
15) Show Administrator Log
Press "Enter" key to redisplay menu. Action ? 1
$
#!/vbaperf/local/bin/perl
use Getopt::Std;
use Term::Cap;
use IO::Tee;
use POSIX;
use POSIX qw(setsid);
use POSIX qw(:errno_h :fcntl_h);
use File::Path;
use Archive::Tar::Streamed;
use Cwd;
# Turn on Auto buffering
$| = 1;
# Capture program directory
our $main_directory = getcwd;
# Verify that we are running as root
$get_id = POSIX::geteuid();
if ($get_id ne "0") {
print "You must be root to run this script!\n";
exit 1;
}
getopts('kfhco:g:');
# This variable contains the commands necessary for this script to work properly
# If a user running this script is unable to run these commands, the user will be notified
# and the script will exit
our @run_commands = ("symmir","vxdg","vxvol","is_mounted");
our @vx_diskgroups = ("db1","db2","db3","db4","db5","db6","db7","db8","db9","db10","db11","db12","db13","db14","sys1","sys2","sys3");
# Directory that is created to contain temporary data to flush EMC cache
our $dummy_dir="offshoot";
# Directories used as source to create tar files in various directories to flush EMC cache
our @source_directories = ("/vbaperf/disk2/CDs2/","/vbaperf/disk2/audit/");
# Directories used as the target for tar files to flush EMC cache
our @flush_directories = ("/tuxulog/","/vbadata/vetsnet/batch/","/tuxcompresslog/");
our $verify = "verify ";
our $config_file = "ALL_CFG";
our $symmetrix_id = "0411";
our $operation = "";
our $filesystem_list = "filesystems.txt";
our $bcv_command = "symmir -f $config_file -sid $symmetrix_id";
our $bcv_sec_command = "";
our %companion = ("restore" => "split",
"sync_split" => "split");
our @mounted_fs = {};
our $notify_operation = "";
our %email_not = ( "sync" => "sync",
"restore" => "restore",
"sync_split" => "sync and split"
);
# sync option commented to protect non-sysadmins "sync" => "-noprompt establish",
our %valid_ops = (
"restore" => "-noprompt restore",
"split" => "-noprompt split",
"sync_split" => "-noprompt establish",
"verify split" => "verify -split -bg",
"verify restore" => "verify -restored",
"verify sync_split" => "verify -synched",
"d_split" => "verify -synched",
"vximport" => "vximport",
"vxunmount" => "vxunmount"
);
# Log file
my $tee = new IO::Tee(">> /vbaperf/local/log/bcv_ops.log",\*STDOUT);
# Get current date
open (DT,"date |");
our $start_date =
# Define variable with termcap command to clear the screen
$terminal = Term::Cap->Tgetent( {OSPEED => 9600} );
$clear_string = $terminal->Tputs('cl');
# Clear screen
print $clear_string;
#######################
###* Begin program *###
#######################
# Main #
validate_options();
check_cmd_scope();
check_process_state();
populate_filesystems();
execute_operation($opt_o);
if (defined($opt_c)) {
cache_flush();
}
## Subroutines ##
###################################
## check_process_state subroutine #
###################################
sub check_process_state() {
print $clear_string;
print "Checking for running applications...\n\n";
$check_command = "./check_procs.sh";
if (! -e $check_command) {
print $tee "Unable to locate the script(" . $check_command . ") to check for running applications!\n";
print $tee "Please replace the script and re-run this program.\n";
print $tee "If this is not possible, please manually verify that all aplications have been shutdown\n";
print $tee "and that all users are logged off that don't need to be logged on.\n";
print $tee "Then create a file called " . $check_command . " and put the following command inside it:\n";
print "exit 0;\n\n";
exit 1;
}
# Option to forcibly kill all processes that might interfere with a BCV operation
if (defined($opt_k)) {
$check_command = $check_command . " -f";
}
system($check_command);
if ($? ne 0) {
print $tee "There appear to be applications or application related processes still running!\n";
print $tee "Please verify that all applications have been properly shutdown.\n";
print $tee "A log indicating processes that were found has been generated and is named proc_log.txt\n";
exit 1;
}
print $tee "All applications appear to be shutdown.\n";
print $tee "Locking system to prevent further logins.\n";
print $tee "\nPlease wait...\n";
$lock_command = "touch /etc/nologin";
system ($lock_command);
sleep(5);
}
###################################
### validate_options subroutine ###
###################################
sub validate_options() {
# Check for options passed
if ((!defined($opt_o)) || (defined($opt_h))) {
print "Operation required!\n";
print "usage: bcv_mgmt.pl -o [restore|split|sync_split|vxunmount|vximport] -g [config file] -f -c -k(Forcibly kill all processes that might conflict with BCV operations)\n";
print "-c : Cache flush.\n";
print "-f : Add -full to BCV operation.\n";
print "-g : Specify custom BCV config file.\n";
print "-k : Forcibly kill all process that might interfere with a BCV operation.\n";
print "-o : BCV operation to perform.(required)\n";
exit 1;
}
if (defined($opt_g)) {
print $tee "You have requested a manual override of the default configuration file.\n";
print $tee "Verifying file...\n";
if (-e ($opt_g)) {
print $tee "File located successfully!\n\n";
print $tee "While this script has verified the existence of the file requested, it can not\n";
print $tee "verify that it contains valid devices. This is left to the end user to confirm prior\n";
print $tee "to running this scipt. If you are not sure that the file specified($opt_g) contains the\n";
print $tee "correct information, you should press control-c now to exit.\n";
print "\nPress any key to continue.\n";
$prompt =
$config_file = $opt_g;
$bcv_command = "symmir -f $config_file -sid $symmetrix_id";
}
}
# Make sure we got valid options, if not inform user of valid options
if (defined($opt_o)) {
print $tee "Analyzing operation to be performed...\n\n";
$operation = $valid_ops{$opt_o};
if ($operation eq "") {
print $tee "Invalid operation requested!\n\n";
print $tee "Valid operations are: ";
foreach $ops (keys %valid_ops) {
print $tee $ops . " ";
}
print $tee "\n";
exit 1;
}
# Capture operation in notify string for later email notification
$notify_operation = $opt_o;
if (defined($opt_f)) {
print $tee "Requested operation is $opt_o with -full option\n\n";
if (defined($opt_c)) {
print $tee "This operation will be followed by a cache flush.\n";
}
#$bcv_command = "symmir -f $config_file -sid $symmetrix_id -full";
#$bcv_sec_command = "symmir -f $config_file -sid $symmetrix_id";
} else {
print $tee "Requested operation is $opt_o\n";
if (defined($opt_c)) {
print $tee "This operation will be followed by a cache flush.\n";
}
if (defined($opt_k)) {
print $tee "\nAdditionally all processes that might interfere with this BCV operation will be forcefully killed.\n";
}
}
}
sleep(5);
}
##################################
### check_cmd_scope subroutine ###
##################################
sub check_cmd_scope() {
# Verify access to needed commands to carry out requested operations
print $tee "Verifying PATH access to necessary commands\n";
foreach $cmd (@run_commands) {
open (COMMAND, "$cmd -H 2>&1 |");
@test_command =
$results_cmd_test = scalar(@test_command);
if ($results_cmd_test < 1) { print $tee "Unable to run the $cmd command!\n"; print $tee "This script should generally be run as root. Any other user must have $cmd in their path\n"; exit (1); } } print $tee "All commands verified successfully!\n"; print "\nPlease wait....\n"; sleep (5); #print "Press any key to continue.\n"; #$prompt =
}
####################################
### execute_operation subroutine ###
####################################
sub execute_operation($) {
use Switch;
$operation = shift (@_);
print $clear_string;
print $tee "Checking prerequisites for the $operation operation\n\n";
switch ($operation) {
case "split" {
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
system($cmd);
if ($? eq 0) {
print $tee "BCV's are already in a split state, please verify the operation you want to execute.\n";
exit 1;
}
check_mounted_fs();
check_vx_dgs();
print $tee "\nProceeding with the $operation operation at $start_date\n";
bcv_split($operation);
exit 0;
}
case "vximport" {
print $tee "Importing DG's!\n";
import_vx_dgs();
mount_fs();
exit 0;
}
case "vxunmount" {
print $tee "Unmounting filesystems!\n";
check_mounted_fs();
check_vx_dgs();
exit (0);
}
case "restore" {
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
system($cmd);
if ($? == 0) {
print $tee "BCV's are already in a restored state, please verify the operation you want to execute.\n";
exit 1;
}
check_mounted_fs();
check_vx_dgs();
print $tee "\nProceeding with the $operation operation at $start_date\n";
bcv_restore($operation);
print $tee "\nStandard procedure calls for a split immediately after a restore, so the next step in the process will be a split.\n";
bcv_split($companion{"$operation"});
import_vx_dgs();
mount_fs();
open (FDT,"date |");
our $finish_date =
print $tee "System recovered at $finish_date\nBeginning services startup.....\n";
$cmd_script = "./run_rc.ksh " . $email_not{"$notify_operation"};
system($cmd_script);
$release_script = "rm /etc/nologin";
system($release_script);
print $tee "Releasing login lock file.\n";
}
case "sync_split" {
print $tee "Starting Sync/Split at $start_date\n";
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
system($cmd);
if ($? == 0) {
print $tee "BCV's are already in a synchronized state, please verify the operation you want to execute.\n";
exit 1;
}
check_mounted_fs();
check_vx_dgs();
print $tee "\nProceeding with the $operation operation at $start_date\n";
bcv_sync($operation);
print $tee "\nStandard procedure calls for a split immediately after a sync, so the next step in the process will be a split.\n";
bcv_split($companion{"$operation"});
import_vx_dgs();
mount_fs();
open (FDT,"date |");
our $finish_date =
print $tee "System recovered at $finish_date\nBeginning services startup.....\n";
$cmd_script = "./run_rc.ksh " . $email_not{"$notify_operation"};
system($cmd_script);
$release_script = "rm /etc/nologin";
system($release_script);
print $tee "Releasing login lock file.\n";
exit 0;
}
case "d_split" {
$start = 0;
while ($start != 1) {
$cmd="cd /vbaperf/refresh/EMC; symmir -f ALL_APPS_CFG -sid 1709 verify -synched";
system($cmd);
$return = $?/256;
print $tee "Status returned for sync: $return\n";
if ($return == 0) {
$start = 1;
}
sleep 10;
}
print $tee "Sync appears to have finished successfully!\n";
print "Sync appears to have finished successfully!\n";
print $tee "Beginning split!\n";
print "Beginning split!\n";
check_mounted_fs();
check_vx_dgs();
bcv_split("split");
import_vx_dgs();
mount_fs();
$cmd_script = "./run_rc.ksh";
system($cmd_script);
exit 0;
}
}
}
###################################
### check_mounted_fs subroutine ###
###################################
sub check_mounted_fs() {
print $tee "\nAttempting to unmount pertinent filesystems.......\n";
$mount_check = 1;
foreach $filesystem (@mounted_fs) {
chomp ($filesystem);
$cmd = "umount -f $filesystem > /dev/null 2>&1";
system($cmd);
$cmd = "is_mounted $filesystem > /dev/null 2>&1";
system($cmd);
if ($? == 0) {
print $tee "Unable to unmount $filesystem!\n";
print $tee "Please verify that all processes associated with $filesystem have been terminated.\n";
print $tee "Then re-run this script.\n";
exit 1;
}
}
print $tee "All filesystems successfully unmounted.\n";
}
###############################
### check_vx_dgs subroutine ###
###############################
sub check_vx_dgs () {
print $tee "\nAttempting to deport all pertinent Veritas disk groups.......\n";
print $tee "Now deporting disk group: ";
foreach $diskgroup (@vx_diskgroups) {
print $tee "$diskgroup ";
$cmd = "vxdg deport $diskgroup > /dev/null 2>&1";
system($cmd);
}
print $tee "\n";
# Verify that all pertinent diskgroups have been deported
foreach $diskgroup (@vx_diskgroups) {
$cmd = "vxdg -o verify list $diskgroup > /dev/null 2>&1";
system($cmd);
if ($? == 0) {
print $tee "Diskgroup: $diskgroup could not be deported. There may still be volumes in use for this diskgroup.\n";
print $tee "Please verify that all processes associated with volumes in $diskgroup have been terminated and re-run this script.\n";
print $tee "A list of all volumes in a diskgroup can be obtained by running the following command:\n";
print $tee "vxprint -g [diskgroup(e.g. $diskgroup)] -v -F \"%name\"\n";
exit 1;
}
}
print $tee "All Veritas diskgroups successfully deported.\n";
}
#############################
### unmount_fs subroutine ###
#############################
sub unmount_fs () {
foreach $filesystem (@mounted_fs) {
$cmd = "umount -f $filesystem > /dev/null 2>&1";
system($cmd);
}
}
############################
### bcv_split subroutine ###
############################
sub bcv_split($) {
$operation = shift(@_);
if ($bcv_sec_command ne "") {
$bcv_command = $bcv_sec_command;
}
print $tee "\nThis process will take several minutes, consequently there will be no more output to the screen until the process is initiated.\n";
$cmd = "$bcv_command $valid_ops{$operation}\n";
print $tee "$cmd \n";
system($cmd);
print $tee "The split operation has been initiated and will take several minutes to complete.\n";
print $tee "This script will poll the symmetrix frame every 30 seconds to determine the current status of all BCV's.\n";
print $tee "Once the $operation is complete, this script will print out a status message indicating success.\n";
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
$bcv_status = 1;
while ($bcv_status == 1) {
system($cmd);
if ($?/256 == 0) {
$bcv_status = 0;
} else { sleep 30; }
}
print $tee "\nThe $operation operation is now complete!\n";
}
############################
### bcv_sync subroutine ###
############################
sub bcv_sync($) {
$operation = shift(@_);
print $tee "\nThe sync process will take several minutes, consequently there will be no more output to the screen until the process is initiated.\n";
$cmd = "$bcv_command $valid_ops{$operation}\n";
if ($opt_f) {
$cmd = "$bcv_command -full $valid_ops{$operation}\n";
}
print $tee "$cmd \n";
system($cmd);
print $tee "The $operation operation has been initiated and will take several minutes to complete.\n";
print $tee "This script will poll the symmetrix frame every 30 seconds to determine the current status of all BCV's.\n";
print $tee "Once the $operation is complete, this script will print out a status message indicating success.\n";
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
$bcv_status = 1;
while ($bcv_status == 1) {
system($cmd);
if ($?/256 == 0) {
$bcv_status = 0;
} else { sleep 30; }
}
print $tee "\nThe $operation operation is now complete!\n";
}
##############################
### bcv_restore subroutine ###
##############################
sub bcv_restore($) {
$operation = shift(@_);
print $tee "\nInitiating $operation process...\n";
print $tee "This process will take several minutes, consequently there will be no more output to the screen until the process is fully initiated.\n";
$cmd = "$bcv_command $valid_ops{$operation}\n";
if ($opt_f) {
$cmd = "$bcv_command -full $valid_ops{$operation}\n";
}
print $tee "$cmd \n";
system($cmd);
print $tee "The $operation operation has been initiated and will take several minutes to complete.\n";
print $tee "This script will poll the symmetrix frame every 30 seconds to determine the current status of all BCV's.\n";
print $tee "Once the $operation is complete, this script will print out a status message indicating success.\n";
# Check status of operation
$cmd = "$bcv_command $valid_ops{\"$verify$operation\"} > /dev/null 2>&1";
$bcv_status = 1;
while ($bcv_status == 1) {
system($cmd);
if ($?/256 == 0) {
$bcv_status = 0;
} else { sleep 30; }
}
print $tee "\nThe $operation operation is now complete!\n";
}
#####################
## EMC Cache Flush ##
#####################
sub cache_flush() {
print $tee "\nPreparing files for cache flush....\n";
# Verify that critical directories are present to perform the flush
foreach $dir (@flush_directories) {
if (! -e $dir) {
print "Unable to locate directory $dir\nAborting cache flush!\n";
print "It may be necessary to mount this directory and then re-run this script.\n";
exit 1;
}
}
foreach $dir (@source_directories) {
if (! -e $dir) {
print "A necessary source directory($dir) is not present.\nThis directory is critical to the cache flush process.\nPlease make sure this directory is mounted and re-run this script.";
exit 1;
}
}
print $tee "All prerequisites for the cache flush have been met.\nThe cache flush process will take approximately 1 hour.\nNo BCV operations will occur until this process is complete.\n";
sleep 5;
print $tee "Starting flush process...";
foreach $source_dir (@source_directories) {
foreach $flush_dir (@flush_directories) {
chdir($flush_dir);
if (! -e $dummy_dir) { mkdir ($dummy_dir,oct(777)); }
chdir($dummy_dir);
$cmd = "/vbaperf/local/bin/tar -cvf dummy.tar $source_dir > /dev/null 2>&1";
system($cmd);
}
foreach $flush_dir (@flush_directories) {
chdir($flush_dir);
rmtree([$dummy_dir],0,0);
}
}
print $tee "Complete!\n";
# Change back to main program directory to continue execution
chdir($main_directory);
# Operational pause.
sleep 5;
# Clear screen
print $clear_string;
} # End subroutine cache_flush
######################
### recover_vx_dgs ###
######################
sub import_vx_dgs() {
print $tee "\nAttempting to import Veritas disk groups....\n";
print $tee "\nNow importing disk group: ";
foreach $diskgroup (@vx_diskgroups) {
print $tee "$diskgroup ";
$cmd = "vxdg -C import $diskgroup > /dev/null 2>&1";
system($cmd);
}
print $tee "\n";
# Verify that all pertinent diskgroups have been imported
foreach $diskgroup (@vx_diskgroups) {
$cmd = "vxdg -o verify list $diskgroup > /dev/null 2>&1";
system($cmd);
if ($? != 0) {
print $tee "Diskgroup: $diskgroup could not be imported. There may be disk problems associated with the disk group.\n";
print $tee "An administrator should be notified immediately!\n";
exit 1;
}
}
print $tee "All Veritas diskgroups successfully imported.\n";
print $tee "\nAttempting to start Veritas volumes....\n";
foreach $diskgroup (@vx_diskgroups) {
$cmd = "vxvol -g $diskgroup startall\n";
system($cmd);
if ($? != 0) {
print $tee "Could not start volumes for diskgroup $diskgroup!\n";
print $tee "Command issued was $cmd\n";
print $tee "There may be disk problems associated with the disk group.\n";
print $tee "An administrator should be notified immediately!\n";
exit 1;
}
}
print $tee "All Veritas volumes have been started!\n";
}
sub mount_fs() {
print $tee "\nAttempting to mount pertinent filesystems.......\n";
$mount_check = 1;
foreach $filesystem (reverse @mounted_fs) {
print $tee "Now mounting $filesystem\n";
$cmd = "mount $filesystem > /dev/null 2>&1";
system($cmd);
}
# Verify that all pertinent filesystems have been mounted
foreach $filesystem (@mounted_fs) {
$cmd = "is_mounted $filesystem > /dev/null 2>&1";
system($cmd);
if ($? != 0) {
print $tee "Unable to mount $filesystem!\n";
print $tee "Please verify that all processes associated with $filesystem have been terminated.\n";
print $tee "Then re-run this script.\n";
exit 1;
}
}
print $tee "All filesystems successfully mounted.\n";
print $tee "\n---------------------------------------\n";
print $tee "Any needed services may now be started.\n";
}
sub populate_filesystems() {
open (FS,"< $filesystem_list") or die ("Unable to open $filesystem_list, try copying $filesystem_list\.bak into place\n"); @mounted_fs =
}
/vbaperf/SUNWappserver9/bin
./asadmin stop-domain domain1
./asadmin start-domain domain1
Master Password = root password
Output Log
/vbaperf/SUNWappserver9/domains/domain1/logs/server.log
pcpu='cd /vbaperf/local/data/web_reports/vbaprod/Daily/CPU'
perf='echo perf|. setsid'
pmem='cd /vbaperf/local/data/web_reports/vbaprod/Daily/MEMORY'
pora='cd /vbaperf/local/data/web_reports/vbaprod/Daily/ORACLE'
pp='cd /vbaperf/local/scripts/web_reports/'
ptrl='echo ptrl|. setsid'
ptux='cd /vbaperf/local/data/web_reports/vbaprod/Daily/TUXEDO'
pvar='cd /vbaperf/local/data/web_reports/vbaprod/Daily/VERITAS'
http://vbaperf:8089/vbaperf-webrpt
/vbaperf/local/data/web_reports/vbaperf/Daily/CPU Web Reports
/vbaperf/opt/bmc/Patrol3/Solaris210-sun4/remote Patrol
Code
/vbaperf/SUNWappserver9/domains/domain1/applications/j2ee-modules/vbaperf-webrpt/scripts
/vbaperf/home/s101dxg/haha/wr/apps/vbaperf-webrpt
The Cuddletech Veritas Cheat Sheet
by: B. Rockwood
benr@cuddletech.com
Overview:
--------
The purpose of this paper is to
quickly get you up to speed in Veritas,
and to act as a quick referance. All new
users to Veritas are HIGHLY encouraged to
first read the Veritas users guides enlucded
with Veritas, and found on docs.sun.com
Remember!: Almost all commands can use several
diffrent options that are similar
across all commands. The most used
of these is "-g
specifies which Disk Group the command
will be executed on. For instance,
vxinfo will only display volume information
for volumes in the rootdg, to see
volumes in the datadg, for instance, use:
Ex: "vxinfo -g datadg"
-----------------------------------------------
DISPLAY and MONITORING
-----------------------------------------------
vxdisk list
List all disks used by Veritas (VX).
vxdisk list
Display detailed information about a
single disk, including mutlipathing
information, size, type, Vx version,
and more.
vxprint
Display report style information about
the current status of all Vx componants,
including disks, subdisks, plexes, and
volumes.
vxprint
Display report style information about
the current status of ONLY the componant
you request. So for instance,
"vxprint vol01" shows information about
all subcomponants of vol01. This works
for plexes, disk groups, etc.
vxprint -hrt
Display detailed information about all
Vx componanats, including stwdith,
ncolumns, offsets, layout type, read-
policy, and more. This is best for
a true picture of your configuration.
vxdg list
Display listing and state information
of all Disk Groups.
vxdg list
Display detailed information about
a diskgroup, including flags, version,
logs status, etc.
vxinfo
Display volume status and volume type.
By default, only displays "rootdg",
to display a diffrent Disk Group,
use "vxinfo -g
vxassist maxgrow
This command will output the maximum size
the volume specified can increased by,
specified in sectors.
--------------------------------------------------
DISK TASKS and COMMANDS
--------------------------------------------------
vxdiskadd
Adds a disk to Vx by Initializing and Encapsolating
it. Specified by its device name (ex: c0t1d0s2).
NOTE: You'll need to reboot to finalize the
disk addition!
This command, can also be used to add a disk to
a specified disk group. Just follow the prompts.
No reboots needed for changing DG's.
vxedit rename
Rename a Vx disk. Ex: "vxedit rename disk01 disk05"
vxedit set reserve=on
Sets the "reserve" flag to a Vx disk. This
is used to keep specific disks from being
accidentally, or generally used.
vxdisk offline
Used to "offline" a disk. The disk should
be removed from its diskgroup before being
offlined.
vxdisk rm
Used to remove disks from Vx control completely.
Ex: "vxdisk rm c0t1d0s2" Make sure to
removed the disk from its diskgroup, and offline
the disk before removing it.
vxedit set spare=on
Sets the "spare" flag to a Vx disk. This is used
to make the specified disk a hot spare, which
is then added to the "hot spare pool".
vxedit set spare=off
Same as above but removes the disk from the
"hot spare pool".
----------------------------------------------------
DISK GROUPS and COMMANDS
----------------------------------------------------
vxdg init
Creates a new disk group, and assigns the naming
scheme to the first disk added to the group.
ex: "vxdg init newdg newdg01=c0t10d0s2".
NOTE: This is kinda tricky because the disk that
you're adding can't be a member of ANY DG, but
must be initialized. It's easier to use
"vxdiskadd", and add the disk to a newdg by
specifying a new DG name for the DG field.
vxdg deport
Disabled a diskgroup, but doesn't remove it. Often
used as an organized pool of disk to realocate, and
to moved DG's from one system to another.
vxdg import
Reverse of above. Enables local access to the specified
disk group.
vxdg -n
Change a Disk Groups name.
vxdg list
Use this to check the version numbers of Disk
Groups. Shows other details about the DG too.
vxdg destroy
Removes the specified DG, and frees all its disks
back to general use by Vx.
-= Quick Chart!: Disk Group Version Number Translation
VxVM Introduced Supported
Release Version Versions
------- ------------ ---------
1.2 10 10
1.3 15 15
2.0 20 20
2.2 30 30
2.3 40 40
2.5 50 50
3.0 60 20-60
-----------------------------------------------------------
SUBDISKS and COMMANDS
-----------------------------------------------------------
vxmake sd
Creates a subdisk with the specified name,
and by the offset and length specified.
ex: "vxmake sd disk02-01 disk02,0,8000"
NOTE: If you are going to add this subdisk
to a plex, its good to check the other
subdisks in that plex to see what their
lengths and offsets are, use the command:
"vxprint -st"
vxedit rm
Removes a subdisk.
vxsd assoc
Associates the specified subdisks to
the specified plex. Example:
"vxsd assoc vol01-03 disk01-01,disk02-01"
NOTE: Striped volumes are diffrent,
you need to specify the column# so
use the following:
vxsd -l
Same as above, but used for associating
subdisks to a striped plex. Use the command
"vxprint -st" to see what other subdisk
in the plex look like, and then set the
new subdisks column number and offset
(found in the seventh column of output)
to the appropriate value.
vxsd aslog
Adds a log subdisk to the specified plex.
Ex: "vxsd aslog vol01-02 disk03-01"
vxsd dis
Disassociates the specified subdisk from its
current plex.
------------------------------------------------------
PLEXS and COMMANDS
------------------------------------------------------
vxmake plex
Creates a new plex by the name specified and
assigns the specified subdisks to it.
vxmake plex
Like above command, but specifies layout type
as defined by
of striped and RAID5 plexes. The layout is
constrained by the defined number of columns,
and stripe width. Subdisks specified are
added to the created plex.
vxplex att
Associates specified plex with specified volume.
(Adds a mirror)
NOTE: Attachment will take a while. Watch
it with Vxtask, or via vxprint
vxplex dis
Disassociate specified plex from its connected
volume.
vxedit -r rm
Remove the plex.
vxmend off
Offlines a plex for repair to it's disks.
vxplex det
Detaches specified plex from its connected
volume, but maintians association with it's
volume. The plex is no longer used
for I/O untill it is (re)attached.
vxmend fix clean
Used to clean plexes that are in the
"unclean" state. Used with unstartable
volumes.
vxplex mv
Moves the data content from the origonal
plex onto a new plex.
NOTE: The old plex must be active (ENABLED).
The new plex should be the same length, or
larger than the old plex. The new plex
must not be associated with another volume.
(duh)
vxplex cp
Copies the data from the specified volume
to a new plex.
NOTE: The new plex cannot be associated
with any other volume. The new plex,
further, will NOT be attached to
the specified volume. (Also, see notes
from above)
-------------------------------------------------------
VOLUMES and COMMANDS
-------------------------------------------------------
vxassist make
Creates a new volume with the name specified
and is made to the length specified.
Ex: "vxassist make newvol 10m"
NOTE: This command will pull disk space
from the generally avalible Vx disk space.
vxassist make
Like the above command, but with layout specified.
The most common layouts are: striped and raid5
ex: "vxassist make newvol 100m layout=raid5 disk01 disk02 disk03"
NOTE: See the vxassist(1M) man page for more information.
vxmake vol
Creates a new volume of specified length (usually
in sectors), and attachs the specified plexes to that
volume. Useful for creating volumes to house
copied or moved plexes.
NOTE: See the vxmake(1M) man page for more information.
vxvol init
Manually sets the state of a volume.
NOTE: Not for the squimish.
vxassist maxsize [layout=raid5]
Returns the maximum size avalible via Vx to create
a new volume. By adding "layout=raid5" to the command
the calulations take into account losse due
to raid5. Output is in sectors and Megs.
vxassist maxgrow
Returns the maximum ammount of Vx space that
can be added to the specified volume.
vxassist mirror
Creates a mirror for the specified volume.
NOTE: Think of this as "handsfree plex creation".
This is fast, but the disks you want used
may not be used... often best to do manually.
vxassist addlog
Adds a Dirty Region Log (DRL) for the specified volume.
vxassist remove log
Reverse of above.
vxvol start
Starts a volume
vxvol stop
Stops a volume. Alternately you can use command as
such: "vxvol stopall" in order to stop all volumes.
vxassit growto/growby/shrinkto/shrinkby
Resizes the volume specified. Use one of the
following: growto, growby, shrinkto, and shrinkby
in order to descide what
By default length is specified in sectors.
This does not resize the filesystem inside the volume.
NOTE: Don't shrink volumes to be less that
its contained filesystem! (duh)
vxvol set len=
An alternate to above command. Sets the absolute
lenths of the specified volume to the length
specified, by default, in sectors. This
does not resize the filesystem inside the volume.
NOTE: There is also a resize(1M) command, used
for resizing both volume AND filesytem. See
the man page for that one.
vxedit rm
Removes the specified volume. (poof!)
NOTE: If the volume specified is in the ENABLED
state, you will need to use the command
"vxedit -f
with "f" will remove all plexes and subdisks
with the volume. If you didn't guess, "r"
is Recursive, and "f" is Force.
----------------------------------------------------------------
Misc Stuff:
To calculate the size of a filesystem inside a volume, use
the command:
fstyp -v
Ignore the errors. Output will look this this:
# fstyp -v /dev/vx/rdsk/datadg/vol01 | head -30 | grep ncg
ncg 17152 size 70254592 blocks 65863396
# Broken Pipe
Unknown_fstyp (no matches)
The size found after the label "size" is presented in kilobytes.
You can convert to sectors by multiplying by 2.
-----------
To calculate the size of a volume, use vxprint, and look for the
"len". The volume length is in sectors. Convert to kilobytes
by dividing by 2.
-------------
Volume Growth Procudure:
1) You can use vxassist to estimate the max size of
a given volume based on the disks you wish to add:
ex: # vxassist -g rootdg maxgrow vol01 disk01 disk02 disk03
2) Next, actually grow the volume (NOT THE FS) via the
command (assuming maxgrow outputed 10639360 as the maxsize):
ex:# vxassist -g rootdg growto vol01 10639360 disk01 disk02 disk03
3) Now VxVM grinds away, monitor with vxtask.
4) Now Grow the Filesystem, for UFS use:
# /usr/lib/fs/ufs/mkfs -F ufs -M /export /dev/vx/rdsk/rootdg/vol01 10639360
for VXFS ufs:
# /usr/lib/fs/vxfs/fsadm -b 10639360 -r /dev/vx/rdsk/rootdg/vol01 /mnt
---------------------------------------------------------------
5) Done!
----------
Changing User/Group of a Raw Volume: (ex:)
vxedit -g xxxdg set group=dba data_vol_123
vxedit -g xxxdg set user=oracle data_vol_123
======= Ben Rockwood == cuddletech.com ========================
---------------------------------------------------------------
#fcinfo hba-port
Example 2: Listing HBA ports and link statistics
The following command lists information for the HBA ports
and the link statistics for those ports:
# fcinfo hba-port -l 210000e08b074cb5 210100e08b274cb5
Example 3: Listing all remote ports
The following command lists all remote ports that are visi-
ble through the given HBA port:
# fcinfo remote-port -p 210100e08b274cb5
Startin Tuxedo
Done as tpadmin
Tmboot –y
Shutdown Tuxedo
Tmshutdown –y
Starting and Stopping Patrol
As patrolad
/vbaperf/usr/patrol
PatrolAgent –p 3183 –config /vbaperf/usr/patrol/3183.cfg
/etc/rc3.d
s90PatrolAgent stop|start
fix_hist
dump_hist
Oracle Listener
S51sqlnetv2 stop|start
S51tnslsnr Start|stop
tar -cvf - . | (cd /vbaperf/oradata/; tar xfBp -)
find . -name test1 -prune -o -name test2 -prune -o -print
find . -name test1 -prune -o -name test2 -prune -o -print|tar -cvf - . | (cd /tmp/exclude2/; tar xfBp -)
find . \( -name "package" -o -name "release" -o -name "buildscripts" \) -prune | cpio -pdumv ./package
find . -name test1 -prune -o -name test2 -prune -o -print|cpio -pdumv /tmp/exclude2
find . -name test1 -prune -o -print|cpio -pdumv /tmp/exclude2
find . -name test1 -prune -o -print | cpio -pdumv /tmp/exclude2
find . -name disk2 -prune -o -name oracle_devl -prune -o -name oradata -prune -o -name dbexport -prune -o -print | cpio -pdumv /vbaperf
nohup find . -name disk2 -prune -o -name oracle_devl -prune -o -name oradata -prune -o -name dbexport -prune -o -print | cpio -pdumv /vbaperf &
vbaperf:$ pwd
/devl/vnetbatch5/vbaperf-backup/oradata
vbaperf:$ nohup tar -cvf - . | ( cd /vbaperf/oradata/; tar xfBp - ) &
[1] 26180
0 comments:
Post a Comment