Archive

Archive for November, 2011

Enable or disable hibernate in Windows 7.

1. Enable Hibernate.
NOTE: This option will restore the hiberfil.sys file, and the Allow hybrid sleep and Hibernate after Power Options under Sleep.
– Open the elevated Command Prompt (Run as Administrator)
– In the elevated command prompt, type ‘powercfg -h on’ and press Enter
– Close the elevated command prompt

2. Disable Hibernate.
NOTE: This option will disable hibernation, delete the hiberfil.sys file, and remove the Allow hybrid sleep and Hibernate after Power Options under Sleep.
– Open the elevated Command Prompt (Run as Administrator)
– In the elevated command prompt, type ‘powercfg -h off’ and press Enter
– Close the elevated command prompt

Advertisements
Categories: MS Windows, OS Tags: , , ,

Disable and turnoff UAC in Windows 7.

Well, there are few ways to accomplish this goal. The simple way – use Control Panel, just follow these steps:
1. Access User Control Panel from Start Menu -> Control Panel -> User Accounts and Family Safety -> User Account.
2. Click on User Account Control settings link.
3. Move the Slider to Never Notify.
4. Click OK to make the change effective.
5. Reboot the computer.

That’s all.

Categories: MS Windows, OS Tags: , , ,

Oracle Shell Scripting in Windows.

This note presents some basic techniques for creating Windows batch files that connect to SQL*Plus and RMAN.

To run an SQL script using SQL*Plus, place the SQL along with any SQL*Plus commands in a file and save it on your operating system. For example, save the following script in a file called “C:\example.sql”.

CONNECT scott/tiger
SPOOL C:\example.txt
SET LINESIZE 100
SET PAGESIZE 50
SELECT * FROM emp;
SPOOL OFF
EXIT;

Next, create a batch file called “C:\example.bat” containing the following command.

sqlplus /nolog @C:\example.sql

The resulting batch file can be run manually, by double-clicking on it, or scheduled using the Scheduled Tasks Wizard (Start > Programs > Accessories > System Tools > Scheduled Tasks) or any other Windows scheduler.

The method is very similar when using Recovery Manager (RMAN). As an example, place the following RMAN commands in a file called “C:\rman.txt”.

run {
allocate channel dev0 type disk;
backup as compressed backupset database format 'I:\BACKUP\db_%u';
SQL 'alter system archive log current';
backup as compressed backupset archivelog all format 'I:\BACKUP\arc_%u' delete input;
backup current controlfile format 'I:\BACKUP\ctl_%u';
}
EXIT;

Next create a batch file called “C:\rman.bat” containing the following command.

rman TARGET username/pass@instance NOCATALOG @rman.txt

This command can include a ‘catalog=’ entry if a recovery catalog is used. Once again, resulting batch file can be run manually or scheduled.

Hope this helps.

For more information see:
SQL*Plus User’s Guide and Reference
Oracle Database Backup and Recovery Reference
UNIX Commands for DBAs