SQL*Plus: Run Command as SYSDBA

I'm currently logged into SQL*Plus as CARLOS & even though I don't want to grant CARLOS specific DBA or SYSDBA roles, I was wondering if there was a way in SQL*Plus I could run a command as SYSDBA while logged in as CARLOS? Kind of like how I can sudo a command in Bash as the root user while logged in as my current non-priveleged user.
SQL> shutdown immediate;
ORA-01031: insufficient privileges:(

CarlosinFL wrote:
I'm currently logged into SQL*Plus as CARLOS & even though I don't want to grant CARLOS specific DBA or SYSDBA roles, I was wondering if there was a way in SQL*Plus I could run a command as SYSDBA while logged in as CARLOS? Kind of like how I can sudo a command in Bash as the root user while logged in as my current non-priveleged user.
SQL> shutdown immediate;
ORA-01031: insufficient privileges:(SQL> CONNECT SYS/ AS SYSDBA

Similar Messages

  • Preference equivalents for relevant SQL*Plus set commands?

    I know that the SQL*Plus set command is not supported in Raptor (as per http://www.oracle.com/technology/products/database/project_raptor/sql_worksheet_commands.html), but there are a number of set options that are relevant.
    For example, set define (for which "set define off" is covered in Ampersand in scripts We have a number of existing SQL scripts where we have set the define character to something apart from & to avoid issues where this is a required value in the code.
    Setting server output size is another option - as per set serveroutput on size unlimited .
    Is there any proactive plan to provide preferences equivalent to the set options that are relevant (to either SQL scripts or the various output tabs)? Or is the exclusion of the SQL*Plus set command only for the current version and it will be included later? From the discussion on the forums so far, it seems as though you are looking at each set option as it is raised, rather than being proactive about it.
    Even if Raptor does provide preferences, it would still be useful for the equivalent set commands to work. Lets say that we do get a preference for the define character - 99% of the time, scripts want this to be & - however there are some where the script wants it to be $ (or whatever). With a preference, I need to know what the script wants and change the preference before running the script and then change it back afterwards.

    Hi Turloch,
    When is this script executed ?
    In 3.1EA2 I created a sql script where a variable is defined and set this script as you suggested.
    Script:
    define varname=abc
    When I open a connection, a worksheet is automatically opened. I run this statements:
    select '&varname' from dual;
    define varname=xyz
    select '&varname' from dual;
    Running the first select statement results in a popup window for entering a value for the substitution variable, while I was expecting the value abc as the result of the query.
    See also this blog where the login script is explained.
    But in my SQL Developer 3.1EA2 64-bit on Windows 7 it doesn't work like that.
    Is this a bug?
    Dennis

  • How to Hide password when invoking sql plus from command promt?

    When i try to open sql plus in command prompt window and enter the sqlplus command follwed by username/password@connection string, the password is not hidden.
    How do I get it to show **** instead of displaying password characters out?
    Also, what is the command to clear screen : when I try cls or clear screen, I get a windows memory exception of somekind and the only option there is to kill the command window.
    Any tips on getting around this?
    Thanks a lot for your time and help.

    user8848256 wrote:
    Can you please give more details on how to not enter password when calling sqlplus from command window like you are saying?
    I tried this :
    sqlplus username/ @connection string -->Hit Enter : it asks for password but does not recognise the connectionstring to connect to.
    sqlplus username/ -->Hit Enter: It does same thing again.asks for password but gives tns adapter error after the password is entered.Leave out the slash:
    sqlplus username@connect_string

  • SQL*Plus 'Copy' command and LONG datatypes

    Hi. I'm using Oracle 9.2.0.5 and wanna copy LONG to LONG without using an Interface in VB or any other programming language.
    Some of the fields (plain text) are greater than 32 Kb, and I tried the SQL*Plus 'Copy' command, without success.
    (For compatibility reasons I can't convert LONG to CLOB, I need to copy LONG to LONG)
    This is the example I'm working with:
    Table Source_LONG (ID number, DATA long)
    Table Destination_LONG (ID number, DATA long)
    The SQL*Plus command: (connected from test_database@environment)
    set long 100000
    copy from test_database/test_database@environment insert destination_long (id,data)
    I tried using both FROM and TO, but same results.
    The fields are copied into destination_long, but they are
    truncated at 32768 bytes, even with the LONG variable set to 100000. Any ideas ?
    Thanks.

    I'm working with 2 similar tables with this structure:
    SOURCE_LONG (ID number, DATA long)
    DESTINATION_LONG (ID number, DATA long)
    SOURCE_LONG contains two rows:
    ID DATA
    1 hello
    3 ....text bigger than 32kb...
    I tried your solution and it insert 2 rows, but only the ID is filled. The DATA is empty in both cases :-(
    insert into destination_long(id,data) (select id,to_lob(data) from source_long);

  • SQL*Plus COPY command does not work

    SQL*Plus COPY command does not work in SQL Developer. I am using SQL Developer 1.5.1 on Windows XP.
    copy from <source_db_connection> to <target_db_connection> create <target_tab_name> using select * from <source_tab_name>
    Does it work on different versions of SQL Developer ?
    Anyone had any success in trying COPY command in SQL Developer?
    Thanks in advance.

    While it hasn't been updated for v1.5, this page lists the supported SQL*Plus commands. COPY is explicitly listed as not supported.
    theFurryOne

  • ORA-01401 on execution SQL*Plus Copy command

    I looking solution for strange problem :
    I having two database created with AL32UTF8 character-set ; current application design are that we loading data throw SQL Loader and than transferring loaded data from one database to another using SQL*Plus copy command.
    Now , we having two tables , declared 100% identically , with respect to NLS and CHAR semantics (all varchar fields having CHAR inside length).
    At attempt to transfer data , with SQL*Plus Copy command I'm receiving next output :
    ERROR:
    ORA-01401: inserted value too large for column
    If I'm trying to transfer data via DB link , and this succeeds , or throw exp/imp utilities it also works .
    Database servers are 9.2 (i tryied with 9.2.0.6 or 9.2.0.8) ; client side were 9.2.0.8 , 10.1.0.5 ...
    On client side NLS_LANG variable are set to AMERICAN_AMERICA.AR8MSWIN1256 (we working on project who needs to support arabic language)
    Did anyone encountered same problem ? Any One ?

    it could be that the column of the table that you are trying to insert the data has a small length.

  • Help Using SQL*Plus Format Commands (like TTITLE) in Packages

    Where (within a package) can/should SQL*Plus format commands such as TTITLE, COLUMN & BREAK be coded?

    A package is coded in PL/SQL.
    TTITLE, COLUMN and BREAK are SQL*Plus commands, they cannot be used in PL/SQL.
    If you want to output data (using dbms_output) in your package, you'll have to implement the features yourself. But probably just using SQL*Plus is better in your case.
    Regards,
    Rob.

  • W'azup with SQL Developer barfing on SQL*Plus "set" commands

    Check out this short script and the results it generates, as pasted below.
    I can't find anything in the SQL Dev documenation re: what SQL*Plus set commands it supports and which it considers "passe." I'm particularly puzzled by the "column ... format ..." command getting ignored.
    set heading off
    set pagesize 0
    set linesize 80
    set feedback off
    prompt ...start...
    column x format a5
    select 'abcdefghij' x from dual;
    prompt ...end...
    line 1: SQLPLUS Command Skipped: set heading off
    line 2: SQLPLUS Command Skipped: set pagesize 0
    line 3: SQLPLUS Command Skipped: set linesize 80
    ...start...
    X ----------
    abcdefghij 1 rows selected
    ...end...

    For supported SQL*Plus commands: SQL Developer Help > SQL Developer Concepts and Usage > Using the SQL Worksheet > SQL*Plus Statements Supported and Not Supported in SQL Worksheet.
    The "column ... format ...." command is not supported. A workaround is to use substr in your select statement.
    See also How to set a column size in sqldeveloper?

  • SQL*Plus column command not working with Script Runner

    SQL Developer EA 2.1
    When running a script (interactive or from a file), the COLUMN commands are ignored. The documentation (User's Guide 1.7.1) says that COLUMN is supported, but the headings set in the column command are not changed. As a test, the SET FEEDBACK OFF command is processed.
    SET FEEDBACK OFF
    COLUMN ename HEADING 'Name'
    COLUMN job HEADING 'Job'
    COLUMN deptno HEADING 'Dept'
    SELECT ename as ename, JOB, DEPTNO
    FROM EMPLOYEES;
    The documentation for Script Runner (User's Guide 1.7.2) says that a much more limited set of SQL*Plus commands are available.
    Is this intended behavior? If so, the documentation should reflect that the COLUMN command is ignored.

    Hi,
    Doc bug logged:
    Bug 9015160 - OTNEA1: USER GUIDE COLUMN SUPPORTS 'COLUMN...NEWVAL' ONLY
    The user guide says column is supported, but
    Column supports the following new_value use only
    i.e. moving a value from a selected column to a substitution variable:
    column aval new_v a
    select 1 aval from dual;
    select '&a' || ' is 1' from dual;
    Output:
    AVAL
    1
    1 rows selected
    '1'||'IS1'
    1 is 1
    1 rows selected
    -Turloch

  • GPF in SQL*PLUS Copy Command?

    Hello,
    I'm getting a GPF and crash of SQL*Plus when I use the copy command. Seems like I used to be able to make it work if I tried logging on to the source database before the copy, but now even that won't work. I issue the command, it looks out over the modem for the remote database, then the GPF occurs.
    copy from me/[email protected] to me/me@LocalDB -
    insert ARRG_BNDRY_OBJECT -
    using -
    SELECT * FROM ARRG_BNDRY_OBJECT WHERE ARRG_BNDRY_KEY IN -
    (80169);
    Ideas?
    Thanks,
    Dale

    You might also want to try the same command using SQL*Plus command line (DOS version). If you haven't used it before, enter SQLPLUS at the command prompt, eg:
    c:\sqlplus
    Alison

  • SQL PLUS Copy Command

    I'm having problems with the copy command in sql plus
    Here's my command
    COPY FROM tib_oms/tib_oms@odb1 -
    TO gbonk/gbonk@stage -
    INSERT -
    gbonk.products ( id_manufacturer, id_sku, category ) -
    USING -
    select id_mfr, sku, prodcat from tib_oms.pricinghistory
    The error I receive is...
    CPY0007: Select list has fewer columns than destination table
    I'm selecting 3 columns and I'm specifing 3 columns so I don't get what's up.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Greg Bonk ([email protected]):
    Well i gave it a shot. Here's my modified copy command....
    copy from tib_oms/tib_oms@odb1 -
    TO gbonk/gbonk@stage -
    insert -
    gbonk.products ( "ID_MANUFACTURER", "ID_SKU", "CATEGORY" ) -
    using -
    select "ID_MFR", "SKU", "PRODCAT" from tib_oms.pricinghistory;
    But I still recieve the same error. Is there anything else that I could trouble shoot?<HR></BLOCKQUOTE>
    did u check if the destination & target columns have the same structure. maybe one of the is a composite datatype (i.e varray,nested tables etc) ?
    null

  • Enterprise manager configuration failed but i*SQL Plus runs fine

    While Installing Oracle database 10g rel 2 on windows XP professional Service Pack 2 The Enterprise manager configuration failed.
    However I*SQL plus and
    Datbase configuration assistant and other tools run fine.
    I got the following error message
    Error instantiating em configuration files.
    Refer log E:\oracle\product\10.2.0\db_1\cfgtoollogs\dbca\orcl\emConfig.log for more details.
    On checking the contents of the log file I saw the following enteries
    Creating directories...
    Apr 14, 2007 2:24:45 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
    CONFIG: Unable to copy E:\oracle\product\10.2.0\db_1/sysman/config/emomsintg.xml to E:\oracle\product\10.2.0\db_1\localhost_orcl/sysman/config/emomsintg.xml: No such file or directory at bin/EMDeploy.pm line 261.
    Apr 14, 2007 2:24:45 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
    WARNING: Error executing CMD /C E:\oracle\product\10.2.0\db_1\bin\emctl.bat deploy dbconsole E:\oracle\product\10.2.0\db_1\localhost_orcl localhost:3938 localhost orcl
    Apr 14, 2007 2:24:45 PM oracle.sysman.emcp.EMAgentConfig instantiateEMConfigFiles
    CONFIG: Failed to deploy state dirs
    Apr 14, 2007 2:24:45 PM oracle.sysman.emcp.EMConfig perform
    SEVERE: Error instantiating EM configuration files
    Refer to the log file at E:\oracle\product\10.2.0\db_1\cfgtoollogs\dbca\orcl\emConfig.log for more details.
    Apr 14, 2007 2:24:45 PM oracle.sysman.emcp.EMConfig perform
    CONFIG: Stack Trace:
    oracle.sysman.emcp.exception.EMConfigException: Error instantiating EM configuration files
    at oracle.sysman.emcp.EMAgentConfig.updateAgentConfigFiles(EMAgentConfig.java:2560)
    at oracle.sysman.emcp.EMAgentConfig.performConfiguration(EMAgentConfig.java:1166)
    at oracle.sysman.emcp.EMAgentConfig.invoke(EMAgentConfig.java:207)
    at oracle.sysman.emcp.EMAgentConfig.invoke(EMAgentConfig.java:185)
    at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:146)
    at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:430)
    at java.lang.Thread.run(Thread.java:534)
    Can anybody suggest me a workaround.
    Is this an open bug?

    worth running emca -deconfig dbcontrol db and then running emca -configure dbcontrol db to let it have another try.

  • Formatting output columns - ala SQL*Plus 'column' command

    SQL_Developer 1.5
    Is there a way to format the output of queries for numbers, etc. like the 'column' command found in SQL*Plus?
    I realize I can use the TO_CHAR() function in the SQL but was hoping there was something easier.
    Thanks very much!
    -gary

    it could be that the column of the table that you are trying to insert the data has a small length.

  • SQL*Plus - multiple commands

    Is there a way to execute multiple commands in a single sql*plus command file, e.g.
    select count(*) from table1
    select count(*) from table2
    The above gets a syntax error becuase of the multiple commands

    Hi,
    If you just want counts from two tables, you could try:
    select
    (select count(*) from table1) Count_Tab1,
    (select count(*) from table2) Count_Tab2
    from dual;
    Regards Robert

  • Connecting Oracle using SQL Plus in command window through LDAP settings?

    Hi
    Just like to know if it is possible to connect Oracle using SQL Plus with connection type as LDAP.
    Generally we connect to Oracle in cmd window as
    username/password@DBServiceName
    Similarly is it possible to connect Oracle using SQL plus cmd window using LDAP configuration settings.
    Eg:-
    If my LDAP server is oid:123:456
    Context is: cn=OracleContext,dc=abcdefgh,dc=com
    DBService is: xyz
    Regards
    jc

    Specify the -L command line option to SQL*Plus, i.e.:
    sqlplus -L username/password@db @blah.sql
    (this will prevent the second prompt for username/password if the initial login is unsuccessful for any reason, like an invalid password).

Maybe you are looking for

  • How to use preprocess​or directives (#define) in C++ header file with LabVIEW 8.2

    I have a C++ header file that contains around 2000 preprocessor directives: #define MEM_1   0xC #define MEM_2   0xD #define MEM_3   0x18 I want to be able to "access" these memory offsets by identifier name (MEM_1) in my LabVIEW program like I would

  • Pam.conf does not use ldap for password length check when changing passwd

    I have already posted this in the directory server forum but since it is to do with pam not using ldap I thought there might be some pam experts who check this forum. I have dsee 6.0 installed on a solaris 10 server (client). I have a solaris 9 serve

  • Can I install a SSD in a Mac Pro 1,1?

    Is it possible to install a SSD in a Mac Pro 1,1 2 x 3GHz Dual core? On reading this: http://macperformanceguide.com/Mac-InstallingSSD.html#Installing_MacPro it seems it is, but when I contacted Crucial memory they didn't seem to think it was. I was

  • Problem download data with trailing blanks using gui_download

    Hi All,       I am using SAP 4.6C. I have requirement to download data with trailing blanks.But i am not succeeded fully to acheive my requirement.I want to download data to be in the below format. Eg: 'T000000070600000004000000003593593             

  • I have no Ringtones Tab or Checkbox

    So I have been researching how to make and import Ringtones.  Well, I have successfully done it but my ringtones are not synching to my phone.  I have gone into Preferences>to allow the Ringtones tab to appear in the panel, however I do not have one.