1) To use hot backup and clone the database the
production database has to be in archivelog mode.

2) Create a new init.ora from the production
database’s init.ora file and make the required
modifications like the location of bdump,udump,
cdump,log_archive_dest_1,instance_name,db_name and
also make sure the folders are physically present
at the OS level(i.e create them).

3) On the target machine (i.e where the clone database has been created)
we have to create a new service as well as the password file.

Commands for the same are:-
C:\oracle\ora92\bin>oradim -new -sid <new SID>
C:\oracle\ora92\database>orapwd file=PWD<new_sid>.ora password=sys

4) Now on your production database fire the following command
 to create a trace of the controlfile

SQL>alter database backup controlfile to trace;

This will create a trace file in your udump folder
 (kindly check the time to make sure it is the latest trace file).

5) Open the trace file which was created in step 4 and
make the following modifications

a) Change the
CREATE CONTROLFILE REUSE DATABASE “<production database name>” NORESETLOGS
             TO
CREATE CONTROLFILE SET DATABASE “<new database name>” RESETLOGS ARCHIVELOG

b) Change all directories in the create controlfile clause
to point to the correct directories for the new target database, if necessary
  
c) Leave “only” the CREATE CONTROLFILE clause. The other statements,
like the recover command, will be done manually.
    
Be sure you also remove the STARTUP NOMOUNT command.
So remove all the other statements other then the script starting
with CREATE CONTROLFILE …and ending with CHARACTER SET WE8MSWIN1252;

After making the modifications save the changed script
as a sql file (i.e for example like create_contol.sql)
 and send it to the target machine.

6) Now on the produstion database
we begin the hot backup procedure

To find out the datafile associated with each tablespace
fire the following query

SQL>select file_name,tablespace_name from dba_data_files;
SQL>alter tablespace <tablespace_name> begin backup;

Copy all the datafiles associated with this tablespace
to the required location as specified in the CREATE CONTROLFILE script.
After copying is over fire the following command to end the backup

SQL>alter tablespace <tablespace_name> end backup;
Do this for all the tablespaces.

7) After all the datafiles have been copied and no more tablespace
 is in backup mode fire the following query to archive the current logfile;

SQL>alter system archive log current;

These were the steps to be performed on the production database
except for step 3 which needs to be performed on the target machine.

The following steps needs to be performed on the target machine.

8) On the target machine log into SQL with the following commands

C:\>set oracle_sid=<new_database_sid>
C:\>sqlplus
and then enter the username and password.

9) Ater logging into the sql prompt startup the database in nomount phase
with the modified init file.

SQL>startup nomount pfile=<location of the modified init file>

10) After the instance is started then we have to run the script
to create the controlfile.

SQL>@<location of the create controlfile sql script>

11) After the command has been executed successfully and
the controlfile is created then we have to recover the database
using the following command.

SQL>recover database until cancel using backup controlfile;

It will ask for the archives which were generated in the production database
during the hot backup and till the latest archive.Kindly copy those
archives to the target machine at the loaction
specified by the log_archive_dest_1 parameter in init file
     .

12) After recovery is completed then open the database with resetlogs option.

SQL>alter database open resetlogs;

Now after this command completed successfully your clone database is ready.
                     
        

 

Oracle Question – I

On November 14, 2007, in oracle faq, by admin

11) What is the use of the large Pool?

Large pool is mainly used to offload some burden of caching

from shared pool.

Large pool is a memory structure used during rman backup

with multiple channel location.

It is also used when DBWR I/O slaves are configured.

Finally most importantly it is used to store UGA(user global area) when database is configured  in shared server configuration.

Without large pool being configured all these information would be stored in shared pool thereby

reducing the library hit ratio of shared pool and

degrading the performance

12) What is the use of java pool?

Java Pool is mainly used to load Java class and

libraries in oracle database

13) What is Dedicated Server Configuration? 

In case of dedicated server configuration for each client which

tries to connect to the database

a user process is generated in the client machine and

when this client gets authenticated by the listener at the server,

the listener spawns a server process which fires the queries and fetches

the data from the database on behalf of the user process on the client.

Also this server process is dedicated to that particular client only and

serves only the request of that particular client

Hence such type of confirguration is called as

dedicated server process. The dedicated server configuration

requires more resources viz memory but provides better perfromance

14) What is Shared Server Configuration ?

In Shared Server  Configuration when the client tries

to connect to database a user process is spawned at

the client machine.This client is authenticated by the listener on the

database server and handed over to the dispatcher.

There are normally few dispatcher pre spawned when the instance is started dependinding on the dispatchers

parameter in init<SID>.ora

The Dispatcher places the request from client to the

common request queue placed in the sga.

The idle shared server which are also pre spawned

will pick the request from request queue service

the request and place it in the response queue

which is dedicated to each dispatcher.

The Shared server configuration requires less resources

like memory scarely and is the

favourite configuration for internet application

where large users connect to database

15) Where is the Session Information stored in case of dedicated server configuration?

In case of the Dedicated server Configuration the session

information is stored in PGA.For each session which is established

a dedicated server process is spawned. And for each dedicated server process a memory structure called as PGA

(Program Global Area) is

allocated. This PGA memory is used to store bind variable information,

cursors and session information for that particular session.

16)  Where is the Session Information stored in Shared Server Configuration?

In case of the Shared server Configuration the session information

is stored in Shared pool.

Because in shared server confirguration all the session are not linked

to same shared server during the entire period of the session.

 17) Where is Shared Server Configuration used in Oracle Database?

The Shared Server is used in internet application

where large users connect to database.

It is also used in application where not all the users connect or

hit the database simultaneously

Shared server Confirguration is based on the concept that between

two consequent queries fired by a particular session on the database

there is a idle time for server process and this idle time is

used to serve request from other clients.

18) Which process starts the shared server process dynamically?

In shared server confirguration initially shared servers

specified by shared_server parameter in init<SID>.ora is started at instance startup.

But as the load on the shared server process

increases background process PMON starts the shared server process dynamically .

19) What is the maximum of number of shared servers which can be started by PMON?

The max number shared server processes which can be started by PMON is decided by

max_shared_servers parameter in init.ora