Newbie: dropping and creating an identical user
Oracle 10g
Hi: I need to drop and recreate the user. This is what I had from my previous notes.
1. how do I figure out what is the current default tablespace
2. how do I figure out the current temporary tablespace?
3. the table space and temporary table space get deleted when I drop the user. if Yes, Is it possible some other user's default tablespace and temporary tablespace is the same as well.
Drop user systems cascade;
CREATE USER SYSTEMS
IDENTIFIED BY VALUES 'Test123'
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMPts1
PROFILE DEFAULT
ACCOUNT UNLOCK;
/
When I do a "SELECT DBMS_METADATA.GET_DDL('USER', 'Test123') || '/' DDL FROM DBA_USERS;", I get 34 rows. What does that mean. They all look identical.
SELECT DBMS_METADATA.GET_DDL('USER', 'Test123') || '/' DDL FROM DBA_USERS;
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
CREATE USER "Test123" IDENTIFIED BY VALUES 'F42EB0B11017F065'
DEFAULT TABLESPACE "ARSYSTEM"
TEMPORARY TABLESPACE "TEMP"
34 rows selected.
Similar Messages
-
Drop and create tablespace for users
I am using Oracle 8i. I have created some users and, assigned the default & temporary tablespace to them.
I would like to drop and re-create the temporary tablespace, should I assign the tablespace to users again?
my script for creation of users:
CREATE USER USER01 IDENTIFIED BY ABC
DEFAULT TABLESPACE WEB_DATA
TEMPORARY TABLESPACE TEMPORARY_DATA
PROFILE DEFAULT;Hi,
I would like to drop and re-create the temporary tablespace, should I assign the
tablespace to users again?If temp tbs is not in usage, you can drop and recreate it without reassign. Users keep this one.
Nicolas. -
What is the difference between the drop and create the index and rebuild index ?
Hi All,
what is the difference between drop and create index & rebuild index ? i think both are same...Please clarify if both are same or any difference...
Thanks in Advance,
rupBoth are same. Rebuilding an index drops and re-creates the index.
Ref:
SSMS - https://technet.microsoft.com/en-us/library/ms187874(v=sql.105).aspx
TSQL - https://msdn.microsoft.com/en-us/library/ms188388.aspx
I would suggest you to also refer one of the best index maintenance script as below:
https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html -
I've recently tried to restore my IPhone4. For some reason, its not working properly (i.e my phone won't come out of restore). I've already restarted my computer, and created a new user account on my computer.The message that keeps popping up says Error 1604 which i know has somethign to do with the USB port but i don't know what specifically. Any Help??
Error 1604
This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode, put it into Recovery Mode.
Restore and wait for the error.
When prompted, click OK.
Close and reopen iTunes while the device remains connected.
The device should now be recognized in Recovery Mode again.
Try to restore again.
If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection. -
my friend gave his Macbook pro to me a month ago but he forgot his password. I want to log him out and creat a new user account of myself.
Did your friend also provided you with the original DVDs that came with the MacBook Pro?
-
I have just purchased an iPhone5 and created a new user instead of using my iPhone3 ID. How can I access my previous data?
don't just sign out!
if you simply sign out, the stuff you recently purchased will be an issue in the future when an update comes out for apps or anything else. restore the device as new from itunes then restore from a back if you have one as stated above...or set up as new and use correct apple id. this will ensure you will be using the apple id that you used originally without issues from the new one. -
How to create stored procedure to drop and create table
Version: Oracle 10g
I am trying to create a stored procedure that will drop and create a table based on a select statement. I can create the table but I can't drop it.
CREATE OR REPLACE procedure EC_LOAD is
begin
INSERT INTO Sales_table
(FSCL_WK,
DIV,
ACCT_TYPE)
Select
FSCL_WK,
DIV,
ACCT_TYPE
from
sales_revenue;
end ecload;
I need to drop Sales_table before inserting the values. How do i do this?Or with a drop:
SQL> desc emp2
ERROR:
ORA-04043: object emp2 does not exist
SQL>
SQL> declare
2 cnt int := 0;
3 begin
4 select max (1)
5 into cnt
6 from user_tables
7 where table_name = 'EMP2';
8
9 if cnt = 1
10 then
11 execute immediate 'drop table emp2';
12 end if;
13
14 execute immediate 'create table emp2 as select * from emp';
15 end;
16 /
PL/SQL procedure successfully completed.
SQL>
SQL> desc emp2
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL> -
Way to programmatically drop-and-create-tables?
Hi all,
I have a persistence unit which exists to provide lookup information to my application. It is populated by data that is available at runtime. It takes a long time to parse this data, and therefore my intention is to only parse it once at the deployment target. To do this, I have created a main method that does all the parsing, and I do not set the toplink.ddl-generation property in persistence.xml. This causes the application to fail if the database is not created.
However, this means that during the population stage, I must drop and create any existing tables. I had thought it would be possible to do this by obtaining an EntityManagerFactory which has a property map sent to it, containing the property toplink.ddl-generation set to drop-and-create-tables. But this does not work... the tables are not dropped (if they exist) and are not created (if the database is empty).
Is it possible to do the drop-and-create-tables programmatically using the JPA?
I may have another EntityManagerFactory open at the same time, which has been opened with the default options... would this be conflicting?I don't think there is any easy way to generate the default tables once your have created the EntityManagerFactory. You could use the EclipseLink/TopLink schemaframework or TableCreator to create tables using a EclipseLink/TopLink DatabaseSession.
There is a DefaultTableGenerator in org.eclipse.persistence.tools.schemaframework, which may give you what you are looking for.
-- James : http://www.eclipselink.org -
How to create one procedure which can drop and create materialized view
Hi,
I want to create one pl/sql procedure which can first drop materialized view CATEGORY_PK and after that create same materialized view CATEGORY_PK.
programme is as follows:
DROP MATERIALIZED VIEW CATEGORY_PK;
CREATE MATERIALIZED VIEW CATEGORY_PK REFRESH FORCE WITH PRIMARY KEY AS
SELECT cav1.ownerid AS categoryid, p.uuid AS productid ,p.domainID AS productdomainid,pav.stringvalue AS NAME
,pav2.stringvalue AS ID, pav3.stringvalue AS SHORT
FROM product p, product_av pav, catalogcategory_av cav1, catalogcategory_av cav2,product_av pav2,product_av pav3
WHERE
cav1.NAME = 'PRODUCT_BINDING_ATTRIBUTE' AND
cav2.NAME = 'PRODUCT_BINDING_VALUE' AND
cav1.ownerid = cav2.ownerid AND
p.uuid = pav.ownerid AND
p.uuid = pav2.ownerid AND
p.uuid = pav3.ownerid AND
pav.NAME = cav1.stringvalue AND
pav2.NAME = cav1.stringvalue AND
pav2.NAME = cav1.stringvalue AND
pav.stringvalue = cav2.stringvalue AND
pav2.stringvalue = cav2.stringvalue AND
pav3.stringvalue = cav2.stringvalue
UNION
SELECT catalogcategoryid AS categoryid, productid, repdomainid AS productdomainid,pav1.stringvalue AS NAME
,pav2.stringvalue AS ID, pav3.stringvalue AS SHORT
FROM productcategoryassignment ,product_av pav1,product_av pav2,product_av pav3
WHERE pav1.ownerid=productid
AND pav2.ownerid=productid
AND pav3.ownerid=productid
AND pav1.NAME='name'
AND pav2.NAME='productID'
AND pav3.NAME='shortDescription';user498566 wrote:
I want to create one pl/sql procedure which can first drop materialized view CATEGORY_PK and after that create same materialized view CATEGORY_PK.That sounds like a waste of time and resources. What do you hope to achieve by this? A refresh? If so, a simple refresh of the old materialized view will do.
If you truly want to continue this road, you'll have to use the EXECUTE IMMEDIATE command to execute DDL commands from within PL/SQL.
Regards,
Rob. -
Basic anonymous block which drops and creates a table
Version: 11.2.0.3
I am fairly new to PL/SQL.
We have a table named CHK_CNFG_DTL.
I want to create a backup table for CHK_CNFG_DTL which will be named like CHK_CNFG_DTL_BKP_<timestamp> eg: CHK_CNFG_DTL_BKP_JULY_22_2013
Creation of this backup table has to be automated so, I want to create an anonymous block which will first drop the existing backup table and then create a new backup table from the original table.
The below code works fine. But the very first time when you run it , the loop won't iterate because there is no such table named CHK_CNFG_DTL_BKP%.
declare
v_stmt varchar2(1000);
v_date date;
begin
for rec in
(select * from user_tables where table_name like 'CHK_CNFG_DTL_BKP%' )
loop
begin
execute immediate 'alter session set nls_date_format=''DD_MON_YYYY''';
v_stmt := 'drop table '||rec.table_name|| ' purge';
dbms_output.put_line(v_stmt); ----- Drops Old backup table
execute immediate v_stmt;
select sysdate into v_date from dual;
v_stmt := 'create table CHK_CNFG_DTL_BKP_'||to_date(v_date)||' as select * from CHK_CNFG_DTL';
dbms_output.put_line('Creating Bkp table CHK_CNFG_DTL_BKP_'|| to_date(v_date) );
dbms_output.put_line(v_stmt);
execute immediate v_stmt; --- Creates new Backup table
exception
when others
then
dbms_output.PUT_LINE (rec.table_name||'-'||sqlerrm);
end;
end loop;
end;
PL/SQL procedure successfully completed.
-- Backup table not created.
SQL> select table_name from user_Tables where table_name like 'CHK_CNFG_DTL%';
TABLE_NAME
CHK_CNFG_DTL
Of course, this can fixed by creating a table like bleow before executing the anonymous block
SQL> create table CHK_CNFG_DTL_BKP_JULY_22_2013 (x varchar2(37));
Table created.
and now the block will succesfully run like
24 end;
25 /
drop table CHK_CNFG_DTL_BKP_JULY_22_2013 purge
Creating Bkp table CHK_CNFG_DTL_BKP_22_JUL_2013
create table CHK_CNFG_DTL_BKP_22_JUL_2013 as select * from CHK_CNFG_DTL
PL/SQL procedure successfully completed.
But this is going to production . We can't a table like CHK_CNFG_DTL_BKP_JULY_22_2013 without a proper business reason.
How can I modify the above code so that if even if there is no such table like 'CHK_CNFG_DTL_BKP%' , it will proceed to create the backup table?Hi,
Why won't you push the creation of the backup out of the loop ?
declare
v_stmt varchar2(1000);
v_date date;
begin
for rec in
(select * from user_tables where table_name like 'CHK_CNFG_DTL_BKP%' )
loop
begin
execute immediate 'alter session set nls_date_format=''DD_MON_YYYY''';
v_stmt := 'drop table '||rec.table_name|| ' purge';
dbms_output.put_line(v_stmt); ----- Drops Old backup table
execute immediate v_stmt;
exception
when others
then
dbms_output.PUT_LINE (rec.table_name||'-'||sqlerrm);
end;
end loop;
select sysdate into v_date from dual;
v_stmt := 'create table CHK_CNFG_DTL_BKP_'||to_date(v_date)||' as select * from CHK_CNFG_DTL';
dbms_output.put_line('Creating Bkp table CHK_CNFG_DTL_BKP_'|| to_date(v_date) );
dbms_output.put_line(v_stmt);
execute immediate v_stmt; --- Creates new Backup table
end; -
anyone else with application incompatibilites?
Okay, so, fast forward from July to now -
- I've visited my closest Apple store's genius bar twice now. (Over an hour and a half away.)
- My computer spent at least 8 hours behind their closed doors in the workshop
- Several complete erases of the harddrive have taken place
- Most of the Apple geniuses I dealt with were nice and very knowledgeable, but they were and still aren't 100% sure exactly what is wrong with my computer.
The good news is:
- They were able to at least get it running again, with a clean install from their servers of OS X Lion 10.7.5
- They believe that my problems stem from either 1 of 2 things:
- Faulty Hard Drive (even though it is brand new)
- The wrong build of software being installed.
Now, while the wrong build does seem like it could be the problem, it doesn't make sense in the aspect that all of the initial problems began when the first hard drive failed. The same problems continued when I changed out the failed hard drive with the brand spanking new one, and only slightly improved when I was able to successfully install the OS that came with the original disks for my computer. I'm not convinced this thing is back to normal, but hopefully I can make it last through getting a shiny new retina Macbook Pro in the coming future. Thank you so much to everyone who read and replied to this post!
- Andrew =) -
Share songs and create tracks between users using only iPhones
Me and a friend from out of state want to collaborate on tracks but we only have iPhones. We like garage band, how can we do this. Right now we think the only option is to have 1 iTunes account that we share. It seems like there should be a better option but we cannot figure it out. Please help.
Thank youTo share GarageBand projects as project and not as audio file, you can either save the project in iCloud or share the project to a Mac, mail it, then upload it from another mac
Both options are not feasable for you, since you have only iPhones and not macs as well. And the iCloud solution would require you to be using the same AppleID on your iPhones and share your iCloud, including mail, contacts, ....
As a workaround - you can solo the tracks and mail each track as audio file.
Or, if you and your friend have access to a PC, see turingtests2's workaround:
See this thread:
Re: Loading a .band file back into Garageband (iPad 2)
or HT4622 Re: Can I share the .band file to my friend for edit/record his track?
also turingtest2's solution to upload project files from your PC back to the iPhone. -
Performance issue with drop and re-create index
My database table has about 2 million records. The index in the table was not optmized, so we created a new index lets call it index2. So this table now was the original index (index1) and the index2. We then inserted data into this table from the other box. It was running for a few weeks.
Suddenly we noticed that a query which used to take a few seconds now took more than a minute. The execution plan was using the index2 which technically should be faster. We checked if the statistics were upto date and it was. So then we dropped the new index, re-ran the query and it completed in 10 sec's. It was usign the old index. This puzzled me since the point of the index2 was to make it better. So then we re-created index2 and genrated stats for the index. Re-ran the query and it completed in 5 sec's.
Everytime we timed to run the query, I shutdown and restarted the box to clear all cache's. So all the time I have specified are pure time's and not cached. The execution plan using index2 taking 1 min and 5 sec's are nearly the same, with very minior difference in cost and cardnitality. Any ideas why index2 took 1 min before and after drop and create again takes only 5 sec.
The reason I want to find the cause is to ensure that this doesn't happen again, since its impossible for me to re-create the index everytime I see this issue. Any thoughts would be helpful.Firstly the indexes are different index1 is only on the time column, where as index2 is a composite index consisting of 3 columns.
Here are the details. The test that I did were last friday, 3/31. Yesterday and today when I executed the same query I get more increased times, yesterday it took 9 sec amd today 17 sec. The stats job kicked in on both days and is upto date. This table, nothing gets deleted. Only added.
3/31
Original
Elapsed: 00:01:02.17
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6553 Card=9240 Bytes
=203280)
1 0 SORT (UNIQUE) (Cost=6553 Card=9240 Bytes=203280)
2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
UE) (Cost=15982 Card=2306303 Bytes=50738666)
drop index EVENT_NA_TIME_ETYPE
Elapsed: 00:00:11.91
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=7792 Card=9275 Bytes
=204050)
1 0 SORT (UNIQUE) (Cost=7792 Card=9275 Bytes=204050)
2 1 TABLE ACCESS (BY INDEX ROWID) OF 'EVENT' (Cost=2092
Card=2284254 Bytes=50253588)
3 2 INDEX (RANGE SCAN) OF 'EVENT_TIME_NDX' (NON-UNIQUE
) (Cost=6740 Card=2284254)
create index EVENT_NA_TIME_ETYPE ON EVENT(NET_ADDRESS,TIME,EVENT_TYPE);
BEGIN
SYS.DBMS_STATS.GENERATE_STATS('USER','EVENT_NA_TIME_ETYPE',0);
end;
Elapsed: 00:00:05.14
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6345 Card=9275 Bytes
=204050)
1 0 SORT (UNIQUE) (Cost=6345 Card=9275 Bytes=204050)
2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
UE) (Cost=12878 Card=2284254 Bytes=50253588)
4/3
Elapsed: 00:00:09.70
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6596 Card=9316 Bytes
=204952)
1 0 SORT (UNIQUE) (Cost=6596 Card=9316 Bytes=204952)
2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
UE) (Cost=11696 Card=2409400 Bytes=53006800)
Statistics
0 recursive calls
0 db block gets
11933 consistent gets
9676 physical reads
724 redo size
467 bytes sent via SQL*Net to client
503 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
3 rows processed
4/4
Elapsed: 00:00:17.99
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6681 Card=9421 Bytes
=207262)
1 0 SORT (UNIQUE) (Cost=6681 Card=9421 Bytes=207262)
2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
UE) (Cost=12110 Card=2433800 Bytes=53543600)
Statistics
0 recursive calls
0 db block gets
12279 consistent gets
9423 physical reads
2608 redo size
467 bytes sent via SQL*Net to client
503 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
3 rows processed
SQL> select index_name,clustering_factor,blevel,leaf_blocks,distinct_keys from u ser_indexes where index_name like 'EVENT%';
INDEX_NAME CLUSTERING_FACTOR BLEVEL LEAF_BLOCKS DISTINCT_KEYS
EVENT_NA_TIME_ETYPE 2393170 2 12108 2395545
EVENT_PK 32640 2 5313 2286158
EVENT_TIME_NDX 35673 2 7075 2394055 -
RE: Drop and recreate user
Hi,
If we drop and recreate the oracle user in production database, what advantages we will get?
Any one help me...
DB Version:10.2.04
OS: HP-UX
Thanks,
Srini ...935930 wrote:
Hi,
If we drop and recreate the oracle user in production database, what advantages we will get?
Any one help me...
DB Version:10.2.04
OS: HP-UX
Thanks,
Srini ...The "advantage" (or "disadvantage") would depend on what you are trying to accomplish, correct? -
Drop and recreate table in stored procedure
Hi all
When creating tables using Transact-SQL scripts, I have always preferred to drop the table if it exists and then create it explicitly using CREATE TABLE. For two reasons:
1) It does not matter if it is the first time the SP is run ie. if I create the table manually in the first instance and just use TRUNCATE TABLE it could fail if the table is deleted
2) I have control over the data types of the table fields
Just recently though I discovered the error that can occur when dropping and creating a table in the same batch (see link below)
Microsoft Website
This causes me a problem when dropping and creating tables in stored procedures, as I understand that a stored procedure is in itself a single batch?
Can I avoid this error in a stored procedure whilst continuing to drop and create tables? Or should I be taking a different approach?
Coding best practice advice would be greatly appreciated.
Thank youThanks Ronen
Please see my second post immediately before your reply.
Given that I need to store the data output in a physical table for use in QlikView, would you suggest truncating the table each time the SP runs? And then having a script that handles both dropping and creating the physical table, and also creating
the SP?
>> QlikView
QlikView is an Israeli company, right?
In any case I am not familiar with QlikView's application, therefore I can only give you general information, based on assumptions regarding the application, and facts regarding the SQL Server.
>> for use in QlikView
I assume that external application use specific database structure (table
structure) and it is change only in rare situations (for example CMS interface might change the tables if and when a module s update/install). In this case there is no need to drop the table and recreate it and TRUNCATE is the solution.
>> would you suggest truncating the table each time the SP runs
I am sorry but i cant recommend on TRUNCATE a table each time you execute SP, without know the exact reason for this logic. It sound to me, at this point of time (with the information that we have), that this
is very bad logic (application architecture). As I wrote above, basing your application on TRUNCATING the table each time mean that you have problems with multi users. Thins about 2 people that try to execute the same SP at almost the same time. Think about
locking in the SQL Server and bad data (one truncate while the other already inserted the new data and get no rows, if there is no locking).
But TRUNCATE is much better in this case probably then DROP and DELETE, since it is faster, and locking will be shorter (hopefully the application use the correct locking). There are other reasons why TRUNCATE is better, and other people already mentioned
most of them, but time in this scenario might be critical.
>> having a script that handles both dropping and creating the physical table, and also creating the SP?
I do not undestand what is this second step. we said that you truncate the table, so why do you need to
dropping and creating the physical table and who
creating the SP?
Are you meaning that the application create the tables and SP?
There are lot of application that during installation create the database structure. is this what you mean?
Ronen Ariely
[Personal Site] [Blog] [Facebook]
Maybe you are looking for
-
Dynamic JDBC Credentials and using ADF Region ERROR
Hi, I used solution by Steve Muench, Dynamic JDBC Credentials (for ADF Faces Rich Client) (129. 11g Dynamic JDBC Credentials for Model 1, Struts, Trinidad, and ADF Faces Rich Client 11.1.1.0.0 06-AUG-2008), but it works not correct in case of usi
-
How to update photoshop files in DW8
I had purchased a template from dreamtemplates.com #0064 to save me some time and get my site up sooner. I do not have a url yet to show you all. The template came with the images prepared in photoshop included in a psd file along with the images and
-
I just reinstalled win 7 on a laptop that came with vista. I can't find drivers. Mainly looking for Wi-Fi driver. As the others were installed except for video. I looked on the HP site and entered the model....f700.....I also tried by searching the p
-
I have an include within a program that has some code in it. If I put a break point in the code, it never reaches it. I have put a break point in the bit before the include, and it just steps straight over it. Can anybody suggest why this might be
-
Gmail will not open except in HTML My homepage ButchNews.com will not display google ads, nor content from some widgets. Facebook messages will not open. But everything works fine in Explorer... except I hate Explorer.