SET ORACLE_HOME=d:\app\database SET ORACLE_SID=ERKSDB1 cd D:\backup %ORACLE_HOME%\bin\rman target / @D::\backup\full_backup_local.rman log=D:\backup\full_backup_local.log}
run { ALLOCATE CHANNEL C01 TYPE FORMAT DISK ‘/dbexport/rman/backup/DF_CH01_%U’; ALLOCATE CHANNEL C02 TYPE FORMAT DISK ‘/dbexport/rman/backup/DF_CH02_%U’; ALLOCATE CHANNEL C03 TYPE FORMAT ‘/dbexport/rman/backup/DF_CH03_%U’; ALLOCATE CHANNEL C04 TYPE FORMAT ‘/dbexport/rman/backup/DF_CH04_%U’; SQL ‘ALTER SYSTEM ARCHIVE LOG CURRENT’; BACKUP DATABASE; SQL ‘ALTER SYSTEM ARCHIVE LOG CURRENT’; BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL; BACKUP CURRENT CONTROLFILE FORMAT ‘/dbexport/rman/backup/controlfile_%d_%t_%s’; BACKUP SPFILE FORMAT ‘/dbexport/rman/backup/spfile_%d’; RELEASE CHANNEL C01; RELEASE CHANNEL C02; RELEASE CHANNEL C03; RELEASE CHANNEL C04; }
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE disk; ALLOCATE CHANNEL c2 DEVICE TYPE disk; ALLOCATE CHANNEL c3 DEVICE TYPE disk; ALLOCATE CHANNEL c4 DEVICE TYPE disk; sql ‘alter system archive log current’; backup AS COMPRESSED BACKUPSET full database tag GPIS_FULL format ‘/dbexport/rman/backup/%d_%T_%s_%p_FULL’ ; sql ‘alter system archive log current’; backup AS COMPRESSED BACKUPSET archivelog all delete all input tag GPIS_ARCHIVE format ‘/dbexport/rman/backup/%d_%T_%s_%p_ARCHIVE’; backup tag GPIS_CONTROL current controlfile format ‘/dbexport/rman/backup/%d_%T_%s_%p_CONTROL’; BACKUP tag GPIS_SPFILE FORMAT ‘/dbexport/rman/backup/spfile_%d’; release channel c1; release channel c2; release channel c3; release channel c4; }
run { allocate channel c1 type disk; backup archivelog from sequence 461797 until sequence 461798 thread 1 format ‘/backup/archivelog/arch_%U’; backup archivelog from sequence 459596 until sequence 459597 thread 2 format ‘/backup/archivelog/arch_%U’; }
run { catalog start with ‘/home/oracle/archivelog’; allocate channel c1 type disk ; restore archivelog from sequence 461797 until sequence 461798 thread 1; restore archivelog from sequence 459596 until sequence 459597 thread 2; }
1.) Contact the SAN administrator and make sure s/he knows how to present LUNs for Linux dm-multipath (may require different options at the SAN side than PowerPath; have him/her check the appropriate documentation from the SAN manufacturer)
2.) Unmount the data disks, shutdown any raw databases, and deactivate the VGs (vgchange -a n ).
umount /test vgchange -a n testvg
3.) Remove and un-install PowerPath
Before you remove PowerPath, ensure the following: Steps ● Ensure that no PowerPath devices are in use. Unmount all file systems from pseudo devices and ensure that none of the logical volumes on volumes groups from pseudo devices are in use. ● Run the lsof command and ensure that none of the storage devices that are managed by the PowerPath are listed. If the lsof command lists the processes along with opened PowerPath managed storage devices, then close such applications/ processes and ensure that PowerPath managed storage devices are not in use. ● Manually remove references to PowerPath pseudo devices from system configuration files. For example, /etc/fstab. ● If the LVM filter had previously been updated to PowerPath recommended filter when PowerPath was initially installed and configured, restore the filter back to the default configuration. Pseudo devices are not available after PowerPath is uninstalled.
rpm -qa | grep EMCpower.LINUX
rpm -ev EMCPower.LINUX-_
NOTE: In rare instances, if the PowerPath uninstall program displays a message saying that it could not unload the emcp module, run the lsmod | grep emcp command to determine if any PowerPath modules are loaded on the host. If so, restart the host after the uninstallation completes to unload the modules.
4.) Configure device-mapper-multipath and make the appropriate changes to the LVM configuration: with PowerPath, your LVM should be configured to use only PowerPath devices/prefer them over anything else. Now LVM should be configured to use dm-multipath devices instead.
Yes, filtering and/or the “preferred_names" setting in lvm.conf, if your Linux distribution has it.
# By default we accept every block device: filter = [ “a/.*/" ] #filter = [ “a|/dev/mapper/mpath.*|", “r|.*|" ]
5.) Run “multipath -v2″ to initialize the multipath configuration, then make sure the multipathd daemon is running and configured to start at boot time.
multipath -v2
pvscan (is this reqd?)
6.) Run “vgscan". It should automatically figure out that your VGs are now accessible through dm-multipath devices. Verify with commands like “pvs", “vgs". Make sure LVM uses dm-multipath devices, not /dev/sd* devices.
vgscan -vvvv
7.) Activate your VGs again (vgchange -a y). Mount filesystems; etc.
vgchange -a y testvg
mount /dev/testvg/testvol /test
8.) Remember to re-create your initrd, to remove the last traces of PowerPath & to include your new LVM and dm-multipath configurations. You might want to reboot to make sure the system can boot without issues.
Following are the steps to rename the listener log file in Oracle:
1. Open the command prompt or terminal, Set the Oracle home and PATH: -- Windows set oracle_home=E:\oracle\18.0.0\dbhome_1 set path=%oracle_home%\bin;%oracle_home%\opatch;%path%
2. Open the listener command prompt with command “lsnrctl”. C:\windows\system32>lsnrctl LSNRCTL for 64-bit Windows: Version 18.0.0.0.0 - Production on 26-NOV-2020 20:40:20 Copyright (c) 1991, 2018, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL>
3. Stop the listener log with command “set log_status off” LSNRCTL> set log_status off Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WINORACLE.ORCL.com)(PORT=1521))) LISTENER parameter "log_status" set to OFF The command completed successfully
4. Manually rename the listener log file by Operating system commands Go to location of listener.log file: mv listener.log listener_old.log
Note: If you donot know the location of listener log file then use command “status” LSNRCTL> status -- In status you will find the following line but it will point to xml. Listener Log File C:\Oracle\dbhomeXE\diag\tnslsnr\WINORACLE\listener\alert\log.xml
--You will change the path of last folder instead of "alert" to "trace". C:\Oracle\dbhomeXE\diag\tnslsnr\WINORACLE\listener\trace\listener.log
5. Start the listener log with command “set log_status on” LSNRCTL> set log_status on Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WINORACLE.ORCL.com)(PORT=1521))) LISTENER parameter "log_status" set to ON The command completed successfully
2. Set the oracle_home and oracle_sid parameter for database.
3. Execute the adrci utility command. #adrci oracle@localhost/u01/app/oracle# adrci ADRCI: Release 11.2.0.2.0 - Production on Tue Jul 23 15:25:00 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. ADR base = "/u01/app/oracle" adrci>
4. Check the present homes on the server with following commands. #show homes adrci> show homes ADR Homes: diag/rdbms/darvel/11 diag/tnslsnr/darvel/listener_11
5. You need to set the home which you want to check log file. In Oracle 11g, LISTENER and RDBMS home is at different location. adrci> set homepath diag/tnslsnr/darvel/11
6. Check the alert log file error on the home location. ---For check the last lines of alert log adrci> show alert –tail --For checking last 200 line of alert log adrci> show alert -tail 200 --For check the error message present in the alert log file adrci> show alert -p "message_text like '%ORA-%' " --For check the last 30 days error present in alert log file adrci> show alert -p "message_text like '%ORA-%' and originating_timestamp > systimestamp-30"
7. For Purge diagnostic data that is over 1 day old (1440 minutes). adrci> PURGE -age 1440 -type ALERT --For purging incident data older than 1 day adrci> purge -age 1440 -type incident adrci> PURGE [[-i id1 | start_id end_id] | [-age mins [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]
8. Show all the incident happening in database. adrci> show incident adrci> show incident -p "incident_id = 40165 or incident_id = 145" adrci> show incident -mode detail adrci> show incident -mode detail -p "incident_id=33" adrci> show incident -p "CREATE_TIME > '2011-09-18 21:35:25.012579 +00:00'" adrci> show incident -p "problem_key='ORA 600 [ksmnfy2]'" adrci> show incident -p "problem_key='ORA 700 [kfnReleaseASM1]'" -mode basic -last -all
9. Show the problem happening in database. adrci> show problem adrci> show problem -all adrci> show problem -p "problem_id=44" adrci> show problem -p "problem_key='ORA 600 [krfw_switch_4]'"
1. Go to command windows and used adrci command: C:\Windows\System32\config\systemprofile>adrci ADRCI: Release 12.1.0.2.0 - Production on Wed Mar 29 05:04:40 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. ADR base = "E:\oracle" adrci>
2. List the oracle home present by show home command: adrci> show home ADR Homes:home diag\rdbms\ic\ic diag\tnslsnr\IC\listener
3. Select the home with set homepath command: adrci> set homepath diag\rdbms\ic\ic
4. For list all the problem going, please run show problem command: adrci> show problem
ADR Home = E:\oracle\diag\rdbms\ic\ic:
************************************************************
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
---------- ------------ ------------- ---------------------------------
3 ORA 600[723] 246517 2017-03-10 21:14:18.539000 -05:00
2 ORA 445 243935 2017-03-11 06:06:54.406000 -05:00
1 ORA 4030 283042 2017-03-23 02:25:05.963000 -04:00
5. Show all incident and specific incident with following commands: --Show all incident on at home: ardci> show incident --If you want for specific problem then enter define problem key: adrci> show incident -p "problem_key='ORA 4030'"
ADR Home = E:\oracle\diag\rdbms\ic\ic:
*********************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
----------- ----------- -----------------------------
235513 ORA 4030 2017-03-02 22:00:05.502000 -05:00
235401 ORA 4030 2017-03-02 22:00:05.861000 -05:00
235402 ORA 4030 2017-03-02 22:00:11.002000 -05:00
6. Create package for specific incident id for upload on oracle support. Note: specify the path and incident number for creating package. adrci> ips pack incident 235402 in E:\patch_backup Generated package 2 in file E:\patch_backup\ORA4030_20170329050754_COM_1.zip, mode complete
Script for monitoring with ADRCI utility in Oracle
Following is the script used for monitoring with help of ADRCI utility. It will generate or report error and incident coming in Listener.log and alert.log files.
###### ALERT LOG CHECKING VIA ADRCI ############# ################################################# # To run for last 24 hours – ./check_alert.sh D # To run for last hour – ./check_alert.sh # Edit variables below for moving between servers # Changes To the Script #
for adrci_lsnr_home in ${adrci_lsnr_homes[@]} do echo $adrci_lsnr_home’ Listener Log’ >> $DAILY_LOG adrci exec="set home ${adrci_lsnr_home}; show alert -p \\\"message_text like ‘%TNS-%’ and originating_timestamp > systimestamp-1\\\"" -term >> $DAILY_LOG done
for adrci_home in ${adrci_homes[@]} do echo $adrci_home’ Alert Log’ >> $HOURLY_LOG adrci exec="set home ${adrci_home}; show alert -p \\\"message_text like ‘%ORA-%’ and originating_timestamp > systimestamp-1/24\\\"" -term >> $HOURLY_LOG done
num_errors=`grep -c -e ‘TNS’ -e ‘ORA’ $HOURLY_LOG` if [ $num_errors != 0 ] then MAIL_SUBJ=$MAIL_SUBJ$HOST_NAME" Errors Found in Hourly Alert Summary" mailx -s “$MAIL_SUBJ" $MAIL_RECIPIENT < $HOURLY_LOG fi