24 Ağustos 2011 Çarşamba

fiziksel standby - incremental backup uygulama

standby>SQL> select CURRENT_SCN from v$database;

CURRENT_SCN
-----------
3584975657

primary>SQL> select CURRENT_SCN from v$database;

CURRENT_SCN
-----------
3586326579


primary>backup incremental from scn 3584975657 database format '/oracle/yedek/standby_%U';

standby>catalog start with '/oracle/yedek/standby';

primary>alter database create standby controlfile as '/oracle/yedek/standby.ctl';


primmary>alter database register logfile '1_6696_746463756.dbf';

http://jarneil.wordpress.com/2008/06/03/applying-an-incremental-backup-to-a-physical-standby/

14 Temmuz 2010 Çarşamba

Redo log Dosyalarında Bozulma (ORA-00312)

O an kullanılmayan (statusu current olmayan) Redo log dosyalarında bozulma olursa, Archiver redo log dosyasını kullanmaya çalıştığında durur ve veritabanı DML işlemini tamamlayamaz. Örnek bir redo log bozulması durumunda alert log’da göreceğimiz mesajlara bakalım:

Errors in file /oracle/diag/rdbms/oratest/oratest/trace/oratest_arc3_10426.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: ‘/oracle/oradata/oratest/redo01.log’
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
Bu durumda yapılması gereken hatalı olan redo logları sıfırlamaktır. Hata mesajlarında görüldüğü üzere 1. gruptaki redo log dosyasında (redo1.log) problem var. Bozulmuş olan redo log dosyasını aşağıdaki komutlar ile temizleyebilirsiniz:

ALTER DATABASE CLEAR UNARCHIVED LOGFILE ‘/oracle/oradata/oratest/redo1.log’;

veya

ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 1;
Alternatif olarak bu log dosyasını DROP edip yeniden oluşturabilirsiniz. Log file’ı temizlerken kullanılan UNARCHIVED parametresi, log file’ın henüz archivelenmediğini, yeniden kullanıldıktan sonra arşivleme yapılmasının istendiğini gösterir. Bu işlemden sonra archiever prosesi çalışmaya devam edecektir:

Completed: ALTER DATABASE CLEAR UNARCHIVED LOGFILE group 1
Wed May 26 22:50:43 2009
Archiver process freed from errors. No longer stopped
Wed May 26 22:50:50 2009
Starting background process SMCO
Wed May 26 22:50:50 2009
SMCO started with pid=15, OS id=16754
Wed May 26 22:52:41 2009
Thread 1 cannot allocate new log, sequence 14
Private strand flush not complete
Current log# 1 seq# 13 mem# 0: /oracle/oradata/oratest/redo01.log
Thread 1 advanced to log sequence 14 (LGWR switch)
Current log# 2 seq# 14 mem# 0: /oracle/oradata/oratest/redo02.log
Thread 1 cannot allocate new log, sequence 15
Checkpoint not complete
Archiver prosesi çalışmasına devam etmesine rağmen eğer “checkpoint not complete” uyarısı veriyorsa manuel olarak checkpoint yaptırmamız gerekir:

ALTER SYSTEM CHECKPOINT;
Eğer sorunlu olan redo log dosyası “o an kullanımda olan” (statusu current) redolog dosyası ise hata archiver yerine logwiter (LGWR) prosesi tarafından tespit edilecek ve veritabanı kapanacaktır. Yeniden açtığınız zaman veritabanı, redo log’un silinmesine izin vermez. Bu durumda recovery işlemi yapmanız gerekir:

RMAN> RESTORE DATABASE;
SQL> RECOVER DATABASE UNTIL CANCEL;
SQL> ALTER DATABASE OPEN RESETLOGS;
---------------------------------------
http://www.gokhanatil.com/2009/07/redo-log-dosyalarinda-bozulma-ora-00312/

8 Temmuz 2010 Perşembe

CP of Datafile for Online Backup Returns "A system call received a parameter that is not valid."

Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.3
AIX5L Based Systems (64-bit)

Symptoms
Coping a datafile after a 'begin backup' with the database is open returns an error:
A system call received a parameter that is not valid.


Cause
This problem is caused with the use of JFS2 file systems, CIO not enabled, and the parameter FILESYSTEMIO_OPTIONS set to SETALL.

Note 272520.1 - Direct I/O or Concurrent I/O on AIX 5L:
External utilities or tools cannot read datafiles on JFS2 file systems if you use the values SETALL or DIRECTIO for the FILESYSTEMIO_OPTIONS parameter. For more information, refer to the AIX
documentation which covers the open() restriction in cio mode.


Solution
1. Enable CIO on JFS2 file system

OR

2. Change FILESYSTEMIO_OPTIONS=asynch


Since its a dynamic initialization parameter you can use the ALTER SESSION,
ALTER SYSTEM commands to do this.

Parameter type
String

Syntax
FILESYSTEMIO_OPTIONS = {none | setall | directIO | asynch}

Default value
There is no default value.

Parameter class
Dynamic: ALTER SESSION, ALTER SYSTEM


References
Note 257338.1 - Direct I/O (DIO) and Concurrent I/O (CIO) on AIX 5L
Note 272520.1 - Direct I/O or Concurrent I/O on AIX 5L
----------------------------------------------------
http://ebsblog.blog.163.com/blog/static/127949789200981533133531/
http://forums.sdn.sap.com/message.jspa?messageID=3129195

26 Haziran 2010 Cumartesi

Solaris Oracle kurulumu Hazırlıkları

network ip sabitleme;
/etc/hostname
/etc/hosts
/etc/nodename
----------------------
Creating Required Operating System Groups and Users

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper
id nobody
id -a oracle
useradd -g oinstall -G dba,oper -m -d /export/home/oracle -s /bin/bash oracle
# id -p
uid=0(root) gid=0(root) projid=1(user.root)
# prctl -n project.max-sem-ids -i project user.root
#prctl -n project.max-shm-memory -i project 1
#prctl -n project.max-shm-memory -v 6gb -r -i project 1
#projadd -p 101 -c 'ORA DBA' -U oracle -G dba -K 'project.max-shm-memory=(privileged,6G,deny)' ORA
/etc/user_attr
oracle::::project=ORA
id -p
uid=100(oracle) gid=100(oinstall) projid=101(ORA)
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=100
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=256
--swap alanı ekleme
swap -l
zfs create -V 1G -b 4k rpool/swap2
zfs volsize=1G rpool/swap2
swap -a /dev/zvol/dsk/rpool/swap2
http://docs.sun.com/app/docs/doc/817-5093/gizfl?a=view

TDP for Oracle for Solaris RMAN backup

root>pkgadd -d TIVsmCapi.pkg
root>./TDPoraclex86.bin
set LD_LIBRARY_PATH=$ORACLE_HOME/lib
shutdown db
$ ln -s /usr/lib/amd64/libobk.so $ORACLE_HOME/lib/libobk.so
$ ln -s /opt/tivoli/tsm/client/oracle/bin64/libobk.so $ORACLE_HOME/lib/libobk.so
veya
ln -s /opt/tivoli/tsm/client/oracle/bin/libobk.so $ORACLE_HOME/lib/libobk.so
start db
/usr/bin/dsm.opt
SERVERNAME TBM
traceflag config
tracefile /export/home/oracle/log/tsm_trace.out /opt/tivoli/tsm/client/oracle/bin64
/usr/bin/dsm.sys
SErvername TBM
COMMMethod TCPip
TCPPort 1500
TCPServeraddress ipaddress
NODENAME TBM
PASSWORDACCESS prompt
COMPRESSION yes
root ile
Export DSMO_NODE=TBM
Export DSMI_CONFIG=/usr/bin/dsm.opt
Export DSMI_LOG=/opt/tivoli/tsm/client/oracle/bin
DSMI_DIR
/opt/tivoli/tsm/client/oracle/bin/tdp.opt
DSMI_ORC_CONFIG /usr/bin/dsm.opt
DSMI_LOG /opt/tivoli/tsm/client/oracle/bin64
TDPO_FS orc8_db
TDPO_NODE TBMI
TDPO_OWNER root
TDPO_PSWDPATH /opt/tivoli/tsm/client/oracle/bin64
resolv.conf
nsswitch.conf
/opt/tivoli/tsm/client/oracle/bin/tdpoconf password veya showenv
backup;
shutdown immediate;
startup mount;
--------------------------
hata verirse log dosyasına yazma izni verilmesi yeterli!
--------------------------
run
{
allocate channel t1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin/tdpo.opt)';
backup
format 'df_%t_%s_%p'
(database);
}

run
{
allocate channel 'c1' device type sbt_tape
PARMS='SBT_LIBRARY=/opt/tivoli/tsm/client/oracle/bin/libobk.so';
}

24 Haziran 2010 Perşembe

TDP for Oracle for Windows RMAN backup

1. Register a node on the TSM server.
register node nodename password domain=domainname
parola-123
2. Stop all Oracle services.
OK
3. Install TDP for Oracle for Windows.
E diskine kuruldu
4. Configure the client options file (dsm.opt).
commmethod tcpip
tcpport 1500
TCPServeraddress ip
Nodename TBMI
passwordaccess generate
5. Generate the encrypted password using aobpswd.exe.
E:\Program Files\Tivoli\TSM\AgentOBA\tdpoconf password - 123
E:\Program Files\Tivoli\TSM\AgentOBA\tdpoconf show
6. Test a TDP for Oracle for Windows RMAN backup.
set ORACLE_HOME
rman nocatalog
connect target user/pass@
shutdown immediate
startup mount
ora12514
lissner
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(GLOBAL_DBNAME = orcl)
)

run {
allocate channel t1 type 'sbt_tape' parms
'ENV=(DSMO_DEBUG=49)';
backup (database);}
rman>list backup;
tsm>q occupancy
tsm>select * from backups where node_name='nodename'
rman>allocate channel for delete type 'sbt_tape';
rman>list backup;
rman>change backuppiece '03lh1hgg_1_1' delete; -tsm LL_NAME:03lh1hgg_1_1
rman>change backuppiece '06lh1meb_1_1' delete;
ANS4994S DP Oracle Win32 ANU0599 TDP for Oracle: (848): => () ANS1126E (RC27) The
file space cannot be deleted because this node does not have
permission to delete archived or backed up data.
tsm>update node backdel=y

7. Install the TSM backup-archive client (optional).

job listesi

EXEC dbms_job.broken(jobno, FALSE);
select job,broken from user_jobs;
select text from user_source
where type = 'PROCEDURE'
and name = procedure_name;
SELECT text FROM all_source WHERE name like '%CTRL%';

SQL> CREATE OR REPLACE PROCEDURE CTRL IS
2 begin
3 dbms_utility.exec_ddl_statement('alter database backup controlfile to trace as ''/oracle/yedek/ctrlbackup.trc'' reuse');
4 end CTRL;
5 /

Procedure created.

SQL> execute CTRL;
SQL> SET ARRAYSIZE 1
SQL> SET MAXDATA 60000
SHOW ERRORS PROCEDURE
DROP PROCEDURE