Różności …

Różności …

25 kwietnia 2013

Kolejność działań

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 07:50

24 kwietnia 2013

Oracle Virtual Box shared foleders.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 07:34

http://www.oracledistilled.com/virtualbox/create-and-mount-virtualbox-shared-folders/

22 kwietnia 2013

FAST RECOVERY AREA

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 09:10

FAST RECOVERY AREA

http://umardba.blogspot.com/2009/12/how-to-change-flash-recovery-area-to.html

sql> select value from v$parameter where name like ‘%db_recovery%;
sql> select value from v$paremeter where name=’control_files’;
sql> show parameter control_files;

ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+disk1' SCOPE=BOTH SID='*';
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 10G SCOPE=BOTH;
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
sql> alter system switch logfile;
rman> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;
RMAN> show all;
RMAN> list backup;
RMAN> list expired backup;
http://gavinsoorma.com/2009/12/11g-release-2-rman-backup-compression/  
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘HIGH’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘MEDIUM’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘LOW’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘BASIC’;
Unfortunately, unless you have purchased the Advanced Compression Option, your only choice is BASIC.
rman>list backup summary;
rman>DELETE BACKUPSET 145913,145914,145915,145916,145917;
rman>delete obsolete;
rman> crosscheck backup;
rman> crosscheck copy;
rman> list archivelog all;
rman> delete backup;

rman> DELETE NOPROMPT ARCHIVELOG ALL;
rman> delete noprompt archivelog until time 'SYSDATE-10';

SELECT * FROM v$recovery_file_dest; SELECT * FROM v$recovery_area_usage;

RMAN (Oracle docs)
http://docs.oracle.com/cd/E29597_01/backup.1111/e10642/rcmmaint.htm

ORACLE 9i

rman> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/ora_df%t_s%s_s%p';

Retention policy
rman> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;



18 marca 2013

archive log – cannot allocate new log

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 22:29

Droping online redo logs, if the redo log is Status is CURRENT or ACTIVE, the on-line redo log cannot be dropped. When trying to drop CURRENT online redo log, Oracle will return “ORA-01623: log 1 is current log for instance testdb (thread 1) – cannot drop” error message. When trying to drop online redo log in ACTIVE status, Oracle will return “ORA-01624: log 1 needed for crash recovery of instance testdb (thread 1)”

SQL> ALTER DATABASE
ADD LOGFILE GROUP 4 (‘E:\ORACLE\DB\TESTDB\ORADATA\REDO04A.LOG’,
‘E:\ORACLE\DB\TESTDB\ORADATA\REDO04B.LOG’)
SIZE 200M;

SQL>alter database add logfile member
‘/u01/oracle/ica/log11.ora’ to group 1;
Wszystkie redologi w grupie mają taką samą zawartość. Oracle zaleca aby w grupie były co najmniej dwa redologi.
W przypadku “cannot allocate new log” – należy dodać nowe grupy logów.

sql> alter database drop logfile group 1;
gdy grupa ma status active należy wykonać:
sql> alter system checkpoint;
sql> alter system switch logfile;

REDO LOG STATUS:

  • USED. Indicates either that a log has just been added (never used), or that a RESETLOGS command has been issued.
  • CURRENT. Indicates a valid log that is in use.
  • ACTIVE. Indicates a valid log file that is not currently in use.
  • CLEARING. Indicates a log is being re-created as an empty log due to DBA action.
  • CLEARING CURRENT. Means that a current log is being cleared of a closed thread. If a log stays in this status, it could indicate there is some failure in the log switch.
  • INACTIVE. Means that the log is no longer needed for instance recovery but may be needed for media recovery.

The v$logfile table has a status indicator that gives these additional codes:

  • INVALID. File is inaccessible.
  • STALE. File contents are incomplete (such as when an instance is shut down with SHUTDOWN ABORT or due to a system crash).
  • DELETED. File is no longer used.

17 marca 2013

ORA-19089 limit exceeded for recovery files

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 22:30

parameter: db_recovery_file_dest
/u01/app/oracle/flash_recovery_area
c:\oracle\app\oracle\flash_recovery_area

parameter: db_recovery_file_dest_size

SQL> alter database open;
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=2048576000 SCOPE=BOTH;
SQL> shutdown abort
SQL> startup

– fast recovery area usage
SELECT
NAME,
TO_CHAR(SPACE_LIMIT/1024/1024,’9999999.99′) || ‘ MB’ AS SPACE_LIMIT,
TO_CHAR((SPACE_LIMIT – SPACE_USED + SPACE_RECLAIMABLE)/1024/1024,’9999999.99′) || ‘ MB’ AS SPACE_AVAILABLE,
ROUND((SPACE_USED – SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1)
AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;
fast recovery area – informacje
http://www.orafaq.com/wiki/FRA
SELECT flashback_on, log_mode FROM v$database;
enabling archive log
http://www.oracledistilled.com/oracle-database/backup-and-recovery/enabledisable-archive-log-mode-10g11g/ (uwaga – TUTAJ NIE KORZYSTAJĄ Z FRA!!!!!!!!)

Przełączenie do bazy Oracle bez tnsnames.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 21:03

informacja o oracle service name:
lsnrctl> services

sqlplus sys@”(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=NUMER_PORTU))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=SID)))” as sysdba

SQLPLUS – komendy: http://docs.oracle.com/cd/B10501_01/server.920/a90842/ch13.htm

define _editor=vim
save nazwa append;

SQL> column colum_name alias alias_name
SQL> column colum_name clear

SQL> column colum_name entmap on
SQL> column colum_name entmap off

SQL> column colum_name fold_after
SQL> column colum_name fold_before
SQL> column colum_name format a25
SQL> column colum_name heading header_text

SQL> column colum_name justify left
SQL> column colum_name justify right
SQL> column colum_name justify center

SQL> column colum_name like expr|alias
SQL> column colum_name newline
SQL> column colum_name new_value variable
SQL> column colum_name print
SQL> column colum_name noprint
SQL> column colum_name old_value 

SQL> column colum_name on
SQL> column colum_name off 

SQL> column colum_name wrapped
SQL> column colum_name word_wrapped
SQL> column colum_name truncated
olumn column_name format a20
column column_name format a50 word_wrapped
column column_name format 999.999  -- Decimal sign
column column_name format 999,999  -- Seperate thousands
column column_name format $999     -- Include leading $ sign
http://www.adp-gmbh.ch/ora/sqlplus/

5 marca 2013

Oracle archive log enable/disable.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 12:03

ORACLE 11g/10g

http://www.oracledistilled.com/oracle-database/backup-and-recovery/enabledisable-archive-log-mode-10g11g/

RMAN

rman> show controlfile autobackup;

rman> configure controlfile autobackup on;

rman> report schema;

rman> list backup;

rman> backup database;

1 lutego 2013

VIM

Zaszufladkowany do: Oracle — Jacek @ 00:10

wyłączenie kolorowania:

syntax off

skasowanie pustych linii:

:g/^$/d

wyszukanie ^M


:%s/<Ctrl-V><Ctrl-M>//g

dopisanie czegoś do końca linii:
%s/$/ddd/g

SET TERMOUT OFF; spool M:\Documents\test; select * from employees; / spool off;


vim:
For example, to delete all lines containing "profile" (the first command is optional;
it shows the lines that the second command will delete):
:g/profile
:g/profile/d

skasowanie początku lini do określonego wyrażenia:
:%s/^.*QUERY: //g

dodanie średnika na końcu każdej linii
:%s/$/;/g

skasowania linii od znaku "*" do końca linii
:%s/*.*//g
:%s/OU=.*//g
skasowanie linii od zanku "*" np. 5 znaków
:%s/*.....//g
dodanie czegoś na początku linii
:%s/^/Coś /g
skasowanie linii do ostatniej spacji
:%s/^.* //g
skasowanie całości tekstu
:%s/.*//g
x   - delete current character
dw  - delete current word
dd  - delete current line
5dd - delete five lines

d$  - delete to end of line
d0  - delete to beginning of line

:1,.d
delete to beginning of file

:.,$d
delete to end of file

More complex patterns can be used, such as deleting all lines that are empty or that
contain only whitespace:

:g/^\s*$/d

To delete all lines that do not contain a pattern, use g!, like this command
to delete all lines that are not comment lines in a Vim script:

:g!/^\s*"/d
Delete all trailing whitespace (at the end of each line) with:
:%s/\s\+$//

Like with ed(1), the substitution text can be omitted if blank:

:%s/\s\+$

More rarely, a user might want to delete (leading) whitespace at the beginning of each line:

:%s/^\s\+
" Same thing (:le = :left = left-align given range):
:%le
:%s/<Ctrl-V><Ctrl-M>//g
Źródło:
http://vim.wikia.com/wiki/Delete_all_lines_containing_a_pattern

24 listopada 2012

Oracle Enterprise Manager in Linux.

Zaszufladkowany do: Bazy danych,Linux,Oracle — Tagi: , — Jacek @ 22:15

emctl start dbconsole

emctl status agent

emctl stop agent

https://host:1158/em/console/aboutApplication

ORA-00845: MEMORY_TARGET not supported on this system

Zaszufladkowany do: Bazy danych,Oracle — Tagi: — Jacek @ 21:52

Problem Description
While creating a startup database using dbca the database creation GUI gives error message in a pop up window,
ORA-00845: MEMORY_TARGET not supported on this system
from where you can ignore the error message.
The similar scenario also occur whenever you try to start your database then startup shows error message like below.

SQL> STARTUP
ORA-00845: MEMORY_TARGET not supported on this system

Cause of the Problem
•Starting from Oracle 11g the automatic memory management feature is now defined with parameter MEMORY_TARGET and MEMMORY_MAX_TARGET.

•On linux file system the shared memory need to be mounted on /dev/shm directory on the operating system.

•And the size of /dev/shm needs to be greater than MEMORY_TARGET or MEMMORY_MAX_TARGET.

•The AMM (Automatic Memory Management) now in 11g manages both SGA and PGA together by MMAN process.

•The MEMORY_TARGET parameter in 11g comes for (SGA_TARGET+PGA_AGGREGATE_TARGET) which was in 10g.

•And MEMORY_MAX_TARGET parameter in 11g comes instead of SGA_MAX_TARGET parameter which was in 10g.

•The ORA-00845:can arises for the following two reasons on linux system.

1)If the shared memory which is mapped to /dev/shm directory is less than the size of MEMORY_TARGET or MEMORY_MAX_TARGET.
or,
2)If the shared memory is not mapped to /dev/shm directory.

Solution of the Problem
Make sure /dev/shm is properly mounted. You can see it by,
#df -h or #df -k command.
The output should be similar like

$ df -k
Filesystem            Size  Used Avail Use% Mounted on
...
shmfs                 1G    512M 512M  50% /dev/shm
We see here for /dev/shm we have assigned 1G memory. Now if you set MEMORY_TARGET more than 1G then above ORA-845 will arise. For example if you have MEMORY_TARGET or MEMORY_MAX_TARGET set to 12G then you can mount shared memory to 13g like below.
As a root user,
# mount -t tmpfs shmfs -o size=13g /dev/shm
In order to make the settings persistence so that it will affect after restarting machine add an entry in /etc/fstab similar to the following:

shmfs /dev/shm tmpfs size=13g 0

Źródła:
http://arjudba.blogspot.com/2009/01/ora-00845-memorytarget-not-supported-on.html

23 listopada 2012

Sieć pod linuksem.

Zaszufladkowany do: Linux — Tagi: — Jacek @ 22:01

plik ifcfg-eth0 (/etc/sysconifig/network-scripts)

DEVICE=”eth0″
BOOTPROTO=none
NM_CONTROLLED=”yes”
ONBOOT=”yes”
TYPE=”Ethernet”
UUID=”3f1930ec-bca6-4ebc-a43e-1297b20a1079″
IPADDR=192.168.0.131
NETMASK=255.255.254.0
DNS2=153.19.250.100
GATEWAY=192.168.0.1
DNS1=153.19.105.120
IPV6INIT=no
USERCTL=no
HWADDR=”00:50:56:8C:3D:2D”
PREFIX=25
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes

route add -host 192.168.0.131 dev eth0

route add -net 192.168.0.0 netmask 255.255.254.0 dev eth0

route add default gw 192.168.0.1 eth0

15 sierpnia 2012

A jadę sobie w P….

Zaszufladkowany do: BLOG,Podróże — Tagi: , — Jacek @ 18:10

… znaczy się w góry PAMIRU.

Relacje, fotki i naszą aktualną lokalizację można zobaczyć na:

http://www.pamir2012.pl/

Do zobaczenia za 6 tygodni :-)

9 lipca 2012

People are awesome…

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 13:40

28 czerwca 2012

McDonald’s

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 18:58

22 czerwca 2012

Gorący apel!

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 12:30

14 czerwca 2012

Się szkolimy, się ćwiczymy …

Zaszufladkowany do: BLOG — Tagi: — Jacek @ 20:28

przed wyjazdem w Pamir …

17 maja 2012

Strona o naszej planowanej wyprawie do Pamiru w tym roku.

Zaszufladkowany do: BLOG,Podróże — Tagi: , — Jacek @ 13:53

W prawym górnym rogu tej strony znajdziesz link: pamir2012
Tam znajdują się informacje o naszej planowanej wycieczce … Zapraszam!

2 maja 2012

Fotki z naszych wypraw do Armenii i Gruzji.

Zaszufladkowany do: BLOG,Podróże — Tagi: , — Jacek @ 12:04

27 kwietnia 2012

Afganistan – historia konfliktu.

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 08:11

25 kwietnia 2012

Afganistan

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 15:53

http://www.advrider.com/forums/showthread.php?t=504942

« Nowsze wpisyStarsze wpisy »

Strona startowa: www.jaceksen.pl