Monday, June 11, 2012

THE CLONING OF THE DATABASE IN NOARCHIVELOG MODE

Why cloning is needed?


1. Oracle database has to be relocated to another machine.

2. Oracle database has to be mounted to new Storage media.

3. Renaming Oracle database



[oracle@localhost ~]$ export ORACLE_SID=orcl

[oracle@localhost ~]$ sqlplus "/ as sysdba"



SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 12 15:01:03 2011

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

Connected to an idle instance.



SQL> startup

ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 96470608 bytes

Database Buffers 184549376 bytes

Redo Buffers 2973696 bytes

Database mounted.

Database opened.



SQL> select name from v$database;

NAME

---------

ORCL



SQL> conn / as sysdba

Connected.

SQL> select username from v$session;


USERNAME

------------------------------

space

space

space

SYS

Space



22 rows selected.

You would see several blank rows being returned with no username they are actually the internal oracle logins and one SYS login will be shown thats the only sys who is running the commands.

SQL> alter system enable restricted session;

System altered.



SQL> alter database backup controlfile to trace;

Database altered.



SQL> show parameter user_dump_dest



NAME TYPE VALUE

------------------------ --------- --------------------------------------------------

user_dump_dest string /u01/app/oracle/admin/orcl/udump



SQL> archive log list;

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 3

Current log sequence 5



SQL> shut immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.



CREATE “CREATE_DB.SQL” IN VIM OR NOTEPAD AND MAKE THE FOLLOWING ENTRIES



STARTUP NOMOUNT

CREATE CONTROLFILE set DATABASE "Shoaib3" RESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 '/u01/app/oracle/oradata/shoaib3/redo01.log' SIZE 50M,

GROUP 2 '/u02/app/oracle/oradata/shoaib3/redo02.log' SIZE 50M,

GROUP 3 '/u03/app/oracle/oradata/shoaib3/redo03.log' SIZE 50M

-- STANDBY LOGFILE

DATAFILE

'/u01/app/oracle/oradata/shoaib3/system01.dbf',

'/u01/app/oracle/oradata/shoaib3/undotbs01.dbf',

'/u01/app/oracle/oradata/shoaib3/sysaux01.dbf',

'/u01/app/oracle/oradata/shoaib3/users01.dbf',

'/u01/app/oracle/oradata/shoaib3/example01.dbf'

CHARACTER SET WE8ISO8859P1;

[oracle@localhost ~]$ export ORACLE_SID=shoaib3

[oracle@localhost ~]$ sqlplus "/ as sysdba"



SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 12 15:19:18 2011

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



Connected to an idle instance.



Remember to create the init.ora file at dbs folder example: ‘/u01/app/oracle/product/10.2.0/db_1/dbs/initshoaib3.ora'



SQL> @/u01/app/oracle/create_db.sql

ORACLE instance started.



Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 92276304 bytes

Database Buffers 188743680 bytes

Redo Buffers 2973696 bytes



Control file created.



SQL> alter database open resetlogs;

Database altered.



SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/shoaib3/temp03.dbf' size 25m;

Tablespace altered.



SQL> alter database rename global_name to shoaib3;

Database altered.



SQL> select name from v$database;



NAME

---------

SHOAIB3



SQL> archive log list;

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 0

Current log sequence 1

SQL>

No comments:

Post a Comment

ORA-12519: TNS:no appropriate service handler found error

ORA-12519: TNS: no appropriate service handler found error The real problem lies in the PROCESSES parameter All you need ...