Nls_date_format in oracle 10g XE

Hi guys,
I've been trying to change the default date format in my instance of 10g XE. I could do it in Standard version just modifying the init script but I couldn't find a way to do it in XE.
I don't want to use "ALTER SESSION" since I really need to change the default date format and not just in the sesion.
Could you help me?
Cheers.

You could create an after logon trigger as in following example :
SQL> sho user
USER is "SYS"
SQL> select sysdate from dual;
SYSDATE
24-MAY-07
SQL> create or replace trigger after_logon
  2  after logon on database
  3  begin
  4     if user='TEST' then
  5             execute immediate
  6             'alter session set nls_date_format=''YYYY-mm-dd hh24:mi:ss''';
  7     end if;
  8  end;
  9  /
Trigger created.
SQL> conn test/test
Connected.
SQL> select sysdate from dual;
SYSDATE
2007-05-24 15:56:55
SQL> conn system/manager
Connected.
SQL> /
SYSDATE
24-MAY-07
SQL>

Similar Messages

  • In Oracle 10g global support system,I set parameter of NLS_DATE_FORMAT.(98)

    In Oracle 10g global support system,I have set parameter of NLS_DATE_FORMAT.I am wondering about that whether it could affect the default value of NLS_TIMESTAMP_FORMAT?
    Message was edited by:
    frank.qian

    test@ORCL> select sysdate from dual;
    SYSDATE
    24-NOV-06
    Elapsed: 00:00:00.00
    test@ORCL> DECLARE
      2     checkout TIMESTAMP(3);
      3  BEGIN
      4     checkout := '22-JUN-2004 07:48:53.275';
      5     DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
      6  END;
      7  /
    22-JUN-04 07.48.53.275 AM
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    test@ORCL> alter session set nls_date_format="MM/DD/YYYY";
    Session altered.
    Elapsed: 00:00:00.00
    test@ORCL> select sysdate from dual;
    SYSDATE
    11/24/2006
    Elapsed: 00:00:00.00
    test@ORCL> DECLARE
      2     checkout TIMESTAMP(3);
      3  BEGIN
      4     checkout := '22-JUN-2004 07:48:53.275';
      5     DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
      6  END;
      7  /
    22-JUN-04 07.48.53.275 AM
    PL/SQL procedure successfully completed.
    test@ORCL> alter session set NLS_TIMESTAMP_FORMAT = 'DD/MM/YYYY HH:MI:SS.FF';
    Session altered.
    Elapsed: 00:00:00.00
    test@ORCL> DECLARE
      2     checkout TIMESTAMP(3);
      3  BEGIN
      4     checkout := '22-JUN-2004 07:48:53.275';
      5     DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
      6  END;
      7  /
    22/06/2004 07:48:53.275
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    test@ORCL>
    test@ORCL>

  • Date format in Oracle 10g XE

    I'm using Oracle 10g XE on Windows Vista and I'm curious as to what determines the date format.
    According to the globalization section in the Oracle installation guide the NLS_DATE format is dependent on the NLS_LANGUAGE setting. In my database the NLS_LANGUAGE is American, the NLS_TERITORY is America and all other NLS_* parameters are blank (default).
    From that I would expect the default date format to be mon-dd-yyyy.
    However when I run SELECT sysdate FROM dual the date is reported as dd/mm/yyyy and this was the default format when I used SQL Developer and when I used the command line SQL*Plus. Obviously something else is determining the date format, but what?

    Your settings are dependent on NLS_LANG on the client.
    They are derived from (assuming Windows) the regional settings of the O/S.
    This means in Western Europe the default 'American_America.WE8MSWIN1252'.
    This makes the default NLS_DATE_FORMAT dd-mm-yy.
    You can override this in the registry, or set up an after logon trigger.
    Sybrand Bakker
    Senior Oracle DBA

  • Oracle 10g R2 - Unicode is converted to unknown ?����

    Ok, I've read a thousand posts. Tried everything still stuck.
    I am using Oracle 10g : 10.2.0.5.0
    I'm on a Mac, using SQL Developer 3.1.07
    When I enter "ė€£¥©", the insertion into the database converts it to: ?����
    This is straight from a SQL INSERT command, in SQLDeveloper, no java code or anything.
    I tried adding a file called SQLDeveloper.app/Resources/sqldeveloper/sqldeveloper/sqldeveloper.conf and added these lines:
    -Doracle.jdbc.defaultNChar=true
    -Doracle.jdbc.convertNcharLiterals=true
    Didn't help.
    I tried created a test column and made the datatype NVARCHAR2. same results. VARCHAR column does the same corruption but that's expected.
    I tried N'©' - doesn't work
    I tried INSERT INTO testchar (column1) VALUES ( unistr('©') );
    results is still : �
    I check NSL_NVAR_CHARACTERSET and it's UTF8
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     US7ASCII
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    NLS_NCHAR_CHARACTERSET     UTF8
    NLS_RDBMS_VERSION     10.2.0.5.0I don't know what else to do. I am not a DBA. I'm just trying to fix a bug or at least tell a customer what's wrong. Entering special characters is required. Can anyone help? thank you!
    I have read that the insertion into the database does its own conversion but I don't know if that applies to me since I'm in 10g R2
    Edited by: 947012 on Aug 14, 2012 11:43 AM
    My mac's locales are also :
    $ locale
    LANG="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_CTYPE="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_ALL=Edited by: 947012 on Aug 14, 2012 11:45 AM
    Edited by: 947012 on Aug 14, 2012 11:49 AM

    NLS_NCHAR_CHARACTERSET specifies the encoding of the NVARCHAR2 variables but not the SQL statements. SQL statements, when they arrive to the database server, are always encoded in the database character set (NLS_CHARACTERSET). This is true for the whole statement, including any character literals. Therefore, even if a literal is valid in SQL Developer (which works in Unicode), when the literal arrives to the database, it is already stripped of all characters that the database character set does not support. The characters are not actually removed but they are converted to a replacement character. In case of the US7ASCII database character set, anything non-ASCII is lost.
    The trick to avoid this problem is to:
    - mark the literals that need to be preserved for NVARCHAR2 columns as NVARCHAR2 literals by prefixing them with "n".
    - set the mentioned property to activate the client side encoding mechanism with basically does a rough parsing of the statement and replaces all N-literals with U-literals. Undocumented U literals are similar to UNISTR calls. They encode non-ASCII characters with Unicode escape sequences. For example, n'€' (U+20AC) is encoded as u'\20AC'. As u'\20AC' contains only ASCII characters, it arrives to the database unchanged. The SQL parser recognizes the U-literals and converts them (unescapes them) to NVARCHAR2 constants before further SQL processing, such as INSERT.
    -- Sergiusz

  • Oracle 10g - Chinese Charecter issue

    Hi All
    I have the following scenario and I need your valuable inputs solve my problem
    I am using Oracle 10g version and I have a database created and it contains around 9 tables and 25k records, as per my current requirement I need to add few more columns in the existing tables and those new columns are going to be filled with contents from multiple languages (as of now Chinese and English). I went through Oracle 10g globalization guide and I understood that, for my requirements I need to add new columns with data types of either NVARCHAR or NCHAR.
    I created the following table and tried to insert some Chinese characters as follows but it’s not coming as expected and I’m getting inserted only ‘????’ in my table columns
    Please find below the list of my actions from SQL Developer
    create table Employee(EmpId varchar(255), EmpName NCHAR(255));
    insert into Employee(EmpId, EmpName) values('280129','彭俊睦');
    select * from Employee;280129 ¿¿¿
    insert into Employee(EmpId, EmpName) values('28018',N'彭俊睦');
    select * from Employee;280129 ¿¿¿
    28018 ¿¿¿
    When I run the “select * from v$nls_parameters;” query I’m getting the following data
    NLS_LANGUAGE --------- SIMPLIFIED CHINESE
    NLS_TERRITORY--------- AMERICA
    NLS_CURRENCY--------- $
    NLS_ISO_CURRENCY--------- AMERICA
    NLS_NUMERIC_CHARACTERS--------- .,
    NLS_CALENDAR--------- GREGORIAN
    NLS_DATE_FORMAT--------- DD-MON-RR
    NLS_DATE_LANGUAGE--------- SIMPLIFIED CHINESE
    NLS_CHARACTERSET--------- WE8ISO8859P1
    NLS_SORT--------- BINARY
    NLS_TIME_FORMAT--------- HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT--------- DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT--------- HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT --------- DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY--------- $
    NLS_NCHAR_CHARACTERSET--------- AL16UTF16
    NLS_COMP--------- BINARY
    NLS_LENGTH_SEMANTICS--------- BYTE
    NLS_NCHAR_CONV_EXCP--------- FALSE
    Please let me know what I’m doing wrong, and help me to solve this problem.
    Waiting for your update
    Thanks
    With Regards
    Venkatesh
    Edited by: user13118930 on May 21, 2010 5:20 PM

    Dear ,
    The problem is with your SQL>
    You can not use the unicode characters in the sql * plus ad the sql * plus is not able to identify them
    you need to do is as follow:
    you can use a high ide for the input and output which supports the unicode system for the chacaters input;
    as in the sql * plus if you are typing the chinese characters then sql*plus environment which is taking only the
    256 characters could not understand the given characters and hence ? is inserted as default exceptions for not recognising any characters....
    So use the graphical user interface to enter the data and extract the data..
    You can even take the html forms to enter the data for unicode character sets and any others developer
    forms using richtext box for the input...
    Even you can take the MS Access forms to enter the data in unicode supports and link the tables with oracle...
    If still problem then come back
    Best of luck

  • Multi Language Support in Oracle 10g

    Hi
    My problem is as detailed below :
    Server : Windows 2003 based IIS Web Server( English )
    DB : Oracle 10g EE on Linux Enterprise Edition (Eng)
    The web pages should accept data in 7 world languages including Chinese, Japanese, German, French, Spanish, Italian and English. The data should be stored in the database in the language in which the data is typed.
    Please let me know the database settings in Linux ( the characterset and NLS_LANG parameters ).
    What precautions need to be taken at the client side ?
    Thanks
    Dev

    Hi Justin,
    The database setting is:
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 9.2.0.4.0
    The session settings is :
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    What parameters need to be altered and how to make us enter Japanese / Chinese Characters and display the same accordingly ?
    Thanks
    Dev

  • Error starting up Oracle 10g database.

    Hi,
    (I had shutdown my database by "shutdown abort")
    Now i'm getting the following error while trying to startup Oracle 10g database version :- 10.2.0.1.0.
    SQL> startup nomount
    ORA-07345: The datafile name must not contain the string '..'.
    I get the same error even for startup/ startup mount
    currently i'm using only pfile for startup as there is no spfile in dbs directory.

    Hi Kuljeet,
    This is a very strange error, i know, controlfile contains are not read in "no mount" state of database... still i'm getting the error.
    The contents of my pfile are as follows :-
    ============================================================
    # Copyright (c) 1991, 2001, 2002 by Oracle Corporation
    # Archive
    log_archive_dest_1='location=/net/nasdbdmp/vl/nasdbdmp/db_dumps/OQF/data/arch'
    #log_archive_format=%t_%s_%r.dbf
    log_archive_format=%t_%s_%r
    ##log_archive_dest='/net/nasdbdmp/vl/nasdbdmp/db_dumps/OQF/data/arch'
    # Cache and I/O
    db_block_size=8192
    # Cluster Database
    cluster_database=FALSE
    # Cursors and Library Cache
    open_cursors=300
    # Database Identification
    db_domain=""
    db_name=DSOLPROD
    # Diagnostics and Statistics
    background_dump_dest=/vl/dsolprod/oracle/product/admin/DSOLPROD/bdump
    core_dump_dest=/vl/dsolprod/oracle/product/admin/DSOLPROD/cdump
    user_dump_dest=/vl/dsolprod/oracle/product/admin/DSOLPROD/udump
    # Distributed, Replication and Snapshot
    open_links=4
    # File Configuration
    control_files=("/vl/dsolprod/ora2/control/control01.ctl")
    db_recovery_file_dest=/vl/dsolprod/db_dumps
    db_recovery_file_dest_size=2147483648
    # Job Queues
    job_queue_processes=5
    # Miscellaneous
    compatible=10.2.0.1.0
    # NLS
    nls_date_format=dd-mm-yyyy
    # Optimizer
    optimizer_mode=CHOOSE
    # Processes and Sessions
    processes=150
    # Redo Log and Recovery
    log_buffer=22479872
    log_checkpoint_interval=10000
    log_checkpoint_timeout=1800
    # SGA Memory
    sga_max_size=314032288
    sga_target=314032288
    # Security and Auditing
    audit_trail=DB
    os_authent_prefix=OPS$
    remote_os_authent=TRUE
    # Sort, Hash Joins, Bitmap Indexes
    pga_aggregate_target=25165824
    sort_area_retained_size=65536
    sort_area_size=65536
    # System Managed Undo and Rollback Segments
    undo_management=AUTO
    undo_tablespace=UNDOTBS1
    ===========================================================

  • Error while installing Oracle 10g on Fedora Core 1

    Error while installing Oracle 10g on Fedora Core 1. After 40% of the Installation is thru, the progress bar is showing 40%, it gives error "Not connected to Oracle" and the installation has to be terminated.
    We have tried by using the on-line procedure and changing the required script to make believe it as said.

    Are you createing DB also???

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • FRM-41211 Integration Error SSL - OracleAS 10g

    Hi.
    I have error Frm-41211 Integration Error SSL Failure Running Another Product error while calling a report from web form in oracleAS 10g.
    I have problem with RUN_REPORT_OBJECT in web forms.
    I have error: FRM-41211 SSL integration error .....
    OracleAS server began on Windoes XP SP2.
    Do you help me ?

    Hi,
    I remember having seen this issue in teh apst. My best recommendation is to work with customer support (metalink.oracle.com)
    Frank

  • Stopping the Enterprise Manager Console (Oracle 10g on SuSE 9.1)

    I'm trying to stop the Enterprise Manager Console by issuing the command:
    ${ORACLE_HOME}/bin/emctl stop dbconsole
    Unfortunately, the command fails to stop the EM Console. Here's the output I get:
    TZ set to US/Pacific
    Oracle Enterprise Manager 10g Database Control Release 10.1.0.2.0
    Copyright (c) 1996, 2004 Oracle Corporation. All rights reserved.
    http://<hostname>:5505/em/console/aboutApplication
    Stopping Oracle Enterprise Manager 10g Database Control ...
    --- Failed to shutdown DBConsole Gracefully ---
    failed.
    The only way I can stop the EM Console (and related services--i.e., emagent) is to kill its process.
    Everything (Listener, DB Instance, EM Console) starts fine. I can stop the Listener and DB Instance without any problems. It's just the EM Console shutdown that doesn't happen cleanly.
    Has anyone else encountered the same condition? If so, what was the solution?
    Here's my operating environment:
    SuSE 9.1 (Kernel 2.6.5-7.108-default)
    Oracle 10g
    Thanks in advance for any help/insight.

    Has anyone else encountered the same condition? If so, what was the solution?Yes. Shutdown/reboot of the system made the error go away.
    Sorry, no better clues,
    Toni

  • Migration from Oracle 9i 32 bit to Oracle 10G 64 bit on Windows 2003 Server

    I am working on migrating Oracle 9i 32 bit to Oracle 10G 64 bit on Windows 2003 from Old server to new server. We have db around 500 GB and 3 schemas. I installed Oracle 10G on new server, created tablespaces, schema's blah blah and now doing export and import at schema level from old server to new server.
    Import is taking more than 4 to 5 hours on new server. My manager is saying, window time is bit longer and he wants me to try possiblities to make this process faster. Can some one help me on this, to use the best possible method to complete this process faster?
    Will below step work, if I try?
    If I install, oracle 9i and 10g both on new server in different home directories and take the hot backup from old machine and restore on new machine in 9i home directory and use the upgrade configuration assistant from 10g and do the upgrade? Pls advice.
    Thanks in advance,
    Hari babu
    Edited by: user6367891 on Mar 2, 2010 5:28 AM

    It looks good.
    I have one question in below steps:
    To migrate an Oracle9i or older database to an Oracle Database 10g Release 1 (10.1) database for 64-bit Windows:
    1 Perform steps 1 - 11 in "Migrating an Oracle Database 10g Release 1 (10.1) Database".
    2 Shut down the database on the 64-bit computer:
    SQL> SHUTDOWN IMMEDIATE;
    3 Start the database migration:
    SQL> STARTUP MIGRATE;
    4 Migrate the database as described in Chapter 3, "Upgrading a Database to the New Oracle Database 10g Release" in Oracle Database Upgrade Guide.
    In step 4, it says, migrate database as described in chapter 3. In chapter 3, it says, to do the upgrade the process using dbca or manually. Pls confirm whether do the upgrade process after issuing startup migrate or not.
    Thanks in advance.

  • Oracle 10G New Feature........Part 1

    Dear all,
    from last couple of days i was very busy with my oracle 10g box,so i think this is right time to
    share some intresting feature on 10g and some internal stuff with all of you.
    Have a look :-
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Oracle 10g Memory and Storage Feature.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1.Automatic Memory Management.
    2.Online Segment Shrink
    3.Redolog Advisor, checkpointing
    4.Multiple Temporary tablespace.
    5.Automatic Workload Repository
    6.Active Session History
    7.Misc
    a)Rename Tablespace
    b)Bigfile tablespace
    c)flushing buffer cache
    8.ORACLE INTERNAL
    a)undocumented parameter (_log_blocks_during_backup)
    b)X$ view (x$messages view)
    c)Internal Structure of Controlfile
    1.Automatic memory management
    ================================
    This feature reduce the overhead of oracle DBA.previously mostly time we need to set diff oracle SGA parameter for
    better performance with the help of own experience,advice views and by monitoring the behaviour
    of oracle database.
    this was just time consuming activity.........
    Now this feature makes easy life for oracle DBA.
    Just set SGA_TARGET parameter and it automatically allocate memory to different SGA parameter.
    it focus on DB_CACHE_SIZE
    SHARED_POOL_SIZE
    LARGE_POOL
    JAVA_POOL
    and automatically set it as
    __db_cache_size
    __shared_pool_size
    __large_pool_size
    __java_pool_size
    check it in alert_log
    MMAN(memory manager) process is new in 10g and this is responsible for sga tuning task.
    it automatically increase and decrease the SGA parameters value as per the requirement.
    Benefit:- Maximum utlization of available SGA memory.
    2.Online Segment Shrink.
    ==========================
    hmmmmm again a new feature by oracle to reduce the downtime.Now oracle mainly focus on availablity
    thats why its always try to reduce the downtime by intrducing new feature.
    in previous version ,reducing High water mark of table was possible by
    Exp/imp
    or
    alter table move....cmd. but on these method tables was not available for normal use for long hrs if it has more data.
    but in 10g with just few command we can reduce the HWmark of table.
    this feature is available for ASSM tablespaces.
    1.alter table emp enable row movement.
    2.alter table emp shrink space.
    the second cmd have two phases
    first phase is to compact the segment and in this phase DML operations are allowed.
    second phase(shrink phase)oracle shrink the HWM of table, DML operation will be blocked at that time for short duration.
    So if want to shrink the HWM of table then we should use it with two diff command
    first compact the segment and then shrink it on non-peak hrs.
    alter table emp shrink space compact. (This cmd doesn't block the DML operation.)
    and alter table emp shrink space. (This cmd should be on non-peak hrs.)
    Benefit:- better full table scan.
    3.Redolog Advisor and checkpointing
    ================================================================
    now oracle will suggest the size of redo log file by V$INSTANCE_RECOVERY
    SELECT OPTIMAL_LOGFILE_SIZE
    FROM V$INSTANCE_RECOVERY
    this value is influence with the value of FAST_START_MTTR_TARGET .
    Checkpointing
    Automatic checkpointing will be enable after setting FAST_START_MTTR_TARGET to non-zero value.
    4.Multiple Temporary tablespace.
    ==================================
    Now we can manage multiple temp tablespace under one group.
    we can create a tablespace group implicitly when we include the TABLESPACE GROUP clause in the CREATE TEMPORARY TABLESPACE or ALTER TABLESPACE statement and the specified tablespace group does not currently exist.
    For example, if group1 is not exists,then the following statements create this groups with new tablespace
    CREATE TEMPORARY TABLESPACE temp1 TEMPFILE '/u02/oracle/data/temp01.dbf'
    SIZE 50M
    TABLESPACE GROUP group1;
    --Add Existing temp tablespace into group by
    alter tablespace temp2 tablespace group group1.
    --we can also assign the temp tablespace group on database level as default temp tablespace.
    ALTER DATABASE <db name> DEFAULT TEMPORARY TABLESPACE group1;
    benefit:- Better I/O
    One sql can use more then one temp tablespace
    5.AWR(Automatic Workload Repository):-
    ================================== AWR is built in Repository and Central point of Oracle 10g.Oracle self managing activities
    is fully dependent on AWR.by default after 1 hr, oracle capure all database uses information and store in AWR with the help of
    MMON process.we called it Memory monitor process.and all these information are kept upto 7 days(default) and after that it automatically purge.
    we can generate a AWR report by
    SQL> @?/rdbms/admin/awrrpt
    Just like statspack report but its a advance and diff version of statspack,it provide more information of Database as well as OS.
    it show report in Html and Text format.
    we can also take manually snapshot for AWR by
    BEGIN
    DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT ();
    END;
    **The STATISTICS_LEVEL initialization parameter must be set to the TYPICAL or ALL to enable the Automatic Workload Repository.
    [oracle@RMSORA1 oracle]$ sqlplus / as sysdba
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Mar 17 10:37:22 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @?/rdbms/admin/awrrpt
    Current Instance
    ~~~~~~~~~~~~~~~~
    DB Id DB Name Inst Num Instance
    4174002554 RMSORA 1 rmsora
    Specify the Report Type
    ~~~~~~~~~~~~~~~~~~~~~~~
    Would you like an HTML report, or a plain text report?
    Enter 'html' for an HTML report, or 'text' for plain text
    Defaults to 'html'
    Enter value for report_type: text
    Type Specified: text
    Instances in this Workload Repository schema
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    DB Id Inst Num DB Name Instance Host
    * 4174002554 1 RMSORA rmsora RMSORA1
    Using 4174002554 for database Id
    Using 1 for instance number
    Specify the number of days of snapshots to choose from
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Entering the number of days (n) will result in the most recent
    (n) days of snapshots being listed. Pressing <return> without
    specifying a number lists all completed snapshots.
    Listing the last 3 days of Completed Snapshots
    Snap
    Instance DB Name Snap Id Snap Started Level
    rmsora RMSORA 16186 16 Mar 2006 17:33 1
    16187 16 Mar 2006 18:00 1
    16206 17 Mar 2006 03:30 1
    16207 17 Mar 2006 04:00 1
    16208 17 Mar 2006 04:30 1
    16209 17 Mar 2006 05:00 1
    16210 17 Mar 2006 05:31 1
    16211 17 Mar 2006 06:00 1
    16212 17 Mar 2006 06:30 1
    16213 17 Mar 2006 07:00 1
    16214 17 Mar 2006 07:30 1
    16215 17 Mar 2006 08:01 1
    16216 17 Mar 2006 08:30 1
    16217 17 Mar 2006 09:00 1
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Enter value for begin_snap: 16216
    Begin Snapshot Id specified: 16216
    Enter value for end_snap: 16217
    End Snapshot Id specified: 16217
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is awrrpt_1_16216_16217.txt. To use this name,
    press <return> to continue, otherwise enter an alternative.
    Benefit:- Now DBA have more free time to play games.....................:-)
    Advance version of statspack
    more DB and OS information with self managing capabilty
    New Automatic alert and database advisor with the help of AWR.
    6.Active Session History:-
    ==========================
    V$active_session_history is view that contain the recent session history.
    the memory for ASH is comes from SGA and it can't more then 5% of Shared pool.
    So we can get latest and active session report from v$active_session_history view and also get histortical data of
    of session from DBA_HIST_ACTIVE_SESS_HISTORY.
    v$active_session_history include some imp column like:-
    ~SQL identifier of SQL statement
    ~Object number, file number, and block number
    ~Wait event identifier and parameters
    ~Session identifier and session serial number
    ~Module and action name
    ~Client identifier of the session
    7.Misc:-
    ========
    Rename Tablespace:-
    =================
    in 10g,we can even rename a tablespace by
    alter tablespace <tb_name> rename to <tb_name_new>;
    This command will update the controlfile,data dictionary and datafile header,but dbf filename will be same.
    **we can't rename system and sysaux tablespace.
    Bigfile tablespace:-
    ====================
    Bigfile tablespace contain only one datafile.
    A bigfile tablespace with 8K blocks can contain a 32 terabyte datafile.
    Bigfile tablespaces are supported only for locally managed tablespaces with automatic segment-space management.
    we can take the advantage of bigfile tablespace when we are using ASM or other logical volume with RAID.
    without ASM or RAID ,it gives poor response.
    syntax:-
    CREATE BIGFILE TABLESPACE bigtbs
    Flushing Buffer Cache:-
    ======================
    This option is same as flushing the shared pool,but only available with 10g.
    but i don't know, whats the use of this command in prod database......
    anyway we can check and try it on test server for tuning n testing some query etc....
    SQL> alter system flush buffer_cache;
    System altered.
    ++++++++++++++++++
    8.Oracle Internal
    ++++++++++++++++++
    Here is some stuff that is not related with 10g but have some intresting things.
    a)undocumented parameter "_log_blocks_during_backup"
    ++++++++++++++++++++++++
    as we know that oracle has generate more redo logs during hotbackup mode because
    oracle has to maintain the a complete copy of block into redolog due to split block.
    we can also change this behaviour by setting this parameter to False.
    If Oracle block size equals the operating system block size.thus reducing the amount of redo generated
    during a hot backup.
    WITHOUT ORACLE SUPPORT DON'T SET IT ON PROD DATABASE.THIS DOCUMENT IS JUST FOR INFORMATIONAL PURPOSE.
    b)some X$ views (X$messages)
    ++++++++++++++++
    if you are intresting in oracle internal architecture then x$ view is right place for getting some intresting things.
    X$messages :-it show all the actions that a background process do.
    select * from x$messages;
    like:-
    lock memory at startup MMAN
    Memory Management MMAN
    Handle sga_target resize MMAN
    Reset advisory pool when advisory turned ON MMAN
    Complete deferred initialization of components MMAN
    lock memory timeout action MMAN
    tune undo retention MMNL
    MMNL Periodic MQL Selector MMNL
    ASH Sampler (KEWA) MMNL
    MMON SWRF Raw Metrics Capture MMNL
    reload failed KSPD callbacks MMON
    SGA memory tuning MMON
    background recovery area alert action MMON
    Flashback Marker MMON
    tablespace alert monitor MMON
    Open/close flashback thread RVWR
    RVWR IO's RVWR
    kfcl instance recovery SMON
    c)Internal Structure of Controlfile
    ++++++++++++++++++++++++++++++++++++
    The contents of the current controlfile can be dumped in text form.
    Dump Level Dump Contains
    1 only the file header
    2 just the file header, the database info record, and checkpoint progress records
    3 all record types, but just the earliest and latest records for circular reuse record types
    4 as above, but includes the 4 most recent records for circular reuse record types
    5+ as above, but the number of circular reuse records included doubles with each level
    the session must be connected AS SYSDBA
    alter session set events 'immediate trace name controlf level 5';
    This dump show lots of intresting information.
    it also show rman recordes if we used this controlfile in rman backup.
    Thanks
    Kuljeet Pal Singh

    You can find each doc in html and pdf format on the Documentation Library<br>
    You can too download all the documentation in html format to have all on your own computer here (445.8MB)<br>
    <br>
    Nicolas.

  • Oracle 10g - Defining the column name in Non English

    Hi Experts,
    I have an exisitng application which is developed on Windows using ASP Technology and uses Oracle 10g 10.1.0.2.0.
    The application is supported with an instance of Data Base within which multiple tablespaces are created for different clients. The application is developed in such a way that some of the tables arecreated dynamically and the columns are named using the data entered through the UI.
    This application needs to be globalized now. The problem is, the column name entered through the UI can be in any language based on the client's settings and those values in turn will be used for naming the columns in the tables.
    1) Can I have the column names to be named using non english characters in Oracle 10g DB? If so,
    1.1) what should I do to configure the exisiting Oracle instance to support it?
    1.2) To what level is that configuration possible, is it per DB instance level (or) can it be done at Tablespace level. I would like to configure each tablespace to host tables with columns defined with different languages, say for example, tablespace 1 will have tables with Japaenese column names and tablespace 2 will have tables with German column names?
    2) What should I do to make my entire DB to support unicode data i.e., to accept any language strings. Currently all strings are declared as VarChar2, should I change all VarChar2 to NVarChar2 (or) is there a way to retain the VarChar2 as is and make some database wide setting?
    Please note that I do not have an option of retaining the column in English as per the Business Requirement.
    Envionment:
    OS - Windows 2003 32 bit
    Oracle 10g 10.1.0.2.0
    UI forms in ASP
    TIA,
    Prem

    1. Yes, you can.
    SQL> create table ÜÝÞ( ßàá number(10));
    Table created.
    SQL> insert into ÜÝÞ values (10);
    1 row created.1.1 and 1.2 and 2. You can choose UTF as your default character set. It allows the user of non-English characters in VARCHAR columns in your whole database. It is not per tablespace.
    SQL> create table ÜÝÞ( ßàá varchar2(100));
    Table created.
    SQL> insert into ÜÝÞ values ('âãäçìé');
    1 row created.

  • Oracle 10g - Date format in SELECT query for CFOUTPUT

    Hello, everyone.
    The project that I am working on in the dev environment is connected to an Oracle 11g database, but the production side is Oracle 10g.
    I have a page that is erroring in production (but not development) when it gets to a date that it needs to display.
    A co-worker mentioned that, in 10g, if a date/time is being SELECTed, you have to put it in to_char(), so I did that.
    But it's still erroring, and I'm not getting an error message, so I'm assuming that I have an incorrect format for the date in the SELECT.
    What is the proper format for SELECTing a date/time when using to_char()?  Right now, I have SELECT to_char(create_date,'MM-DD-YYYY HH:MI') FROM tableA .  Is this not correct for CF to output?
    Thank you,
    ^_^

    Please see my original post ("I have a page erroring in production (but not in development) when it gets to a date that it needs to display.")  Sorry if it came across as vague.  It made sense, to me, when I typed it.  But, then, I'm usually typing fast just to get the question out there, when I'm in a hurry.
    Haven't done a CFDUMP, yet, as every time I make a change in development that needs to be tested in production, I have to notify my supervisor that there are files that need to be copied into production, which can sometimes take a while, so I try to do troubleshooting on dev side - it's a pain in the you-know-what, but that's the kind of environment I'm working in.
    As it turns out, changing the format in the SELECT to_char() did the trick.  If anyone else has this issue with Oracle 10g, I'm now using SELECT to_char(create_date,'YYYY/MM/DD HH:MI') FROM tableA, and now the CFOUTPUT is processing the whole page.  I guess the MM-DD-YYYY threw CF into a tizzy, breaking the process?
    Anyhoo, it's working, now.  Thank you, Dan and Adam, for your thoughts on this.
    ^_^

Maybe you are looking for

  • Is there a way to specifiy memory size usage in embedded OC4J?

    I'm using JDeveloper 9.0.3 and am having a problem with EJB's not being created at a certain point in my application. I can create EJBs fine up to a certain point then I start to get java.rmi.RemoteException's, even when i try to create the exact sam

  • AVfoundationCF.dll is missing, windows 8

    after the newest update for itunes it has ceased to even open. Two error messages come up when trying to open itunes, in the order shown. My operating system is windows 8, and I have uninstalled and reinstalled multiple different ways.

  • Xfce4 - problem with fonts again... (especially k3b)

    hi, i did a base install from the arch widget iso 0.6 and used pacman to install everything i need. i use xfce4. after installing licq i noticed the same font problem writen sevarel times in this forum (big  font with large spaces) but in the options

  • Macbook Pro Retina 15" External Display

    I have a Macbook Pro Retina 15" that I want to connect to a projector via HDMI connection. How do I turn on the External Display to present a Keynote Presentation? I have not tried it yet, will the Mackbook automatically connect to the projector when

  • Cover in iBooks (epub)

    hi, i produce/export an ebub-File in Indesign CS4. Everything works fine, but i don`t see on the left site in iBooks content view the cover of my book, instead the default brown cover. I want my cover on the left side like in Winnie the Pooh: http://