SQL MORE QUESTIONS

According to the tables and the attributes below, I need solve 25 questions. I answered some of them and some of them I couldn't solve. I need your help please.

School (sch_name, sch_phone, sch_code, sch_dean)
Advisor (adv_code, adv_fname, adv_lname, adv_phone, sch_code)
Major (maj_code, maj_desc, sch_code)
maj_adv (maj_code, adv_code)
student (std_code, std_lname, std_fname, std_gend, maj_code, std_dob)
rank (std_code, gr_lname, gr_fname, gr_t1, gr_t2, gr_hw, gr_pr)


create table school
(sch_code varchar2 (8) school_sch_code_pk primary key constraint,)
sch_name varchar2 (50).
sch_phone varchar2 (12),
sch_dean varchar2 (20));

insert into the values of the school ('BUS', "School of Business", 281-283-3100', 'Ted Cummings');
insert into the values of the school ("EDU", «School of Education», 281-283-3600', "Dennis Spuck");
insert into the values of the school ("MSM", "School letters" and Human Sciences, ' 281-283-3333', "Bruce Palmer");
insert into the values of the school ('DRY', 'school of Science and engineering', ' 281-283-3700', "Sadegh Davari");

create table Advisor
(adv_code varchar2 (08) advisor_adv_code_pk primary key constraint,)
adv_lname varchar2 (15).
adv_fname varchar2 (15).
adv_phone varchar2 (12),
sch_code varchar2 (8) constraint advisor_sch_code_fk references school (sch_code));

insert into portfolioadvisor ('A1', 'Porter', 'Mattie', ' 281-283-3163', 'BUS');
insert into portfolioadvisor ("A2", "Grady", "Lost", 281-283-3400', 'BUS');
insert into portfolioadvisor ("A3", "Tran", "Van", 281-283-3203', 'BUS');
insert into portfolioadvisor ('A4', 'Sale', 'Nili', 281-283-3202', 'BUS');
insert into portfolioadvisor ("A5", "Kwok-good', 'Yue', 281-283-3864', 'SEC');
insert into portfolioadvisor ("A6", "Jones", "Lisa", ' 281-283-3551', "EDU");
insert into portfolioadvisor ("A7", "Palmer", "Bruce", 281-283-3445', "MSM");


create major table
(maj_code varchar2 (10) major_maj_code_pk primary key constraint,)
maj_desc varchar2 (30),
sch_code varchar2 (8) constraint major_sch_code_fk references school (sch_code));

insert into large values ('ACCT', 'Accounting', 'BUS');
insert into the great values ('Ministers', 'Finance', 'BUS');
insert into large values ("ISAM", 'Management Information systems', 'BUS');
insert into large values ('SMK', 'Computer Science', 'DRY');
insert into large values ('HIST', 'History', "MSM");
insert into large values ("INST", "Instructional Technology", "EDU");

create the table maj_adv
(maj_code varchar2 (10) constraint maj_adv_maj_code_fk main references (maj_code),)
adv_code varchar2 (08) constraint maj_adv_adv_code_fk references Advisor (adv_code).
constraint maj_adv_maj_code_adv_code_cpk primary key (maj_code, adv_code));

insert into maj_adv values ('ACCT', 'A1');
insert into maj_adv values ("ACCT", "A2");
insert into maj_adv values ("Ministers", "A2");
insert into maj_adv values ("ISAM", "A3");
insert into maj_adv values ("ISAM", "A4");
insert into maj_adv values ("CSCI", "A5");
insert into maj_adv values ("INST", "A6");
insert into maj_adv values ("HIST", "A7");


create table students
(std_code, varchar2 (9))
std_lname varchar2 (15) constraint student_std_lname_nn not null,
std_fname varchar2 (15) constraint student_std_fname_nn not null,
std_gend varchar2 (8).
maj_code varchar2 (10) constraint student_maj_code1_fk main references (maj_code).
date of std_dob,
constraint student_std_code_pk primary key (std_code));

insert into student values ('S1', 'Jordan', 'Michael', 'F' 'Ministers', to_date (10 March 1962 ',' Mon-DD-YYYY ""));
insert into student values ('S2', 'Barkley', 'Charles, m', null, to_date ('12-Sept-1964, ' Mon-DD-YYYY ""));
insert into student values ('S3 ', 'Johnson', 'Magic', am ', 'ACCT', to_date ('13-Sep-1960, ' Mon-DD-YYYY ""));
insert into values student ("S4", "Williams', 'Serena', 'F', 'ISAM', to_date (October 23, 1980 ',' Mon-DD-YYYY" "));
insert into student values ('S5', 'Duncan', 'Tim', am', 'ISAM', to_date (August 7, 1972 ',' Mon-DD-YYYY'));
insert into values student ("S6", "Graff", 'Steffi', 'F', 'SMK', to_date (30 April 1962 ',' Mon-DD-YYYY ""));
insert into values student ("S7", "Navratilova", "Martina", 'F', 'ACCT', to_date (18 December 1972 ',' Mon-DD-YYYY ""));

NOTE Insert student (std_lname, std_fname, std_code, std_dob)
NOTE values ('S2', 'Barkley', 'Charles', to_date('12-Sep-1964','DD-Mon-YYYY'));

create the table class
(std_code varchar2 (9) grade_std_code_pk primary key constraint)
constraint grade_std_code_fk references student (std_code).
gr_lname varchar2 (15) constraint grade_gr_lname_nn not null,
gr_fname varchar2 (15) constraint grade_gr_fname_nn not null,
gr_t1 number (5), constraint grade_gr_t1_cc check (gr_t1 between 0 and 100).
gr_t2 number (5),
gr_hw number (5),
gr_pr number (5));

insert into rank values ('S1', 'Jordan', 'Michael', 90, 80, 98, 90);
insert into rank values ('S2', 'Barkley', 'Charles', 60, 100, 100, 60);
insert into rank values ('S3', 'Johnson', 'Magic', 88, 98, 96, 98);
insert into rank values ("S4", "Williams", "Serena", 92, 92, 92, 92);
insert into rank values ('S5', 'Duncan', 'Tim', 90, 94, 94, 96);
insert into rank values ("S6", "Graffiti", "Steffi", 80, 83, 84, 72);
insert into category values ("S7", "Navratilova", "Martina", 91, 88, 94, 95);

the questions are:

Give the following commands:

1 the names of students who do not have a large.
2 display the names of the students whose name has two "o" inside.
3 the names of the students whose first name has an "e" in it.
4 the names of the students whose name has exactly five characters in there.
5 the names of students with higher test grade 2 test 1 grade.
6 the names of pupils with grade of the project between trials 1 and 2 test classes.
7. give the name of the student whose name begins with the character 'B' or who have never transformed into working from home.
8. give the command that will appear two columns and one record. The first column will have the title "Major" and "ACCT" as value. The second column will have the title of 'MIS_Count' and will display the number of advisors of accounting.
9 display the name of the student whose test 1 score is higher than the average on test 1.
10. give the names and surname of the students who scored above average on test 1, as well as above average on the test # 2.
11 show the date variable system using the double table.
12. show the date variable system using the table of quality ensuring that the date is displayed only once.
13. give the name of the student who is the oldest student and scored highest on the first try.
14 list different majors and number of advisors for these majors.
15 show the names of students who do not quality for any element.
16 show the names of students who do not have at least one element.
17 the names of students who have the same major as 'Michael Jordan'.
18. give the names of the students whose average on test 1 and test 2 is higher than the average on the homework and project.
19 display name and the average of the test 1 and 2 test for each student.
20 display the number of students in the student table using three different methods.
21. view student numbers in the table of student accountants.
22 display the number of students of accounting and finance in the student table.
23 show the average on the test 1 and 2 test for female students.
24 show the number of students of accounting and finance including test 1 grades are above average on test 1.
25 display the name of the major that has more than two students.

I'm stuck with the following questions (1,12,13, 15,16,17,24) and the rest, I finished them but I'm not sure.
Thank you and looking forward to hear your suggestions.

Hi and welcome to the forum!

This looks like a duty for me to be perfectly honest. When it's people are usually not willing to spoon feed answers because is not helping improve learning.

I'll try to help if you can show me what you have tried for the issues that you are having problems with.

Thank you!

Tags: Database

Similar Questions

  • SQL * more question: unprinted despite SET ECHO ON command

    RDBMS Version: 11.2.0.4

    OS: Oracle Linux 6.4 (bash shell)

    I'm kinda a newbie to SQL * more.

    Here's a SQL * Plus script embedded in bash script that scales multiple data files. This script has been run on the DB server side.

    #! / bin/bash

    export ORACLE_SID = ORCL1

    echo "resize Datafile began to" 'date '.

    sqlplus "/ as sysdba" < < EOF

    set echo on

    Set of feedback on

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.338.834340223' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.337.834340223' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.336.834340225' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.335.834340225' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.334.834340225' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.333.834340225' resize 25g;

    ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.332.834340227' resize 25g;

    quit smoking

    EXPRESSIONS OF FOLKLORE

    echo "resize Datafile ended in" 'date '.

    As you can see, the SQL * more script contains ON SET ECHO ON and PUT your COMMENTS.

    But in the logfile (see below), I don't see every ALTER DATABASE DATAFILE... command printing. I see that ' altered database.'  printing messages.

    I executed the script to nohup as

    nohup resize.sh > MyResize2.log &

    $ cat MyResize2.log

    DataFile resize started at Sun Dec 29 00:09:45 MYT 2013

    SQL * more: Production of the 11.2.0.4.0 on Sun Dec 29 00:09:45 version 2013

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    With partitioning, Real Application Clusters, Automatic Storage Management, OLAP,.

    Options of Data Mining and Real Application Testing

    SQL > SQL > SQL > SQL > SQL >

    Database altered.

    SQL >

    Database altered.

    SQL >

    Database altered.

    SQL >

    Database altered.

    SQL >

    Database altered.

    SQL >

    Database altered.

    SQL >

    Database altered.

    Hello

    ECHO applies only to the SQL commands * Plus reads through the @ or the STARTUP command, no statements you type directly in the SQL > prompt or read the bash script statements.

    Try to create a separate file, containing only the command ALTER DATABASE in a separate file (let's call it alter_database.sql for now) and call it from your script bash, like this:

    #! / bin/bash

    export ORACLE_SID = ORCL1

    echo "resize Datafile began to" 'date '.

    sqlplus "/ as sysdba".<>

    set echo on

    Set of feedback on

    @whatever/alter_database

    quit smoking

    EXPRESSIONS OF FOLKLORE

    echo "resize Datafile ended in" 'date '.

  • Configure SQL * more question

    People,

    Hello. My operating system is Oracle Linux 5. Database is DB Oracle 11 GR 1 material.

    I tried to configure SQL * Plus in the following way:

    My directory: / home/myOracle/OracleDB_Home/bin

    SYSTEM_PASS = SYSTEM/SYSTEM
    export SYSTEM_PASS
    . / sqlplus SYSTEM/SYSTEM

    But this message appears:

    Error Initializing SQL 6 * more
    Sql < lang > .msb file not found message
    SP2-0750: you may need to set ORACLE_HOME in your Oracle software directory.

    Where the message sql < lang > .msb file? What is Oracle software directory?
    Any folk can help solve this problem?

    user8860348 wrote:
    Folk,

    Hello. Thanks much for the reply.

    What is Oracle software directory?
    How to set ORACLE_HOME directory of Oracle software?

    Hello

    run

    $ > export ORACLE_HOME = / home/myOracle/OracleDB_Home

    See you soon

  • SQL * more question

    Hello
    Could you help me with writing SQL script, please.
    I had 4 tables.
    1: offers: attributes: Hotel, car, id of the offer, day, place.
    2: clients: attributes: customer id, name, address, no.phone.
    3. travel: attributes: id of the offer, date of the excursion, the price.
    4: reservations; attributes: offer code, the date of the offer, customer id, date of reservation, no.people, prepayment.

    I do the script:
    Please provide the name of the customer, address, no.phone. who has chosen to offer for the Special Place. Should be dinamic script.

    Help, please.
    SQL> ACCEPT Place PROMPT "Please enter place: "
    Please enter place: Zakopane
    SQL> SELECT  K.NAZWA,
      2          K.ADRES,
      3          K.NR_TELEFONU
      4    FROM  KLIENCI K,
      5          REZERWACJE  R,
      6          OFERTY O
      7    WHERE O.MIEJSCE     = '&Place'
      8      AND R.KOD_OFERTY  = O.KOD_OFERTY
      9      AND K.KOD_KLIENTA = R.KOD_KLIENTA
     10  /
    old   7:   WHERE O.MIEJSCE     = '&Place'
    new   7:   WHERE O.MIEJSCE     = 'Zakopane'
    
    NAZWA           ADRES                NR_TELEFONU
    --------------- -------------------- -----------
    Andrzej Krzak   Ul.Wiosenna Lublin    7814562508
    
    SQL> ACCEPT Place PROMPT "Please enter place: "
    Please enter place: berlin
    SQL> SELECT  K.NAZWA,
      2          K.ADRES,
      3          K.NR_TELEFONU
      4    FROM  KLIENCI K,
      5          REZERWACJE  R,
      6          OFERTY O
      7    WHERE O.MIEJSCE     = '&Place'
      8      AND R.KOD_OFERTY  = O.KOD_OFERTY
      9      AND K.KOD_KLIENTA = R.KOD_KLIENTA
     10  /
    old   7:   WHERE O.MIEJSCE     = '&Place'
    new   7:   WHERE O.MIEJSCE     = 'berlin'
    
    NAZWA           ADRES                NR_TELEFONU
    --------------- -------------------- -----------
    Robert Dole     Ul.Lubelska Ciechan   7522885699
    
    SQL> 
    

    SY.

  • SQL * more substitution vs bind variable question

    Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...

    example:

    create table blah as

    Select * from table

    WHERE DATE between start_date and END_DAY;

    the DATE is a numeric field, YYYYMMDD

    The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.

    The END_DAY is * always * last Friday and I realized that:

    variable L_FRIDAY char (15);

    Start

    Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;

    end;

    /

    The thing is that I get an error when I try to use the binding variable?

    create table blah as

    Select * from table

    WHERE DATE between start_date and: L_FRIDAY;

    Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...

    When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?

    Help!

    :-)

    Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables

    I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.

    Hello

    Kodiak_Seattle wrote:

    Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...

    example:

    create table blah as

    Select * from table

    WHERE DATE between start_date and END_DAY;

    the DATE is a numeric field, YYYYMMDD

    The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.

    The END_DAY is * always * last Friday and I realized that:

    variable L_FRIDAY char (15);

    Start

    Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;

    end;

    /

    The thing is that I get an error when I try to use the binding variable?

    create table blah as

    Select * from table

    WHERE DATE between start_date and: L_FRIDAY;

    Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...

    When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?

    Help!

    :-)

    Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables

    I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.

    Or SQL * more bind variable or variable substitution can be DATEs.  The best you can do is set a different type, as a string, representing a date.  A string as June 19, 2015"represents a date, but so strings like 'SYSDATE' and ' SYSDATE - 7', so you can do something like this:

    SET l_friday = ' NEXT_DAY ((SYSDATE-7), 'FRIDAY').

    DEFINE start_date = "ADD_MONTHS (& l_friday, - 12)"

    SELECT & start_date AS t_n

    , & l_friday AS l_f

    OF the double

    ;

    Output (when executed on 25 June 2015):

    L_F T_N

    ----------- -----------

    June 19, 2014 19 June 2015

  • Question on the definition of the width of column in SQL * more with information recovered w SQL

    Hello

    Is there a way to tell SQL * more to set the width of a column with the largest width of the items in the column? (as opposed to the default which is declared in the DDL width)

    In other words, I would like to do something functionally equivalent to this:

    COL < columname > format [select max (length (< columnname >)) < thetablethatcontainscolumname >]

    I do above manually in two steps

    1. select max (length (columnname)) of...

    2 col columnname format a [resultofstep1]

    Is it possible to do in one step?

    Thank you for your help,

    John.

    Hi John

    I don't think that there is a way to do this, because this information is not known at run time (as you proved it, you must run a separate SQL query first to calculate that information - also, what happens if there are predicates, this could affect the defined result so the request will actually be performed twice). You may decide an arbitrary width for each column and set it as being wrapped/word_wrapped/truncated.

    Other that that, you should consider whther you are using the right tool for the job, SQLplus is not exactly ideal for the presentation layer stuff. Something like APEX would give you much more control over the layout and formatting.

    See you soon

    Ben

  • SQL * more the 'timing' in SQL Developer command

    I installed SQL Developer version 4.1.1.19. In the sql worksheet, how can I use SQL * more order 'timing' in a script to see a time elapsed SQL? The "Timing" on 'set' did not return any info after running SQL, and 'calendar beginning mon_timer' back 'command Timing is obsolete. Help, please.

    Thank you

    • As you can see, there is no calendar information in the script output log.
    • Then I tried on the discussion forum, found it can be enabled in "tool > preference > Database > startup script" and set as startup script:

    Set serveroutput on

    set timing on

    • However, 2 questions are:
    1. the calendar that he returned is NOT the elapsed time of my stored procedure to run. He simply choose the 2 time points its time, before and not after MS point run. Set timing on is therefore not a solution for me.
    2. He did not follow the instructions in the startup script. After that I put the calendar in the startup script, stop & restart SQL Developer, same laptop charging, timing still on. The only way to turn off now is to configure it to NOT use

    any startup script.

    • Then I developed my own coding as a solution:

    3. control of the COIL

    VAR bv_start_ts VARCHAR2 (30)

    VAR bv_end_ts VARCHAR2 (30)

    VAR bv_elps_ts VARCHAR2 (30)

    DECLARE

    v_start_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;

    : bv_start_ts: = v_start_ts;

    END;

    /

    IMPRESSION bv_start_ts

    EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15);

    DECLARE

    v_end_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;

    : bv_end_ts: = v_end_ts;

    END;

    /

    IMPRESSION bv_end_ts

    EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6');

    IMPRESSION bv_elps_ts

    SPOOL OFF

    • Then I got what I want, the answer is in the 'PRINT ': bv_elps_ts

    SQL > VAR bv_start_ts VARCHAR2 (30)

    SQL > VAR bv_end_ts VARCHAR2 (30)

    SQL > VAR bv_elps_ts VARCHAR2 (30)

    SQL > DECLARE

    v_start_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;

    : bv_start_ts: = v_start_ts;

    END;

    /

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.031

    SQL > PRINT bv_start_ts

    BV_START_TS

    -----------

    20150702Thu112617.775545

    SQL > EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15)

    PL/SQL procedure successfully completed.

    SQL > DECLARE

    v_end_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;

    : bv_end_ts: = v_end_ts;

    END;

    /

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.062

    SQL > PRINT bv_end_ts

    BV_END_TS

    ---------

    20150702Thu112630.805786

    SQL > EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6')

    PL/SQL procedure successfully completed.

    SQL > PRINT bv_elps_ts

    BV_ELPS_TS

    ----------

    + 00:00:13.030241000 000000

    SQL > SPOOL OFF

  • Special characters could not load DB via SQL * MORE

    Hi, I have a pl as .accidentally sets sql script which will insert data in database. The question is there are some records are missing and these missing records contains a special character: Sansao and Strasse. The strange was if I run the script via F5 (Toad), all data can be inserted successfully but run through SQL * MORE (Toad), all records that contain special characters are not inserted.

    Anyone here know why it didn't load these special characters via SQL * MORE?

    Probably because you have given unicode (multi byte charsets) you read with a customer of standard single-byte character set.

    It's SILLY to loading data using SQL * more. It's the wrong tool used for loading the data. It does not support the bind variable. It doesn't support liaison in bulk. It does not support direct path inserts. It is not SQL * Loader.

  • Choose one in SQL Developer fails - SQL * more work

    Hi all

    I have the HS to MySLQ connection works correctly and most of the requirements I have in regards to the data works.


    However, I "only able to test my procedures and functions in SQL * more." IN SQL Developer 4.0.0.12 there is always a problem and questioning of the results are never displayed.

    Thanks in advance for any advice.

    Sincerely

    JS

    Hello Mike,.

    I use Oracle XE 11.2.0.2 x 64 on Linux. Using the MySQL ODBC 5.3.4 connection.

    I've just upgraded the SQL Developer to version 4.0.3 (released September 2014) and the problem seems to be resolved because I'm able to query the MySQL database and get the results.

    However, there is something I don't like all the whitespace added, whether in SQL Developer 4.0.3 in SQL * more.

    Here's the query I tested:

    Select "host", "User", "Password" in "user"@MYODBC5;

  • SP2-0642: SQL * more internal error of State 2165

    Hello

    I was faced with the question with sqlplus suddenly in 11.2.0.3 throw version on solaris 10 OS, it was working fine until today. No changes made on this (11.2.0.3.Q3) oracle home, but new ORACLE HOME installed by Server DBA (shared server) with the Q4 patch.

    -bash-3, $2 sqlplus / as sysdba

    SP2-0642: SQL * more internal error state 2165, context 4294967295:0:0

    Impossible to continue

    As explained in metalink note: 396154.1, I set NLS_DATE_FORMAT, but it doesn't seem to work

    also, I've checked the timezone as explained in the blog file, but the file timezone.dat does not exist in 11.2.0.3 version and all the files in $ORACLE_HOME/oracore/zoneinfo/have permissions of reading to the dba group

    http://arjudba.blogspot.com/2010/07/non-Oracle-user-hits-SP2-0642-or-SP2.html

    -bash - $3.2 ls - ltr

    30942 total

    -rw - r - r - 1 oracle dba readme.txt 6068 7 June 2010

    -rw - r - r - 1 oracle dba 31525 June 7, 2010 timezdif.csv

    -rw - r - r - 1 oracle dba 351525 Aug 21, 2011 timezone_9.dat

    -rw - r - r - 1 oracle dba 302100 August 21, 2011 timezone_8.dat

    -rw - r - r - 1 oracle dba 286815 Aug 21, 2011 timezone_7.dat

    -rw - r - r - 1 oracle dba 286217 Aug 21, 2011 timezone_6.dat

    -rw - r - r - 1 oracle dba 286310 Aug 21, 2011 timezone_5.dat

    -rw - r - r - 1 oracle dba 286264 Aug 21, 2011 timezone_4.dat

    -rw - r - r - 1 oracle dba 286651 Aug 21, 2011 timezone_3.dat

    -rw - r - r - 1 oracle dba 274900 August 21, 2011 timezone_2.dat

    -rw - r - r - 1 oracle dba 344448 Aug 21, 2011 timezone_14.dat

    -rw - r - r - 1 oracle dba 344425 Aug 21, 2011 timezone_13.dat

    -rw - r - r - 1 oracle dba 345024 Aug 21, 2011 timezone_12.dat

    -rw - r - r - 1 oracle dba 345356 Aug 21, 2011 timezone_11.dat

    -rw - r - r - 1 oracle dba 345637 Aug 21, 2011 timezone_10.dat

    -rw - r - r - 1 oracle dba 274427 Aug 21, 2011 timezone_1.dat

    -rw - r - r - 1 oracle dba 801410 Aug 21, 2011 timezlrg_9.dat

    -rw - r - r - 1 oracle dba 616723 Aug 21, 2011 timezlrg_8.dat

    -rw - r - r - 1 oracle dba 601242 Aug 21, 2011 timezlrg_7.dat

    -rw - r - r - 1 oracle dba 586750 Aug 21, 2011 timezlrg_6.dat

    -rw - r - r - 1 oracle dba 587487 Aug 21, 2011 timezlrg_5.dat

    -rw - r - r - 1 oracle dba 531137 Aug 21, 2011 timezlrg_4.dat

    -rw - r - r - 1 oracle dba 527717 Aug 21, 2011 timezlrg_3.dat

    -rw - r - r - 1 oracle dba 507957 Aug 21, 2011 timezlrg_2.dat

    -rw - r - r - 1 oracle dba 791430 Aug 21, 2011 timezlrg_14.dat

    -rw - r - r - 1 oracle dba 782475 Aug 21, 2011 timezlrg_13.dat

    -rw - r - r - 1 oracle dba 785621 Aug 21, 2011 timezlrg_12.dat

    -rw - r - r - 1 oracle dba 787272 Aug 21, 2011 timezlrg_11.dat

    -rw - r - r - 1 oracle dba 792894 Aug 21, 2011 timezlrg_10.dat

    -rw - r - r - 1 oracle dba 493675 Aug 21, 2011 timezlrg_1.dat

    drwxr-xr-x 2 oracle dba 30 Sep 8 05:03 big

    drwxr-xr-x 2 oracle dba 30 Sep 8 05:03 little

    Please suggest alternatives to troubleshoot

    Thank you

    Sol.beach thanks for the reply, I'm able to correct the problem. In fact the PATH variable has put in .profile of export PATH = $PATH: $ORACLE_HOME/bin and the value is lower.

    -bash-3, $ 2 echo $PATH

    /Apps/Oracle/product/9.2.0.8.2009Q4/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/bin:.:/ bin:/opt/bin:usr/CSS/bin:/usr/ucb:/usr/local/bin:/apps/Oracle/product/11.2.0.3.2014Q3/bin

    I changed as export PATH = $ORACLE_HOME/bin: $PATH and now it works fine. It seems to be a problem with the old Oracle Home, also present in the PATH variable before the bin to the current address of Oracle Home Directory.

    -bash-3, $ 2 echo $PATH

    /Apps/Oracle/product/11.2.0.3.2014Q3/bin:/apps/Oracle/product/9.2.0.8.2009Q4/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/bin:.:/ bin: / opt/bin: css/usr/bin: / usr/ucb: / usr/local/bin

    Concerning

  • Database demo of vision: how to access the database through SQL * more?

    I'm totally new in this space, so forgive my beginner questions.

    What I want to do, is to integrate EBS with APEX. To get there I downloaded (of delivery) and installed the Vision database unique node in a VirtualBox. To do this, I followed this video on YouTube: https://www.youtube.com/watch?v=8JgxMDPsd6s

    Now I want to install APEX and for this I need to access my database as SYS. Now for my questions:

    1. How can I use SQL * more in the VirtualBox?

    2. What is the default password for SYS with this demo database?

    Thanks, Alex

    File under $ORACLE_HOME and the owner is the user 'oracle '.

    You will need to source the file VISION_ebs.env , and then deliver "env | fate"and you should see the set env variables. You can connect as sysdba.

    Thank you

    Hussein

  • Cannot access SQL more from other than the Oracle users

    Hello

    I installed Oracle 11 g R2 on Red Hat 6. My problem is that I can't access sqlplus from other than the oracle users.

    I put the PATH, the ORACLE_HOME and ORACLE_SID to the correct values.

    Session1

    Connect as: oracle

    [email protected] password:

    Last login: Sun Aug 24 01:24:46 192.168.202.1 2014

    [oracle@localhost ~] $ echo $PATH

    /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/Home/Oracle/bin:/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1/bin

    [oracle@localhost ~] $ echo $ORACLE_HOME

    /Home/Oracle/app/Oracle/product/11.2.0/dbhome_1

    [oracle@localhost ~] $ echo $ORACLE_SID

    ORCL

    [oracle@localhost ~] $ sqlplus

    SQL * more: Production release 11.2.0.1.0 Sun Aug 24 03:17:32 2014

    Copyright (c) 1982, 2009, Oracle.  All rights reserved.

    Enter the user name:

    Session2

    Connect as: nada

    [email protected] password:

    Last login: Sun Aug 24 02:31:49 192.168.202.1 2014

    [prithwish@localhost ~] $ export PATH=$PATH:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin

    [prithwish@localhost ~] $ export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1

    [prithwish@localhost ~] $ export ORACLE_SID = orcl

    [prithwish@localhost ~] $ echo $ORACLE_HOME

    /Home/Oracle/app/Oracle/product/11.2.0/dbhome_1

    [prithwish@localhost ~] $ echo $ORACLE_SID

    ORCL

    [prithwish@localhost ~] $ echo $PATH

    /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/Home/Prithwish/bin:/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1/bin

    [prithwish@localhost ~] $ sqlplus

    -bash: sqlplus: command not found

    I guess that I could not access sqlplus as the Nada the user has no access to X11R6

    [prithwish@localhost ~] $ cd...

    [Host prithwish@localhost] $ ls - ltr

    Total 8

    drwx-. 30 oracle oinstall 4096 23 August 23:51 oracle

    drwx-. Nada Nada 4096 24 August to 02:33 27 Mathieu

    [Host prithwish@localhost] $

    My question is, although quite stupid, that double

    (1) I have to change the permissions of the directory oracle of 755 for any other user to access the sqlplus?

    (2) why is the user directory under the folder created with permissions of 700, even when the umask is set to 002? Change the permissions of the directory under/Home oracle will cause security problems?

    My apologies for being naïve. It's the first time I installed Oracle under UNIX

    Kind regards

    Prithwsh

    Actually, the default procedure is NOT to install oracle to X11R6, but in/opt/oracle. or maybe/usr/local/oracle.

    This is what you're going to be recommended in the installation documentation, and in doing so, don't forget to run rootpre.sh and root.sh, I never had security problems and could run Oracle from any account.

    Sybrand Bakker

    Senior Oracle DBA

  • Can I connect to SQL * more as SYS after connecting as a user and then run a GRANT?

    Oracle 11 g 2

    Linux RHEL 6.3

    SQL * Plus 11.2.0.2 on Windows 7

    ------------------------------------------------

    I am running a script SQL through SQL * more connected as "DOE, JOHN".

    In the SQL script, I need to connect as SYS to make a GRANT EXECUTE on a SYS package (e.g. GRANT EXECUTE ON DBMS_CRYPTO to JOHN;).

    But it fails with the following error:


    GRANT EXECUTE ON TO JOHN DBMS_CRYPTO
    *
    ERROR on line 1:
    ORA-01917: user or role 'JOHN' does not exist

    But of course, 'JOHN' are.  The rest of the SQL script is running "DOE, JOHN" without any problem.

    The code segment of SQL script in question is:

    connect sys/password as sysdba
    GRANT EXECUTE ON DBMS_CRYPTO TO ROYSECITYDATA;  <-fails here
    to connect/DOE

    Please advise on what my being the issue.

    tx103108 wrote:

    I connect to a remote database.  All dbs distance have the same instance name as they are all images.  I see where you're going (I think).  Should I try

    I'll try to connect sys/password@MYDB

    Sounds like a plan... (the instance_name returned with what you expected? or something else?)

  • BECAUSE a node: when to stop through SQL * more...


    Hello

    I installed a CCR node for the first time and playing with it to get better knowledge. The underlying cluster has two nodes, call them the Node_A and node_b.

    The cluster database itself is called upon to DEVELOP, DEVELOP_1 instance is running on the node Node_A, instance DEVELOP_2 is supposed to work on node_b. The preferred node is

    NŒUD_A.

    When testing database online relcation everything works as expected: DEVELOP_1 instance Gets the stop on Node_A node - instance DEVELOP_2 is started on node_b.

    But what closing instance DEVELOP_1 on Node_A with SQL * more I was surprised of the result:

    -C' is not instance DEVELOP_2 which began on node_b - it was DEVELOP_1 for instance!  (Because of this my control sews has changed - but is not the issue of this discussion).

    Now my questions are:

    -is the clusterware responsible for the DEVELOP_1 instance on node_b startup behavior when I stop instance DEVELOP_1 down on Node_A via SQL * more?

    - and if this behavior is documented? I went through the RAC documentation node, but could not find something useful

    Any help will be appreciated.

    Rgds

    Jan

    Hi Jan,

    Yes, its expected behavior in a node of the FCAC, please consult the document below.

    "Oracle Real Application Clusters one node Overview" (Page 1) (relocation of the database online)

    http://www.Oracle.com/technetwork/products/Clustering/overview/TWP-rac1nodev1-1-130698.PDF

  • Privileges differ between SQL * more and stored procedure

    A user with the dba role can access dba_role_privs. But this is not possible in a stored procedure created by the same user.
    Normally, the example should work fine
    But with Oracle XE 11.02 - cost free database with some limitations - I get error 942

    I show a simple example in SQL * more:

    SQL > r
    1 * select distinct dba_role_privs recipient where the recipient as "SY %.

    DEALER
    ------------------------------
    SYSTEM
    SYS

    SQL > create or replace procedure x as
    2 start
    3 for rec in (select distinct dba_role_privs dealer where the beneficiary as 'SY %')
    4 loop
    5 zero;
    6 end of loop;
    7 end;
    8.

    Warnung: Prozedur wurde mit Kompilierungsfehlern standing.
    English translation: procedure created with compilation errors

    SQL > show error

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    3/14 PL/SQL: statement ignored
    3/43 PL/SQL: ORA-00942: table or view does not exist
    SQL >

    How can I fix?

    Why do you think the example should work properly?

    Normally, regardless of the version, the privileges granted through roles (such as DBA) not available for stored procedures. Stored procedure of a DEFINER rights can only take advantage of the privileges granted directly to the owner of the procedure. Stored procedure of the invoker rights can enjoy privileges granted by a role, but that requires that the appellant has independent privileges to query the table in question (and, in this case, would require dynamic SQL usage).

    Generally, the simplest approach would be to grant the privilege to CHOOSE ANY DICTIONARY to the owner of the procedure.

    Justin

Maybe you are looking for

  • Why the app is slow on 2g and 3g networks

    Why there is no turbo speed as opera and uc browser speeder firefox it takes longer to open a site than the other browser why you shouldn't be an update for this in your android and PC are turbo Mozilla to load faster

  • iPhoto 11 works with el capitan

    I have a neighbor with a mac that uses exclusively with iPhoto and do not like the new photo app.  If he updates to el capitan iPhoto still work?   It has an iMac 20 "running os 10.10.5.

  • WLAN and LAN can not work together...

    I have a ProBook 6550 b with LAN, WLAN, WWAN...Control software and software packages, all and of course - BIOSupdate regularly!And some other user and I found BIG BUG (Limitation in work procedures)...In BIOS v F.20 LAN and WLAN cannot work at the s

  • Start windows live messenger

    When I try to open windows live messenger, I get this message: "the request failed because its side-by-side configuration is incorrect.  See the application event log. "What should I do?

  • Problems with internet access, troubleshooting, Windows 7 does not work.

    Hello, I have recently started up to Windows 7 on a partition of Windows 10, because a game wasn't working properly on Windows 10 system (has notified downgrade after a one hour session troubleshooting). I don't know if the game is causing these issu