Showing posts with label sqlplus. Show all posts
Showing posts with label sqlplus. Show all posts

Friday, February 12, 2010

sqlplus / as sysdba, ORA-01031: insufficient privileges

One of the reason of this error is OS user must be belong to "osdba" group defined in group as defined in the "$ORACLE_HOME/rdbms/lib/config.s" or "$ORACLE_HOME/rdbms/lib/config.c". Typically this is set to "dba".
  1. Check your OS user group e.x my group is dbap (not dba)
    %id
    uid=1030(oracle) gid=1030(dbap)
  2. Check if this group is in /etc/group
    cat /etc/groupgrep dbap
  3. Check config.s or config
    cd $ORACLE_HOME/rdbms/lib
    ls -lrt config.*
    cat config.s #It can be also config.c
  4. correct group name in config.s file (example Change both ocurrences of dba to dbap )

    Sun SPARC Solaris
    .ascii "dbap\0"

    IBM AIX/Intel Solaris:
    .string "dbap"
  5. To effect any changes to the groups and to be sure you are using the groups defined in this file relink the Oracle executable.Be sure to shutdown all databases before relinking

    mv config.o config.o.orig
    make -f ins_rdbms.mk ioracle

Thursday, November 1, 2007

Can one generate HTML reports from SQL*Plus?

One can generate static HTML pages from SQL*Plus (8.1.6 and above) by setting the MARKUP option to HTML ON. This can be done by specifying -MARKUP "HTML ON" from command line, or with the "SET MARKUP HTML ON" command. Look at this example SQL Script:
set markup HTML on
spool index.html
select * from tab;
spool off
set markup HTML off

You can deploy this file on your web site or edit it in an HTML editor (like FrontPage or Dreamweaver). Another good idea is to develop a CSS to present the data more elegantly. One can also embed HTML tags in the select statement to create hyperlinks and add more HTML features.
Ref:http://www.orafaq.com/faqplus.htm