Working with RMAN Stored Scripts

Creating Stored Scripts: CREATE SCRIPT

 

Make sure RMAN is connected to the right target database and the recovery catalog. Then run the CREATE SCRIPT command, as shown in this example:

 
 
CREATE SCRIPT full_backup 
{
BACKUP DATABASE PLUS ARCHIVELOG;
DELETE OBSOLETE;
 
 

 you can also provide a COMMENT with descriptive information:

CREATE GLOBAL SCRIPT global_full_backup 
COMMENT 'use only with ARCHIVELOG mode databases'
{
BACKUP DATABASE PLUS ARCHIVELOG;
DELETE OBSOLETE;
}

Running Stored Scripts: EXECUTE SCRIPT

 

RUN { EXECUTE SCRIPT full_backup; }

Displaying a Stored Script: PRINT SCRIPT

PRINT SCRIPT full_backup;
PRINT SCRIPT full_backup TO FILE 'my_backup.txt'; 

Listing Stored Scripts: LIST SCRIPT NAMES

LIST SCRIPT NAMES;

LIST ALL SCRIPT NAMES;

Updating Stored Scripts: REPLACE SCRIPT

REPLACE SCRIPT full_backup 
{
BACKUP DATABASE PLUS ARCHIVELOG;
}

Deleting Stored Scripts: DELETE SCRIPT

 

DELETE SCRIPT 'full_backup';
DELETE GLOBAL SCRIPT 'global_full_backup'; 

 

 

 

 Thank you 

Osama mustafa

 

 

 

DBCONSOLE For Real Application Cluster

Drop DBCONSOLE FOR RAC (Uninstall) : 



we will user the following command :

emca -deconfig dbcontrol db -repos drop -cluster

Make sure you have the below information :

  • Database unique name
  • Listener port number
  • Password for SYS user
  • Password for SYSMAN user

Create DBCONSOLE FOR RAC ( Install) : 

In this case you have more than one choice you can use what you want depend on your requirements :

1-

emca -config dbcontrol db -repos create -cluster

2-

 emca -reconfig dbcontrol –cluster –EM_NODE node1 -EM_NODE_LIST node2,node3,node4

emca -reconfig dbcontrol –cluster –EM_NODE node5 -EM_NODE_LIST node6,node7,node8

 The below Information for installing DBCONSOLE :

  • The Database unique name
  • The Listener port number
  • The Cluster name
  • The Password for SYS user
  • The Password for DBSNMP user
  • The Password for SYSMAN user
  • The Email address for notifications (optional)
  • The Outgoing Mail (SMTP) server for notifications (optional)
  • The ASM ORACLE_HOME e.g. /u01/app/asm/product/10.2.0
  • The ASM port e.g. 1521
  • The ASM user role e.g. SYSDBA
  • The ASM username e.g. SYS
  • The ASM user password

Note : Sometimes you need to put the password between “” . 
Thank you
Osama mustafa

Create Enterprise manager for RAC (Real Application Cluster)

Hi All ,

Sometimes we need to create enterprise manager for Rac Environment , its the same way for One instance with different Command . 

We are here talk about 10g , 11g database .
you follow the below steps to create or recreate enterprise manager LET’S START :

if you already have RAC – enterprise manager and you need to recreate then start from here

**Stop Dbconsole for the both nodes :

Commands :

On Node-1
emctl stop dbconsole .
On Node 2 :
emctl stop dbconsole .

**Drop dbconsole with re posterity from node 1 :

Command :

$emca -deconfig dbcontrol db -repos drop -cluster

“you will wait for while until repos been dropped”.

**recreate dbconsole with re posterity from node 1 “if you don’t have EM for your Rac start from here”
Command :

$emca -config dbcontrol db -repos create -cluster 

“follow the instsruction and fill the information such as DB SID,Listener Port , Crs Name”

To know your CRS NAME :
$CRS_HOME/bin/cemutlo -n

the output will be your crs name .

Thank you
Osama mustafa