Restore Don’t Need DBID If You Use A Tag

The last day a coworker asked me to take a look at a rman script that I had to launch to start recovering a database. He specified the DBID and a TAG to restore the control file. Since the database is not mounted and we are recovering from a backup catalog, at some point we have to tell RMAN which database we want to recover (this catalog has hundreds of databases). Usually the “set dbid” clause is used to tell you which database we are interested in. But he previously made a backup of the database using the TAG clause in the backup database. In this case if you use the TAG you will not have to specify the BDID, since Oracle associates it with said tag.

The script would be as follows

 

connect target /
connect rcvcat backup/xxxxx@catalog;

#### set dbid 325364398  -- Don't neccesary

spool log to '/exp/home/ora12c/util/LOG/restore_cf.log';

run {

         allocate channel t1 type 'SBT_TAPE' MAXPIECESIZE 700G
         parms 'ENV=(NSR_DATA_VOLUME_POOL=Prod_Pool,
                                     NSR_CLIENT=bckcli.domain.one,
                                     NSR_SERVER=bckser.domain.one)';

         restore controlfile from tag backup_migra12c_v2_290617 ;

}

HTH – Antonio NAVARRO

 

How To Put Comments Using Spfile

More than once I have been asked, co-workers, or people in a forum if you can put comments on an SPFILE. In the old times it was very usual to comment when changing a parameter (with the date of the change and the old value in case there were performance problems) or when you put some new parameter. Seeing these changes was easy, since the init.ora is at the end a text file. The problem we can have with SPFILE since this is a bianrio file, ofcourse to you can make a strings to SPFILE and see some things. The correct thing is to dump SPFILE to a text file.

So, to put a comment in SPFILE the same alter sentence allows us with the comment clause, look at the example below;

alter system set “optimizer_adaptive_features”=true comment =’21.06.2017 Changed by Antonio NAVARRO’ scope=both sid=’*’;

HTH – Antonio NAVARRO

 

Multiple Alias Comma Separated For A Connect String

In this entry I like show a simple way of use multiple alias for the same connect string, usually you use the following structure

FINANCIAL  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS =
         (COMMUNITY= TCPCOM)(PROTOCOL = TCP)(HOST = zeus.world.es)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sapdb)
    )
  )
EMPLOYEES  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS =
         (COMMUNITY= TCPCOM)(PROTOCOL = TCP)(HOST = zeus.world.es)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sapdb)
    )
  )
TAX  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS =
         (COMMUNITY= TCPCOM)(PROTOCOL = TCP)(HOST = zeus.world.es)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sapdb)
    )
  )

 

But you can get the same result by use comma separated;

FINANCIAL,EMPLOYEES,TAX  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS =
         (COMMUNITY= TCPCOM)(PROTOCOL = TCP)(HOST = zeus.world.es)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sapdb)
    )
  )

HTH – Antonio NAVARRO

 

How To Delete A Entry From SPFILE

Last day I updated the spfile, but I made a mistake, I write a non-existing SID, I want wrote IND1 (Instance number one) but wrote IND11. Now I have a entry for instance IND11. This is a typical error.

For remove it from spfile you must to reset the parameter as show below;

alter system reset memory_target scope=spfile sid=’IND11′;

Now I have a nice spfile. Next time I must to be more carefull.

HTH – Antonio NAVARRO.

ORA-19870 ORA-19504 ORA-17502 ORA-15041 When Restoring Backup

I was restoring a backup to Flex ASM instance when I get the next errorstack;

 
channel t4: restoring datafile 00069 to +CLOUD_PROD_DATA_DISKG
channel t4: restoring datafile 00075 to +CLOUD_PROD_DATA_DISKG
channel t4: restoring datafile 00077 to +CLOUD_PROD_DATA_DISKG
channel t4: reading from backup piece dbwebdb_c0s464nj_1_1
channel t1: ORA-19870: error while restoring backup piece dbclout_c1f432tc_1_1
ORA-19504: failed to create file "+CLOUD_PROD_DATA_DISKG"
ORA-17502: ksfdcre:4 Failed to create file +CLOUD_PROD_DATA_DISKG
ORA-15041: diskgroup "CLOUD_PROD_DATA_DISKG" space exhausted

I checked the space. Usually before start the restore look at the filesystem or ASM to check free space. From asmcmp (I like with -p parameter);

ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  4194304      5116       52                0              52              0             N  ACFS_CLOUD_PROD_TRZ_DG/
MOUNTED  EXTERN  N         512   4096  4194304      1020       52                0              52              0             N  ACFS_CLOUD_PROD_UDD_DG/
MOUNTED  NORMAL  N         512   4096  1048576     30717    21271            10239            5516              0             Y  OCRVTD_DG/
MOUNTED  EXTERN  N         512   4096  4194304     71676    71544                0           71544              0             N  CLOUD_PROD_ARCCLD1_DG/
MOUNTED  EXTERN  N         512   4096  4194304     71676    71548                0           71548              0             N  CLOUD_PROD_ARCCLD2_DG/
MOUNTED  EXTERN  Y         512   4096  4194304    747476   425468                0          425468              0             N  CLOUD_PROD_DATA_DISKG/
MOUNTED  EXTERN  N         512   4096  4194304      5116     4372                0            4372              0             N  CLOUD_PROD_RC1_DG/
MOUNTED  EXTERN  N         512   4096  4194304      5116     4372                0            4372              0             N  CLOUD_PROD_RC2_DG/

Of course, the column Rebal(ance) has value Y, ummm I suppose a new disk was added to the diskgroup but no rebalanced. With the nexts commands you can rebalance all the DG.

Execute the rebalance of my diskgroup;

rebal CLOUD_PROD_DATA_DISKG

To monitoring rebalancing;

lsop

I tryed the restores again with a happy end.

HTH – Antonio NAVARRO