Monday, February 28, 2011

Multiplexing Redolog files:



Steps for Renaming Redo Log Members

Shut down the database.

SHUTDOWN

Copy the redo log files to the new location.

Operating system files, such as redo log members, must be copied using the appropriate operating system commands.


Note:

You can execute an operating system command to copy a file (or perform other operating system commands) without
exiting SQL*Plus by using the HOST command. Some operating systems allow you to use a character in place of the
word HOST. For example, you can use an exclamation point (!) in UNIX.
The following example uses operating system commands (UNIX) to move the redo log members to a new location:

mv /diska/logs/log1a.rdo /diskc/logs/log1c.rdo
mv /diska/logs/log2a.rdo /diskc/logs/log2c.rdo

Startup the database, mount, but do not open it.

CONNECT / as SYSDBA
STARTUP MOUNT

Rename the redo log members.

Use the ALTER DATABASE statement with the RENAME FILE clause to rename the database redo log files.

ALTER DATABASE
  RENAME FILE '/diska/logs/log1a.rdo', '/diska/logs/log2a.rdo'
           TO '/diskc/logs/log1c.rdo', '/diskc/logs/log2c.rdo';

Open the database for normal operation.

The redo log alterations take effect when the database is opened.

ALTER DATABASE OPEN;

Query to check that redolog files locations.

Sql> select GROUP#,member from v$logfile;




Multiplexing control files using SPFILE OR PFILE


Multiplexing Control file using SPFILE

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u02/abcprod/db/tech_st/11.2.0
                                                 /dbs/spfilePROD.ora

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/abcprod/db/apps_st/data/cntrl01.dbf
/u01/abcprod/db/apps_st/data/cntrl02.dbf
/u01/abcprod/db/apps_st/data/cntrl03.dbf

SQL> ALTER SYSTEM SET CONTROL_FILES = '/u01/abcprod/db/apps_st/data/cntrl01.dbf'
  2  ,'/u02/abcprod/db/tech_st/11.2.0/prod_controlfile/cntrl02.dbf',
  3  '/u03/abcprod/prod_controlfile/cntrl03.dbf' SCOPE = SPFILE;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

Using cp or mv command to copy or move the control file to their location.

$ cp cntrl02.dbf /u02/abcprod/db/tech_st/11.2.0/prod_controlfile/
$ cp cntrl03.dbf /u03/abcprod/prod_controlfile/


Start the database

SQL> startup

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/abcprod/db/apps_st/data/cntrl01.dbf
/u02/abcprod/db/tech_st/11.2.0/prod_controlfile/cntrl02.dbf
/u03/abcprod/prod_controlfile/cntrl03.dbf

SQL>


Multiplexing Control file using PFILE

Shutdown the database

Edit the control_files parameter from init_ORACLESID.ora file

control_files='/u01/abcprod/db/apps_st/data/cntrl01.dbf',
'/u02/abcprod/db/tech_st/11.2.0/prod_controlfile/cntrl02.dbf',
'/u03/abcprod/prod_controlfile/cntrl03.dbf';

save the pfile

Now move or copy the control files to their appropraite locations using cp or mv command

Start the database



Tuesday, February 15, 2011

Mounting of NFS File System on HP-UX 11.31 Server.


Source Server : Server whose file system you want to share
Destination Server : Server where you want to mount.

From the HP-UX 11.31 Source Server :

e.g I want to mount /stage/StageR12 on HP-UX Destination Server.

# share -F nfs -o rw /stage/StageR12/
# share -- will show which file system you want to share.
     -       /stage/StageR12 rw " "
#

# shareall

From the HP-UX 11.31 Destination Server :

# mount hostname:/stage/StageR12/ /backup/stage/
or
# mount ipaddress:/stage/StageR12/ /backup/stage/


Unmounting of NFS File System

Destination Server:

# umount /backup/stage/

  if getting error
#  umount /mountpoint    e.g # umount /backup/stage/
   umount: cannot unmount /dev/disk/disk23 : Device busy
   umount: return error 1.

 Run :

# fuser -kuc /mountpoint e.g # fuser -kuc /backup/stage/

# umount /backup/stage/

Source Server :

# unshare /stage/StageR12/

#unshareall if using shareall command on source server