Tuesday, April 17, 2012

gather_system_stats

SQL> exec dbms_stats.gather_system_stats (gathering_mode => 'noworkload');

PL/SQL procedure successfully completed.

SQL> select sname, pname, pval1 from sys.aux_stats$;
Resize undo table space

1. define a new temporary undo tablespace
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/ccbprod/oradata/ccbprod/UNDOTBS2.dbf' SIZE 100M
AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M ;

Monday, April 16, 2012

Convert UNIX to DOS format using sed command

Type the following command if you are using bash shell:
$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt

Convert DOS newlines (CR/LF) to Unix format using sed command
If you are using BASH shell type the following command (press Ctrl-V then Ctrl-M to get pattern or special symbol)
$ sed 's/^M$//' input.txt > output.txt

NCARGS value configuration for AIX 5.1


NCARGS value configuration (5.1.0)
In AIX 5L Version 5.1, the option has been added to allow the super user or
any user belonging to the system group to dynamically change the value of
the NCARGS parameters. In previous releases of AIX, these values were
permanently defined as 24576, which resulted in a problem similar to that
shown below when a large number of arguments are parsed to a command:
# rm FILE*
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

The value of NCARGS can be increased to overcome this problem. The value
can be tuned anywhere within the range of 24576 to 524288 in 4 KB page
size increments. To display the value, use the following command.


Typical production init file (10g)

#####################################################################
# Common parms
#####################################################################
ifile = ?/dbs/orabase-dg.ora
#####################################################################
# Structural Parms
#####################################################################
db_domain = psoug
db_block_size = 8192
db_writer_processes = 8
Thread 1 cannot allocate new log

Sometimes, you can see in your alert.log file, the following corresponding
messages:


  Thread 1 advanced to log sequence 248
    Current log# 2 seq# 248 mem# 0: /prod1/oradata/logs/redologs02.log

  Thread 1 cannot allocate new log, sequence 249
  Checkpoint not complete

Resize Redo log

If the redo logs need to be resized, the following steps can be taken. 
1.  Create new log group members with the following command:

ALTER DATABASE ADD LOGFILE
GROUP 4 (    '/ccbprod/oradata/ccbprod/REDO04A.LOG',
        '/ccbprod/oradata/ccbprod/REDO04B.LOG') SIZE 1280M reuse,
GROUP 5 (    '/ccbprod/oradata/ccbprod/REDO05A.LOG',
        '/ccbprod/oradata/ccbprod/REDO05B.LOG') SIZE 1280M reuse,
GROUP 6 (    '/ccbprod/oradata/ccbprod/REDO06A.LOG',
        '/ccbprod/oradata/ccbprod/REDO06B.LOG') SIZE 1280M reuse;