Visit Counter

Tuesday, March 14, 2017

Restore Oracle Database on Different Host but same file location


Oracle 12c Database
Solaris 11.2 Sparc 64-bit


Scenario: 

I restored full database from source to destination server but not a different location.
I already took the full backup of source and moved destination server. Actually my source server having large memory...So manually I created parameter file (Pfile) to start up the database.



-bash-4.1$ cat initinforln.ora
inforln.__data_transfer_cache_size=0
inforln.__db_cache_size=3422552064
inforln.__java_pool_size=16777216
inforln.__large_pool_size=33554432
inforln.__oracle_base='/ora/app/oracle12c'#ORACLE_BASE set from environment
inforln.__pga_aggregate_target=1509949440
inforln.__sga_target=4529848320
inforln.__shared_io_pool_size=234881024
inforln.__shared_pool_size=805306368
inforln.__streams_pool_size=0
*.audit_file_dest='/ora/app/oracle12c/admin/inforln/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/ora/app/oracle/oradata/inforln/control01.ctl','/ora/app/oracle12c/fast_recovery_area/inforln/control02.ctl'
*.db_block_size=32768
*.db_domain=''
*.db_name='inforln'
*.db_recovery_file_dest='/ora/app/oracle12c/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/ora/app/oracle12c'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=inforlnXDB)'
*.enable_pluggable_database=true
#*.local_listener='LISTENER_INFORLN'
*.log_archive_dest_1='LOCATION=/ora/app/oracle/oradata/archive1'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=1437m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=4313m
*.undo_tablespace='UNDOTBS1'
*._use_osm=FALSE
-bash-4.1$







SQL> select dbid from v$database;

      DBID
----------
1270400239




RMAN> list backup


....

....

....

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
55      22.55M     DISK        00:00:01     07-MAR-17
        BP Key: 55   Status: AVAILABLE  Compressed: NO  Tag: TAG20170307T121936
        Piece Name: /ora/dbfullbk/full_1qruhiaq_58_1

  List of Archived Logs in backup set 55
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    486     11861751   07-MAR-17 11864486   07-MAR-17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
56      Full    17.48M     DISK        00:00:03     07-MAR-17
        BP Key: 56   Status: AVAILABLE  Compressed: NO  Tag: TAG20170307T121941
        Piece Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/o1_mf_s_938002781_dcwysjqh_.bkp
  SPFILE Included: Modification time: 06-MAR-17
  SPFILE db_unique_name: INFORLN
  Control File Included: Ckp SCN: 11864497     Ckp time: 07-MAR-17



COPY CONTROLFILE AUTOBACUP FILE FROM SOURCE SERVER


$ scp o1_mf_s_938002781_dcwysjqh_.bkp 1           92.0.0.47:/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/
Password:
o1_mf_s_938002781_dc 100% |*********************************************************************| 17920 KB    00:00



DESTINATION SERVER




RMAN> restore controlfile from '/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/o1_mf_s_938002781_dcwysjqh_.bkp';

Starting restore at 14-MAR-17
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/ora/app/oracle/oradata/inforln/control01.ctl
output file name=/ora/app/oracle12c/fast_recovery_area/inforln/control02.ctl
Finished restore at 14-MAR-17



RMAN> alter database mount;


COPY DATABASE BACKUP FILE TO DESTINATION SERVER

I moved from source database folder to destination folder path given below. Source path same

#scp * 192.0.0.47:/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup




RMAN> catalog start with '/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup';

searching for all files that match the pattern /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup

List of Files Unknown to the Database
=====================================
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1mruhh66_54_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1pruhi99_57_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1qruhiaq_58_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1oruhi6a_56_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1nruhi06_55_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1mruhh66_54_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1pruhi99_57_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1qruhiaq_58_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1oruhi6a_56_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1nruhi06_55_1


Now Restore Database plus recover


RMAN> run {
2> restore database;
3> recover database;
4> }

Starting restore at 14-MAR-17
using channel ORA_DISK_1

skipping datafile 1; already restored to file /ora/app/oracle/oradata/inforln/system01.dbf
skipping datafile 3; already restored to file /ora/app/oracle/oradata/inforln/sysaux01.dbf
skipping datafile 5; already restored to file /ora/app/oracle/oradata/inforln/undotbs01.dbf
skipping datafile 6; already restored to file /ora/app/oracle/oradata/inforln/users01.dbf
skipping datafile 7; already restored to file /ora/app/oracle/oradata/inforln/pinforln/system01.dbf
skipping datafile 8; already restored to file /ora/app/oracle/oradata/inforln/pinforln/sysaux01.dbf
skipping datafile 9; already restored to file /ora/app/oracle/oradata/inforln/pinforln/pinforln_users01.dbf
skipping datafile 10; already restored to file /ora/app/oracle/oradata/inforln/pinforln/xdb_INFORLN01.dbf
skipping datafile 11; already restored to file /ora/app/oracle/oradata/inforln/pinforln/idx_INFORLN01.dbf
skipping datafile 12; already restored to file /ora/app/oracle/oradata/inforln/pinforln/undots01.dbf
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /ora/app/oracle/oradata/inforln/pdbseed/system01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /ora/app/oracle/oradata/inforln/pdbseed/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /ora/dbfullbk/full_1pruhi99_57_1
channel ORA_DISK_1: piece handle=/ora/dbfullbk/full_1pruhi99_57_1 tag=TAG20170307T121358
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 14-MAR-17

Starting recover at 14-MAR-17
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=486
channel ORA_DISK_1: reading from backup piece /ora/dbfullbk/full_1qruhiaq_58_1
channel ORA_DISK_1: piece handle=/ora/dbfullbk/full_1qruhiaq_58_1 tag=TAG20170307T121936
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/ora/app/oracle/oradata/archive1/1_486_933728367.dbf thread=1 sequence=486
unable to find archived log
archived log thread=1 sequence=487
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/14/2017 12:34:13
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 487 and starting SCN of 11864486


I copied missing archives from source to destination server.

RMAN> run {
allocate channel t1 type disk;
recover database;
release channel t1;
}



RMAN>exit



-bash-4.1$ ./rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Mar 14 14:24:14 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: INFORLN (DBID=1270400239, not open)

RMAN> alter database open resetlogs;

using target database control file instead of recovery catalog
Statement processed

RMAN> exit




Refer:


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=247610951693761&id=1300586.1&_afrWindowMode=0&_adf.ctrl-state=vsv5cduf0_74


Monday, March 13, 2017

ORA-27102 Out of memory / Not enough space



I try to startup database getting below error. 

Solaris 11 64 Sparc Database 12c 


SQL> conn / as sysdba 
Connected to an idle instance. 
SQL> startup nomount pfile='/ora/app/oracle/product/12.2.0/dbhome_1/dbs/initinforln.ora'; 
ORA-27102: out of memory 
SVR4 Error: 12: Not enough space 
Additional information: 1671 
Additional information: 16106127360 
Additional information: 4513071104 
SQL> exit 
Disconnected 






Alert.log file
----------------

Mon Mar 13 12:30:57 2017 
Dump of system resources acquired for SHARED GLOBAL AREA (SGA) 

Mon Mar 13 12:30:57 2017 
Available system pagesizes: 
8K, 64K, 512K, 4096K, 32M, 256M 
Mon Mar 13 12:30:57 2017 
Supported system pagesize(s): 
Mon Mar 13 12:30:57 2017 
PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s) 
Mon Mar 13 12:30:57 2017 
4096K Configured 10 1 ORA-27102 
Mon Mar 13 12:30:57 2017 
32M Configured 6 0 ORA-27102 
Mon Mar 13 12:30:57 2017 
256M Configured 16 0 ORA-27102 
Mon Mar 13 12:30:57 2017 
Reason for not supporting certain system pagesizes: 
Mon Mar 13 12:30:57 2017 
8K - Pagesize not supported by shared memory type 
Mon Mar 13 12:30:57 2017 
64K - Pagesize not supported by shared memory type 
Mon Mar 13 12:30:57 2017 
512K - Pagesize not supported by shared memory type 
Mon Mar 13 12:30:57 2017 
********************************************************************** 
-bash-4.1$ 




Solution:

I  added below parameter in parameter file and reboot the system.

Please check the following note: 
12C Database Instance Startup Fails With ORA-27102: OUT OF MEMORY Error On Solaris ( Doc ID 1987090.1 ) 

A workaround that has proven successful is to set the following parameter in the init/spfile and restart the database 



*._use_osm=FALSE





SQL>  startup nomount pfile='/ora/app/oracle/product/12.2.0/dbhome_1/dbs/initinforln.ora';
ORACLE instance started.

Total System Global Area 4529848320 bytes
Fixed Size                  2922936 bytes
Variable Size             973080136 bytes
Database Buffers         3539992576 bytes
Redo Buffers               13852672 bytes

SQL>







Refer:


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=192956862419777&parent=SrDetailText&sourceId=3-14469331361&id=1987090.1&_afrWindowMode=0&_adf.ctrl-state=17xaia30lx_368





Tuesday, March 7, 2017

Creating, Destroying, and Renaming ZFS File Systems in Solaris 11 Sparc




Solaris 11 Sparc
--------------------

ZFS file systems can be created and destroyed by using the zfs create and zfs destroy commands. ZFS file systems can be renamed by using the zfs rename command.


Last time I added two new disks in M3000 Sparc Server which running on Solaris 11.3



Creating a ZFS file system

Destroying a ZFS file system
Renaming a ZFS file system



root@afi-ssaerp:/# zpool status

  pool: datapool
 state: ONLINE
  scan: none requested
config:

        NAME       STATE     READ WRITE CKSUM

        datapool   ONLINE       0     0     0
          c2t40d0  ONLINE       0     0     0

errors: No known data errors


  pool: lnpool

 state: ONLINE
  scan: none requested
config:

        NAME      STATE     READ WRITE CKSUM

        lnpool    ONLINE       0     0     0
          c1t2d0  ONLINE       0     0     0
          c1t3d0  ONLINE       0     0     0

errors: No known data errors


  pool: rpool

 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM

        rpool          ONLINE            0     0     0
        c1t0d0s0   ONLINE              0     0     0

errors: No known data errors


root@afi-ssaerp:/#


 #  zpool create c1t2d0 c1t3d0 lnpool  (Pool Name)

   
#  zpool create lnpool c1t2d0 c1t3d0    

root@afi-ssaerp:~# format

Searching for disks...done



AVAILABLE DISK SELECTIONS:

       0. c1t0d0 <FUJITSU-MBD2147RC-3701 cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@0,0
       1. c1t1d0 <FUJITSU-MBB2147RC-3703 cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@1,0
       2. c1t2d0 <HGST-H101860SFSUN600G-A990-558.91GB>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@2,0
       3. c1t3d0 <HGST-H101860SFSUN600G-A3T0-558.91GB>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@3,0
       4. c2t40d0 <SUN-StorEdge 3510-327R-681.16GB>
          /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w216000c0ff87d4cf,0



Specify disk (enter its number):



root@afi-ssaerp:~#  zpool list


NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT

datapool   680G   204K   680G   0%  1.00x  ONLINE  -
lnpool    1.09T   186K  1.09T   0%  1.00x  ONLINE  -
rpool      136G   133G  3.13G  97%  1.00x  ONLINE  -


root@afi-ssaerp:~#



Creating a ZFS file system



# df -h


lnpool                 1.1T    31K       1.1T     1%    /lnpool

lnpool/test            1.1T    31K       1.1T     1%    /test
lnpool/inforln         1.1T    31K       1.1T     1%    /inforln


 # zfs create lnpool/test



# zfs set mountpoint=/inforln lnpool/inforln





root@afi-ssaerp:/# zfs get mountpoint lnpool/ora

NAME        PROPERTY    VALUE  SOURCE
lnpool/inforln  mountpoint  /inforln   local


Destroying a ZFS File System



To destroy a ZFS file system, use the zfs destroy command. The destroyed file system is automatically unmounted and unshared. For more information about automatically managed mounts or automatically managed shares, see Automatic Mount PointsIn the following example, the test file system is destroyed:





root@afi-ssaerp:/# zfs list
NAME                              USED  AVAIL  REFER  
lnpool                                234K  1.07T    31K  /lnpool
lnpool/inforln                     31K  1.07T    31K  /inforln
lnpool/ora                           31K  1.07T    31K  /ora
lnpool/test                           31K  1.07T    31K  /test




root@afi-ssaerp:/# zfs destroy lnpool/test




root@afi-ssaerp:/# zfs list

NAME                              USED  AVAIL  REFER 

lnpool/inforln                     31K  1.07T    31K  /inforln
lnpool/ora                           31K  1.07T    31K  /ora



remove test folder from / mount point
# rm -rf test






Renaming a ZFS file system


While renameing the zfs file system getting error: Cannot Un mount '/ora' device busy




root@afi-ssaerp:~# zfs rename rpool/ora rpool/ora1



cannot unmount '/ora': Device busy

We have to unmount the mountpoint /ora using below command.

root@afi-ssaerp:~# zfs umount -f /ora



root@afi-ssaerp:~# zfs rename rpool/ora rpool/ora1

root@afi-ssaerp:~# zfs mount rpool/ora1

root@afi-ssaerp:~# zfs mountpoint=ora1 rpool/ora1

root@afi-ssaerp:~# df -h
....


rpool/ora1              55G    12G       380M    97%    /ora1


Refer:


http://docs.oracle.com/cd/E19253-01/819-5461/gamnq/index.html