Skip to main content

Posts

How to Create manually an Oracle 11g Database.

1- Create a pfile for parameters database (below are the contents of the initDB11ora.ora file) *.audit_file_dest='/apps/ora11/admin/db11/adump' *.audit_sys_operations=TRUE *.audit_syslog_level='local1.warning' *.audit_trail='OS' *.compatible='11.2.0.0.0' *.control_files='/oracle11/db11/control01.ctl','/oracle11/db11/control02.ctl','/oracle11/db11/control03.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='db11' *.deferred_segment_creation=FALSE *.diagnostic_dest='/apps/ora11' *.dispatchers='(PROTOCOL=TCP) (SERVICE=ebXDB)' *.log_archive_dest_1='LOCATION=/arch11/DB11' *.log_archive_format='%t_%s_%r.dbf' *.memory_target=3221225472 *.open_cursors=300 *.parallel_max_servers=5 *.processes=200 *.remote_login_passwordfile='EXCLUSIVE' *.sessions=225 *.undo_tablespace='UNDOTBS1' 2- Set Environment Variables: set ORACLE_SID=db11 set ORACLE_HOM

How to force the database open

There are times when it may become necessary to force a database open. This document identifies one way to attempt to get the database open. You may need to use this procedure because something happened to the database that required you to perform recovery. The recovery completed, but you receive the following error message:     ORA-01194 - file 1 needs more media recovery to be consistent You have determined that there is nothing else that can be done to get the database to a consistent state.  You tried opening the database using RESETLOGS, but that also failed.   Procedure: ========== To ATTEMPT to force the database open, perform the following steps: 1. Add the parameter _ALLOW_RESETLOGS_CORRUPTION = TRUE to the init.ora file _corrupted_rollback_segments= 2. STARTUP MOUNT the database 3. Issue the appropriate RECOVER DATABASE command:        a) RECOVER DATABASE UNTIL CANCEL            or        b) RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CAN

RMAN full backup in windows

This is an example for Oracle archive logs backup only on Windows using RMAN and a catalog database. 1- We create an env.cmd file in order to set all the environtment variables @REM ---------------------------------------------------------- @REM @REM    Check ORACLE_HOME and ORACLE_SID @REM @REM ---------------------------------------------------------- SET DB=ccrjr SET DBDIR=ccrjr SET PATH=C:\oracle\ora92\bin\;%PATH% SET ORACLE_HOME=C:\oracle\ora92\ SET ORACLE_SID=%DB% SET SCRIPTS=C:\oracle\BKC\BACKUPS\scripts 2- We create a hot_backup_full.bat file. @call        C:\oracle\BKC\BACKUPS\scripts\env.cmd @SET EXECCMD=C:\oracle\BKC\BACKUPS\scripts\hot_backup_full.cmd %1 @SET LOGFILE=C:\oracle\BKC\BACKUPS\scripts\logs\hot_Backup_full.log @REM *************************   EXECUTION SECTION ************************* move %LOGFILE% %LOGFILE%.bkp_full.txt @cls @echo -------------------------------------------------------------------------------- @echo EXECUTING SCRIPT: %0 @echo -----------------

RMAN archive log backup in Windows

This is an example for Oracle archive logs backup only on Windows using RMAN and a catalog database. 1- We create an env.cmd file in order to set all the environtment variables @REM ---------------------------------------------------------- @REM @REM    Check ORACLE_HOME and ORACLE_SID @REM @REM ---------------------------------------------------------- SET DB=ccrjr SET DBDIR=ccrjr SET PATH=C:\oracle\ora92\bin\;%PATH% SET ORACLE_HOME=C:\oracle\ora92\ SET ORACLE_SID=%DB% SET SCRIPTS=C:\oracle\BKC\BACKUPS\scripts 2- We create a archivelog_backup.bat file. @REM ***********************   DOCUMENTATION SECTION *********************** @REM @REM @REM ARCHIVE LOG SCRIPT. @REM @REM @REM ***********************   CONFIGURACION SECTION *********************** @call        C:\oracle\BKC\BACKUPS\scripts\env.cmd @SET EXECCMD=C:\oracle\BKC\BACKUPS\scripts\archivelog_backup.cmd %1 @SET LOGFILE=C:\oracle\BKC\BACKUPS\scripts\logs\archivelog_backup.log @REM *************************   EXECUTION SECTION *

RMAN restore database from disk in custom location

This topic explain a basic methodology for restoring an Oracle database without catalog from a custom location in  disk in the local server.  1- Connect to the catalog database. $ORACLE_HOME/bin/rman target db_user/password  catalog  db_catalog/password@db_catalog You need to check the incarnation id of  the database in order to see if you need to reset another one. RMAN> LIST INCARNATION of database; List of Database Incarnations   DB Key   Inc Key DB Name   DB ID             STATUS   Reset SCN      Reset Time   ------- ------- -------- ---------------- ---      ----------     ---------- 32705    211103   TST       1523482262        ORPHAN   244511521611   04-05-15:17:10:38 32705    211266   TST       1523482262        ORPHAN   244511530444   05-05-15:17:44:35 32705    215420   TST       1523482262        ORPHAN   244511530444   06-05-15:09:27:51 236249   236262   TST       2719392798        PARENT   960431         23-02-11:09:25:52 236249   2362

How to manage AIX file system

Create a   file system with 10 Megabytes #crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2 Increase or resize a file system # lsvg rootvg VOLUME GROUP: rootvg VG IDENTIFIER: 0004455666767777777777899990 e VG STATE: active PP SIZE: 128 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 579 (75672 megabytes) MAX LVs: 256 FREE PPs: 282 (36096 megabytes) LVs: 12 USED PPs: 317 (41576 megabytes) # chfs -a size=+10M /usr   Mount   CDROM #mount -v cdrfs -o ro /dev/cd0 /cdrom Mount   file system #mount /dev/fslv02   /test Remove a File System #rmfs /test Defrag a file system #defragfs /home  

Rman Disk full backup with shell script example.

 This is an example of rman backup that connects to a catalog database and the whole database files are copied to disk. 1- Generate a .sh shell script with the following. #!/bin/ksh # ####Invokes the full backup of the database. DATE=`date '+%d-%m-%y:%H:%M:%S'` export DATE ORACLE_HOME=/apps/ora11/product export ORACLE_HOME ORACLE_SID=test export ORACLE_SID BKPSCRIPTS=/backup/scripts_bkp/rman/$ORACLE_SID export BKPSCRIPTS PATH=/apps/ora11/product/bin:/usr/bin export PATH SERVIDOR=`hostname` export SERVIDOR ARCH_DEST=/backup/arch11/$ORACLE_SID export ARCH_DEST export PASSWD_CAT=`cat /backup/scripts_bkp/.catuser_passwd` export PASSWD_LOCAL=`cat /backup/scripts_bkp/.dbpasswd_user` echo "Running full backup RMAN, please wait ...";     $ORACLE_HOME/bin/rman target BACKUP/${PASSWD_LOCAL} catalog  RMAN_CAT/${PASSWD_CAT}@CAT cmdfile=$BKPSCRIPTS/rman_full_test.rcv   msglog  $BKPSCRIPTS/logs/backup_full_RMAN_test_diario_$DATE.log; /bin/mailx -s "Backup Diario RMAN test TST_