Skip to main content

Posts

RMAN : Duplicate database without connecting to target

Using "backup location", I do not need to connect to target database, but how do I know what "until time" is available in the backup pieces? one way is to find the backup piece information from target database by using "list backup...", but what if I do not have the target database at all? while, I can arbitrarily give a time, then RMAN will tell me what is the time in those back pieces, nice! Steps captured! 1.create the RAC database using dbca 2.create spfile='+oradata/bcfw/spfileBCFW.ora' from pfile='/tmp/pfile.ora'.     alter system set cluster_database=false scope=memory 3.srvctl start instance -d dbname -i dbname1 -o nomount 4.export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss' 5.rman> duplicate database /* the backup was done using this: RUN {   ALLOCATE CHANNEL ch11 TYPE DISK MAXPIECESIZE 1G;   BACKUP as COMPRESSED backupset   FORMAT '/u01/dba/jsun/%d_D_%T_%u_s%s_p%p'   DATABASE   PLUS ARCHIVELOG   FORM...

RAC GI patch version mismatched

After GI is patched. the " kfod op=PATCHLVL " and " crsctl query crs softwarepatch " ,output mismatched from node 3 comparing to node 1&2, though "opatch lsinventory" output match... Patch ID  28729169 and  4104219146 were not in the output of " kfod op=PATCHES   " on node 3. Created oracle SR, the support suggested the following steps to fix the issue. root>patchgen commit -pi 28729169  root>patchgen commit -pi  4104219146    check the below on all nodes and notify if there is any difference  kfod op=PATCHLVL  kfod op=PATCHES  If they are same run the below  # rootcrs.sh -patch  That fixed the problem.

Command to find patch folders that can be deleted from .patch_storage

According to this Doc, I can remove the patch folder in .patch_storage if the patch is not listed in opatch inventory. How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space. (Doc ID 550522.1) The following two scripts work the same way, they list the patch number that has zero match in opatch inventory. #1: $ORACLE_HOME/OPatch/opatch lsinventory>dropit; for patch in `ls|cut -d "_" -f 1|grep [0-9]`;   do echo $patch:`grep -c $patch dropit`; done|awk -F":" '{if ($2==0) print $0}' #2 ls $ORACLE_HOME/.patch_storage|cut -d "_" -f 1|grep [0-9] > patchstorage.txt; $ORACLE_HOME/OPatch/opatch lsinventory>opatchinventory.txt; for patch in `cat patchstorage.txt`; do echo $patch:`grep -c $patch opatchinventory.txt`; done|awk -F":" '{if ($2==0) print $0}' sample output: 19872484:0 20299018:0 20831113:0 21436941:0 23854735:0 #3: this will display the ls command of those pat...

Powershell to collect SQLServer compliant info Verson 2

We established some best practice rules for SQL Server, we need method to collect these data and analyze the compliance. Powershell script is our solution。 The Best Practice rules are: ##• Do not install sqlserver on C drive, ##• do not put database files on C drive ##• Set maximum memory: should not left as default, leave 1GB memory for OS ##• Agent start automatically ##• Database auto growth on, with 10% percentage ##• Database backup regularly, either by SQLServer maintenance, Netbackup agent or Doc Ave ##• Transaction log backup regularly to prevent db size growth out of control ##• Disable CLR, with exception on kdcwdbsqlprd03 where respontek requires CLR. ##• Disable xp_cmdshell ##• Database recovery mode: full recovery mode for production, simple recovery mode for PPE ##• Turn off DB autoshrink Step 1: create the tables in oracle where the data will be saved, we choose oracle, it can be MSSQL, create table mssqlhostcpuinfo (hostname varchar2(...

RAC database restore from netbackup tape without RMAN catalog

The Oracle RAC databases were being backed up regularly without using catalog, even worse, the database controlfile autobackup was turned off.  That configuration compromise the RPO. I restored and recovered the database to the latest scn that the last controlfile backup knows, but not the latest scn that available in the archivelogs. Below are the steps: The assumption is that all database files, controlfile are gone. 1. list available backup handles in netbackup after a particular date: /usr/openv/netbackup/bin/bplist -l -S $netbackupserver -C $client -t 4 -R -s 11/29/2018 / output: ... -rw-rw---- oracle    asmadmin     19922944 Nov 29 11:55 /ctrl_dAPIMGRS_u16tje9lj_s1062_p1_t993470131 -rw-rw---- oracle    asmadmin    142082048 Nov 29 11:54 /arch_dAPIMGRS_u15tje9kd_s1061_p1_t993470093 ... From the above output, we guess the latest controlfile backup is in /ctrl_dAPIMGRS_u16tje9lj_s1062_p1_t993470131 2.  restore cont...

Powershell, SQLLDR, CMDB for MSSQL

The following are the end-to-end coding solution to collect MSSQL system information (CPU/cores, memroy, disk space and free space, OS version, database version and edition), and load the information to Oracle database as CMDB repository, the steps are: Create tables as CMDB repository in oracle db: mssqlhostcpuinfo ; mssqlhostmemoryinfo ; mssqlhostdiskinfo ; mssqlhostosinfo ; mssqlhostdbinfo ; Truncate the above tables Run powershell to collect MSSQL server information and output to files mssqlcpu.txt, ssqlos.txt,mssqldb.txt,mssqlmem.txt,mssqldisk.txt Run sqlldr and load above txt file into the repository tables Create view mssqlcmdball, mssqlcmdbserver, mssqlcmdbdb Step 1: create table mssqlhostcpuinfo (hostname varchar2(20), cores int,logicalcors int); create table mssqlhostmemoryinfo (hostname varchar2(20), membytes number(13)); create table mssqlhostdiskinfo (hostname varchar2(20), diskletter varchar2(2),capacity number(13), freedisk number(13)); c...