25 kwietnia 2013
Kolejność działań
24 kwietnia 2013
Oracle Virtual Box shared foleders.
22 kwietnia 2013
FAST RECOVERY AREA
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.htmORACLE 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
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
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
Przełączenie do bazy Oracle bez tnsnames.
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 $ signhttp://www.adp-gmbh.ch/ora/sqlplus/
5 marca 2013
Oracle archive log enable/disable.
ORACLE 11g/10g
RMAN
rman> show controlfile autobackup;
rman> configure controlfile autobackup on;
rman> report schema;
rman> list backup;
rman> backup database;
1 lutego 2013
VIM
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/gSET 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.
emctl start dbconsole
emctl status agent
emctl stop agent
https://host:1158/em/console/aboutApplication
ORA-00845: MEMORY_TARGET not supported on this system
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.
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
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
23 listopada 2012
Sieć pod linuksem.
plik ifcfg-eth0 (/etc/sysconifig/network-scripts)
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….
… znaczy się w góry PAMIRU.
Relacje, fotki i naszą aktualną lokalizację można zobaczyć na:
Do zobaczenia za 6 tygodni
9 lipca 2012
28 czerwca 2012
22 czerwca 2012
14 czerwca 2012
17 maja 2012
Strona o naszej planowanej wyprawie do Pamiru w tym roku.
W prawym górnym rogu tej strony znajdziesz link: pamir2012
Tam znajdują się informacje o naszej planowanej wycieczce … Zapraszam!