Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Czesc I
- 1. rman target sustem/manager@orcl
- 2.
- CONFIGURE DEFAULT DEVICE TYPE TO DISK;
- CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
- CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
- CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘c:\kopie_RMAN\ora_df%t_s%s_s%p';
- CONFIGURE CONTROLFILE AUTOBACKUP ON;
- CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘c:\kopie_RMAN\ora_cf%F';
- CONFIGURE BACKUP OPTIMIZATION ON;
- 3.
- RMAN configuration parameters for database with db_unique_name ORCL are:
- CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
- CONFIGURE BACKUP OPTIMIZATION ON;
- CONFIGURE DEFAULT DEVICE TYPE TO DISK;
- CONFIGURE CONTROLFILE AUTOBACKUP ON;
- CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "c:\kopie_RMAN\o
- ra_cf%F";
- CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
- CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
- CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
- CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT "c:\kopie_RMAN\ora_df%t_s%s_s%p";
- CONFIGURE MAXSETSIZE TO UNLIMITED; # default
- CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
- CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
- CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default
- CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
- CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\APP\PRODUCT\11.1.0\DB_1\DATABASE\SNCF
- ORCL.ORA'; # default
- CZESC II
- 1. system/manager@orcl
- 2. SQL> select log_mode from v$database;
- LOG_MODE
- ------------
- NOARCHIVELOG
- 3. SHUTDOWN IMMEDIATE
- 4. SQL> startup mount;
- ORACLE instance started.
- Total System Global Area 535662592 bytes
- Fixed Size 1334380 bytes
- Variable Size 201327626 bytes
- Database Buffers 327155884 bytes
- Redo Buffers 5844992 bytes
- Database mounted.
- 5. rman target sys/manager@targetdb
- 6 RMAN> backup database;
- Starting backup at 04-NOV-16
- using channel ORA_DISK_1
- using channel ORA_DISK_2
- channel ORA_DISK_1: starting full datafile backup set
- channel ORA_DISK_1: specifying datafile(s) in backup set
- input datafile file number=00001 name=C:\APP\ORADATA\ORCL\SYSTEM01.DBF
- input datafile file number=00003 name=C:\APP\ORADATA\ORCL\UNDOTBS01.DBF
- channel ORA_DISK_1: starting piece 1 at 04-NOV-16
- channel ORA_DISK_2: starting full datafile backup set
- channel ORA_DISK_2: specifying datafile(s) in backup set
- input datafile file number=00002 name=C:\APP\ORADATA\ORCL\SYSAUX01.DBF
- input datafile file number=00005 name=C:\APP\ORADATA\ORCL\EXAMPLE01.DBF
- input datafile file number=00004 name=C:\APP\ORADATA\ORCL\USERS01.DBF
- channel ORA_DISK_2: starting piece 1 at 04-NOV-16
- channel ORA_DISK_1: finished piece 1 at 04-NOV-16
- piece handle=C:\KOPIE_RMAN\ORA_DF865814791_S3_S1 tag=TAG20161104T000630 comment=
- NONE
- channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
- channel ORA_DISK_2: finished piece 1 at 04-NOV-16
- piece handle=C:\KOPIE_RMAN\ORA_DF865814795_S4_S1 tag=TAG20161104T000630 comment=
- NONE
- channel ORA_DISK_2: backup set complete, elapsed time: 00:00:38
- Finished backup at 04-NOV-16
- Starting Control File and SPFILE Autobackup at 04-NOV-16
- piece handle=C:\KOPIE_RMAN\ORA_CFC-1296006456-20161104-00 comment=NONE
- Finished Control File and SPFILE Autobackup at 04-NOV-16
- 7. Kopia bazy: C:\KOPIE_RMAN
- 9. RMAN> startup
- database is already started
- database opened
- 12. SQL> CREATE USER student IDENTIFIED BY student;
- User created.
- SQL> GRANT DBA to Student
- 2 ;
- Grant succeeded.
- SQL> select tablespace_name, table_name from tabs;
- TABLESPACE_NAME TABLE_NAME
- ------------------------------ ------------------------------
- SYSTEM SYS_IOT_OVER_11732
- SYSAUX SYS$SERVICE_METRICS_TAB
- SYSAUX AQ$_SYS$SERVICE_METRICS_TAB_S
- SYSAUX SYS_IOT_OVER_11848
- SYSTEM KSIZAKA
- ATEMPTAB$
- SQLLOG$
- SQLOBJ$
- SQLOBJ$DATA
- MAP_OBJECT
- CLUSTER_DATABASES
- 13. SQL> insert into KSIAZKA values(1,'Jeden',111);
- 1 row created.
- SQL> insert into KSIAZKA values(2,'Dwa',222);
- 1 row created.
- SQL> insert into KSIAZKA values(3,'Trzy',333);
- 1 row created.
- SQL> COMMIT
- Commit complete.
- 14. SQL> ALTER SYSTEM SWITCH LOGFILE;
- System altered.
- SQL> ALTER SYSTEM SWITCH LOGFILE;
- System altered.
- SQL> ALTER SYSTEM SWITCH LOGFILE;
- System altered.
- SQL> ALTER SYSTEM SWITCH LOGFILE;
- System altered.
- 15. SQL> SHUTDOWN IMMEDIATE;
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- 16. Usunieto:
- C:\app\oradata\orcl\USERS01.DBF
- 17. SQL> startup;
- ORACLE instance started.
- Total System Global Area 535662592 bytes
- Fixed Size 1334380 bytes
- Variable Size 201327626 bytes
- Database Buffers 327155884 bytes
- Redo Buffers 5844992 bytes
- Database mounted.
- ORA-01113: file 1 needs media recovery
- ORA-01110: data file 1: 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
- Wykryto brakujacy plik
- SQL> startup;
- ORACLE instance started.
- Total System Global Area 535662592 bytes
- Fixed Size 1334380 bytes
- Variable Size 201327626 bytes
- Database Buffers 327155884 bytes
- Redo Buffers 5844992 bytes
- Database mounted.
- ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
- ORA-01110: data file 4: 'C:\APP\ORADATA\ORCL\USERS01.DBF'
- 18. rman target sys/manager@orcl
- 19. RMAN> RESTORE TABLESPACE USERS;
- Starting restore at 04-NOV-16
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=161 device type=DISK
- allocated channel: ORA_DISK_2
- channel ORA_DISK_2: SID=151 device type=DISK
- channel ORA_DISK_1: starting datafile backup set restore
- channel ORA_DISK_1: specifying datafile(s) to restore from backup set
- channel ORA_DISK_1: restoring datafile 00004 to C:\APP\ORADATA\ORCL\USERS01.DBF
- channel ORA_DISK_1: reading from backup piece C:\KOPIE_RMAN\ORA_DF865814795_S4_S
- 1
- channel ORA_DISK_1: piece handle=C:\KOPIE_RMAN\ORA_DF865814795_S4_S1 tag=TAG20161104T000630
- channel ORA_DISK_1: restored backup piece 1
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
- Finished restore at 04-NOV-16
- 20. SQL> SHUTDOWN IMMEDIATE;
- ORA-01109: database not open
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup;
- ORACLE instance started.
- Total System Global Area 535662592 bytes
- Fixed Size 1334380 bytes
- Variable Size 184550292 bytes
- Database Buffers 343932928 bytes
- Redo Buffers 5844992 bytes
- Database mounted.
- ORA-01113: file 1 needs media recovery
- ORA-01110: data file 1: 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
- 21. System wymaga pliku
- 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
- CZESC IV
- 2. SQL> select log_mode from v$database;
- SQL> archive log
- LOG_MODE
- ------------
- NOARCHIVELOG
- 3. SQL> SHUTDOWN IMMEDIATE;
- ORA-01109: database not open
- Database dismounted.
- ORACLE instance shut down.
- 4. SQL> startup mount;
- ORACLE instance started.
- Total System Global Area 535662592 bytes
- Fixed Size 1334380 bytes
- Variable Size 184550292 bytes
- Database Buffers 343932928 bytes
- Redo Buffers 5844992 bytes
- Database mounted.
- SQL> alter database archivelog;
- Database altered.
- SQL> alter database open;
- Database altered.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement