แสดงบทความที่มีป้ายกำกับ Oracle แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Oracle แสดงบทความทั้งหมด

วันจันทร์ที่ 13 พฤษภาคม พ.ศ. 2556

Oracle : Import Export Whole DB

Export
set NLS_LANG=English
exp userid=[oldusername]/[oldpassword]@[sid] grants=no file=[filename].dmp
Import
set NLS_LANG=English
imp [username]/[password] file=[filename].dmp  full=yes

*may u need to grant extra role for import
SQL> grant imp_full_database to [username];

Oracle : Create new user

1. Check all users.
Start SQLPlus
If u are administrator
type
sqlpus / as sysdba
for login as sysdba
your password is sys password
type
select * from all_users;
for check all users.

2. Create new Table Space for new user (Or use old one.)
create tablespace TableSapceName datafile '[path]'
size 32m autoextend on
next 32m maxsize 2048m extent management local;
your default path for Oracle 11g Express is
'c:\oraclexe\app\oracle\oradata\XE\TableSpaceName.dbf'
dbf file will create automatically

3. Create new user with default table space.
CREATE USER [Name] IDENTIFIED BY [pass]
DEFAULT TABLESPACE "TableSpaceName"
TEMPORARY TABLESPACE "TEMP";

4. Alter user to unlimited with this tablespace.
ALTER USER [username] QUOTA UNLIMITED ON [TablespaceName];
5. Grant user permission
GRANT create procedure, create session, create table,
create type, create view, create synonym, create trigger,
resource TO [username];

grant imp_full_database to [username];

วันอังคารที่ 13 พฤศจิกายน พ.ศ. 2555

MVC4 IIS 6 and error occurred while establishing a connection to SQL Server


I use MVC 4 with My Custom Membership controller can test normally in my Localhost but when upload to Server it show when go to page that need authorize

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


I don't use any ms sql in this project so this error is wild. After  check on my code that use sql connection name "DefaultConnection" I found in 2 place
AccountModels.cs in Models
InitializeSimpleMembershipAttribute.cs in Filters
so I don't use InitializeSimpleMembershipAttribute in any place so I chnage

AccountModels.cs in line 14,15
public UsersContext()
            : base( "DefaultConnection" )
to 
public UsersContext()
            : base( "MyDBConnection" )

and now it work fine.

Hope this help.

วันพฤหัสบดีที่ 30 สิงหาคม พ.ศ. 2555

Oracle 10g with Windows Sever 2008

Information tell me Oracle 10g 10.2.0.1 not work with Window Server 2008 R2
but we can still install and use if have patch 10.2.0.5

ref : http://docs.oracle.com/cd/B19306_01/relnotes.102/b14264/toc.htm#BABGFAJI


So you can download this patch if you have license Oracle 10g and enter "Support Identifiers" for retrieve patch 10.2.0.5 at "https://support.oracle.com"

วันพฤหัสบดีที่ 23 กุมภาพันธ์ พ.ศ. 2555

Use Oracle in IIS Server Error!

And Error said.

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

For use Oracle Client We need Oracle Client to install in server.

วันจันทร์ที่ 27 มิถุนายน พ.ศ. 2554

ORA-01033: ORACLE initialization or shutdown in progress

Today news system in mot.go.th can't connect correctly
by this error
"ORA-01033: ORACLE initialization or shutdown in progress"

after try to restart database it found another error "ORA-32004: obsolete and/or deprecated parameter(s) specified"
with error in write to log
after search someone said to recovery by delete old log with

RMAN> connect target sys/*******
RMAN> delete archivelog all;
RMAN> crosscheck archivelog all;

so anything fine and can restart database again hope this help someone like me too.

วันจันทร์ที่ 2 สิงหาคม พ.ศ. 2553

Oracle Error : illegal variable name/number

This happen when i use some variable that can be not use in oracle

try to don't use any word like "@demo_table" but can use "@demotable"

Yes remove that line will help. but if variable name is can' use even if it only one word try to change that word.

วันอังคารที่ 29 มิถุนายน พ.ศ. 2553

ORA-00911: invalid character when try to query with .net app

Yes it because when use command like
SELECT TABLE_NAME FROM user_TABLES; in sqlplus in don't have any problem.

But when use in command string in .net APP
it will throw exception "ORA-00911: invalid character"

yes get rid of ";" in the end of line solve problem.

- -'

enjoy your coding.

Oracle 10g Express listener.ora and connection files default location

I try to find this information finally I found it.

C:/oraclxe/app/oracle/product/10.2.0/server/NETWORK/ADMIN/

listener.ora
sqlnet.ora
tnsnames.ora