23/9
Riddle: Digitalkey =hash
At the start of this experiment Flashback is off. Meaning flashback is not a requirement for restore point.
V$database:Flashback_on=NO
SQL> create restore point test guarantee flashback database;
Incremental backup using tar : good for file system backup/archiving of log directories etc.
Commands: I am using LVL variable to ease my work in rewriting incremental backup. Start from 0 and go up from there.
export LVL=0
tar --verbose --create --file=tmp_${LVL}.tar --listed-incremental=tmp.snar tmp/*
Note: snar file remains same at all levels, it is the tracker for incremental changes.
Next just change LVL=1,2 ..... so on. Must or the tar file get overwritten.
If any of the files get changed or new file created, next level automatically picks it up.
Alternate Method(I prefer):See the variable --level (0 means base and the incrementals)
export LVL=1
tar --verbose --create --file=tmp_${LVL}.tar --listed-incremental=tmp.snar --level=${LVL} tmp/*
Careful, I am endorsing any feature. Use judiciously.
DOC: https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/managing-indexes.html#GUID-FF3F7EF5-9468-48BC-8990-8189C1CBFD12
Auto Indexing feature
--create/make it available
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','IMPLEMENT');
--create/keep invisible
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','REPORT ONLY');
--Feature off
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','OFF');
***AUTO_INDEX_SCHEMA configuration setting to specify schemas that can use auto indexes
-- exclusion list
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', 'MYSCHEMA', FALSE);
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', 'YOURSCHEMA', FALSE);
--remove from exclusion list i.e. include
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', 'HR', NULL);
--Clear exclude list
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', NULL, TRUE);
***Retition for unused indexes
AUTO_INDEX_RETENTION_FOR_AUTO
--retain for 30days
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_AUTO', '30');
--default retention 373 days
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_AUTO', NULL);
---Warning/Alert Applicable for Manually created indexes(Use judgement)
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_MANUAL', '160');
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_MANUAL', NULL);
**Auto index logs/tracking
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_REPORT_RETENTION', '160');
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_REPORT_RETENTION', NULL); --default 373
**Specify tablespace for auto index
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_DEFAULT_TABLESPACE', 'TBS_AUTO');
**Allocation for auto indexes
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SPACE_BUDGET', '15'); --15%
**Compression on off
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_COMPRESSION','ON');
###**Reporting on auto index
REPORT_ACTIVITY and REPORT_LAST_ACTIVITY functions of the DBMS_AUTO_INDEX package
declare
report clob := null;
begin
report := DBMS_AUTO_INDEX.REPORT_ACTIVITY();
end;
declare
report clob := null;
begin
report := DBMS_AUTO_INDEX.REPORT_ACTIVITY(
activity_start => TO_TIMESTAMP('2018-11-01', 'YYYY-MM-DD'),
activity_end => TO_TIMESTAMP('2018-12-01', 'YYYY-MM-DD'),
type => 'HTML',
section => 'SUMMARY',
level => 'BASIC');
end;
Challenge 10
Dona , snow queen, boomister-Manual
Challenge 9
Challenge 8
Challenge 7
Chanllenge 6:
Challange 5:
Manual
Challenge 4:
Challenge 3:
Automode
Basic steps:
1.Cancel MRP on Standby database/shutdown/startup(default opens in readonly mode).
2. Include target tns in source tnsnames.ora
3. Prepare target.
Procedure is same as copying from Primary database with minor difference, put physical standby on RO mode.
RO-Read only.
Steps:
1. Configure Listener(to listen for connection) & copy orapwd.
Sample:
LISTENER =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL=IPC)
(KEY= CloneDB.world)
)
(ADDRESS =
(PROTOCOL = TCP)
(Host =<CloneDB Host>)
(Port = <PORT>)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = <CloneDB>)
(ORACLE_HOME = <Valid Home Path>)
)
)
2. Prepare TNS: Both source(Physical Standby) and Destination and init.ora(copy from source and adjust for DB & LOG convert parameters)
Sample:(Format :'Source path','Target Path', ........for each path in source)
*.db_file_name_convert='/u02/ORACLE/dbs','/u001/oradata/db,'/u03/ORACLE/dbs','/u002/oradata/db'
*.log_file_name_convert='/u02/ORACLE/redo','/u003/oradata/db','/u03/ORACLE/redo','/u004/oradata/db'
3. Open Physical standby in RO mode:
a. Cancel recovery.: alter database recover managed standby database cancel;
b. Shutdown immediate.
c. startup (This will open physical standby in RO mode automatically)
Note : TNS connection entries needed in tnsnames.ora both side(source/target)
Fireup RMAN:
rman target sys/pwd@<physicalstandby tns> auxiliary sys/pwd@<DuplicateDB tns>
run
{
allocate channel T1 type disk;
allocate channel T2 type disk;
allocate channel T3 type disk;
allocate channel T4 type disk;
allocate auxiliary channel A1 type disk;
allocate auxiliary channel A2 type disk;
allocate auxiliary channel A3 type disk;
allocate auxiliary channel A4 type disk;
DUPLICATE TARGET DATABASE TO 'sblut1db' FROM ACTIVE DATABASE NOFILENAMECHECK;
}
Number of channels may help to speedup the duplication process, be aware of load on the system(IO/CPU).
Additional info:
a. if duplicate fails fix the problem, normally would be 'missed' path creation.
b. UNDO tablespace parameter should either same or commented altogether, if different duplication would fail.