[oracle@vmlnx01 admin]$ oerr ora 12514 12514, 00000, "TNS:listener does not currently know of service requested in connect descriptor" // *Cause: The listener received a request to establish a connection to a // database or other service. The connect descriptor received by the listener // specified a service name for a service (usually a database service) // that either has not yet dynamically registered with the listener or has // not been statically configured for the listener. This may be a temporary // condition such as after the listener has started, but before the database // instance has registered with the listener. // *Action: // - Wait a moment and try to connect a second time. // - Check which services are currently known by the listener by executing: // lsnrctl services // - Check that the SERVICE_NAME parameter in the connect descriptor of the // net service name used specifies a service known by the listener. // - If an easy connect naming connect identifier was used, check that // the service name specified is a service known by the listener. // - Check for an event in the listener.log file. lsnrctl services i dodać odpowiedni service do tnsnames.ora
5 grudnia 2013
ORA-12514: TNS:listener does not currently know of service
14 listopada 2013
Oracle 11g installation on Centos 6.4
28 października 2013
sqlplus – zmienna
export LD_LIBRARY_PATH=”/usr/lib/oracle/12.1/client64/lib/”
2 maja 2013
25 kwietnia 2013
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;
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
20 stycznia 2012
Oracle Enterprise Manager
13 stycznia 2012
13 grudnia 2011
6 grudnia 2011
Instalacja Oracle Express.
23 listopada 2011
ORA-01882 on SQL Developer
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
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.
http://www.adp-gmbh.ch/ora/misc/ext_table.html