Jul 16, 2015

Moving Spfile from File System to ASM Disk


[oracle@vbox-01 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jul 15 08:00:15 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/spfilefaizal.ora

SQL> create pfile='/home/oracle/initfaizal.ora' from spfile;

File created.

SQL> create spfile='+DATA' from pfile='/home/oracle/initfaizal.ora';

File created.

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

SQL> exit
 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options

[oracle@vbox-01 ~]$ cd $ORACLE_HOME/dbs
[oracle@vbox-01 dbs]$ ls -ltr *faizal*

-rw-r----- 1 oracle oinstall 1536 Jul 15 07:23 orapwfaizal
-rw-r----- 1 oracle oinstall 4608 Jul 15 07:48 spfilefaizal.ora
-rw-rw---- 1 oracle oinstall 1544 Jul 15 07:57 hc_faizal.dat
[oracle@vbox-01 dbs]$
[oracle@vbox-01 dbs]$ mv spfilefaizal.ora spfilefaizal.ora.bck

[oracle@vbox-01 dbs]$ export ORACLE_SID=+ASM
ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
 
Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JUL 15 08:00:00  Y    spfile.313.885110543
ASMCMD> pwd
+data/FAIZAL/PARAMETERFILE

# you must give init.ora not spfile.ora
[oracle@vbox-01 dbs]$ vi initfaizal.ora 
[oracle@vbox-01 dbs]$
[oracle@vbox-01 dbs]$ cat initfaizal.ora
spfile='+DATA/faizal/parameterfile/spfile.313.885110543'

[oracle@vbox-01 dbs]$ ls -ltr *faizal*
-rw-r----- 1 oracle oinstall 1536 Jul 15 07:23 orapwfaizal
-rw-r----- 1 oracle oinstall 4608 Jul 15 07:48 spfilefaizal.ora.bck
-rw-r--r-- 1 oracle oinstall   61 Jul 15 07:54 initfaizal.ora
-rw-rw---- 1 oracle oinstall 1544 Jul 15 07:57 hc_faizal.dat
[oracle@vbox-01 dbs]$
[oracle@vbox-01 dbs]$ export ORACLE_SID=faizal
[oracle@vbox-01 dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jul 15 08:05:30 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup;

ORACLE instance started.
Total System Global Area 1.2827E+10 bytes
Fixed Size                  2265224 bytes
Variable Size            6140465016 bytes
Database Buffers         6677331968 bytes
Redo Buffers                7307264 bytes
Database mounted.
Database open.

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/faizal/parameterfile/spfile.313.885110543

Done

 

No comments: