Re: More spfile goodness

  • From: Mladen Gogala <mladen@xxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 5 May 2004 15:41:09 -0400

On 05/05/2004 12:31:28 PM, Pete Sharman wrote:
>
> ecoverable from simply by opening the SPFILE, highlighting the complete fil=
> e except the binary first line and pasting it into another editor window.  =

The civilized way of doing this would be:
strings 
$ORACLE_HOME/dbs/spfile$ORACLE_SID.ora>$ORACLE_HOME/dbs/init$ORACLE_SID.ora
It gives results like:
[root@tux925 root]# su - oracle
-bash-2.05b$ cd $ORACLE_HOME/dbs
-bash-2.05b$ strings spfile$ORACLE_SID.ora|head -10
*.aq_tm_processes=1
*.background_dump_dest='/pub/oracle/admin/CMPL/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/data1/CMPL/ctl/control01.ctl','/data2/CMPL/ctl/control02.ctl','/data3/CMPL/ctl/control03.ctl'
*.core_dump_dest='/pub/oracle/admin/CMPL/cdump'
*.db_block_size=8192
*.db_cache_advice='OFF'
*.db_cache_size=402653184
*.db_domain='wangtrading.com'
*.db_file_multiblock_read_count=32

That asterisk in front of the parameter means "for all available instances". I 
have only one
instance, but it will still work. To make Jared's heart beat faster, this also 
works:

#!/usr/bin/perl -w
use strict;
my $HOME=$ENV{"ORACLE_HOME"};
my $SID=$ENV{"ORACLE_SID"};
die "Please check your Oracle environment vars!\n" if (!defined $HOME or 
!defined $SID);
my $file="$HOME/dbs/spfile$SID.ora";
open (IN,"<",$file) or die "Cannot open $file:$!\n";
while (<IN>) {
  print $_ if ( $_ =~ /^\*\./) ;
}


That is, essentially, the same as:

egrep --binary-files=text "^\*\." $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora

-- 
Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege 
is waived or lost by any mistransmission.  If you receive this message in 
error, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender.  You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient. Wang Trading LLC and any of its 
subsidiaries each reserve the right to monitor all e-mail communications 
through its networks.
Any views expressed in this message are those of the individual sender, except 
where the message states otherwise and the sender is authorized to state them 
to be the views of any such entity.

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: