Restore Oracle 11g Database from RMAN Backup (Full and Archive Logs Backup)
- 10月 19 週一 201516:10
Restore Oracle 11g Database from RMAN Backup (Full and Archive Logs Backup)
- 10月 15 週二 201317:16
Using RMAN to Restore A Dropped Tablespace (11gR2)
Using RMAN to Restore A Dropped Tablespace without Resetlogs (11gR2)
##############################################
# Create a Tablespace named “DROP_TEST_TBS”
##############################################
# Create a Tablespace named “DROP_TEST_TBS”
- 10月 09 週三 201315:10
RMAN Backup Packages
There are two SYS Packages Used by RMAN while performing the backup:
1. SYS.dbms_backup_restore
à used to create system calls to backup datafiles, control files and archived redo logs
2. SYS.dbms_rcvman
à used to retrieve control file information to RMAN
1. SYS.dbms_backup_restore
à used to create system calls to backup datafiles, control files and archived redo logs
2. SYS.dbms_rcvman
à used to retrieve control file information to RMAN
- 9月 30 週一 201315:21
Simple RMAN Backup and Recovery Example
# Perform Backup:
. oraenv
[test1]
RMAN> backup device type disk format '/backup/test1_fullbk/%U' database;
RMAN> backup device type disk format '/backup/test1_fullbk/%U' archivelog all;
. oraenv
[test1]
RMAN> backup device type disk format '/backup/test1_fullbk/%U' database;
RMAN> backup device type disk format '/backup/test1_fullbk/%U' archivelog all;
- 8月 23 週四 201218:29
RMAN Encrypted Backups Practice (Oracle 11g)
RMAN Encrypted Backups Practice (Oracle 11g):
export ORACLE_SID=TESTDB
sqlplus / as sysdba
SQL> create smallfile tablespace test_tbs datafile size 10M autoextend on;
SQL> col tablespace_name format a20
SQL> col file_name format a50
SQL> select tablespace_name,file_name,bytes/1024/1024 as MB from dba_data_files where tablespace_name = 'TEST_TBS';
export ORACLE_SID=TESTDB
sqlplus / as sysdba
SQL> create smallfile tablespace test_tbs datafile size 10M autoextend on;
SQL> col tablespace_name format a20
SQL> col file_name format a50
SQL> select tablespace_name,file_name,bytes/1024/1024 as MB from dba_data_files where tablespace_name = 'TEST_TBS';
- 12月 06 週二 201118:55
Clone RAC Database to a None-RAC DB From RMAN Backup Without Connect to the Source DB (Oracle11gR2)
Clone RAC Database to a None-RAC DB From RMAN Backup Without Connect to the Source DB (Oracle11gR2)
-- Copy RMAN backup files from source DB server to the destination DB server
-- (Create the same directory structure)
-- Destination
# mkdir -p /u01/app/oracle/admin/TESTDB/adump
# mkdir -p /u01/app/oracle/admin/TESTDB/dpdump
# mkdir -p /u01/app/oracle/admin/TESTDB/pfile
# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db110203
# echo "TESTDB:/u01/app/oracle/product/11.2.0/db110203:N" >> /etc/oratab
# srvctl add database -d TESTDB -o /u01/app/oracle/product/11.2.0/db110203
/
-- vi $ORACLE_HOME/dbs/initTESTDB.ora
db_name='TESTDB'
memory_target=2G
processes=500
audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
audit_trail='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='+ARCH'
db_recovery_file_dest_size=50G
diagnostic_dest='u01/app/oracle'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
compatible='11.2.0'
# export ORACLE_SID=TESTDB
# sqlplus / as sysdba
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initTESTDB.ora
SQL> exit
# rman auxiliary /
set decryption identified by 'mypwd';
duplicate database to testdb
pfile='/u01/app/oracle/product/11.2.0/db110203/dbs/initTESTDB.ora'
backup location '/backup/daily/2011-10-01/TESTDB'
nofilenamecheck;
Result:
......
......
......
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 01-DEC-11
-- Copy RMAN backup files from source DB server to the destination DB server
-- (Create the same directory structure)
-- Destination
# mkdir -p /u01/app/oracle/admin/TESTDB/adump
# mkdir -p /u01/app/oracle/admin/TESTDB/dpdump
# mkdir -p /u01/app/oracle/admin/TESTDB/pfile
# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db110203
# echo "TESTDB:/u01/app/oracle/product/11.2.0/db110203:N" >> /etc/oratab
# srvctl add database -d TESTDB -o /u01/app/oracle/product/11.2.0/db110203
/
-- vi $ORACLE_HOME/dbs/initTESTDB.ora
db_name='TESTDB'
memory_target=2G
processes=500
audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
audit_trail='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='+ARCH'
db_recovery_file_dest_size=50G
diagnostic_dest='u01/app/oracle'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
compatible='11.2.0'
# export ORACLE_SID=TESTDB
# sqlplus / as sysdba
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initTESTDB.ora
SQL> exit
# rman auxiliary /
set decryption identified by 'mypwd';
duplicate database to testdb
pfile='/u01/app/oracle/product/11.2.0/db110203/dbs/initTESTDB.ora'
backup location '/backup/daily/2011-10-01/TESTDB'
nofilenamecheck;
Result:
......
......
......
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 01-DEC-11
- 10月 11 週二 201117:11
ORA-16014: log ....not archived, no available destinations
Alert Log:
************************************************************************
You have following choices to free up space from flash recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
system command was used to delete files, then use RMAN CROSSCHECK and
DELETE EXPIRED commands.
rman target / nocatalog
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;
SQL> alter system switch logfile;
************************************************************************
You have following choices to free up space from flash recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
system command was used to delete files, then use RMAN CROSSCHECK and
DELETE EXPIRED commands.
rman target / nocatalog
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;
SQL> alter system switch logfile;
- 9月 21 週三 201110:37
Rman: Ora-01008 When Connecting To Target in 11.2.0.2 [ID 1280447.1]
Rman: Ora-01008 When Connecting To Target in 11.2.0.2 [ID 1280447.1]
Bug#10414993
workaround:
SQL> alter system flush shared_pool;
or
alter system set cursor_sharing=exact scope=both sid='*';
- 8月 26 週五 201115:18
Delete All Archivelog using RMAN
List All Archivelog:
RMAN> list archivelog all;
Delete All Archivelog:
RMAN> delete noprompt archivelog all;
RMAN> list archivelog all;
Delete All Archivelog:
RMAN> delete noprompt archivelog all;
- 8月 19 週四 201015:22
Archivelog Mode 實現無備份下還原遺失資料檔的演練
SQL> conn /@test9i as sysdba
已連線.
SQL> archive log list
資料庫日誌模式 儲存模式
可自動儲存 開啟
儲存目的地 D:\oracle\oradata\TEST9I
最早的線上日誌順序 185
下一個日誌順序以儲存 187
已連線.
SQL> archive log list
資料庫日誌模式 儲存模式
可自動儲存 開啟
儲存目的地 D:\oracle\oradata\TEST9I
最早的線上日誌順序 185
下一個日誌順序以儲存 187
