How to rename the table or synonym?

Hi all

11.2.0.1

I want to rename the table or synonym owned by HR as a SYS user.

SQL > rename hr.emp in hr.emp_old;

*

ERROR on line 1:

ORA-01765: specifying the name of the owner of the table is not allowed

Thank you very much

zxy

Hello

You can do something like that as a user of the SYSTEM:

1 alter session set current_schema = "HR".

2. Rename emp emp_old

Thank you &

Best regards

Tags: Database

Similar Questions

  • Rename the table

    How to rename the table using export and import utility?


    Thanks 10

    883532 wrote:
    How to rename the table using export and import utility?

    Thanks 10

    What is the version?

    It is not possible to rename the table using import and export, why not use SQL in 9i? its very simple
    SQL > create table emp_new in select * from emp;

    If his 10g.then above

    System $expdp / * tables = scott.emp dumpfile = emp.dmp = directory = data_pump_dir emp.log logfile
    System $impdp / * dumpfile = emp.dmp logfile = emp_imp.log remap_table = rΘpertoire emp:emp_new = data_pump_dir

    HTH.

    883532 profile
    883532
    Newbie
         
    Handle: 883532
    Status level: Beginner
    Registration date: Sep 6, 2011
    Messages total: 28
    Total Questions: 18 (12 pending)

    Keep the forum clean as much as possible by markers as replied.

    Published by: CKPT on February 20, 2012 22:00

  • Rename the table with sys 11 g

    Hi all

    Prior to Oracle 11 g and Oracle 10 g (I think) we can rename a table like this:

    (with the user sys):

    alter table SCOTT. Rename ancien_nom NewName;

    I mean the user SYS might rename a table from another schema (for example, SCOTT)

    Now, (oracle 11g) when I try to rename a table with the user SYS to another schema, it shows me:

    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> rename table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    rename table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
           *
    ERROR at line 1:
    ORA-00903: invalid table name
    
    
    
    
    SQL> alter table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    alter table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
                                          *
    ERROR at line 1:
    ORA-01735: invalid ALTER TABLE option
    
    
    
    
    SQL>
    

    I read the documentation and the only way (as much, I know) rename table is that the user PLANTEST be connected to the database and rename the table. I mean, only the table owner can rename?

    Please, how can I rename ANY table of my database with the user SYS or SYSTEM?

    Thank you

    chijar,

    Please user query,

    Use the ALTER TABLE RENAME command:
    
     SQL> ALTER TABLE . RENAME TO ; 
    

    This is the keyword to rename mising is why you receive error below.

    1. SQL > alter table plantest. PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    2. ALTER table plantest. PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
    3. *
    4. ERROR on line 1:
    5. ORA-01735: invalid option of ALTER TABLE
    6. SQL >

    Naming conventions:
    -------------------

    1 names must be between 1 and 30 characters long.
    2. the names must begin with a letter.
    3. it must contain only A - Z, a - z, 0-9, _, $, and the #. You are strongly
    not recommended to use $ and #.
    4. the names are not case sensitive, unless they are created by double-quotes.

  • How to clear the table dhcp clients

    Does anyone know how to clear the Table of Clients DHCP?

    I have a WRV54G.

    Concerning

    I understand this is a very old post, but since I found it when I was looking for the same answer in 2009, I thought go ahead and give my $.02 worth.

    I have a different router, so it may not be present in your.

    I use a version of the firmware WRT54GLwith 4.30.7 and finally found on the status under "Local network" page a link to the DHCP table. You can click on that and delete existing IP addresses.

  • How to rename the HFM web form

    Hi all

    How to rename the HFM web form

    Thanks in advance

    Concerning

    Satheesh.s

    Hello

    Unfortunately, you cannot rename a form online.

    In order to change the name of an existing one, you need to:

    • Save the existing one with a different name
    • Remove the previous and start using the new

    See you soon,.

    Thanos

  • How to know the tables used in packages of a schema.

    How to know the tables used in packages of a pattern that I have connected.

    SELECT DISTINCT referenced_owner, referenced_name

    Of all_dependencies

    Owner WHERE = "MY_USER_NAME".

    AND type ('PACKAGE', 'BODY of PACKAGE')

    AND referenced_type = 'TABLE '.

  • How to rename the temporary tablespace group name

    How to rename the temporary tablespace group name?  I have to remove all the temporary tablespace under the Group and then re-create the temporary tablespace again.

    EBS r12.1.1

    Database 11.0.1.7

    Please see any id doc.

    concerning

    pritesh Rodriguez

    Thanks for your update. I have solved my problem by creating a new group and add temporary tablespace to new goup.

    concerning

    pritesh Rodriguez

  • How to rename the configuration files store data with downtime

    HI team

    I've renamed the vcenter client name. How to rename the configuration also files in data store with to take the time to stop.

    you have renamed virtual machines, and now you want to also rename the config files (vmdk, vmx and so on)?

    Just do a storage vmotion and the files will be automatically renamed...

  • How to purge the table ECX_OUTQUEUE of the ECX_OUTBOUND AGENT

    How to purge the table ECX_OUTQUEUE of the ECX_OUTBOUND AGENT

    904632 wrote:

    How to purge the table ECX_OUTQUEUE of the ECX_OUTBOUND AGENT

    Please see (how to recreate the ECX Related queues? (Doc ID 1354312.1)).

    Thank you

    Hussein

  • How to design the table from the answer to the question table.

    Hi all

    I am creating an application for student review online.

    There are two types of questions, the only choice of response and multi choice answers.

    My question is less than
    create table question_master
    (
    exam_id number references exam_master(exam_id),
    marks_of_each_question number,
    type_of_question char(1),-- single choice answer/multiple choices answer
    q1 varchar2(2000),
    q2 varchar2(2000),
    q3 varchar2(2000),
    q4 varchar2(2000))
    my table to answer (I'm not satisfied with who is below
    create table answers_of_questions
    (
    answer_id number primary key,
    question_ID number referenes question_master(question_id),
    answer varchar2(4000) not null,
    is_answer_correct char(1),--y/n,
    student_selection char(1),--y/n   student select it or not
    ....
    ...
    now, I'm perfectly how to create the RESPONSE table to contain the answers.
    the only choice is good, but several checkboxes choices, what to do?
    How to design the table from the answer?

    do I have to create 2 tables to contain the answers?
    Note: the QUESTIONS and ANSWERS, all will be entered by the teacher. students will make a choice and I will store this choice in another table
    may be called STUDENT_SELECTED_ANSWERS or something like that.
    If anyone has some reference to the script retail scheme review online, kindly share with me.

    Kind regards.

    Kind regards.

    If you need to have answers in another table:

    Student (student_id, name, etc...)
    Review (exam_id, exam_name, etc...)
    Question (question_id, exam_id, question_text)

    Response (question_id, a_text, b_text, c_text, d_text, a, b, c, d).<-- one-to-one="" with="" question="" table,="" a-d="" flags="" used="" to="" indicate="">
    OR
    Response (question_id, answer_id, answer_text, OK)<-- many-to-one="" with="" question="" table,="" correct="" flag="" used="" to="" indicate="" correctness="" for="" this="" single="">

    Student_Answer (student_id, question_id, a, b, c and d)
    OR
    Student_Answer (question_id, student_id, answer_id)<-- creation="" of="" a="" question_id+answer_id="" in="" this="" table="" implies="" the="" student="" checked/selected="" it="" as="" an="">

    To what extent you want to standardize, it is up to you.

  • How to rename the button "Give FInal notes" in the assessment.

    Hello

    How to rename the button "Give FInal notes" in the assessment. (Assessment Manager the manager finally click 'Give Final notes'. "I want to rename this button).

    I tried through customization, but impossible to find the name of the button in the customization structure, so that I can rename it.

    concerning

    Published by: Maya on 24 November 2012 23:23

    Hi Maya,

    In customization, find the point jacquard simiilar Word. For example: "Ranking Final %" or something like that.
    You will get the item as well as block the name.

    According to my understanding, if you want to change the label of the button, and then set the property: LABEL for this element.
    Apply and save the customization.

    Switch the responsibility and test again the case.

    HTH
    Sanjay

  • RENAMECOLLECTIONTABLE - questions by renaming the table from the collection.

    Hi all

    I use the version of database Oracle 10.2.0.2, OS - Solaris

    I am enrolled in the scheme after successfully.

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xs: schema xmlns: XS = "http://www.w3.org/2001/XMLSchema".
    xmlns:xdb = "http://xmlns.oracle.com/xdb".
    elementFormDefault = "qualified" attributeFormDefault = "unqualified" >

    < xs: element name = "employee" type = "employeeType" xdb:defaultTable = "EMPLOYEEXMLTYPE_TABLE" / >

    < name XS: complexType "employeeType" = >
    < xs: SEQUENCE >
    < xs: element name = "name" type = "xs: String" / >
    < xs: element name = "departments" type = "departmentsType" nillable = "true" minOccurs = "0" / >
    < xs: element name = "name" type = "xs: String" / >
    < / xs: SEQUENCE >
    < name XS: attribute = "id" type = "Integer" use = "required" / >
    < / xs: complexType >

    < name XS: complexType = "departmentsType" >
    < xs: SEQUENCE >
    < xs: element name = "Department" type = "DepartementType" maxOccurs = "unbounded" / >
    < / xs: SEQUENCE >
    < / xs: complexType >

    < name XS: complexType = "DepartementType" >
    < xs: SEQUENCE >
    < xs: element name = "name" type = "xs: String" / >
    < xs: element name = "departmentWings" type = "departmentWingsType" / >
    < / xs: SEQUENCE >
    < / xs: complexType >

    < name XS: complexType = "departmentWingsType" >
    < xs: SEQUENCE >
    < xs: element name = "departmentWing" type = "departmentWingType" maxOccurs = "unbounded" / >
    < / xs: SEQUENCE >
    < / xs: complexType >

    < name XS: complexType = "departmentWingType" >
    < xs: SEQUENCE >
    < xs: element name = "name" type = "xs: String" / >
    < xs: element name = "target" type = "xs: String" / >
    < / xs: SEQUENCE >
    < / xs: complexType >

    < / xs: Schema >

    My goal is to create indexes on/employee/departments/department/departmentWings/departmentWing/name.

    I followed the steps mentioned in Create index for an XMLType column.

    One of the measures mentioned in the link above is to rename the table in the collection (in my case departmentwing) using the DBMS_XMLSTORAGE_MANAGE procedure. RENAMECOLLECTIONTABLE.

    So I tried the following:
    SQL > START
    DBMS_XMLSTORAGE_MANAGE 2. () RENAMECOLLECTIONTABLE
    OWNER_NAME 3 = > "XDB_TEST"
    Table_name 4 = > "EMPLOYEEXMLTYPE_TABLE"
    5 COL_NAME = > NULL,
    XPATH 6 = > ' / employee/departments/Department/departmentWings/departmentWing/name. "
    7 COLLECTION_TABLE_NAME = > 'DEPTWING_TABLE '.
    (8);
    9 END;
    10.

    PL/SQL procedure successfully completed.

    If the procedure has said that it has completed successfully, I couldn't see the created DEPTWING_TABLE.

    SQL > DEPTWING_TABLE DESC;
    ERROR:
    ORA-04043: object DEPTWING_TABLE does not exist

    I am left helpless. Can someone please?

    Kind regards
    Simo.

    Published by: user5805018 on October 12, 2011 04:40

    Hello

    First of all, are you sure that the nested tables generated during the registration of the scheme?

    You must annotate the schema with xdb:storeVarrayAsTable = 'true' and use the option genTables-online true for registration.
    Then you should see something like this:

    SQL> select table_name, table_type_name, parent_table_name, parent_table_column
      2  from user_nested_tables
      3  ;
    
    TABLE_NAME                     TABLE_TYPE_NAME                PARENT_TABLE_NAME              PARENT_TABLE_COLUMN
    ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    SYS_NTy8fd9LOzSmun4whyTbJC4g== department384_COLL             EMPLOYEEXMLTYPE_TABLE          "XMLDATA"."departments"."department"
    SYS_NTeAiIyOu0Q9G3nvWMtcM6mQ== departmentWing381_COLL         SYS_NTy8fd9LOzSmun4whyTbJC4g== "departmentWings"."departmentWing"
     
    

    In addition, according to the manual (xdb_easeofuse_tools.pdf):

    For Oracle Database 11g Release 2 (11.2) and above, this function accepts only, XPath
    the rating as a dotted notation. If the XPath notation is used, a setting of namespaces
    may also be necessary.

    So, on your version, you must use the notation 'dot ':

    SQL> call XDB.DBMS_XMLSTORAGE_MANAGE.renameCollectionTable(
      2    USER
      3  , 'EMPLOYEEXMLTYPE_TABLE'
      4  , NULL
      5  , '"XMLDATA"."departments"."department"'
      6  , 'DEPT_TABLE'
      7  );
    
    Method called
    
    SQL> call XDB.DBMS_XMLSTORAGE_MANAGE.renameCollectionTable(
      2    USER
      3  , 'DEPT_TABLE'
      4  , NULL
      5  , '"departmentWings"."departmentWing"'
      6  , 'DEPTWING_TABLE'
      7  );
    
    Method called
    
    SQL> select table_name, table_type_name, parent_table_name, parent_table_column
      2  from user_nested_tables;
    
    TABLE_NAME                     TABLE_TYPE_NAME                PARENT_TABLE_NAME              PARENT_TABLE_COLUMN
    ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    DEPT_TABLE                     department384_COLL             EMPLOYEEXMLTYPE_TABLE          "XMLDATA"."departments"."department"
    DEPTWING_TABLE                 departmentWing381_COLL         DEPT_TABLE                     "departmentWings"."departmentWing"
     
    

    Hope that helps.

  • 10g - how to rename the dashboard

    Hi, experts, how to rename the dashboard?
    We need to restore security after the name change?

    Hello stephen,.
    In this way, Oracle BI Presentation Services Administration > manage Presentation catalog > YourFolderName > _portal > YourDashboardName.
    (GOLD)
    1. open the catalog of Oracle Business Intelligence Manager
    2. open your required catalog
    3. you can get the portal and your dash board name in this
    4. change the name by renaming options.

    We need to restore security after the name change?

    No need to reset the security

    See you soon,.
    KK

  • How to add the table radio button.

    Hello

    I want to update the record if I want that an option of button raduio shaped tabular .There is no option for tabular.
    How to add the table radio button.


    Thank you

    Published by: 805629 on February 3, 2011 04:56

    Use APEX_ITEM. BOX API in the definition of SQL query for the form of tables

  • How to check the table have are all views in oracle

    Hello
    How to check the table have are all views in oracle
    SELECT * FROM user_dependencies
    WHERE type='VIEW'
    AND referenced_type='TABLE'
    AND referenced_name ='Your_Table_Name' 
    

    You can use dba_dependencies to find views in the different schema.

Maybe you are looking for