Wednesday, February 14, 2018

Using spfile with unix softlink in oracle

Use softlink  with spfile in oracle

If we use softlink for spfile then orginal spfile can be on different location  and in dbs use softlink point to original file.




[oracle@localhost ~]$
[oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost db_1]$ cd dbs
[oracle@localhost dbs]$ ls -lrt
total 19108
-rw-r--r-- 1 oracle oinstall    2851 May 15  2009 init.ora
-rw-r----- 1 oracle oinstall      24 Dec 20 19:18 lkDUCAT
-rw-r----- 1 oracle oinstall    1536 Dec 27 21:32 orapwducat
-rw-r----- 1 oracle oinstall      24 Jan  2 20:25 lkTEST
-rw-r----- 1 oracle oinstall    1536 Jan 15 23:26 orapwtest
-rw-r----- 1 oracle oinstall 9748480 Jan 15 23:37 snapcf_test.f
-rw-rw---- 1 oracle oinstall    1544 Jan 19 17:59 hc_test.dat
-rw-r----- 1 oracle oinstall    2560 Jan 19 18:00 spfiletest.ora
-rw-r----- 1 oracle oinstall 9781248 Feb  3 22:41 snapcf_ducat.f
-rw-rw---- 1 oracle oinstall    1544 Feb 12 20:29 hc_ducat.dat
-rw-r----- 1 oracle oinstall    3584 Feb 13 12:06 spfileducat.ora
[oracle@localhost dbs]$
[oracle@localhost dbs]$ mkdir /u01/app/oracle/backup/pfile
[oracle@localhost dbs]$
[oracle@localhost dbs]$ cp * /u01/app/oracle/backup/pfile
[oracle@localhost dbs]$
[oracle@localhost dbs]$ ls -prt /u01/app/oracle/backup/pfile
hc_ducat.dat  hc_test.dat  init.ora  lkDUCAT  lkTEST  orapwducat  orapwtest  snapcf_ducat.f  snapcf_test.f  spfileducat.ora  spfiletest.ora
[oracle@localhost dbs]$
[oracle@localhost dbs]$
[oracle@localhost dbs]$ rm *
[oracle@localhost dbs]$ ls
[oracle@localhost dbs]$
[oracle@localhost dbs]$
[oracle@localhost dbs]$ ln -s /u01/app/oracle/backup/pfile/spfileducat.ora .
[oracle@localhost dbs]$ ls -lrt
total 0
lrwxrwxrwx 1 oracle oinstall 44 Feb 14 19:00 spfileducat.ora -> /u01/app/oracle/backup/pfile/spfileducat.ora
[oracle@localhost dbs]$
[oracle@localhost dbs]$
[oracle@localhost dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 14 19:00:36 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             654312576 bytes
Database Buffers          381681664 bytes
Redo Buffers                5632000 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
DUCAT     READ WRITE

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost dbs]$ ls -lrt
total 8
lrwxrwxrwx 1 oracle oinstall   44 Feb 14 19:00 spfileducat.ora -> /u01/app/oracle/backup/pfile/spfileducat.ora
-rw-r----- 1 oracle oinstall   24 Feb 14 19:01 lkDUCAT
-rw-rw---- 1 oracle oinstall 1544 Feb 14 19:01 hc_ducat.dat
[oracle@localhost dbs]$

No comments:

Post a Comment