Wednesday, February 24, 2010

RMAN BACKUP TO NETWORK DRIVE

RMAN BACKUP TO NETWORK DRIVE

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'z:/network/backup_db_%d_S_%s_P_%p_T_%t';

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'z:\network\%F';

RMAN> backup current controlfile;


------------------------------ERROR1
Starting backup at 22-FEB-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 22-FEB-10
channel ORA_DISK_1: finished piece 1 at 22-FEB-10
piece handle=E:\SNS0910\BACKUP_DB_SNS0910_S_580_P_1_T_711634422 tag=TAG20100222T
121342 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 22-FEB-10

Starting Control File Autobackup at 22-FEB-10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of Control File Autobackup command on ORA_DISK_1 channel at
02/22/2010 12:13:50
ORA-19504: failed to create file "Z:\C-45805873-20100222-02"
ORA-27056: could not delete file
OSD-04029: unable to get file attributes
O/S-Error: (OS 3) The system cannot find the path specified.


--------------------SOLUTION1
Basically all you need to do is update Oracle Services (both listener and Database) to run with Domain Account which has access on both servers with Administrator Privilege.

After you update the services ;
1- Restart the services

2-Use UNC naming instead of using drive letter on your script. (UNC naming part is not mentioned in the note)

3- Run the RMAN backup

Worked fine on my case.


------------------------------ERROR2

C:\>rman target sys@sns0910srv

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Feb 22 13:49:07 2010

Copyright (c) 1982, 2007, Oracle. All rights reserved.

target database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12631: Username retrieval failed


--------------------SOLUTION2

file:///C:/oracle/product/10.2.0/db_1/network/ADMIN/sqlnet.ora

set to none

SQLNET.AUTHENTICATION_SERVICES= (NONE)

------------------------------ERROR3

ERROR IS STILL SAME

provide permission that shared folder or drive for that USER(KGUPTA2)



--------------------DONOT DO ABOVE PRACTICE JUST DO FOLLOWING------------

1) change rman configuration

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '\\ORANOUP01P.UNICON.COM\ksh\%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '\\ORANOUP01P.UNICON.COM\ksh\backup_db_%d_S_%s_P_%p_T_%t';


------Error----

RMAN> backup current controlfile;

Starting backup at 24-FEB-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 24-FEB-10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/24/2010 13:02:
14
ORA-19504: failed to create file "\\ORANOUP01P.UNICON.COM\KSH\BACKUP_DB_SNS0910_
S_637_P_1_T_711810132"
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.


-------
The problem is at the OS level, not within Oracle. To troubleshoot ORA-27040 errors, you need to test from the OS. You need to check these disk issues

------Steps for correct solution

1) give that user permission to kgupta2 user but same error

2) give folder>properites>shared>permission to kgupta2 but same error

3) give everyone to full permission but same error

4) Just do one thing: give permission for that source computer on that shared folderr>properites>shared>permission on desination server

4) Now RMAN BACKUP TO NETWORK DRIVE work fine


------------------------Final Solution-----

1) change rman configuration

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '\\ORANOUP01P.UNICON.COM\ksh\%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '\\ORANOUP01P.UNICON.COM\ksh\backup_db_%d_S_%s_P_%p_T_%t';


2) for network drive

give permission for that source computer on that shared folderr>properites>shared>permission on desination server

3) Rman backup will work fine

Monday, February 8, 2010

USB drive Disable Enable

Set deny permissions for the user/s and/or group/s to:
%SystemRoot%\Inf\Usbstor.pnf
%SystemRoot%\Inf\Usbstor.inf
It is highly recommended to rename the file names before changing
permissions.

To disable the access to USB port, in windows XP and 2000, follow the steps below
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click Start.
5. In the Value data box, type 4, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.

To re-enable a disabled port, follow these steps below

1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click Start.
5. In the Value data box, type 3, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.

Change ORACLE SID

select name from v$database;
select instance_name from v$instance;
shutdown immediate;
C:\>set ORACLE_SID=sidorcl
C:\>net stop oracleservicesidorcl
C:\>ORADIM -DELETE -SID sidorcl
C:\>set ORACLE_SID=sidorclnew
C:\>ORAPWD FILE=c:\oracle\product\10.1.0\db_1\database\pwdsidorclnew.ora PASSWORD=oracle ENTRIES=5 FORCE=y
C:\>ORADIM -new -sid sidorclnew -startmode manual -spfile
C:\>oradim -edit -sid sidorclnew -startmode auto
C:\>rename c:\oracle\product\10.1.0\db_1\database\initSIDORCL.ORA initsidorclnew.ORA
C:\>sqlplus/nolog
conn sys as sysdba
create spfile from pfile;
startup
select name from v$database;
select instance_name from v$instance;

Oracle Patch 10.20.3 to 10.2.0.4

Oracle Patch 10.20.3 to 10.2.0.4

How to Apply the Patchset ?

Before you apply the patchset you have to check whether the Oracle Version is 32 bit or 64 bit Version, because the patchsets are different.

For 32 Bit Version, Patch no is p6810189_10204_Win32_patchset

For 64 Bit Version, Patch no is p6810189_10204_MSWIN-x86-64.

1. Shut down the database:

SQL>SHUTDOWN IMMEDIATE.

Stop all the Oracle Related Services.

Ex:- Oracle Listener, Oracle DB Console,Oracle JobScheduler, Distrubed Transaction Co-ordinator.

Run the Patch Setup.exe in the same Oracle Home.

For Example: If Existing Oracle is installed in c:\Oracle\product\10.2.0\db_1 then you have to select the same path When you run the Setup.exe. After Successful installation start the Listener & Db Console etc.,

Enter the following SQL*Plus Commands:

SQL> SET ORACLE_SID=sns5

SQL> SQLPLUS/NOLOG

SQL> CONNECT SYS/ORACLE@sns0910SRV AS SYSDBA

SQL> STARTUP UPGRADE SQL> SPOOL patch.log

SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catupgrd.sql

SQL> SPOOL OFF

Review the patch.log file for errors and inspect the list of components that is displayed at the end of catupgrd.sql script.

This list provides the version and status of each SERVER component in the database.

If necessary, rerun the catupgrd.sql script after correcting any problems.

Restart the database:

SQL> SHUTDOWN IMMEDIATE SQL> STARTUP

Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.

SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlrp.sql

Followers