Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Locktree.sql Oracle
  • Btee and Bitmap Plans in Oracle 9i and higher Oracle
  • standard Monitoring – 1 Oracle
  • Search and replace editor command in vi Linux/Unix
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • How to see which patches are applied. Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • Unix command for system configuration Linux/Unix
  • AWR license Oracle
  • create PLAN_TABLE command. Oracle
  • All Hints for Oracle Databases Oracle
  • sid_wise_sql.sql Further explaination Oracle
  • Privilege to describe the table. Oracle
  • block_ident.sql Oracle

DBMS_SQL for alter session.

Posted on 07-Jan-2009 By Admin No Comments on DBMS_SQL for alter session.

SQL>

SQL> CREATE OR REPLACE PROCEDURE AlterSession(

2 p_SessionString IN VARCHAR2) AS

3

4 v_CursorID INTEGER;

5 v_Dummy INTEGER;

6 BEGIN

7 v_CursorID := DBMS_SQL.OPEN_CURSOR;

8

9 DBMS_SQL.PARSE(v_CursorID, p_SessionString, DBMS_SQL.NATIVE);

10 v_Dummy := DBMS_SQL.EXECUTE(v_CursorID);

11 END AlterSession;

12 /

Procedure created.

SQL>

SQL> column sysdate format a30

SQL> SELECT SYSDATE FROM dual;

SYSDATE

——————————

Jun 19, 2008 20:38:44

1 row selected.

SQL>

SQL> DECLARE

2 sqlString VARCHAR2(100);

3 BEGIN

4 sqlString := ‘ALTER SESSION SET NLS_DATE_FORMAT = ‘ ||

5 ”’Mon DD, YYYY HH24:MI:SS”’;

6 AlterSession(sqlString);

7 END;

8 /

PL/SQL procedure successfully completed.

SQL>

SQL> SELECT SYSDATE FROM dual;

SYSDATE

——————————

Jun 19, 2008 20:38:44

1 row selected.

SQL>

Oracle, SQL scripts

Post navigation

Previous Post: get_vmstat_linux
Next Post: Sequence Resetting

Related Posts

  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • To see how much time or progress of long transaction Oracle
  • Jai Shree Ram Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • All About oracle password and security from metalink Oracle
  • AWR settings- MMON is not taking snapshot. Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Convert multiple rows to single column Oracle
  • Sending SQLPLUS output in HTML format Oracle
  • note id 373303.1 Linux/Unix
  • copying/removing directory with all its subdirectory Linux/Unix
  • Transfer SQL Profiles from One database to other database. Oracle
  • move_arch_files.ksh Linux/Unix
  • runsql_once.ksh Linux/Unix
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme