Oracle « Różności …

Różności …

2 maja 2013

Konwersja Oracle

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





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

22 stycznia 2012

ora-00054

Zaszufladkowany do: Oracle,PL/SQL — Tagi: — Jacek @ 21:08

ORA-00054: resource busy and acquire with NOWAIT specified

po zerwaniu sesji – nie można zrobić drop table

aby sprawdzić jaka sesja trzyma:

SELECT * FROM DBA_DML_LOCKS;
szczegóły w kolumnie LOCK_ID1:
SELECT * FROM DBA_LOCK_INTERNAL;

źródła:

http://www.dba-oracle.com/t_ora_00054_locks.htm

20 stycznia 2012

Oracle Enterprise Manager

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 17:06

http://setijoagus.wordpress.com/2008/11/07/oracle-11g-starting-the-oracle-enterprise-manager-console/

13 stycznia 2012

Import/export

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

http://www.oracle-dba-online.com/export_and_import.htm

13 grudnia 2011

Oracle SQL Functions

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

http://beginner-sql-tutorial.com/oracle-functions.htm

6 grudnia 2011

Instalacja Oracle Express.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 11:58

Instalacja Oracle10gXE

http://syntax.home.pl/OracleXEWindows.html

Źródła:

http://ns.prz-rzeszow.pl/~kswider/pbd/Oracle10gXE.pdf

23 listopada 2011

ORA-01882 on SQL Developer

Zaszufladkowany do: Oracle,PL/SQL — Tagi: , — Jacek @ 18:46

Edit sqldeveloper.conf configuration file located in the folder SQLDeveloper / bin

Add this line with the timezone:

AddVMOption -Duser.timezone="Europe/Warsaw"

Restart and try again.

sqlldr – ładownie danych z plików excell

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 17:27

CREATE TABLE HR.JS_USUN_PODWOJNE
(numerid NUMBER);
podwojne.ctl
LOAD DATA INFILE podwojne.csv
APPEND INTO TABLE HR.JS_USUN_PODWOJNE
FIELDS TERMINATED BY ‘,’
(NUMERID)
podwojne.csv
33
4534
35
645
78
2567
153

sqlldr ‘sys/haslo AS SYSDBA’ control=podwojne.ctl log=log2.log

http://infolab.stanford.edu/~ullman/fcdb/oracle/or-load.html

External tables in Oracle.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 15:54

http://www.adp-gmbh.ch/ora/misc/ext_table.html

http://www.dba-oracle.com/art_ext_tabs_spreadsheet.htm

http://www.dba-oracle.com/art_ext_tabs.htm

18 listopada 2011

Oracle SOA jdev extension.

Zaszufladkowany do: Java,Oracle,Programowanie — Tagi: — Jacek @ 17:52

Extensions for JDeveloper:

http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/156082.xml

Oracle licensing – vmware.

Zaszufladkowany do: Bez kategorii,Oracle — Tagi: — Jacek @ 17:06

Oracle licensing:

http://weinshenker.net/blog/2011/04/03/licensing-oracle-vmware-vsphere/

http://oraclestorageguy.typepad.com/oraclestorageguy/2010/05/oracle-license-costs-on-the-vmware-vsphere-platform.html

Oracle partitioning document:

http://www.oracle.com/us/corporate/pricing/partitioning-070609.pdf

Hard Partitioning with Oracle VM

VM TO HOSTS AFFINITY RULE:

http://frankdenneman.nl/2010/07/vm-to-hosts-affinity-rule/

vSphere Resource Management Guide

17 listopada 2011

SOA

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

Including SOA Features in Jdeveloper 11g R1 (11.1.1.1.0)

By rodrigo.jorquera on Jul 09, 2009

The new Jdeveloper’s release doesn’t include the development suite for SOA applications.
There’s an extension for that and can be downloaded from OTN.

The link to download the file (called Oracle SOA Composite Editor):
http://www.oracle.com/technology/products/jdev/101/update/fmw_products.xml

To download the file directly:
http://download.oracle.com/otn/java/jdeveloper/111/extensions/soa-jdev-extension.zip

After download the file, you can install it using the Check for update option in Jdeveloper.

As you can see in the following screenshot, the option is available under the Help menu.

Then select the option “Install From Local File”, and select the location where you put the zip file.

After that you will see that the Oracle SOA Composite Editor will be installed and Jdeveloper will restart.

To verify the installed extension, You can go to File -> New section and you will see the new option “SOA Tier”.

If you chose that you will have the following templates as an option:
Then, you are ready to work in your SOA project!.

źródło:

http://blogs.oracle.com/rodrigo/entry/including_soa_features_in_jdev

26 stycznia 2011

Oracle Web Tier installation – Oracle HTTP Server (OHS), Oracle Process Manager Notification (OPMN), Oracle Web Cache

Zaszufladkowany do: Oracle,Oracle Web Tier — Tagi: — Jacek @ 14:39

Oracle Web Tier contains two main components: Oracle HTTP Server and Oracle Web Cache. Oracle Process Manager and Notification Server (OPMN) is also installed by default. Together, these products are responsible for managing incoming HTTP requests, caching web messages, and sending XML and HTML back to the client.

Oracle HTTP Server provides a listener for Oracle WebLogic Server and the framework for hosting static pages, dynamic pages, and applications over the Web. It is based on Apache 2.2.10 infrastructure, and includes modules developed specifically by Oracle.

Oracle Web Cache is a content-aware server accelerator, or reverse proxy, for the Web tier that improves the performance, scalability, and availability of Web sites that run on Oracle HTTP Server. Oracle Web Cache is the primary caching mechanism provided with Oracle Fusion Middleware. Caching improves the performance, scalability, and availability of Web sites that run on Oracle WebLogic Server by storing frequently accessed URLs in memory.

OPMN provides a command-line interface for you to monitor and manage Oracle Fusion Middleware components and sub-components.

Mamy już zainstalowane Oracle WebLogic Server i skonfigurowaną domenę.

Ze strony Oracle pobieramy: Web Tier Utilities (11.1.1.2.0) i Web Tier Utilities (11.1.1.3.0)
UWAGA: Nie można od razu instalować wersji 11.1.1.3.0 (tak jak ja próbowałem zrobić :-) ) – to jest patch na wersjię 11.1.1.2.0
uruchamiamy: ./runInstaller

Jak widać sprawdzanie wywaliło się na “operating system packages” – no cóż – mamy środowoskow czysto testowe na Fedorze 14, podobna sytuacja była z instalką bazy Oracle. Olewamy to (ale tylko dlatego, że nie jest to środowisko produkcyjne)

ZONK :-)

Java Required Files (JRF)
When you configure Oracle WebLogic Server, you configure each domain using domain templates. One of the domain templates available with Oracle Fusion Middleware 11g is the Java Required Files (JRF) template.
The JRF template provides important Oracle libraries and other capabilities that support new versions of APIs that many OC4J applications depend upon.
Aby zainstalować JRF, należy uruchomić quickstart.sh
/home/oracle/Oracle/Middleware/wlserver_10.3/common/quickstart/quickstart.sh

teraz “Getting started … ”

Teraz wracamy do naszej instalki Web Tier Utilities, ale najpierw zatrzymaj i uruchom ponownie WebLogic Server:
/home/oracle/Oracle/Middleware/user_projects/domains/admserver/bin/stopWebLogic.sh
/home/oracle/Oracle/Middleware/user_projects/domains/admserver/startWebLogic.sh &

Niestety nie może być idealnie:

Błąd dotyczy webcache. Na razie nie udało mi się go rozwiązać … Continue
no i dupa … (ale dzisiaj już nie chce mi się dochodzić na czym się wywliło …)

Źródła:
http://download.oracle.com/docs/cd/E15523_01/install.1111/e14317/qinwt.htm

http://onlineappsdba.com/index.php/2010/06/10/changingstarting-ohs-oracle-http-server-11g-on-port-80-on-unix/

http://onlineappsdba.com/index.php/2009/08/21/installing-oracle-fusion-middleware-fmw-11g-identity-management-components-oid-dip-ovd-oif/

http://download.oracle.com/docs/cd/E12839_01/upgrade.1111/e10127/upgrade_adf_env.htm#CACCFDCA

« Nowsze wpisyStarsze wpisy »

Strona startowa: www.jaceksen.pl