ATEST
How to Put Oracle database to Archivelog Mode
You can check log_mode using following command
SQL> select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
LOG_MODE
------------
NOARCHIVELOG
Step01
If not shutdown database, you have to shutdown the database
SQL> shutdown immediate ;
Step02
stratup database mount stage
SQL> startup mount;
Step03
Alter database archivelog mode
SQL> alter database archivelog;
Step04
Database open
SQL>alter database open;
check again log_mode ,
SQL> select log_mode from v$database;
LOG_MODE
------------
LOG_MODE
------------
ARCHIVELOG
RMAN Duplicate to New Database
I have installed two virtual machine on my PC (Red Hat 6) ,and installed oracle (11.2.0) binary both machine and created database on one machine name DB11G, Now I want to duplicate DB11G database as DB11G2 to my 2nd machine .
Step 1: I have created database backup using RMAN on DB11G database ,
rman target=/
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Step 2: Login to 2nd machine and created the oracle password file in dbs folder
orapwd file=/u01/app/oracle/product/11.2.0/db_1/dbs/orapwDB11G2 password=password entries=10
Step 3:Also added to tns entry in "tnsnames.ora" file in the
"$ORACLE_HOME/network/admin" directory
DB11G=(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =1stMachine-IP )(PORT = 1521))
)
(CONNECT_DATA =(ORACLE_SID = DB11G)
)
)
Step 4: Also created the PFILE on 2nd machine "initDB11G2.ora"
DB_NAME=DB11G2
# Convert file names to allow for different directory structure if necessary.
#DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/DB11G/','/u01/app/oracle/oradata/DB11G2/'
#LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/DB11G/','/u02/app/oracle/oradata/DB11G2/'
Step 5: Create any directories necessary for start the duplicate database.
mkdir -p /u01/app/oracle/oradata/DB11G
mkdir -p /u01/app/oracle/fast_recovery_area/DB11G
mkdir -p /u01/app/oracle/admin/DB11G/adump
Step 6: Copy all the backup files from 1st machine to 2nd machine.
scp -r /u01/app/oracle/fast_recovery_area/DB11G/archivelog oracle@2ndMachine-IP:/u01/app/oracle/fast_recovery_area/DB11G
scp -r /u01/app/oracle/fast_recovery_area/DB11G/backupset
oracle@2ndMachine-IP:/u01/app/oracle/fast_recovery_area/DB11G
scp -r /u01/app/oracle/fast_recovery_area/DB11G/autobackup
oracle@2ndMachine-IP:/u01/app/oracle/fast_recovery_area/DB11G
Setp 7:Log in to 2nd machine
export ORACLE_SID=DB11G2
#this is which you have installed oracle version
*.compatible='11.2.0.4.0'
sqlplus / as sysdba
SQL> startup nomount
SQL> exit
Step 8:Login RMAN as auxiliary database
rman auxiliary /
RMAN>
Step 9: Enter duplicate command as bellow
RMAN>DUPLICATE DATABASE DB11G TO DB11G2 BACKUP LOCATION '/u01/app/oracle/fast_recovery_area/DB11G' nofilenamecheck;
How to Put Oracle database to Archivelog Mode
Step01
If not shutdown database, you have to shutdown the database
SQL> shutdown immediate ;
Step02
stratup database mount stage
SQL> startup mount;
Step03
Alter database archivelog mode
SQL> alter database archivelog;
Step04
Database open
SQL>alter database open;
If not shutdown database, you have to shutdown the database
SQL> shutdown immediate ;
Step02
stratup database mount stage
SQL> startup mount;
Step03
Alter database archivelog mode
SQL> alter database archivelog;
Step04
Database open
SQL>alter database open;
RMAN Backup Re installation with duplicate database
Step -1
login to sqlplus
Step-2
shutdown immediate;
Step-3
startup mount exclusive restrict;
Setp-4
drop database;
Step-5
Then exit from sqlplus
Step-6
Again log into sqlplus and enter below command
startup nomount pfile='$ORACLE_HOME/dbs/initTEST.ora';
Note: Your oracle home path
Step-7
Then exit from sqlplus and log in to RMAN using below command
rman auxiliary /
Step-8
To start databse duplication enter below command , before that copy rman backup files to the correct path and give permission to oracle.
duplicate database to 'NEWDBNAME' backup location '/backup location path /' nofilenamecheck;
Then start the rman re installation .
login to sqlplus
Step-2
shutdown immediate;
Step-3
startup mount exclusive restrict;
Setp-4
drop database;
Step-5
Then exit from sqlplus
Step-6
Again log into sqlplus and enter below command
startup nomount pfile='$ORACLE_HOME/dbs/initTEST.ora';
Note: Your oracle home path
Step-7
Then exit from sqlplus and log in to RMAN using below command
rman auxiliary /
Step-8
To start databse duplication enter below command , before that copy rman backup files to the correct path and give permission to oracle.
duplicate database to 'NEWDBNAME' backup location '/backup location path /' nofilenamecheck;
Then start the rman re installation .
Subscribe to:
Posts (Atom)