1. Single file – Replaces Oracle with Naikhawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ *.txt
2. Multiple Files – Replaces Oracle with Naikhawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ *.txt
3. All the file which contains a patternawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ `find . exec grep -l “Oracle” {} \;
Note: Below command will not workfind . exec grep [...]
Archive for January, 2008
awk: Find & Replace
Posted in Linux/Solaris on January 26, 2008 | Leave a Comment »
Transportable TBS – Part 2
Posted in Transportable TBS on January 26, 2008 | Leave a Comment »
Assumptions* Tablespace name: TTBS* Source platform: Linux (32 bit)* Target platform: Solaris (64 bit)
To Identify the endian formatselect d.platform_name, endian_formatfrom v$transfortable_platform tp, v$database dwhere tp.platform_name=d.platform_name;
List of all platform and respective endian formatselect * from v$transfortable_platform order by platform _id;
Source Machine
1. check tablespace is transprtablea. execute this procedureexec dbms_tts.transport_set_check=(‘ttbs’,true);
b. check for any violationsselect * from transport_set_violations;
2. [...]
Transportable TBS – Part 1
Posted in Transportable TBS on January 26, 2008 | Leave a Comment »
Assumptions* Tablespace name=TTBS* Same platform (source and target) Source Machine1. check tablespace is transprtable a. execute this procedure exec dbms_tts.transport_set_check=(‘ttbs’,true);b. check for any violationsselect * from transport_set_violations;
2. Make tablespace read onlyalter tablspace ttbs read only;
3. Identify the datafilesselect file_name from dba_data_files where tablespace_name=’TTBS’;
4. Export tablespace’s metadataexpdp directory=dump1 dumpfile=expdp_ttbs.dmp transportable_tablespace=ttbs logfile=expdp_ttbs.log job_name=j15. Copy datafile and export [...]
Managing Standby Database
Posted in Standby Database on January 12, 2008 | Leave a Comment »
Start the standby database
startup nomount;alter database mount standby database;alter database recover managed standby database disconnect;
Shutdown the standby database
alter database recover managed standby database cancel;shutdown immediate;Registering the archive logs manualy
alter database register or replace logfile ‘/opt/oracle/archive/oradb_1_1234_48540.arc’;
Opening standby database in READ ONLY modealter database recover managed standby database cancel;
alter database open read only;
From READ ONLY mode to [...]