To check rman output status from database
select output from GV$RMAN_OUTPUT;
Monday, 31 December 2012
Tuesday, 18 December 2012
Recreate control file error ORA-01194:
How to recreate controlfile
http://oracleinstance.blogspot.com/2010/09/re-create-lost-controlfile.html
http://oracleinstance.blogspot.com/2010/09/re-create-lost-controlfile.html
Monday, 5 November 2012
Weblogic clone/ change ip of manage server
BEA-090482 - BAD_CERTIFICATE
1. Disable Flags
Put the following flags at the right places.
Node Manager: -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false
Admin Server: -Dweblogic.security.SSL.ignoreHostnameVerification=true
2. Recreate the Certificates - The recommended way.
Node manager by default uses the WebLogic demo identity keystore. The keystore is generated at install time using the CertGen utility. The generated private key uses the common name (cn) resolved by Java.
2.1 Set the PATH
. $WL_HOME/server/bin/setWLSEnv.sh
2.2 Backup DemoIdentity.jks under $WL_HOME/server/lib
2.3 Generate the private key.
java utils.CertGen -cn -keyfilepass DemoIdentityPassPhrase -certfile newcert -keyfile newkey
2.4 Import the key generated above to the keystore.
java utils.ImportPrivateKey -keystore DemoIdentity.jks -storepass DemoIdentityKeyStorePassPhrase -keyfile newkey.pem -keyfilepass DemoIdentityPassPhrase -certfile newcert.pem -alias demoidentity
2.5 Copy DemoIdentity.jks to $WL_HOME/server/lib
2.6 Restart your nodemanager.
Tuesday, 25 September 2012
Loop xargs
$ find . -iname "*.mp3" -print0 | xargs -0 -I mp3file mplayer mp3file
Connect to iscsi disk debian
List device
iscsiadm -m discovery -t st -p 192.168.42.236
192.168.42.236:3260,1 iqn.2012-08.sc-nas-004.istgt:disk1
Connect:
iscsiadm -m discovery -t st -p 192.168.42.236 "iqn.2012-08.sc-nas-004.istgt:disk2" --portal "192.168.42.236:3260" --login
iscsiadm -m discovery -t st -p 192.168.42.236
192.168.42.236:3260,1 iqn.2012-08.sc-nas-004.istgt:disk1
Connect:
iscsiadm -m discovery -t st -p 192.168.42.236 "iqn.2012-08.sc-nas-004.istgt:disk2" --portal "192.168.42.236:3260" --login
Monday, 24 September 2012
Oracle EM repository recreate
emca -repos recreate
emca -config dbcontrol db
change ports
emca -reconfig ports -dbcontrol_http_port 1158
emca -config dbcontrol db
change ports
emca -reconfig ports -dbcontrol_http_port 1158
Recreate controlfile - change oracle database sid
From sqlplus
alter database backup controlfile to trace;
From trace (trace location you can find in alert_log)
#change reuse to set and remove controlfile
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "DM02DEV" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/data/s_ora01dmdev/oradata/dm02dev/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '/data/s_ora01dmdev/oradata/dm02dev/redo02.log' SIZE 50M BLOCKSIZE 512,
GROUP 3 '/data/s_ora01dmdev/oradata/dm02dev/redo03.log' SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'/data/s_ora01dmdev/oradata/dm02dev/system01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/sysaux01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/undotbs01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/users01.dbf'
CHARACTER SET AL32UTF8
;
ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE '/data/s_ora01dmdev/oradata/dm02dev/temp01.dbf'
SIZE 39845888 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
alter database backup controlfile to trace;
From trace (trace location you can find in alert_log)
#change reuse to set and remove controlfile
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "DM02DEV" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/data/s_ora01dmdev/oradata/dm02dev/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '/data/s_ora01dmdev/oradata/dm02dev/redo02.log' SIZE 50M BLOCKSIZE 512,
GROUP 3 '/data/s_ora01dmdev/oradata/dm02dev/redo03.log' SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'/data/s_ora01dmdev/oradata/dm02dev/system01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/sysaux01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/undotbs01.dbf',
'/data/s_ora01dmdev/oradata/dm02dev/users01.dbf'
CHARACTER SET AL32UTF8
;
ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE '/data/s_ora01dmdev/oradata/dm02dev/temp01.dbf'
SIZE 39845888 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
Rman backup script
#!/bin/bash
export ORACLE_SID=orcl_1
export ORACLE_BASE=/u01/app/oracle
export PATH=/u01/app/oracle/database/product/11.2.0/dbhome_1/bin:/u01/app/11.2.0/grid/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
export ORACLE_HOME=/u01/app/oracle/database/product/11.2.0/dbhome_1
basedir=/u01/app/oracle/backup
host=`hostname`
backup_dir=`date '+%Y.%m.%d'`
filename=`date '+%Y.%m.%d_%H.%M.%S'`
test -d ${basedir}/${host}/${backup_dir} || mkdir -p ${basedir}/${host}/${backup_dir}
if [ "x$1" = "x0" -o "x$1" = "x1" ]; then
inclevel=$1
rman target / log=${basedir}/${host}/${backup_dir}/backup_${filename}.log << !
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup as compressed backupset incremental level ${inclevel} database format '${basedir}/${host}/${backup_dir}/data_lv${inclevel}_${filename}.%U';
backup as compressed backupset archivelog all delete all input format '${basedir}/${host}/${backup_dir}/arch_${filename}.%U';
backup as compressed backupset current controlfile format '${basedir}/${host}/${backup_dir}/control_${filename}.%U';
backup spfile format '${basedir}/${host}/${backup_dir}/spfile_${filename}.%U';
delete noprompt obsolete recovery window of 7 days;
}
!
else
rman target / log=${basedir}/${host}/${backup_dir}/backup_${filename}.log << !
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup as compressed backupset archivelog all delete all input format '${basedir}/${host}/${backup_dir}/arch_${filename}.%U';
backup as compressed backupset current controlfile format '${basedir}/${host}/${backup_dir}/control_${filename}.%U';
backup spfile format '${basedir}/${host}/${backup_dir}/spfile_${filename}.%U';
delete noprompt obsolete recovery window of 7 days;
}
!
fi
export ORACLE_SID=orcl_1
export ORACLE_BASE=/u01/app/oracle
export PATH=/u01/app/oracle/database/product/11.2.0/dbhome_1/bin:/u01/app/11.2.0/grid/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
export ORACLE_HOME=/u01/app/oracle/database/product/11.2.0/dbhome_1
basedir=/u01/app/oracle/backup
host=`hostname`
backup_dir=`date '+%Y.%m.%d'`
filename=`date '+%Y.%m.%d_%H.%M.%S'`
test -d ${basedir}/${host}/${backup_dir} || mkdir -p ${basedir}/${host}/${backup_dir}
if [ "x$1" = "x0" -o "x$1" = "x1" ]; then
inclevel=$1
rman target / log=${basedir}/${host}/${backup_dir}/backup_${filename}.log << !
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup as compressed backupset incremental level ${inclevel} database format '${basedir}/${host}/${backup_dir}/data_lv${inclevel}_${filename}.%U';
backup as compressed backupset archivelog all delete all input format '${basedir}/${host}/${backup_dir}/arch_${filename}.%U';
backup as compressed backupset current controlfile format '${basedir}/${host}/${backup_dir}/control_${filename}.%U';
backup spfile format '${basedir}/${host}/${backup_dir}/spfile_${filename}.%U';
delete noprompt obsolete recovery window of 7 days;
}
!
else
rman target / log=${basedir}/${host}/${backup_dir}/backup_${filename}.log << !
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup as compressed backupset archivelog all delete all input format '${basedir}/${host}/${backup_dir}/arch_${filename}.%U';
backup as compressed backupset current controlfile format '${basedir}/${host}/${backup_dir}/control_${filename}.%U';
backup spfile format '${basedir}/${host}/${backup_dir}/spfile_${filename}.%U';
delete noprompt obsolete recovery window of 7 days;
}
!
fi
Size oracle object in system schema
select owner,segment_name,segment_type
,bytes/(1024*1024) size_m
from dba_segments
where tablespace_name = 'SYSTEM'
and bytes/(1024*1024) >1
order by size_m desc;
Friday, 30 March 2012
Oracle tips 2
Oracle ASM requiered packages
oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
Configuration disk for ASM
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk data /dev/xvdb1
Connecting to asm from SQLPLUS
sqlplus / as sysasm
Checking ASM Groups
select g.name, d.path
from v$asm_Diskgroup g, v$asm_disk d
where g.GROUP_NUMBER=d.GROUP_NUMBER;
RMAN
Changing location of files
catalog start with '+DATA';
Checking archievelog
crosscheck archivelog all;
delete expired archivelog all;
Checking all backups
RMAN> run {
crosscheck backupset;
delete expired backupset;
}
Checking database to copy
switch database to copy;
Restoring controlfile:
restore controlfile from '/u01/app/oracle/backup/control_2012.03.28_10.44.23.0un70f5n_1_1';
Select for create new name of files
select 'set newname for datafile ' || file# || ' to ''+DATA'';' as newname
from v$datafile
Saving result to file
SYS:orclasm > save newname
Adding service name to database
alter system
set service_names='orclasm','orcl'
scope=both;
Adding listerner to database configuration
alter system
set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.2.2)(PORT=1523))'
scope=both;
Change database unique name
alter system
set db_unique_name='orclasm'
scope=spfile;
Database restart
startup force mount
Package for undo in SQLPLUS
rlwrap-0.37-1.el5.x86_64.rpm
alias sqlplus='rlwrap -r sqlplus'
alias rman='rlwrap -r rman'
Calculating from console
echo "2147483648/1024/1024" | bc
Checking system page_size
getconf PAGE_SIZE
Recompilation binaries - turning of options
make -f ins_rdbms.mk rac_off ioracle
Opening database after unclean recovery
alter database open resetlogs;
oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
Configuration disk for ASM
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk data /dev/xvdb1
Connecting to asm from SQLPLUS
sqlplus / as sysasm
Checking ASM Groups
select g.name, d.path
from v$asm_Diskgroup g, v$asm_disk d
where g.GROUP_NUMBER=d.GROUP_NUMBER;
RMAN
Changing location of files
catalog start with '+DATA';
Checking archievelog
crosscheck archivelog all;
delete expired archivelog all;
Checking all backups
RMAN> run {
crosscheck backupset;
delete expired backupset;
}
Checking database to copy
switch database to copy;
Restoring controlfile:
restore controlfile from '/u01/app/oracle/backup/control_2012.03.28_10.44.23.0un70f5n_1_1';
Select for create new name of files
select 'set newname for datafile ' || file# || ' to ''+DATA'';' as newname
from v$datafile
Saving result to file
SYS:orclasm > save newname
Adding service name to database
alter system
set service_names='orclasm','orcl'
scope=both;
Adding listerner to database configuration
alter system
set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.2.2)(PORT=1523))'
scope=both;
Change database unique name
alter system
set db_unique_name='orclasm'
scope=spfile;
Database restart
startup force mount
Package for undo in SQLPLUS
rlwrap-0.37-1.el5.x86_64.rpm
alias sqlplus='rlwrap -r sqlplus'
alias rman='rlwrap -r rman'
Calculating from console
echo "2147483648/1024/1024" | bc
Checking system page_size
getconf PAGE_SIZE
Recompilation binaries - turning of options
make -f ins_rdbms.mk rac_off ioracle
Opening database after unclean recovery
alter database open resetlogs;
Thursday, 29 March 2012
Oracle tips
Checking from with group is runinnig instance
ORACLE_HOME\lib\config.c
Creating pfile from spfile
from sqlplus connected
create pfile from spfile
Creating instance - prepare spfile and may run database to nomount
Repair database though RMAN:
LIST FAILURE;
ADVISE FAILURE;
REPAIR FAILURE;
RMAN command
report schema
list copy of database;
catalog start with '/u01/oradata'; - changing database location
Recompiling oracle binareies without rack option
make -f $ORACLE_HOME/rdbms/ins_rdbms.mk rac_off ioracle
Relinking database
from $ORACLE_HOME/rdbms relink all
Editor from sqlplus
SQL> define _Editor=vim
SQL> ed
ORACLE_HOME\lib\config.c
Creating pfile from spfile
from sqlplus connected
create pfile from spfile
Creating instance - prepare spfile and may run database to nomount
Repair database though RMAN:
LIST FAILURE;
ADVISE FAILURE;
REPAIR FAILURE;
RMAN command
report schema
list copy of database;
catalog start with '/u01/oradata'; - changing database location
Recompiling oracle binareies without rack option
make -f $ORACLE_HOME/rdbms/ins_rdbms.mk rac_off ioracle
Relinking database
from $ORACLE_HOME/rdbms relink all
Editor from sqlplus
SQL> define _Editor=vim
SQL> ed
Subscribe to:
Posts (Atom)