Oracle common script memo

xiaoxiao2021-03-06  100

1. Create a table T2 that has the structure of the T1 table Create Table T2 AS Select * from T1 WHERE 1 <> 2; 2. Create a table T2 to make the structure and data of the T1 table CREATE TABLE T2 AS SELECT * From t1; 3, modify the Michael user's index space for users, temporary table spaces for Temp, and give him a 15M space quota in the UserS table space, ALTER USER Michael Default TableSpace Users Temporary TableSpace Temp Quota 15M on Users; 4, construction of the table statement in the script example, note the capitalization SET ECHO OFF SPOOL Material_test_items.log CREATE tABLE Material_test_items (Material_test_no VARCHAR2 (6) NOT NULL, Test_date DATE NOT NULL, Category VARCHAR2 (2) NOT NULL, Mtrl_item_no VARCHAR2 (2) NOT NULL, Mtrl_item_value VARCHAR2 (60) NULL, MODIFY_DATE DATE NULL, MODIFY_USER VARCHAR2 (30) NULL, INSERT_USER VARCHAR2 (30) NULL, INSERT_DATE DATE NULL, DATA_OWNER VARCHAR2 (10) NULL, CONSTRAINT material_test_items_PK PRIMARY KEY (Material_test_no, Test_date, Category, Mtrl_item_no)) STORAGE (Initial 65536 Next 65536 Minextents 1 Maxextents 505 Pctincrease 0); SPOOL OFF SET ECHO ON5, user_ind_columns user_cons_columns user_constraints

user_tables dba_tables all_tablesuser_views dba_views all_views user_indexs dba_indexs all_indexs user_sequences dba_sequences all_sequences user_synonyms dba_synonyms all_synonyms6, the data added to a table in the database with other watches go, this method is more easy than the database chain. Copy from username / password @ Database append table1 using select * from table1; replace Append to replace if you need to replace data

转载请注明原文地址:https://www.9cbs.com/read-105084.html

New Post(0)